Fedora sound over HDMI using pulseaudio
On a few machine builds I've had some problems getting sound over HDMI interfaces to TVs on Fedora machines (15/16/17). I guess this is probably the same for any system using pulseaudio though like Ubuntu.
Sound would work with MythTV but not browser or desktop sounds like youtube or desktop music players. I found the most reliable method was editing the pulseaduio config.
First off identify the correct device name. aplay -l
will list all possible devices.
[root@m00n ~]# aplay -l **** List of PLAYBACK Hardware Devices **** card 0: NVidia [HDA NVidia], device 0: ALC887-VD Analog [ALC887-VD Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: NVidia_1 [HDA NVidia], device 3: HDMI 0 [HDMI 0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: NVidia_1 [HDA NVidia], device 7: HDMI 0 [HDMI 0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: NVidia_1 [HDA NVidia], device 8: HDMI 0 [HDMI 0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: NVidia_1 [HDA NVidia], device 9: HDMI 0 [HDMI 0] Subdevices: 1/1 Subdevice #0: subdevice #0
Note the card number and the device number for each device. Now we can use aplay -D
to test which one actually produces sound on the TV. It should make a nice soothing static noise while the test is running. You can stop each one with CTRL+C.
[root@m00n ~]# aplay -D hw:1,3 aplay -D hw:1,7 aplay -D hw:1,8 aplay -D hw:1,9
Now we hopefully identified the correct device its simply a case of editing the file /etc/pulse/default.pa
. Uncomment the following line and edit the hw to the appropriate device.
load-module module-alsa-sink device=hw:1,7
Now save the file and either restart pulse or reboot the machine.
m00nie :)