Bug 427774 - HDMI audio output of external monitor is not detected
Summary: HDMI audio output of external monitor is not detected
Status: RESOLVED UPSTREAM
Alias: None
Product: plasma-pa
Classification: Plasma
Component: applet (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: David Rosca
URL: https://gitlab.freedesktop.org/pulsea...
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-15 19:07 UTC by Patrick Silva
Modified: 2020-10-26 11:23 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
hdmi outputs are available in Audio KCM (164.92 KB, image/png)
2020-10-16 11:55 UTC, Patrick Silva
Details
plasma-pa applet when hdmi output is selected in Audio kcm (489.39 KB, image/png)
2020-10-17 13:14 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2020-10-15 19:07:17 UTC
SUMMARY
I have a monitor with an audio output that I can use with headphones when my monitor is connected to hdmi port. However, when I use this monitor as an external screen connected to hdmi port of my laptop, Plasma never detects its hdmi audio output.

STEPS TO REPRODUCE
1. connect an external monitor with audio output to hmdi port
2. try to select hmdi audio output via plasma-pa applet in system tray
3. 

OBSERVED RESULT
hdmi audio output is not available for selection

EXPECTED RESULT
plasma-pa should detect hdmi audio output of external monitors

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.20.80
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.0

ADDITIONAL INFORMATION
I have Arch + Gnome 3.38.1 installed on the same laptop and it detects the hdmi audio output of my external monitor as expected.
Comment 1 Nicolas Fella 2020-10-15 21:35:01 UTC
Please paste the output of `pactl list sinks`
Comment 2 Patrick Silva 2020-10-16 11:55:59 UTC
Created attachment 132406 [details]
hdmi outputs are available in Audio KCM

I noticed that the hdmi outputs are available in Audio KCM.
I'm attaching a screenshot.

$ pactl list sinks
Destino #1
        Estado: SUSPENDED
        Nome: alsa_output.pci-0000_00_1b.0.analog-stereo
        Descrição: Áudio interno Estéreo analógico
        Driver: module-alsa-card.c
        Especificação da amostragem: s16le 2ch 44100Hz
        Mapa dos canais: front-left,front-right
        Módulo proprietário: 25
        Mudo: não
        Volume: front-left: 65535 / 100% / -0,00 dB,   front-right: 65535 / 100% / -0,00 dB
                balanço 0,00
        Volume base: 65536 / 100% / 0,00 dB
        Fonte de monitoração: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
        Latência: 0 useg, 0 useg configurado
        Sinalizadores: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
        Propriedades:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "CX20757 Analog"
                alsa.id = "CX20757 Analog"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "0"
                alsa.card_name = "HDA Intel PCH"
                alsa.long_card_name = "HDA Intel PCH at 0xe0610000 irq 31"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:00:1b.0"
                sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
                device.bus = "pci"
                device.vendor.id = "8086"
                device.vendor.name = "Intel Corporation"
                device.product.id = "1e20"
                device.product.name = "7 Series/C216 Chipset Family High Definition Audio Controller"
                device.form_factor = "internal"
                device.string = "front:0"
                device.buffering.buffer_size = "65536"
                device.buffering.fragment_size = "32768"
                device.access_mode = "mmap+timer"
                device.profile.name = "analog-stereo"
                device.profile.description = "Estéreo analógico"
                device.description = "Áudio interno Estéreo analógico"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        Portas:
                analog-output-speaker: Alto-falantes (priority: 10000)
                analog-output-headphones: Fones de ouvidos (priority: 9900, not available)
        Porta ativa: analog-output-speaker
        Formatos:
                pcm
Comment 3 Patrick Silva 2020-10-16 12:02:45 UTC
output in english:

$ pactl list sinks
Sink #5
        State: SUSPENDED
        Name: alsa_output.pci-0000_00_1b.0.analog-stereo
        Description: Áudio interno Estéreo analógico
        Driver: module-alsa-card.c
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 25
        Mute: no
        Volume: front-left: 65535 / 100% / -0,00 dB,   front-right: 65535 / 100% / -0,00 dB
                balance 0,00
        Base Volume: 65536 / 100% / 0,00 dB
        Monitor Source: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
        Properties:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "CX20757 Analog"
                alsa.id = "CX20757 Analog"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "0"
                alsa.card_name = "HDA Intel PCH"
                alsa.long_card_name = "HDA Intel PCH at 0xe0610000 irq 31"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:00:1b.0"
                sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
                device.bus = "pci"
                device.vendor.id = "8086"
                device.vendor.name = "Intel Corporation"
                device.product.id = "1e20"
                device.product.name = "7 Series/C216 Chipset Family High Definition Audio Controller"
                device.form_factor = "internal"
                device.string = "front:0"
                device.buffering.buffer_size = "65536"
                device.buffering.fragment_size = "32768"
                device.access_mode = "mmap+timer"
                device.profile.name = "analog-stereo"
                device.profile.description = "Estéreo analógico"
                device.description = "Áudio interno Estéreo analógico"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        Ports:
                analog-output-speaker: Alto-falantes (priority: 10000)
                analog-output-headphones: Fones de ouvidos (priority: 9900, not available)
        Active Port: analog-output-speaker
        Formats:
                pcm
Comment 4 Nate Graham 2020-10-16 14:13:07 UTC
What PulseAudio versions do the two distros have? The same, or different versions?
Comment 5 Patrick Silva 2020-10-16 14:21:35 UTC
(In reply to Nate Graham from comment #4)
> What PulseAudio versions do the two distros have? The same, or different
> versions?

neon unstable has pulseaudio 1:13.99.1-ubuntu3.7,
Arch has pulseaudio 13.99.2+13+g7f4d7fcf5-1.
Comment 6 Nate Graham 2020-10-16 16:35:57 UTC
A bit different, but IIRC the HDMI-related changes went into PA 14.

Is this a regression from a prior Plasma version, or did it never work on Neon?
Comment 7 Patrick Silva 2020-10-16 16:39:48 UTC
if I'm not mistaken, neon based on ubuntu 18.04 had the same problem.
Comment 8 Nicolas Fella 2020-10-17 12:46:46 UTC
Can you show how the system tray looks like after you selected the HDMI output in the KCM?
Comment 9 Patrick Silva 2020-10-17 13:14:02 UTC
Created attachment 132468 [details]
plasma-pa applet when hdmi output is selected in Audio kcm

Here is the requested screenshot.
Comment 10 Nicolas Fella 2020-10-17 13:22:45 UTC
As far as I can tell plasma-pa is working as expected here.

There is a single audio card that contains both the internal and the HDMI audio. Depending on the profile (what you select in the combobox in the Advanced tab) a different set of sinks/outputs is active. The applet then only displays the currently active sinks.

While PulseAudio's behaviour of putting both on one card is questionable plasma-pa is working correctly in the sense that it accurately represents the state that is reported by PulseAudio
Comment 11 Patrick Silva 2020-10-17 13:34:56 UTC
Current behavior of pulseaudio can cause confusion.
Here is a post in kde reddit related to the issue reported here
https://www.reddit.com/r/kde/comments/itipyx/how_to_set_sound_output_to_hdmi_connection/

Maybe I will open a report about this issue in pulseaudio bug tracker later.
You can close this report if you want. Thank you.
Comment 12 Nicolas Fella 2020-10-17 13:39:04 UTC
I agree that it's not a good user experience, but I don't think there's much we can do on the Plasma side
Comment 13 Nate Graham 2020-10-17 15:12:04 UTC
Yes, I agree with Nico that the problem here is PulseAudio itself representing the device oddly to downstream software like plasma-pa. I would indeed recommend that you file a bug with the PulseAudio folks. You can do so here: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/

Then can you please add a link to it in the URL field of this bugzilla ticket? Thanks!
Comment 14 Patrick Silva 2020-10-21 13:06:44 UTC
reported to PulseAudio devs
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1014
Comment 15 Patrick Silva 2020-10-26 11:23:09 UTC
Comment in upstream report:

In this case, PulseAudio is representing the hardware as it finds it -- you likely have a single ALSA card that supports output to either analog audio or HDMI, but not separate streams to both concurrently, and hence they are represented as mutually exclusive profiles on the same card.
On GNOME, the sound settings now show available ports rather than the card/profile split as that is more common use-case, but that is an intentionally simpler interface, and for more complex usage (separate routing for multiple simultaneous inputs/outputs), Pavucontrol is recommended.
That said, if there is some specific functionality or API that Plasma requires to provide a different user-experience, I'd be happy to hear about that and see how we can do it.

https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1014#note_669303