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).
Here is just an example for presence. If you want you can use another wires and UART or I2C and you can put your music name or headphone ID in Chip memory and read that on the RPi. ATtiny can be very small. This require another 'cable' attached to the ATtiny itself attached to your headphone cable with 3 wires for power-on, gnd and presence and 1 or more wire for identification.
But as you can see, it either requires DIY or having a camera.