omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Media widget: selecting a paused player is ignored while another paused player holds an audio stream

Open Switchmans opened this issue 4 weeks ago • 3 comments

Omarchy: 4.5.0-3

Steps to reproduce

  1. Play a YouTube video in Chromium, then pause it (the tab keeps its PipeWire stream open).
  2. Play a track in a native player (Tauon), then pause it (it closes its stream on pause).
  3. Open the omarchy.media popup and click the Tauon row in the source list.

Expected: Tauon becomes the active source; the header and the play button control Tauon.

Actual: The header keeps showing Chromium, and the play button resumes YouTube. The click has no visible effect. It works only if the other player has no open stream (e.g. the tab is closed).

Cause selectPlayer() only sets preferredPlayerKey. selectActivePlayer() returns the preferred player directly only when it is playing; otherwise it falls through to MediaModel.idlePlayer(), where the candidate order is:

// plugins/services/media/MediaModel.js:45
var candidates = [streamPreferred, slots.streamPlayer, slots.streamProxy, preferred, ...]

slots.streamPlayer (any player with a playback stream) is ranked above preferred (the user's explicit choice), so a paused player with a lingering stream always wins.

Suggested fix: rank an explicitly selected player first, e.g.

var candidates = [preferred, slots.streamPlayer, slots.streamProxy, slots.trackPlayer, ...]

or at least put preferred before slots.streamPlayer / slots.streamProxy.

Switchmans avatar Nov 05 '26 08:11 Switchmans

Codex (GPT-6; reasoning effort not exposed by this session) reviewed the reported 4.5.0-3 reproduction and checked the current media-selection entry points. I classified this as a bug, but the separate classification model returned no answer, so classification remains unsettled. I have not reproduced it on a worker or verified a fix; this is waiting for classification review.

omarchybot avatar Nov 19 '26 00:11 omarchybot

Reproduced on current quattro (fee089f164) in a disposable worker built from the Omarchy ISO. I used simulated Chromium and Tauon MPRIS players, a real PipeWire stream held open for Chromium, and clicks in the running media popup. With both players paused, clicking Tauon left Chromium in the header; clicking Play then resumed Chromium. MediaModel.idlePlayer() ranks the stream holder before the accepted selection.

#9201 fixes this case at 62bb2e31c9020ab77b990d60b0b4e1e2d2c60e2b: the same clicks selected and resumed Tauon. Restoring quattro brought the failure back. Its 55 focused media assertions also passed using the worker's existing Node installation. This checked the reported interaction; the full suite and CI were not assessed here.

Codex (GPT-6; reasoning effort not exposed by this session) checked the reproduction and source. Opus 5.5 High and muse-wonder via pi, thinking high, reviewed the source and agreed that #9201 covers this report; their independence is not guaranteed. #12772 is related but also asks for playback history across shell restarts and player re-registration, which is a separate requirement.

I attempted to add the automatic closing link from #9201, but omabot refused because that PR has been pushed to since it was classified. It needs classification at its current head in its own review. This issue is waiting on that review and the maintainer's decision on #9201; no additional fix PR was opened.

Before: after clicking Tauon on quattro, Chromium remains selected in the header. Simulated MPRIS players on the worker.

After: the same click at PR 9201's head selects Tauon. Simulated MPRIS players on the worker.

omarchybot avatar Nov 23 '26 05:11 omarchybot

Both #9201 and #20775 now carry Fixes #17668. Codex High checked the popup row and Play in both diffs. Opus 5.5 High and muse-wonder via pi, thinking high agreed that a fresh choice takes precedence over a lingering stream when both players are paused. They also found that #9201 covers the case where playback was paused inside an app and there was no prior source choice. Their independence isn’t guaranteed.

The direct popup click and Play were tested on an Omarchy ISO worker with simulated Chromium and Tauon at #9201’s earlier revision 62bb2e31. The same selection logic is present at 738d6def. The current worker’s source-cycle shortcut gave different results across two setups, so the direct-click result is from the earlier revision. The issue is waiting on the maintainer’s decision on the fix.

omarchybot avatar Nov 29 '26 16:11 omarchybot