Problem
The playback listener holds the AACP state mutex while activating the A2DP profile and sending takeover packets. Profile discovery and WirePlumber recovery can take several seconds, blocking incoming AACP events and queued control commands. The takeover send path also needs the same mutex, which can prevent progress when connected-device notifications are present.
Expected behavior
Read the required ear-detection and connected-device values into a snapshot, release the AACP state guard, and only then perform profile activation and takeover sends.
Acceptance criteria
- No AACP state guard is held across A2DP activation or packet-send awaits.
- Incoming AACP state updates remain able to proceed during profile recovery.
- Playback takeover uses a consistent snapshot of the values that triggered it.
Problem
The playback listener holds the AACP state mutex while activating the A2DP profile and sending takeover packets. Profile discovery and WirePlumber recovery can take several seconds, blocking incoming AACP events and queued control commands. The takeover send path also needs the same mutex, which can prevent progress when connected-device notifications are present.
Expected behavior
Read the required ear-detection and connected-device values into a snapshot, release the AACP state guard, and only then perform profile activation and takeover sends.
Acceptance criteria