https://bugs.kde.org/show_bug.cgi?id=520594

            Bug ID: 520594
           Summary: Built-in microphone mute is lost after suspend/resume,
                    while wpctl set-mute @DEFAULT_SOURCE@ 1 persists
    Classification: Plasma
           Product: plasmashell
      Version First 6.6.4
       Reported In:
          Platform: Kubuntu
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Audio Volume widget
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: 1.0

When I mute my laptop microphone using KDE Plasma’s built-in microphone mute
action / shortcut, the microphone becomes unmuted after suspend/resume.

This only happens with Plasma’s built-in mute path. If I mute the same default
source with:

    wpctl set-mute @DEFAULT_SOURCE@ 1

then the microphone stays muted after suspend/resume.

Because of that, this looks like a Plasma audio integration issue rather than a
PipeWire/WirePlumber issue.

Important detail: on the same laptop, in regular Ubuntu with GNOME, this
problem did not exist. It only started after I installed and started using KDE
Plasma.


STEPS TO REPRODUCE
1. Mute the default microphone using KDE Plasma’s built-in microphone mute
shortcut / action.
2. Suspend the laptop.
3. Resume the laptop from suspend.

OBSERVED RESULT

The microphone is unmuted after resume.

EXPECTED RESULT

The microphone should remain muted after resume.


SOFTWARE/OS VERSIONS
Operating System (available in the Info Center app, or by running `kinfo` in a
terminal window):
Kubuntu 26.04 LTS
KDE Plasma Version: 6.6.4
KDE Frameworks Version: 6.24.0
Qt Version: 6.10.2

Additional system information:
Kernel Version: 7.0.0-15-generic (64-bit)
Graphics Platform: Wayland
Manufacturer: LENOVO
Product Name: 83DF
System Version: Legion Pro 5 16IRX9


ADDITIONAL INFORMATION

My default source is:

    alsa_input.pci-0000_00_1f.3.analog-stereo

What I verified:

- Muting with Plasma’s built-in microphone mute action does NOT persist across
suspend/resume.
- Muting with:

      wpctl set-mute @DEFAULT_SOURCE@ 1

  DOES persist across suspend/resume.

This makes it look like Plasma’s built-in microphone mute handling is the part
that is failing, while the underlying PipeWire mute state itself can be
restored correctly when controlled through `wpctl`.

The fact that the same laptop did not have this issue in regular Ubuntu with
GNOME also suggests that this is Plasma-specific rather than a hardware or
kernel problem.

Workaround script that fixes the problem for me and still shows a notification:

    #!/bin/bash

    DBUS_CMD="$(command -v qdbus6 || command -v qdbus-qt6 || command -v qdbus)"
    wpctl set-mute @DEFAULT_SOURCE@ toggle

    STATE="$(wpctl get-volume @DEFAULT_SOURCE@)"
    LEVEL="$(echo "$STATE" | sed -n 's/.*Volume: \([0-9.]*\).*/\1/p')"
    PERCENT="$(awk "BEGIN { printf \"%d\", $LEVEL * 100 }")"

    make_bar() {
        local percent=$1
        local width=10
        local filled=$(( percent * width / 100 ))
        local empty=$(( width - filled ))
        local bar="["
        for ((i=0; i<filled; i++)); do
            bar+="▰"
        done
        for ((i=0; i<empty; i++)); do
            bar+="▱"
        done
        bar+="]"
        echo "$bar"
    }

    BAR="$(make_bar "$PERCENT")"

    if [ -n "$DBUS_CMD" ]; then
        if echo "$STATE" | grep -q MUTED; then
            "$DBUS_CMD" org.kde.plasmashell /org/kde/osdService
org.kde.osdService.showText \
                microphone-sensitivity-muted "Mikrofon wyciszony"
        else
            "$DBUS_CMD" org.kde.plasmashell /org/kde/osdService
org.kde.osdService.showText \
                audio-input-microphone "Mikrofon ${BAR} ${PERCENT}%"
        fi
    fi

How users can assign this workaround to a keyboard shortcut:
- save the script somewhere, for example `~/.local/bin/mic-toggle`
- make it executable with:

      chmod +x ~/.local/bin/mic-toggle

- in System Settings, create a custom keyboard shortcut that runs:

      ~/.local/bin/mic-toggle

KDE’s Custom Shortcuts module supports binding a shortcut to a command.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to