Skip to content

[RealMAX] Fix track pause with Tidal Connect#224

Merged
Inrixia merged 4 commits intoInrixia:masterfrom
squadgazzz:222/fix-track-pause
Mar 4, 2026
Merged

[RealMAX] Fix track pause with Tidal Connect#224
Inrixia merged 4 commits intoInrixia:masterfrom
squadgazzz:222/fix-track-pause

Conversation

@squadgazzz
Copy link
Contributor

@squadgazzz squadgazzz commented Mar 2, 2026

Summary

This effectively addresses #222 - RealMAX caused every track to pause when switching via Tidal Connect.

Problem

Two issues with Tidal Connect:

  1. Every track paused on skip: The onPreMediaTransition handler called PlayState.pause() + PlayState.play() unconditionally on every transition, even when no HiRes replacement was found. In Tidal Connect, this unnecessary pause/play cycle caused a race condition with the remote device, leaving tracks paused.
  2. Replacement tracks paused on skip: The MOVE interceptors used PlayState.updatePlayQueue() to swap the currently playing track's mediaItemId, which doesn't properly start playback on the Tidal Connect remote device. The local state reported playing=true but the remote device was paused.

Changes

  • MOVE interceptors: Pre-swap the max version at the target index in the queue (keeping currentIndex unchanged so the currently playing track is not disrupted), then use PlayState.next()/previous()/moveTo() to transition through Tidal Connect's normal playback mechanism. No extra PlayState.play() call afterward.
  • onPreMediaTransition: Only perform pause()/playNext()/play() when a HiRes replacement is actually found. Skip it entirely when no replacement exists.
  • Improves the log/message when a replacement is found, showing the exact change:
[RealMAX] Found replacement for No More Tears (16bit/44.1kHz -> 24bit/96kHz)

How to test

Tested locally:

  • Using Volumio Connect
    • No more paused tracks regardless whether the replacement is found
  • Using local output device
    • No changes

Copy link
Owner

@Inrixia Inrixia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome!

Only one thing I'd like to be fixed if possible. Otherwise happy to merge this, thanks for the help 💜

@Inrixia Inrixia merged commit 1452325 into Inrixia:master Mar 4, 2026
@Inrixia
Copy link
Owner

Inrixia commented Mar 4, 2026

Awesome work, thanks so much for this! 💜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants