Bug 106429

Summary: pulseaudio-module-gconf auto-selects incorrect Profile when plugging headphones
Product: PulseAudio Reporter: Geroge T <reportbug>
Component: alsaAssignee: pulseaudio-bugs
Status: RESOLVED MOVED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart, rdieter
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: 4 audio ports on MSI GT73VR

Description Geroge T 2018-05-07 16:55:44 UTC
Source:
https://bugs.kde.org/show_bug.cgi?id=393963

Disconnecting and reconnecting the headphones, automatically switches between these two:

- "Analog Surround 4.0 Output" when disconnecting the headphones, which makes the speakers work.


- "Analog Stereo Output" when plugging the headphones to the computer jack port, BUT there is no sound on them because it should select "Digital Stereo (IEC958) Output" instead.

Running pulseaudio-module-gconf-11.1-18.fc28.x86_64
Comment 1 Tanu Kaskinen 2018-05-08 12:09:38 UTC
Can you attach the output of "pactl list cards"?

Is the headphone connector the normal analog 3.5mm one? It sounds very weird that you want the digital output to be selected when plugging in headphones, because I've never heard of headphones that would use the digital interface.

(By the way, module-gconf is not responsible for the routing. The "Automatically switch all running streams when a new output becomes available" option in the KDE audio settings actually loads module-switch-on-connect. module-gconf provides only the interface through which the KDE audio settings loads module-switch-on-connect.)
Comment 2 Geroge T 2018-05-12 11:24:29 UTC
This is the command on Ubuntu 18.04 (which works fine by default), the problem happens to me on Fedora 28 Workstation (default live install). Do you require also the output of the command on fedora?

The computer is a "MSI GT73VR 6RF Titan Pro". Has 4 audio jacks on left side.

root@ubuntu:~# pactl list cards
Card #0
	Name: alsa_card.pci-0000_01_00.1
	Driver: module-alsa-card.c
	Owner Module: 7
	Properties:
		alsa.card = "1"
		alsa.card_name = "HDA NVidia"
		alsa.long_card_name = "HDA NVidia at 0xdc080000 irq 17"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:01:00.1"
		sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1"
		device.bus = "pci"
		device.vendor.id = "10de"
		device.vendor.name = "NVIDIA Corporation"
		device.product.id = "10f0"
		device.product.name = "GP104 High Definition Audio Controller"
		device.string = "1"
		device.description = "GP104 High Definition Audio Controller"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Profiles:
		output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5400, available: no)
		output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (sinks: 1, sources: 0, priority: 300, available: no)
		output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (sinks: 1, sources: 0, priority: 300, available: no)
		output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (sinks: 1, sources: 0, priority: 5200, available: no)
		output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 100, available: no)
		output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 100, available: no)
		output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (sinks: 1, sources: 0, priority: 5200, available: no)
		output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 100, available: no)
		output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 100, available: no)
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
	Active Profile: off
	Ports:
		hdmi-output-0: HDMI / DisplayPort (priority: 5900, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo, output:hdmi-surround, output:hdmi-surround71
		hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo-extra1, output:hdmi-surround-extra1, output:hdmi-surround71-extra1
		hdmi-output-2: HDMI / DisplayPort 3 (priority: 5700, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo-extra2, output:hdmi-surround-extra2, output:hdmi-surround71-extra2

Card #1
	Name: alsa_card.pci-0000_00_1f.3
	Driver: module-alsa-card.c
	Owner Module: 8
	Properties:
		alsa.card = "0"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0xda120000 irq 131"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1f.3"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "a170"
		device.product.name = "Sunrise Point-H HD Audio"
		device.form_factor = "internal"
		device.string = "0"
		device.description = "Built-in Audio"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Profiles:
		input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 60, available: yes)
		output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6000, available: yes)
		output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6060, available: yes)
		output:analog-surround-40: Analog Surround 4.0 Output (sinks: 1, sources: 0, priority: 700, available: no)
		output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 760, available: yes)
		output:iec958-stereo: Digital Stereo (IEC958) Output (sinks: 1, sources: 0, priority: 5500, available: yes)
		output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5560, available: yes)
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
	Active Profile: output:iec958-stereo+input:analog-stereo
	Ports:
		analog-input-internal-mic: Internal Microphone (priority: 8900, latency offset: 0 usec)
			Properties:
				device.icon_name = "audio-input-microphone"
			Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:iec958-stereo+input:analog-stereo
		analog-input-mic: Microphone (priority: 8700, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "audio-input-microphone"
			Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:iec958-stereo+input:analog-stereo
		analog-input-linein: Line In (priority: 8100, latency offset: 0 usec, not available)
			Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:iec958-stereo+input:analog-stereo
		analog-output-lineout: Line Out (priority: 9900, latency offset: 0 usec, not available)
			Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-40, output:analog-surround-40+input:analog-stereo
		analog-output-speaker: Speakers (priority: 10000, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "audio-speakers"
			Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-40, output:analog-surround-40+input:analog-stereo
		analog-output-headphones: Headphones (priority: 9000, latency offset: 0 usec, available)
			Properties:
				device.icon_name = "audio-headphones"
			Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo
		iec958-stereo-output: Digital Output (S/PDIF) (priority: 0, latency offset: 0 usec)
			Part of profile(s): output:iec958-stereo, output:iec958-stereo+input:analog-stereo
Comment 3 Geroge T 2018-05-12 11:25:17 UTC
Created attachment 139517 [details]
4 audio ports on MSI GT73VR
Comment 4 Geroge T 2018-05-12 11:26:32 UTC
The one with the headphones logo is the one with the issue (the closest to the user if you stand in front of the computer using it).
Comment 5 Geroge T 2018-05-12 22:54:57 UTC
Ok this is on fedora 28 workstation where the issue is happening:

[root@fedora ~]# pactl list cards
Card #0
        Name: alsa_card.pci-0000_01_00.1
        Driver: module-alsa-card.c
        Owner Module: 6
        Properties:
                alsa.card = "1"
                alsa.card_name = "HDA NVidia"
                alsa.long_card_name = "HDA NVidia at 0xdc080000 irq 17"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:01:00.1"
                sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1"
                device.bus = "pci"
                device.vendor.id = "10de"
                device.vendor.name = "NVIDIA Corporation"
                device.product.id = "10f0"
                device.product.name = "GP104 High Definition Audio Controller"
                device.string = "1"
                device.description = "GP104 High Definition Audio Controller"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        Profiles:
                output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5900, available: no)
                output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (sinks: 1, sources: 0, priority: 800, available: no)
                output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (sinks: 1, sources: 0, priority: 800, available: no)
                output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (sinks: 1, sources: 0, priority: 5700, available: no)
                output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 600, available: no)
                output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 600, available: no)
                output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (sinks: 1, sources: 0, priority: 5700, available: no)
                output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 600, available: no)
                output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 600, available: no)
                off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
        Active Profile: off
        Ports:
                hdmi-output-0: HDMI / DisplayPort (priority: 5900, latency offset: 0 usec, not available)
                        Properties:
                                device.icon_name = "video-display"
                        Part of profile(s): output:hdmi-stereo, output:hdmi-surround, output:hdmi-surround71
                hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, not available)
                        Properties:
                                device.icon_name = "video-display"
                        Part of profile(s): output:hdmi-stereo-extra1, output:hdmi-surround-extra1, output:hdmi-surround71-extra1
                hdmi-output-2: HDMI / DisplayPort 3 (priority: 5700, latency offset: 0 usec, not available)
                        Properties:
                                device.icon_name = "video-display"
                        Part of profile(s): output:hdmi-stereo-extra2, output:hdmi-surround-extra2, output:hdmi-surround71-extra2

