I'm doing an audio installation where multiple headphone jacks are on a wall and the user will plug into the jacks and each jack plays an mp3 that starts playing from the beginning when it gets plugged in. Is this possible with an RPi? What is the best approach?
Use custom jack socket with plug detection. Hook the audio pins to Pi jack and the detect pin to GPIO. Make sure the detect pin works against ground (most of them do, but there always is a possibility of some exotic configuration).
You pretty much can't use the Pi jack directly anyway, as doing so would put the power port toward the customer.
Depending on how many jacks you need, possibly at some point it would be cheaper to use a PC with N cheap USB soundcards than N Pis. Researching which cards work would be a real pain, I guess.
I have found this digikey paper : a deep dive into audio jack switches and configurations where switch concept is explain.