About my comment : I think you can use 2 IR Leds and RPi GPIO and use some code for detect cable if really necessary. I have not tested but I'm pretty sure it makes sense. Maybe that can help you. With this you can detect the cable presence BUT not identify the headphone.
With this you can put your music name (or headphone ID) in a QR code for each headphones (presence and identification).
But as you can see, it either requires DIY or having a camera.