Card #1
        Name: alsa_card.pci-0000_00_1f.3
        Driver: module-alsa-card.c
        Owner Module: 7
        Properties:
                alsa.card = "0"
                alsa.card_name = "HDA Intel PCH"
                alsa.long_card_name = "HDA Intel PCH at 0xda120000 irq 131"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:00:1f.3"
                sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
                device.bus = "pci"
                device.vendor.id = "8086"
                device.vendor.name = "Intel Corporation"
                device.product.id = "a170"
                device.product.name = "Sunrise Point-H HD Audio"
                device.form_factor = "internal"
                device.string = "0"
                device.description = "Built-in Audio"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        Profiles:
                input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 65, available: yes)
                output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6500, available: yes)
                output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6565, available: yes)
                output:analog-surround-40: Analog Surround 4.0 Output (sinks: 1, sources: 0, priority: 1200, available: no)
                output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 1265, available: yes)
                output:iec958-stereo: Digital Stereo (IEC958) Output (sinks: 1, sources: 0, priority: 5500, available: yes)
                output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5565, available: yes)
                off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
        Active Profile: output:iec958-stereo
        Ports:
                analog-input-internal-mic: Internal Microphone (priority: 8900, latency offset: 0 usec)
                        Properties:
                                device.icon_name = "audio-input-microphone"
                        Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:iec958-stereo+input:analog-stereo
                analog-input-mic: Microphone (priority: 8700, latency offset: 0 usec, not available)
                        Properties:
                                device.icon_name = "audio-input-microphone"
                        Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:iec958-stereo+input:analog-stereo
                analog-input-linein: Line In (priority: 8100, latency offset: 0 usec, not available)
                        Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:iec958-stereo+input:analog-stereo
                analog-output-lineout: Line Out (priority: 9900, latency offset: 0 usec, not available)
                        Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-40, output:analog-surround-40+input:analog-stereo
                analog-output-speaker: Speakers (priority: 10000, latency offset: 0 usec, not available)
                        Properties:
                                device.icon_name = "audio-speakers"
                        Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-40, output:analog-surround-40+input:analog-stereo
                analog-output-headphones: Headphones (priority: 9000, latency offset: 0 usec, available)
                        Properties:
                                device.icon_name = "audio-headphones"
                        Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo
                iec958-stereo-output: Digital Output (S/PDIF) (priority: 0, latency offset: 0 usec)
                        Part of profile(s): output:iec958-stereo, output:iec958-stereo+input:analog-stereo
Comment 6 Tanu Kaskinen 2018-05-19 16:03:50 UTC
It's expected that PulseAudio chooses the "Analog Stereo Output" profile when plugging in headphones, because it has higher priority than "Digital Output (S/PDIF)", and besides, you're plugging in analog headphones and not an S/PDIF cable. I don't know why Ubuntu doesn't do the same. Does Ubuntu change the profile to "Analog Surround 4.0 Output" when unplugging headphones, or does it keep the digital output active all the time?

Since you apparently need to use the digital profile in order to get audio from the headphones, there seems to be a bug in alsa. Instructions for reporting alsa bugs: http://alsa-project.org/main/index.php/Bug_Tracking
Comment 7 Geroge T 2018-05-22 19:36:55 UTC
Choosing manually:

- To listen audio with headphones, with headphones plugged, you need to choose one of these:
* Digital Stereo (IEC958) Output
* Digital Stereo (IEC958) Output + Analog Stereo Input

- To listen to audio on notebook speakers, with headphone unplugged, any of these 4 work:
* Analog Stereo Output
* Analog Stereo Duplex
* Analog Surround 4.0 Output
* Analog Surround 4.0 Output + Analog Stereo Input

When disconnecting headphones, profile switches to "Analog Stereo Output", but, when reconnecting the headphones it just stays in that profile, even this option enabled: "Automatically switch all running streams when a new output becomes available".

Do you think I still need to report the issue to alsa-project?

The issue happens on latest ubuntu with kde, settings on Audio Volume Settings - Plasma.
Comment 8 GitLab Migration User 2018-07-30 10:35:03 UTC
-- 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/517.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.