Raspberry Pi sound output

How a Raspberry Pi is configured to switch between a 3.5mm Jack sound output to HDMI sound output.


So, up until now, I was using a headphone to listen to Alexa’s responses to my questions.  It was time to experiment with sound output. Check out my Amazon Voice Services setup procedure here.

I figured, the easiest way to get sound is through the HDMI interface to the screen.  The screen I’m using contains speakers, so no extra external speakers would be necessary.

There are 2 things you need to do to force the Raspberry Pi to relay the sound output to the HDMI interface.

Log on to the Pi using ssh and type

sudo raspi-config.

Navigate to the advanced options, and choose “Audio”.

Schermafbeelding 2017-01-12 om 18.38.35.png

Select the third option : “Force HDMI”.

Schermafbeelding 2017-01-12 om 18.39.01.png

Confirm, and get out of the interface.

Next, go to the root of the device by typing

cd /

navigate to the boot directory

cd boot

Edit the “config.txt” file.

sudo nano config.txt

Search for the “hdmi_drive=2” setting.  It will probably be commented out using a hash tag in front of it.  Just remove the hash tag.

Schermafbeelding 2017-01-12 om 18.51.49.png

Ctrl-x y enter to get out of the interface.

Reboot the Pi

sudo reboot

Time to do some testing.  If you also have a monitor, go ahead and test Alexa. In my case there was a problem.  The sound worked all right, but there was a lot of latency.  So much latency, the beeping sound Alexa makes when it indicates it has started listening couldn’t be heard.  The first two words (on average) of Alexa’s response were missing as well.

I decided to reverse the settings above (insert the hash tag, force the 3.5mm Jack) and I bought a 14 euro speaker set in the local grocery store.  It’s powered using USB and connects to the 3.5 mm Jack.  It appears to work perfectly.  The problem will probably be integrating them in the mirror.  They are the smalles speakers I sound find, but still wide enough to have a hard time integrating them.  But that’s a bridge I’ll be crossing later.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s