-
Notifications
You must be signed in to change notification settings - Fork 68
Description
Summary
When I connect my headphones (Sony WH-1000XM4) to my computer via Bluetooth and then select "HandsFree" in the Sound Output Device tab, cinnamon-desktop crashes and enters fallback mode then I restart it and it works perfectly fine. Trying to reproduce this bug by disconnecting my headphones and reconnecting them does not work. This bug only occurs the first time I startup my computer and connect my headphones and select the HandsFree option.
System Info
OS: Linux Mint 21.3 Cinnamon
Cinnamon Version: 6.0.4
Linux Kernel: 6.8.0-57-generic
Display Server: X11
Audio Server: PipeWire
libcvc0 Version: 6.0.0+virginia
Yes I use PipeWire instead of PulseAudio, but I believe this should still be fixed anyways because gvc_mixer_card_get_profile() shouldn't ever return NULL
Reproduction Steps
- Pair Bluetooth headphones that support HFP/HSP (e.g., Sony WH-1000XM4).
- Open the sound settings and select the "Hands-Free" profile.
- Cinnamon crashes to fallback mode.
Cause
In libcvc/gvc-mixer-card.c, the function gvc_mixer_card_get_profile() can return NULL, which is not always safely handled by callers.
Specifically:
gvc_mixer_control_change_output()incinnamon-control-centergvc_mixer_ui_device_get_matching_profile()incinnamon-desktop
Suggested Fix
Add NULL checks before using gvc_mixer_card_get_profile() and return safely/log a warning.
Patch
I am fixing this right now! I will make a PR soon after I test it a bunch to make sure it doesn't break anything else =D