Jan 15, 2015

Easy HDMI Sound for rapsberry pi

Here's a quick way to get HDMI quality sound for your raspberry pi. I tested this on a raspberry pi A+, but it should also work on models B+/B/A.

First, you'll need an HDMI to VGA and Audio converter. I got this one from Amazon for $12.99 USD. You'll also need an HDMI Male to Male cable. Here's how mine looked after hooking it up to the A+:

Most of the work is done with software configuration. Follow the instructions on this page and you should be getting test sounds out if you succeeded.

I wanted to configure mpd, the Music Player Daemon, to complete my config. I had previously set up a USB sound dongle on this installation, so I needed to make changes to /etc/mpd.conf and /etc/modprobe.d/alsa-base.conf to work with the HDMI converter. This is basically changing these configurations files back to a stock installation.

I changed mpd.conf to look like this:
 # An example of an ALSA output:
audio_output {
type        "alsa"
name "My ALSA Device"
# device "hw:0,0" # optional                        <<====commented out
format "44100:16:2" # optional
mixer_device "default" # optional
mixer_control "PCM" # optional
#      mixer_control  "Speaker"       # added for CMedia USB     <<====commented out
mixer_index   "0" # optional

For alsa-base.conf, I changed it to this:
# Keep snd-pcsp from being loaded as first soundcard
options snd-pcsp index=-2
# Allow snd-usb-audio to be loaded as first soundcard
#options snd-usb-audio index=0      <<==== commented out

When I first started playing through mpd, I couldn't hear anything. Turned out the PCM Master volume setting was set almost to zero. I had to set it very high, about 88, for a comfortable listening level. On the USB Sound dongle, I was also used to setting the volume to around 30%. That was way too low for the HDMI sound. I needed to set the volume with mpc to around 90%.

No comments:

Post a Comment