Enabling audio output even when HDMI output is enabled in Raspberry Pi

When I wrote about choosing the correct display cable for Raspberry Pi, I mentioned that you might face problems with getting audio, when you use a cheap HDMI to VGA converter, that doesn’t support audio.

Problem

I use this cheap HDMI to VGA converter which I bought from Amazon, which doesn’t support audio. I thought that I will use this converter to get video output and then get the audio output through the audio jacket.

But it turns out that Raspberry Pi, will shut down audio output in audio jacket, when HDMI output is enabled. Since my converter only supports video, I was not able to get audio output from my Pi.

Solution

I was poking around the Raspberry Pi config files and then found that it is possible to manually override the audio and video output devices. After some more research, I came across the following command which allows you to choose the output devices.

amixer cset numid=3 <n>

where n could be one of the following values

  • 0 – auto (automatically choose the audio output device, based on video output device. If HDMI is enabled then set hdmi as audio output else use audio jacket as audio output. This is the default behavior)
  • 1 – analog (Fore audio jacket as audio output device)
  • 2 – hdmi (Force HDMI as audio output device)

Now, to enable audio through the audio jacket, I ran the command with the following option.

amixer cset numid=3 1

This allowed the audio to be available in the audio jacket. I connected this to my speakers and now I am able to get the audio output as well.

Problem solved 😉

One thought on “Enabling audio output even when HDMI output is enabled in Raspberry Pi

  1. Pingback: A guide to choosing the correct display cable for Raspberry Pi | Hardware Fun

Leave a Reply

Your email address will not be published. Required fields are marked *