mixxxdj / mixxx

Mixxx is Free DJ software that gives you everything you need to perform live mixes.
http://mixxx.org
Other
4.42k stars 1.27k forks source link

When loading a track to an autosync'ed deck, the BPM factor is defaulted to 1 #13689

Open acolombier opened 1 day ago

acolombier commented 1 day ago

Bug Description

Usually, Mixxx detect the best factor (1/2, 1 or 2) to apply when sync-ing a decks together. This way, when you can sync a 100 BPM track with a 200 one without changing the rate. This behaviour however doesn't work when the deck is already sync'ed to a leader, and a track get's loaded

Current behaviour

Expected behaviour

Note that it exist a unit test case that reproduce this exact issue

Version

2.6-alpha

OS

Pop OS 22.04 (with Wayland)

acolombier commented 1 day ago

The root cause appears to be a race condition between the main thread, that recalculate the sync factor upon track load, and uses the BPM information which aren't yet updated. It will usually work one the second deck load, as the BPM information of the previously loaded track (in this example, the same) remains visible

BPM information gets updated by a CacheReader worker thread, once the file has started to be read