Bug 494663

Summary: Headphones at 150% volume incorrectly plays at 100% volume when disconnected and reconnected.
Product: [Applications] systemsettings Reporter: Fernando M. Muniz <fernandommuniz>
Component: kcm_pulseaudioAssignee: Fernando M. Muniz <fernandommuniz>
Status: RESOLVED UPSTREAM    
Severity: normal CC: kde, sitter
Priority: NOR    
Version First Reported In: 6.2.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Notice the sudden sound increase when I go down to 149%
pavucontrol while glitched 150%

Description Fernando M. Muniz 2024-10-13 13:52:29 UTC
Created attachment 174773 [details]
Notice the sudden sound increase when I go down to 149%

When I set my headphone's volume to 150%, then disconnect it, then connect it again, the audio is presumably at 100% until I reduce the volume to 149%, even though the UI shows "150%".
Comment 1 David Edmundson 2024-10-13 14:51:50 UTC
Can you attach output of:
'pactl list sinks' both at the broken 150% and correct 140%.
Comment 2 David Edmundson 2024-10-13 14:53:34 UTC
Also for the sake of another discussion (https://invent.kde.org/plasma/plasma-pa/-/merge_requests/282) can you write a bit about why you run it above 100%?
Comment 3 Fernando M. Muniz 2024-10-13 15:10:07 UTC
BROKEN 150%:

pactl list sinks
Sink #7885
        State: SUSPENDED
        Name: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__HDMI3__sink
        Description: Tiger Lake-LP Smart Sound Technology Audio Controller HDMI / DisplayPort 3 Output
        Driver: PipeWire
        Sample Specification: s24-32le 2ch 48000Hz
        Channel Map: front-left,front-right
        Owner Module: 4294967295
        Mute: no
        Volume: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB
                balance 0,00
        Base Volume: 65536 / 100% / 0,00 dB
        Monitor Source: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__HDMI3__sink.monitor
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY 
        Properties:
                alsa.card = "0"
                alsa.card_name = "sof-hda-dsp"
                alsa.class = "generic"
                alsa.components = "HDA:80862812,80860101,00100000 HDA:10ec0257,17aa38d2,00100001 cfg-dmics:2"
                alsa.device = "5"
                alsa.driver_name = "snd_soc_skl_hda_dsp"
                alsa.id = "sofhdadsp"
                alsa.long_card_name = "LENOVO-82MG-IdeaPadGaming315IHU6-LNVNB161216"
                alsa.mixer_device = "_ucm0001.hw:sofhdadsp"
                alsa.mixer_name = "Realtek ALC257"
                alsa.name = ""
                alsa.resolution_bits = "16"
                alsa.subclass = "generic-mix"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.sync.id = "00000000:00000000:00000000:00000000"
                api.alsa.card.longname = "LENOVO-82MG-IdeaPadGaming315IHU6-LNVNB161216"
                api.alsa.card.name = "sof-hda-dsp"
                api.alsa.open.ucm = "true"
                api.alsa.path = "hw:sofhdadsp,5"
                api.alsa.pcm.card = "0"
                api.alsa.pcm.stream = "playback"
                audio.channels = "2"
                audio.position = "FL,FR"
                card.profile.device = "0"
                device.api = "alsa"
                device.class = "sound"
                device.id = "50"
                device.profile.description = "HDMI / DisplayPort 3 Output"
                device.profile.name = "HiFi: HDMI3: sink"
                device.routes = "1"
                factory.name = "api.alsa.pcm.sink"
                media.class = "Audio/Sink"
                device.description = "Tiger Lake-LP Smart Sound Technology Audio Controller"
                node.name = "alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__HDMI3__sink"
                node.nick = "HDMI / DisplayPort 3 Output"
                node.pause-on-idle = "false"
                object.path = "alsa:acp:sofhdadsp:0:playback"
                port.group = "playback"
                priority.driver = "664"
                priority.session = "664"
                factory.id = "19"
                clock.quantum-limit = "8192"
                client.id = "46"
                node.driver = "true"
                node.loop.name = "data-loop.0"
                library.name = "audioconvert/libspa-audioconvert"
                object.id = "73"
                object.serial = "7885"
                api.acp.auto-port = "false"
                api.alsa.card = "0"
                api.alsa.use-acp = "true"
                api.dbus.ReserveDevice1 = "Audio0"
                api.dbus.ReserveDevice1.Priority = "-20"
                device.bus = "pci"
                device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
                device.enum.api = "udev"
                device.icon_name = "audio-card-analog-pci"
                device.name = "alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic"
                device.nick = "sof-hda-dsp"
                device.plugged.usec = "4810180"
                device.product.id = "0xa0c8"
                device.product.name = "Tiger Lake-LP Smart Sound Technology Audio Controller"
                device.subsystem = "sound"
                sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
                device.vendor.id = "0x8086"
                device.vendor.name = "Intel Corporation"
                device.string = "0"
        Ports:
                [Out] HDMI3: HDMI / DisplayPort 3 Output (type: HDMI, priority: 700, availability group: HDMI/DP,pcm=5, not available)
        Active Port: [Out] HDMI3
        Formats:
                pcm

Sink #7886
        State: SUSPENDED
        Name: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__HDMI2__sink
        Description: Tiger Lake-LP Smart Sound Technology Audio Controller HDMI / DisplayPort 2 Output
        Driver: PipeWire
        Sample Specification: s24-32le 2ch 48000Hz
        Channel Map: front-left,front-right
        Owner Module: 4294967295
        Mute: no
        Volume: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB
                balance 0,00
        Base Volume: 65536 / 100% / 0,00 dB
        Monitor Source: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__HDMI2__sink.monitor
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY 
        Properties:
                alsa.card = "0"
                alsa.card_name = "sof-hda-dsp"
                alsa.class = "generic"
                alsa.components = "HDA:80862812,80860101,00100000 HDA:10ec0257,17aa38d2,00100001 cfg-dmics:2"
                alsa.device = "4"
                alsa.driver_name = "snd_soc_skl_hda_dsp"
                alsa.id = "sofhdadsp"
                alsa.long_card_name = "LENOVO-82MG-IdeaPadGaming315IHU6-LNVNB161216"
                alsa.mixer_device = "_ucm0001.hw:sofhdadsp"
                alsa.mixer_name = "Realtek ALC257"
                alsa.name = ""
                alsa.resolution_bits = "16"
                alsa.subclass = "generic-mix"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.sync.id = "00000000:00000000:00000000:00000000"
                api.alsa.card.longname = "LENOVO-82MG-IdeaPadGaming315IHU6-LNVNB161216"
                api.alsa.card.name = "sof-hda-dsp"
                api.alsa.open.ucm = "true"
                api.alsa.path = "hw:sofhdadsp,4"
                api.alsa.pcm.card = "0"
                api.alsa.pcm.stream = "playback"
                audio.channels = "2"
                audio.position = "FL,FR"
                card.profile.device = "1"
                device.api = "alsa"
                device.class = "sound"
                device.id = "50"
                device.profile.description = "HDMI / DisplayPort 2 Output"
                device.profile.name = "HiFi: HDMI2: sink"
                device.routes = "1"
                factory.name = "api.alsa.pcm.sink"
                media.class = "Audio/Sink"
                device.description = "Tiger Lake-LP Smart Sound Technology Audio Controller"
                node.name = "alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__HDMI2__sink"
                node.nick = "HDMI / DisplayPort 2 Output"
                node.pause-on-idle = "false"
                object.path = "alsa:acp:sofhdadsp:1:playback"
                port.group = "playback"
                priority.driver = "680"
                priority.session = "680"
                factory.id = "19"
                clock.quantum-limit = "8192"
                client.id = "46"
                node.driver = "true"
                node.loop.name = "data-loop.0"
                library.name = "audioconvert/libspa-audioconvert"
                object.id = "69"
                object.serial = "7886"
                api.acp.auto-port = "false"
                api.alsa.card = "0"
                api.alsa.use-acp = "true"
                api.dbus.ReserveDevice1 = "Audio0"
                api.dbus.ReserveDevice1.Priority = "-20"
                device.bus = "pci"
                device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
                device.enum.api = "udev"
                device.icon_name = "audio-card-analog-pci"
                device.name = "alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic"
                device.nick = "sof-hda-dsp"
                device.plugged.usec = "4810180"
                device.product.id = "0xa0c8"
                device.product.name = "Tiger Lake-LP Smart Sound Technology Audio Controller"
                device.subsystem = "sound"
                sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
                device.vendor.id = "0x8086"
                device.vendor.name = "Intel Corporation"
                device.string = "0"
        Ports:
                [Out] HDMI2: HDMI / DisplayPort 2 Output (type: HDMI, priority: 600, availability group: HDMI/DP,pcm=4, not available)
        Active Port: [Out] HDMI2
        Formats:
                pcm

Sink #7887
        State: SUSPENDED
        Name: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__HDMI1__sink
        Description: Tiger Lake-LP Smart Sound Technology Audio Controller HDMI / DisplayPort 1 Output
        Driver: PipeWire
        Sample Specification: s24-32le 2ch 48000Hz
        Channel Map: front-left,front-right
        Owner Module: 4294967295
        Mute: no
        Volume: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB
                balance 0,00
        Base Volume: 65536 / 100% / 0,00 dB
        Monitor Source: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__HDMI1__sink.monitor
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY 
        Properties:
                alsa.card = "0"
                alsa.card_name = "sof-hda-dsp"
                alsa.class = "generic"
                alsa.components = "HDA:80862812,80860101,00100000 HDA:10ec0257,17aa38d2,00100001 cfg-dmics:2"
                alsa.device = "3"
                alsa.driver_name = "snd_soc_skl_hda_dsp"
                alsa.id = "sofhdadsp"
                alsa.long_card_name = "LENOVO-82MG-IdeaPadGaming315IHU6-LNVNB161216"
                alsa.mixer_device = "_ucm0001.hw:sofhdadsp"
                alsa.mixer_name = "Realtek ALC257"
                alsa.name = ""
                alsa.resolution_bits = "16"
                alsa.subclass = "generic-mix"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.sync.id = "00000000:00000000:00000000:00000000"
                api.alsa.card.longname = "LENOVO-82MG-IdeaPadGaming315IHU6-LNVNB161216"
                api.alsa.card.name = "sof-hda-dsp"
                api.alsa.open.ucm = "true"
                api.alsa.path = "hw:sofhdadsp,3"
                api.alsa.pcm.card = "0"
                api.alsa.pcm.stream = "playback"
                audio.channels = "2"
                audio.position = "FL,FR"
                card.profile.device = "2"
                device.api = "alsa"
                device.class = "sound"
                device.id = "50"
                device.profile.description = "HDMI / DisplayPort 1 Output"
                device.profile.name = "HiFi: HDMI1: sink"
                device.routes = "1"
                factory.name = "api.alsa.pcm.sink"
                media.class = "Audio/Sink"
                device.description = "Tiger Lake-LP Smart Sound Technology Audio Controller"
                node.name = "alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__HDMI1__sink"
                node.nick = "HDMI / DisplayPort 1 Output"
                node.pause-on-idle = "false"
                object.path = "alsa:acp:sofhdadsp:2:playback"
                port.group = "playback"
                priority.driver = "696"
                priority.session = "696"
                factory.id = "19"
                clock.quantum-limit = "8192"
                client.id = "46"
                node.driver = "true"
                node.loop.name = "data-loop.0"
                library.name = "audioconvert/libspa-audioconvert"
                object.id = "71"
                object.serial = "7887"
                api.acp.auto-port = "false"
                api.alsa.card = "0"
                api.alsa.use-acp = "true"
                api.dbus.ReserveDevice1 = "Audio0"
                api.dbus.ReserveDevice1.Priority = "-20"
                device.bus = "pci"
                device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
                device.enum.api = "udev"
                device.icon_name = "audio-card-analog-pci"
                device.name = "alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic"
                device.nick = "sof-hda-dsp"
                device.plugged.usec = "4810180"
                device.product.id = "0xa0c8"
                device.product.name = "Tiger Lake-LP Smart Sound Technology Audio Controller"
                device.subsystem = "sound"
                sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
                device.vendor.id = "0x8086"
                device.vendor.name = "Intel Corporation"
                device.string = "0"
        Ports:
                [Out] HDMI1: HDMI / DisplayPort 1 Output (type: HDMI, priority: 500, availability group: HDMI/DP,pcm=3, not available)
        Active Port: [Out] HDMI1
        Formats:
                pcm

Sink #7888
        State: SUSPENDED
        Name: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Speaker__sink
        Description: Tiger Lake-LP Smart Sound Technology Audio Controller Speaker
        Driver: PipeWire
        Sample Specification: s32le 2ch 48000Hz
        Channel Map: front-left,front-right
        Owner Module: 4294967295
        Mute: no
        Volume: front-left: 98304 / 150% / 10,57 dB,   front-right: 98304 / 150% / 10,57 dB
                balance 0,00
        Base Volume: 65536 / 100% / 0,00 dB
        Monitor Source: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Speaker__sink.monitor
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
        Properties:
                alsa.card = "0"
                alsa.card_name = "sof-hda-dsp"
                alsa.class = "generic"
                alsa.components = "HDA:80862812,80860101,00100000 HDA:10ec0257,17aa38d2,00100001 cfg-dmics:2"
                alsa.device = "0"
                alsa.driver_name = "snd_soc_skl_hda_dsp"
                alsa.id = "sofhdadsp"
                alsa.long_card_name = "LENOVO-82MG-IdeaPadGaming315IHU6-LNVNB161216"
                alsa.mixer_device = "_ucm0001.hw:sofhdadsp"
                alsa.mixer_name = "Realtek ALC257"
                alsa.name = ""
                alsa.resolution_bits = "16"
                alsa.subclass = "generic-mix"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.sync.id = "00000000:00000000:00000000:00000000"
                api.alsa.card.longname = "LENOVO-82MG-IdeaPadGaming315IHU6-LNVNB161216"
                api.alsa.card.name = "sof-hda-dsp"
                api.alsa.open.ucm = "true"
                api.alsa.path = "hw:sofhdadsp"
                api.alsa.pcm.card = "0"
                api.alsa.pcm.stream = "playback"
                audio.channels = "2"
                audio.position = "FL,FR"
                card.profile.device = "3"
                device.api = "alsa"
                device.class = "sound"
                device.id = "50"
                device.profile.description = "Speaker"
                device.profile.name = "HiFi: Speaker: sink"
                device.routes = "1"
                factory.name = "api.alsa.pcm.sink"
                media.class = "Audio/Sink"
                device.description = "Tiger Lake-LP Smart Sound Technology Audio Controller"
                node.name = "alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Speaker__sink"
                node.nick = "Speaker"
                node.pause-on-idle = "false"
                object.path = "alsa:acp:sofhdadsp:3:playback"
                port.group = "playback"
                priority.driver = "1000"
                priority.session = "1000"
                factory.id = "19"
                clock.quantum-limit = "8192"
                client.id = "46"
                node.driver = "true"
                node.loop.name = "data-loop.0"
                library.name = "audioconvert/libspa-audioconvert"
                object.id = "74"
                object.serial = "7888"
                api.acp.auto-port = "false"
                api.alsa.card = "0"
                api.alsa.use-acp = "true"
                api.dbus.ReserveDevice1 = "Audio0"
                api.dbus.ReserveDevice1.Priority = "-20"
                device.bus = "pci"
                device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
                device.enum.api = "udev"
                device.icon_name = "audio-card-analog-pci"
                device.name = "alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic"
                device.nick = "sof-hda-dsp"
                device.plugged.usec = "4810180"
                device.product.id = "0xa0c8"
                device.product.name = "Tiger Lake-LP Smart Sound Technology Audio Controller"
                device.subsystem = "sound"
                sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
                device.vendor.id = "0x8086"
                device.vendor.name = "Intel Corporation"
                device.string = "0"
        Ports:
                [Out] Speaker: Speaker (type: Speaker, priority: 100, availability unknown)
        Active Port: [Out] Speaker
        Formats:
                pcm
Comment 4 Fernando M. Muniz 2024-10-13 15:15:23 UTC
(In reply to David Edmundson from comment #2)
> Also for the sake of another discussion
> (https://invent.kde.org/plasma/plasma-pa/-/merge_requests/282) can you write
> a bit about why you run it above 100%?

I run above 100% when the sound of the thing I'm hearing is low, or I'm in other room, or outside.
Comment 5 Fernando M. Muniz 2024-10-13 15:50:48 UTC
In any case, the volume percentage being displayed contradicts the actual volume, therefore it's a bug.
Since 101%+ is going to be removed or hidden, it makes more sense to just make the text say "100%" when the reconnected device had 101+ volume before being disconnected.
Comment 6 Harald Sitter 2024-10-14 01:56:27 UTC
Does pavucontrol show the volume as 100% or 150% after you reconnect?
Comment 7 Fernando M. Muniz 2024-10-14 06:46:20 UTC
Created attachment 174792 [details]
pavucontrol while glitched 150%

1- Set the speakers to 150%.
2- Connected the headset.
3- Disconnected the headset.
4- Screenshotted pavucontrol while the speakers were under this false 150% volume.
5- Watched a song and reduced the volume to 149% to hear a significant increase in volume.
Comment 8 Harald Sitter 2024-10-14 11:22:59 UTC
If pavucontrol is also bugged I rather think this is an upstream bug in pipewire. As we can see in the pactl output it really thinks the volume is 150%.