Skip to content

WIP: #303: unload bt modules

This patcheset brings the following changes:

  • adds a watch to know when the current user becomes active/inactive (module-systemd-login).
  • adds bool user_active to pa core, along with a hook. systemd-login sets this value and fire the hook.
  • bluetooth-discover reacts accordingly by loading/unloading the bluez5 modules.

It solves #303 at quick glance. The most outstanding symptom of this bug is that GDM grabs the A2DP bluetooth sink, and never releases it, making A2DP unusable for any other user. I can confirm that this MR fixes that, and I'm listening to music using A2DP sink right now.

There's probably a race condition when switching user. I'm not sure there's any warranty that the bluetooth device is released in time by the user that is "switched out", for the user that is "switched in" to be able to acquire it. I don't have enough in-depth knowledge to be sure.

Any feedback welcome, please give indication on what I should do to make that mergeable. Thanks!

Merge request reports