Skip to content

Instantly share code, notes, and snippets.

@gkralik
Created April 20, 2017 19:24
Show Gist options
  • Save gkralik/1fd12ec4604ba03252203ee53e55dd06 to your computer and use it in GitHub Desktop.
Save gkralik/1fd12ec4604ba03252203ee53e55dd06 to your computer and use it in GitHub Desktop.
Raspberry Pi 3: simultaneous audio output via HDMI and analogue jack
Secenario: running Kodi and MPD. Kodi should output sound via HDMI,
MPD should use the 3.5mm jack.
aplay -l lists available devices:
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
Configure Kodi to use "PI: HDMI" as audio output.
Configure MPD to use the analogue output (add this to mpd.conf):
audio_output {
type "alsa"
name "Raspberry Pi analogue output"
device "hw:0,0"
}
Make sure to set the 'PCM Playback route' control to 1 (analogue output):
amixer cset numid=3 1
The default of 0 (auto did not work). You can also add this to /boot/config.txt:
hdmi_drive=1
@adrianzhang
Copy link

This is exactly what I need! After searched tons of articles this one saved me! Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment