https://bugs.kde.org/show_bug.cgi?id=525767
Bug ID: 525767
Summary: plasmashell UI freezes forever in
NotificationManager::playSoundHint via libcanberra
ALSA -> PipeWire (`snd_pcm_prepare`)
Classification: Plasma
Product: plasmashell
Version First 6.7.4
Reported In:
Platform: Manjaro
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: Notifications
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: 1.0
Created attachment 196177
--> https://bugs.kde.org/attachment.cgi?id=196177&action=edit
full `thread apply all bt` dump
### SUMMARY
`plasmashell` becomes completely unresponsive (panel, notification popups, and
application D-Bus methods on `org.kde.plasmashell` /
`org.freedesktop.Notifications`), while the process stays alive.
GDB backtrace of the main thread shows it blocked forever inside:
`NotificationManager::Notifications::playSoundHint()` → `libcanberra`
(`ca_context_play_full` / `alsa_driver_play`) → `snd_pcm_prepare()` →
`libasound_module_pcm_pipewire.so` → `pthread_cond_wait` in SPA/PipeWire
support.
D-Bus `org.freedesktop.DBus.Peer.Ping` still answers quickly (handled off the
GUI thread), but UI methods such as `evaluateScript` / `activateLauncherMenu`
and `Notifications.GetCapabilities` time out.
### STEPS TO REPRODUCE
Exact trigger is not 100% deterministic, but the hang was observed after a
long-lived Plasma Wayland session and system suspend/resume, with Bluetooth
audio flakiness in the journal around that time.
1. Run Plasma Wayland for an extended period (here: multi-day session).
2. Suspend to RAM and resume (here: overnight suspend; first suspend attempt
logged `PM: late suspend of devices failed`, second attempt slept
successfully).
3. After resume, allow a notification with a sound hint (or Plasma notification
sound playback path that calls `playSoundHint`) to be processed.
4. Observe panel and notifications stop responding.
Workaround that recovers the session without logout:
```bash
systemctl --user kill -s SIGKILL plasma-plasmashell.service
systemctl --user reset-failed plasma-plasmashell.service
systemctl --user start plasma-plasmashell.service
```
(A normal `systemctl --user restart plasma-plasmashell.service` can hang
because the stuck process does not stop cleanly.)
### OBSERVED RESULT
- Panel clicks do nothing.
- Notification UI / `org.freedesktop.Notifications` application methods hang.
- `plasmashell` remains running (`State: S`), main thread in `futex_do_wait` /
`pthread_cond_wait`.
- CPU usage of plasmashell stays low (~0.5%); this is a blocked wait, not a
busy loop.
- KWin remains responsive.
### EXPECTED RESULT
Playing a notification sound must never block the plasmashell GUI/main thread
indefinitely. Sound playback should be asynchronous and/or time-bounded, so a
stuck audio backend cannot freeze the entire shell.
### SOFTWARE/OS VERSIONS
- Operating System: Manjaro Linux
- Kernel: `7.2.3-2-MANJARO` (x86_64)
- KDE Plasma Version: 6.7.4 (`plasma-workspace 6.7.4-3`)
- KDE Frameworks Version: 6.29.0 (`frameworkintegration 6.29.0-1`)
- Qt Version: 6.11.2 (`qt6-base 6.11.2-3`)
- Windowing system: Wayland (`kwin 6.7.4-7`)
- GPU: AMD Rembrandt (Radeon 680M), Mesa 26.2.2
- Audio: PipeWire 1.6.8 + WirePlumber 0.5.17 + pipewire-pulse
- libcanberra: `1:0.30+r2+gc0620e4-6` (drivers present: alsa, pulse, multi,
null)
### ADDITIONAL INFORMATION
Main-thread backtrace excerpt (full all-threads dump attached):
```
Thread 1 (LWP ... "plasmashell"):
#3 ... in ?? () from /usr/lib/spa-0.2/support/libspa-support.so
#4 ... in ?? () from /usr/lib/alsa-lib/libasound_module_pcm_pipewire.so
#5 ... in ?? () from /usr/lib/libasound.so.2
#6 ... in snd_pcm_prepare () from /usr/lib/libasound.so.2
#7 ... in ?? () from /usr/lib/libcanberra-0.30/libcanberra-alsa.so
#8 ... in alsa_driver_play () from
/usr/lib/libcanberra-0.30/libcanberra-alsa.so
#9 ... in ca_context_play_full () from /usr/lib/libcanberra.so.0
#10 ... in multi_driver_play () from
/usr/lib/libcanberra-0.30/libcanberra-multi.so
#11 ... in ca_context_play_full () from /usr/lib/libcanberra.so.0
#12 ... in NotificationManager::Notifications::playSoundHint(QModelIndex
const&) const
from /usr/lib/libnotificationmanager.so.1
#13 ... in ?? () from /usr/lib/libnotificationmanager.so.1
#14 ... in NotificationManager::Notifications::qt_metacall(...)
#15...#19 QML / QV4 call path (libQt6Qml)
```
Notes:
- libcanberra went through the **ALSA** driver (`libcanberra-alsa.so` via
`libcanberra-multi.so`), which then blocked inside the ALSA→PipeWire PCM
plugin.
- Around the same period the journal showed Bluetooth audio issues
(`bluez_output...` missing objects, RTL Bluetooth firmware timeouts after
resume). That may have contributed to PipeWire/ALSA prepare never completing,
but the critical Plasma bug is **synchronous sound playback on the UI thread**.
- Related feature introduction: https://bugs.kde.org/show_bug.cgi?id=472037 /
commit adding sound-hint playback in `libnotificationmanager`.
- Suggested fix direction: do not call `ca_context_play_full()` synchronously
on the GUI thread; play on a worker with a timeout, or use a non-blocking
backend, and never let audio I/O stall plasmashell.
### ATTACHMENTS TO UPLOAD
1. `plasmashell-bt.txt` — full `thread apply all bt` dump
Command used to capture:
```bash
gdb -batch -p $(pidof plasmashell) \
-ex 'set pagination off' \
-ex 'thread apply all bt' \
-ex 'detach' -ex 'quit' | tee plasmashell-bt.txt
```
--
You are receiving this mail because:
You are watching all bug changes.