You are not logged in.

#1 2015-11-03 23:39:17

sb56637
Member
Registered: 2009-02-18
Posts: 63

Pulseaudio won't switch to HDMI audio and back upon cable plug

Hi there,

I've been fighting with a friend's laptop that is sometimes connected to a Samsung TV over HDMI. Whenever he plugs it in, he wants all audio streams to switch over to the HDMI sound device, and then switch back automatically to the laptop's integrated Intel sound device upon disconnecting the HDMI. But I can't get it to work. Instead I have to manually switch the Pulseaudio output device every time I connect the TV, and upon disconnecting it there is no audio device selected and I have to re-select the Intel integrated.

I also tried this suggestion...
https://bbs.archlinux.org/viewtopic.php?id=203694

Add

load-module module-switch-on-connect

before the if... udev-detect - block in your /etc/pulse/default.pa

... but it also doesn't help. Any idea what I'm doing wrong? Thanks!

Last edited by sb56637 (2015-11-03 23:39:58)

Offline

#2 2015-11-04 01:08:46

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,076

Re: Pulseaudio won't switch to HDMI audio and back upon cable plug

Have you set the fallback device explicitly to your internal card? Check in pavucontrol to confirm, can you post the current default.pa that is used as well as the outputs of

pacmd list-cards
pacmd list-sinks

after/before plugin/replug of your HDMI?

In general you should also make sure that module-rescue-streams is loaded as well, this should, however already be part of the standard default.pa

There also might be a possibility that plugging in your HDMI doesn't trigger the correct events for detection.

Offline

#3 2015-11-04 02:33:48

sb56637
Member
Registered: 2009-02-18
Posts: 63

Re: Pulseaudio won't switch to HDMI audio and back upon cable plug

Thanks V1del for the reply.

Yes, the internal Intel audio was set as the fallback device in Pavucontrol.

default.pa:
https://pastebin.mozilla.org/8851243

pacmd list-cards, unplugged, after a few plug/unplug cycles:
https://pastebin.mozilla.org/8851244

pacmd list-sinks, unplugged, after a few plug/unplug cycles:
https://pastebin.mozilla.org/8851245

(I don't have access to the HDMI TV at the moment, but I'll update this later with plugged output.)

Last edited by sb56637 (2015-11-04 02:57:42)

Offline

#4 2015-11-04 04:00:47

HaloSlayer255
Member
Registered: 2015-02-11
Posts: 31

Re: Pulseaudio won't switch to HDMI audio and back upon cable plug

Hello sb56637 and V1del,

I think these commands might help, judging from the logs it looks like you have card 0 as your main audio source, and card 1 as the HDMI TV.

I found that 'pacmd set-default-sink 1' without the quotes sets sound to the HDMI TV; while 'pacmd set-default-sink 0' without the quotes sets the sound to your main audio source.

If you ever need to toggle the sound when watching a movie to the TV, then back to the computer after finished; I was able to come up with this about a week ago: https://bbs.archlinux.org/viewtopic.php?id=204153

Hope this helps,
HaloSlayer255

Offline

#5 2015-11-04 04:07:36

sb56637
Member
Registered: 2009-02-18
Posts: 63

Re: Pulseaudio won't switch to HDMI audio and back upon cable plug

Hi HaloSlayer255, thanks for the tip. I tried a similar toggle switch according to these instructions:

http://jeffhoogland.blogspot.com/2014/0 … o-out.html

The "hdmi_sound_toggle" script did work correctly when I manually ran it, but I couldn't get the udev rule to switch it automatically on the cable plug/unplug event.

Last edited by sb56637 (2015-11-04 20:05:25)

Offline

#6 2015-11-04 20:05:03

sb56637
Member
Registered: 2009-02-18
Posts: 63

Re: Pulseaudio won't switch to HDMI audio and back upon cable plug

sb56637 wrote:

Thanks V1del for the reply.

Yes, the internal Intel audio was set as the fallback device in Pavucontrol.

default.pa:
https://pastebin.mozilla.org/8851243

pacmd list-cards, unplugged, after a few plug/unplug cycles:
https://pastebin.mozilla.org/8851244

pacmd list-sinks, unplugged, after a few plug/unplug cycles:
https://pastebin.mozilla.org/8851245

(I don't have access to the HDMI TV at the moment, but I'll update this later with plugged output.)

And here the HDMI TV is connected:

pacmd list-cards
https://pastebin.mozilla.org/8851327

pacmd list-sinks
https://pastebin.mozilla.org/8851328

Offline

Board footer

Powered by FluxBB