librepods-org / librepods-org/librepods
[Linux] Stop stale playback listeners when AirPods reconnect
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 29.9k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
Problem
AirPods reconnection constructs a new MediaController, but the playback listener owned by the previous controller loops forever. The per-controller running flag cannot see older instances, so listeners accumulate and can react to the same playback transition concurrently, including overlapping A2DP recovery work.
Expected behavior
Starting a listener for a device should stop the previous listener for the same Bluetooth MAC. Listeners belonging to different connected AirPods must remain independent.
Acceptance criteria
- Reconnecting the same AirPods leaves one active playback listener for that MAC.
- A superseded listener cannot continue into playback takeover side effects.
- Starting a listener for a second MAC does not stop the first device listener.
- The replacement behavior has an automated lifecycle test.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate MediaController and its playback-listener lifecycle, then trace the per-controller running flag and the A2DP recovery side effects. Add an automated lifecycle test covering replacement for the same Bluetooth MAC and independence for a second MAC; done means superseded listeners stop before triggering takeover work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100