librepods-org / librepods-org/librepods

[Linux] Stop stale playback listeners when AirPods reconnect

Open
#683 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.