Audio doesn't auto switch away from HDMI after unplugging HDMI

Bug #1711101 reported by Alan Pope 🍺🐧🐱 πŸ¦„ on 2017-08-16
66
This bug affects 9 people
Affects Status Importance Assigned to Milestone
PulseAudio
Unknown
Medium
pulseaudio (Ubuntu)
Low
Unassigned

Bug Description

Steps to reproduce

* Attach an external HDMI/DP monitor to watch videos on an external display (TV)
* In sound settings, send audio to HDMI out, rather than internal laptop audio
* Play a video, to show audio is going over HDMI
* Unplug HDMI/DP cable
 - Video switches to internal panel only as expected.

Expected behaviour

* Audio switches to internal sound card

Actual behaviour

* Audio does not auto switch

Workaround

* Go to sound settings panel every time, and click the internal sound card

Video showing it: https://www.youtube.com/watch?v=UR3LP0INMeI

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: pulseaudio 1:10.0-2ubuntu2
ProcVersionSignature: Ubuntu 4.11.0-13.19-generic 4.11.12
Uname: Linux 4.11.0-13-generic x86_64
ApportVersion: 2.20.6-0ubuntu5
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: alan 1568 F.... pulseaudio
 /dev/snd/controlC1: alan 1568 F.... pulseaudio
CurrentDesktop: ubuntu:GNOME
Date: Wed Aug 16 11:11:45 2017
InstallationDate: Installed on 2017-08-02 (13 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Alpha amd64 (20170712)
SourcePackage: pulseaudio
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 01/27/2016
dmi.bios.vendor: LENOVO
dmi.bios.version: JBET56WW (1.21 )
dmi.board.asset.tag: Not Available
dmi.board.name: 20BV001BUK
dmi.board.vendor: LENOVO
dmi.board.version: 0B98417 WIN
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: None
dmi.modalias: dmi:bvnLENOVO:bvrJBET56WW(1.21):bd01/27/2016:svnLENOVO:pn20BV001BUK:pvrThinkPadT450:rvnLENOVO:rn20BV001BUK:rvr0B98417WIN:cvnLENOVO:ct10:cvrNone:
dmi.product.name: 20BV001BUK
dmi.product.version: ThinkPad T450
dmi.sys.vendor: LENOVO

Setup:

  Lenovo Gen3 X1 Carbon w/ Intel GPU
  Audio redirected via HDMI to a samsung TV
  Both Wayland and Xorg sessions

I manually set the audio output to the HDMI output in GNOME control center. I thought it would remember my setting like it does for monitor layout, but that does not seem to happen. It sounds like is supposed to be handled by PulseAudio?

Likewise, when I remove the HDMI device, I would expect audio to be redirected back to my laptop speakers.

Is it correct that this should be handled by PulseAudio and not by something like gnome-settings-daemon/control-center?

What's the PulseAudio version?

What does "pactl list cards" show when you have the TV plugged in and directed audio to it, and what does it show after unplugging the TV? Close gnome-control-center when plugging out the cable - I've seen g-c-c interfering with the routing during unplug events.

(In reply to Tanu Kaskinen from comment #1)
> What's the PulseAudio version?

From F24 - pulseaudio-8.0-6.fc24.x86_64

> What does "pactl list cards" show when you have the TV plugged in and
> directed audio to it, and what does it show after unplugging the TV?

I'll attach two versions. First is connected and sound directed to TV. Second is TV unplugged but before manually changing output back to laptop speakers.

> Close gnome-control-center when plugging out the cable - I've seen g-c-c
> interfering with the routing during unplug events.

I've seen this too. I think it has to do with GtkTreeViewSelection updating the "browse-mode" selection when displaying the sound settings.

Created attachment 124083
with audio directed to TV via HDMI

Created attachment 124084
with tv/hdmi disconnected but sound has not been redirected to local speakers

Ok, so HDMI is on a different alsa card than analog output. That explains why unplugging HDMI doesn't result in moving audio to the analog output. We don't currently automatically reroute from one card to another on an unplug event. This should be fixed, but I can't give any timeline.

You also had some issue with remembering routing choices. Is it so that if you route to HDMI and reboot, audio isn't routed to HDMI any more, even if the HDMI cable stays plugged in all the time?

(In reply to Tanu Kaskinen from comment #5)
> You also had some issue with remembering routing choices. Is it so that if
> you route to HDMI and reboot, audio isn't routed to HDMI any more, even if
> the HDMI cable stays plugged in all the time?

I haven't tested that (and it's a bit hard for me to test right now).

My problem is that I unplug the HDMI, go work in another part of the house, and then come back and plug the HDMI back in. I would expect the audio/video to be redirected as a pair (even though they are separate sub-systems in implementation).

(In reply to Tanu Kaskinen from comment #5)
> Ok, so HDMI is on a different alsa card than analog output. That explains
> why unplugging HDMI doesn't result in moving audio to the analog output. We
> don't currently automatically reroute from one card to another on an unplug
> event. This should be fixed, but I can't give any timeline.

but there is no available HDMI ports available anymore , this mean that the only available port is the internal speaker as headphone is not plugged

(In reply to Raymond from comment #7)
> but there is no available HDMI ports available anymore , this mean that the
> only available port is the internal speaker as headphone is not plugged

Yes. What's the reason for stating this fact? If you had some point to make, I didn't catch that.

Changed in pulseaudio (Ubuntu):
importance: Undecided → High
status: New → Triaged
Changed in pulseaudio:
importance: Unknown → Medium
status: Unknown → Confirmed
Daniel van Vugt (vanvugt) wrote :

We now have autoswitching on connect in 17.10, but not on disconnect :)

You might find what you need by uncommenting and editing these lines:

### Make some devices default
#set-default-sink output
#set-default-source input

in /etc/pulse/default.pa or copy it to ~/.config/pulse/default.pa and edit locally.

Regardless, I don't think hotplugging HDMI qualifies as High.

Changed in pulseaudio (Ubuntu):
importance: High → Low
summary: - Audio doesn't auto switch when unplugging hdmi
+ Audio doesn't auto switch when unplugging HDMI
summary: - Audio doesn't auto switch when unplugging HDMI
+ Audio doesn't auto switch away from HDMI after unplugging HDMI
tags: added: bionic
Daniel van Vugt (vanvugt) wrote :

See also bug 1777367

-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/185.

Changed in pulseaudio:
status: Confirmed → Unknown
Keneth C (kenethc) wrote :

Facing the same issue with 18.04.2 LTS
Had the same issue with previous versions as well
Will there be a fix anytime soon?
Thank you.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.