Bug 449532 - Volume monitoring feature causes plasma-pa to crash pipewire-pulse when using headset profile
Summary: Volume monitoring feature causes plasma-pa to crash pipewire-pulse when using...
Status: RESOLVED FIXED
Alias: None
Product: plasma-pa
Classification: Plasma
Component: applet (show other bugs)
Version: 5.24.0
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-03 00:11 UTC by Chang Liu
Modified: 2022-04-08 15:42 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chang Liu 2022-02-03 00:11:02 UTC
SUMMARY

When I use my bluetooth headphone in headset profile (headset-head-unit-msbc or headset-head-unit-cvsd) with pipewire and pipewire-pulse, I can adjust the volume through plama-pa applet initially. However, If I open some application using the headphone (like some meeting website on firefox or chrome), then try to adjust the volume, the applet will crash and I will lost my sound and mic function. journalctl shows that pipewire-pulse has a segfault. Using other application like pavucontrol is OK.

STEPS TO REPRODUCE
1. Pair a bluetooth headphone and set the headphone profile to headset (pactl set-card-profile bluez_card.***** headset-head-unit-cvsd)
2. Open firefox or chrome and start a zoom meeting with mic on
3. Click plasma-pa to adjust volume

OBSERVED RESULT

The applet crashes and sound is lost.

EXPECTED RESULT

The applet should work fine.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.15.11
(available in About System)
KDE Plasma Version: 5.24
KDE Frameworks Version: 5.90 
Qt Version: 5.15.2
Comment 1 Nate Graham 2022-02-03 18:32:45 UTC
If something crashed, we need a backtrace of it so we can figure out what's going on. See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Can you please attach one? Thanks!
Comment 2 Chang Liu 2022-02-03 20:22:29 UTC
(In reply to Nate Graham from comment #1)
> If something crashed, we need a backtrace of it so we can figure out what's
> going on. See
> https://community.kde.org/Guidelines_and_HOWTOs/Debugging/
> How_to_create_useful_crash_reports
> 
> Can you please attach one? Thanks!

It is pipewire-pulse that is crashing, not the KDE components.

Here is the backtrace from pipewire-pulse

(gdb) bt
#0  0x00007f21b64ad47d in ?? () from /lib64/libc.so.6
#1  0x00007f21b56ec9f0 in stream_process () from /usr/lib64/pipewire-0.3/libpipewire-module-protocol-pulse.so
#2  0x00007f21b65aec34 in impl_node_process_input () from /usr/lib64/libpipewire-0.3.so.0
#3  0x00007f21b4cd592a in impl_node_process () from /usr/lib64/spa-0.2/audioconvert/libspa-audioconvert.so
#4  0x00007f21b658f301 in process_node () from /usr/lib64/libpipewire-0.3.so.0
#5  0x00007f21b658dbb8 in node_on_fd_events () from /usr/lib64/libpipewire-0.3.so.0
#6  0x00007f21b661722b in loop_iterate () from /usr/lib64/spa-0.2/support/libspa-support.so
#7  0x00007f21b656f5c0 in do_loop () from /usr/lib64/libpipewire-0.3.so.0
#8  0x00007f21b6516d7e in start_thread () from /lib64/libpthread.so.0
#9  0x00007f21b644d47f in clone () from /lib64/libc.so.6
Comment 3 Nate Graham 2022-02-03 20:28:06 UTC
Then you would need to report this to the PipeWire developers over here: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues.
Comment 4 Chang Liu 2022-02-03 20:29:29 UTC
(In reply to Nate Graham from comment #3)
> Then you would need to report this to the PipeWire developers over here:
> https://gitlab.freedesktop.org/pipewire/pipewire/-/issues.

But as I said in the post, all other apps works fine when adjusting volume (like pavucontrol), only the plasma-pa applet is causing the crash.
Comment 5 Nate Graham 2022-02-03 21:38:41 UTC
The backtrace doesn't contain any KDE code. It's quite possible we're doing something that's triggering a pre-existing issue in PipeWire that other implementations don't do.
Comment 6 Chang Liu 2022-02-03 22:07:26 UTC
(In reply to Nate Graham from comment #5)
> The backtrace doesn't contain any KDE code. It's quite possible we're doing
> something that's triggering a pre-existing issue in PipeWire that other
> implementations don't do.

Nate, before I report it to pipewire, I wonder if you or other developers can help check if you can reproduce it on your machine? Please.

I just want to make sure it is a bug. As this only appears on KDE, the pipewire developers (which I assume are mostly gnome users) may not be able to reproduce it.
Comment 7 Nate Graham 2022-02-03 22:11:59 UTC
I don't have a bluetooth headset so I can't test your exact use case, sorry.
Comment 8 Chang Liu 2022-02-07 00:44:01 UTC
(In reply to Nate Graham from comment #7)
> I don't have a bluetooth headset so I can't test your exact use case, sorry.

I have done some tests for the bug. It seems that the crash is caused by the creation of VolumeMonitor object in volumemonitor.cpp in plasma-pa. By disabling the volume monitor function, the crash can be avoided.

I tried to compare the code in volumemonitor.cpp and the code of mainwindow.cc in pavucontrol, and found that the volume monitor part is almost identical with some subtle difference. Maybe it is these differences that is causing the crash.
Comment 9 Nate Graham 2022-02-07 16:56:53 UTC
Awesome, thanks. Re-opening.
Comment 10 Chang Liu 2022-04-08 15:41:12 UTC
I tested on the latest git version of plasma-pa and pipewire, and the issue seems to be fixed. Maybe due to an update of pipewire.