DAC with software switchable headphone and line output?

July 21, 2024, 07:35

darkbyte

I'm trying to do my research and figure out if any audio HAT supports changing the output in software between the RCA line output jacks and the headphone output without having to unplug the headphone. It's not something the descriptions mentions unfortunately. Anyone have experience with this? eg. the Raspberry Pi DAC has pinouts for the headphone DETECT and MUTE pins, but I think that's hardwired together and will auto mute the RCA jacks once you plug in a headphone. https://www.raspberrypi.com/documentation/accessories/audio.html#raspberry-pi-dac Except maybe if the DAC chip supports ignoring the MUTE pin from it's firmware. There are some ALSA configuration files for the Raspberry DACs (previously IQAudio) which mention something like "Heaphone Switch" which is a changeable boolean value, though I'm not sure these actually do anything: https://github.com/raspberrypi/Pi-Codec/blob/master/Codec_Zero_Playback_only.state#L363 Can somebody with this HAT (or any other hat with an RCA + jack output) in hand test if you can toggle such thing from software, and check if it actually works?

darkbyte

it seems i was right https://forums.raspberrypi.com/viewtopic.php?t=322562 > Pin 5 pulled high with a 100k resistor by the looks of it. Inserting a headphone plug shorts pin 5 to ground (by a switch contact onside the socket) so externally shorting pins 4 and 5 will achieve the same thing. though the last answer is interesting, if they really changed the way the sense pin works in a later revision, and the socket in it's default open state puts 5V to the MUTE PIN, and when the jack inserted it breaks this and then gets pulled to GND. in that case I could use any GPIO pin on the Pi and drive that DETECT pin to my liking. eg. if I want to force the speakers, I'll keep the presence of 5V even if the jack is plugged in. but i couldn't find any schematics for these HATs.