Headphones with Pi3+ and IQaudio hat

Hi all.
I have a Pi3+ with a IQAudio PiDigiamp+ and everything is working really well through Volumio2 program. However I did not forward plan enough when I built my project and did not consider the use of headphones instead of speakers which would sometimes be useful. Is there a way of using the phones out socket on the Pi with the Digiamp hat also connected? if it is possible, do I have to somehow switch between the two and how would this be achieved?
Thanks

Isn’t there an icon in the tray to switch Audio devices? Alternately have a look in Raspberry Pi Configuration settings from the menu bar.
https://www.raspberrypi.org/documentation/configuration/raspi-config.md

I’am not 100% sure of anything …
but reading on this site seems to suggest you cant do it with out disabling and enabling sound devices in config.txt file , then you would not be using the digiamp any more check page 4 and 5 , looks like some of the other board have the ability to use headphone
,http://www.iqaudio.com/downloads/IQaudIO.pdf

Hi.
Thanks for your reply. Yes you are correct that there is the icons for switching devices, but for some reason it does not work. If I change device to phones or HDMI and connect phones to either of these, sound continues to output from speakers and no sound from headphones. I have tried with the
I2S setting on and off - still the same problem. I am not sure where the Pi configuration settings are.

Hi Caperjack.
If I use the disable/enable settings in config.txt I would have to do this each time I want to switch between speakers and headphones. I think also that if I disable the dac/amp hat then I would not have control over volume as this is set by hardware on the dac.
You are correct that other hats do have a headphone out but I think that these are dac only hats and not combined dac and amplifier.

1 Like

Ok, thought you might get lucky. I have speakers and an audio amp feed from the tip ring sleeve jack on one of my Pi’s. I use that icon to make sure its going out the jack and not to the HDMI. That Pi has the Pi foundation 7 inch touch scree that doesn’t have any built in speakers.
The installer for that DAC likely does the config.txt edit to make it the selected audio device. I have a pHat Beat that likely does the same thing to make it the sound source. It’s connected to a ZERO W so there isn’t any audio jack anyway, even if I wanted to use it.
You might be able to write a batch file to rename the config.txt file(s). Have two files, one for the DAC setup and one for the normal audio jack out. Then have the batch file rename the files swapping them around. something like that, you’d likely have to put a reboot command in there two.

Hi again.
Thanks for your reply. I like the idea of a batch file to switch between config. txt files.
I am still not sure how I would control volume with the hat taken out of the action. If that could be overcome, then I have a plan B. When I built my player I extended the sd card slot with a ribbon cable and now have the sd card slot mounted on the back panel of the enclosure. I did this so that I could do back-ups or modes to files easily. If I flash a spare sd card and put the modified files on that, then I could insert one or the other sd card before firing up to give me speakers or headphones. That would work for me

That might actually be easier than the batch file renaming. Just swap cards. If its running headless adjusting the volume cold be tricky. My pHat Beat setup has buttons for that already setup by the Pirate Radio install. It’s codded into vlc radio I think?

I think I have got the solution. I will try with the two sd cards - one for standard output via speakers, and the other with modified files to switch out the dac/amp hat to enable the use of phones connected to phones out on the Pi. For volume control I can use headphones with in-line volume control.
This may take me some time to set up as I am away for a while, but I will post my results.

On my setup, the Pi’s headphones / analog audio out jack feeds a dual potentiometer. That adjusts the audio level into my amplifier. The amplifier then powers my speakers. It might be hard to see but there is a tip ring sleeve jack that plugs into the Pi. The small board in the bottom of the picture is the amplifier. Speakers aren’t connected yet.
Full build pictures are here, if you want to have a look see.
https://1drv.ms/f/s!AjOYwiwlwDtpgq9LUHdGiiRpn7dr2Q

Hi. Your build looks good. I will post pics of my setup to give an idea of what I have.

That would be great thanks. I always like seeing what others come up with. Sometimes you have to get very creative to get what you want.

Hi. I have just posted my project in the projects section

Just posted a comment. =)

Hi alphanumerical. I had to give up on doing the 2 sd card setup. too many problems kicked up including having to re-flash 3 times. I have just posted again re. using bluetooth for headphones

Thats the way things go sometimes. Stuff you think should be so easy isn’t, and then sometimes it just a falls into place and your left thinking it was way to easy. lol. I seem to hit a lot more of the former than latter.