mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-04-25 08:05:56 +03:00
[PR #213] [MERGED] Auto-restart WirePlumber when A2DP profile is unavailable #331
Labels
No labels
android
bug
documentation
enhancement
good first issue
help wanted
linux
pull-request
reverse-engineering
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librepods#331
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kavishdevar/librepods/pull/213
Author: @xxmathias
Created: 9/30/2025
Status: ✅ Merged
Merged: 10/1/2025
Merged by: @kavishdevar
Base:
main← Head:fix-wireplumber-a2dp-discovery📝 Commits (1)
3b968dcFix: Auto-restart WirePlumber when A2DP profile is unavailable📊 Changes
2 files changed (+59 additions, -0 deletions)
View changed files
📝
linux/media/mediacontroller.cpp(+57 -0)📝
linux/media/mediacontroller.h(+2 -0)📄 Description
This PR improves upon the earlier fix in PR #212, which handled A2DP activation timing but didn't address cases where the profile was completely unavailable due to WirePlumber's discovery timing issues. Also might fix #205.
After a system reboot or Bluetooth service restart, WirePlumber (PipeWire's session manager) often fails to properly discover A2DP (Advanced Audio Distribution Profile) audio profiles for Bluetooth devices like AirPods.
Symptoms:
Root Cause:
This is probably a timing issue where WirePlumber queries the Bluetooth device too early during boot/reconnection, before the device has fully advertised its A2DP capabilities. WirePlumber then caches this incomplete profile list and doesn't automatically re-scan.
Solution
Automatically detect missing A2DP profiles and restart WirePlumber to force profile rediscovery, then activate the A2DP profile.
Changes Implemented
New Functions:
isA2dpProfileAvailable()- Checks if A2DP profile exists inpactl list cardsoutput for the connected devicerestartWirePlumber()- Safely restarts the WirePlumber service viasystemctl --user restart wireplumberand waits for rediscoveryModified Function:
activateA2dpProfile()- Now includes automatic recovery:This approach eliminates the need for manual WirePlumber restarts or device reconnections after reboot.
Testing Environment
✅ Wake from sleep/suspend
✅ Manual Bluetooth reconnection
✅ App restart while connected
Technical Notes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.