Hi all :-)
I have the following use-case: I want to attach a TV to the HDMI output of my notebook (Lenovo ThinkPad E480, but I think that doesn't matter), and not only see my desktop, but also have the TV play my audio.
Getting the HDMI output to work was as easy as installing kscreen and activating it in KDE's systemsettings. But the audio part seems to be a bit harder.
aplay -l lists my HDMI output as card 0 device 3:
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: CX20753/4 Analog [CX20753/4 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
Subdevices: 1/1
Subdevice #0: subdevice #0
After creating /etc/asound.conf with the following content:pcm.!default {
type hw
card 0
device 3
}
restarting alsa and unmuting the HDMI output via alsamixer (in my case, this was "S/PDIF"), the TV plays the sound of e.g. a video played via mplayer. But a browser (e.g. Falkon to play some streamed video) doesn't seem to care about this setting: The sound is still only played by my notebook's speakers.
How can I make also a browser play audio via HDMI?
And is there a way to make this more convenient? Like if a HDMI is plugged, play audio via HDMI, and if not, use the notebook's speakers, or at least always play audio via HDMI if a cable is plugged (in addition to the notebook's speakers)?
Thanks for all hints! Because even after reading all I could find about this (for Arch, Artix, and also Gentoo) I can't get this to work.
EDIT:
At least for some use-cases, I could get it to work.
E.g. for mplayer playback, one can address the ALSA device to use directly (without changing ALSA's configuration), in my case like so:
mplayer -ao alsa:device=hw=0.3 ...
For making a browser play audio through HDMI, I had to switch pulseaudio's output profile, in my case:
pacmd set-card-profile alsa_card.pci-0000_00_1f.3 output:hdmi-stereo+input:analog-stereo
Not really nice, but it works.