Skip to content

Cinnamon Desktop crashing upon switching audio output #253

@SpencerLommel

Description

@SpencerLommel

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

  1. Pair Bluetooth headphones that support HFP/HSP (e.g., Sony WH-1000XM4).
  2. Open the sound settings and select the "Hands-Free" profile.
  3. 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() in cinnamon-control-center
  • gvc_mixer_ui_device_get_matching_profile() in cinnamon-desktop

cinnamon_crash.log

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions