Auto detect sound when adding HDMI

Hi everyone - yet another semi silly question

Is there a way to have the audio auto switch from laptop speakers to HDMI tv once the HDMI cable is plugged in?

I know I can manually call it up with the PulseAudio Vol-Control app, but was hoping I can find away around that.

That is the last thing I need to get working for my dual monitor support (I have worked around my polybar setting and backgrounds to auto-fill on both screens etc.).

Would appreciate some guidance on this.

EDIT: So here’s what I have so far. I checked out this link:
https://wiki.archlinux.org/index.php/PulseAudio/Examples

Under the Automatically switch audio to HDMI section.
This seems to work pretty well. On reboot, I played a YouTube vid and ended up with no sound via the laptop but, after plugging in the HDMI cable, it worked well.

Unplugged the cable and ran the script mentioned in the link and audio came back to the lappy. I’ll mess with this a bit more and I don’t know enough to know if this is the best way to accomplish what I want, but it’s damned close!!!

Thank you and cheers!
Chris

Wonder what came out of this thread, everything ok !

Also wonder if it s the same with PNMixer

LOL - I forgot about this but the short answer (I think) it is done. What I did to get it to work, I’ll have to look back at it. BIIRC, I want to say it was something pretty easy. I’ll wrap this thread up later on today or in the morning hours.

Cheers
Chris

Hey that s cool @Chris

So taking some time to look back at this - turns out I never got this working like I was hoping to.
So to recap - I do have everything set that when the HDMI cable is plugged into the laptop, all works as it ought to. Sound seems to divert auto-magically from laptop to big-screen.

When yanking the HDMI cable, all screen settings revert back (for example, Firefox is on workspace 5 and when HDMI is attached, redirects to the big screen) to the laptop except the sound. I have to manually go in and select the analog output.

I know in other distros/DE/WM its all automatic (for example, I was tinkering with Manjaro i3 and flipped back and forth as one might expect).

I do have one last option I might take a look at - and that’s the use of some XFCE apps that control the hardware. i think Manjaro uses a fair amount of them w/i3 and to be honest, I used the same XFCE app on my AL install for HDMI and that did the trick. So, I’ll look to see if there is something to control the sound too.

I have a feeling its just something on my side as I can’t imagine that folks are experiencing the same - and if so, would love to here how they got around it.

50% is still way better than 0% so at least I’m almost there :slight_smile:

Meh - Right or wrong, installing Pulseaudio Preferences (paprefs - extra) and ticking Simultaneous Output seemed to do the trick for me. Now all is switching with just the plug/unplug of the HMDI cable. Nothing more for me to do.

1 Like

Nice job in there @Chris