rncbc / qtractor

Qtractor - An Audio/MIDI multi-track sequencer
https://qtractor.org
GNU General Public License v2.0
495 stars 86 forks source link

Audio sync issue #428

Closed suedwestlicht closed 6 months ago

suedwestlicht commented 6 months ago

From time to time I have strange effects where audio clips are a bit delayed. In most cases stopping playback and starting it before the audio clip helps. I managed to reproduce it:

1.) Run jack with 4096 bufsize to make it more audible 2.) Load my attached session 3.) Play it from the beginning until it enters the loop 4.) After the first 3 notes in the loop press S (Solo on) in Track 2 (MIDI track), that is between note 3 and 4 (the last one) 5.) After another repetition of the first 3 notes in the loop press S again (Solo off) in Track 2 6.) Now Track 1 (Audio track) is a bit delayed.

This effect happens outside of loops as well but I can't reproduce it.

Audiosynctest.qtz.zip

suedwestlicht commented 6 months ago

I could reproduce it with a jack bufsize of 128 as well, see attached video: audiosynctest.mkv.zip

G3N-es commented 6 months ago

@suedwestlicht I could be wrong but I could swear you're on PipeWire. I turned to Jack for that among other things.

I have come to the conclusion that PipeWire tries to make everything sound without xrum even with minimal latency. But that has a cost, and that is that the latency is not stable, and therefore it becomes desynchronized.

It may be a wrong conclusion.

suedwestlicht commented 6 months ago

@G3N-es it's jack2. If there was an issue outside of qtractor it would affect both the audio and the midi track containing the drumkv1 plugin.

rncbc commented 6 months ago

still can't reproduce the issue, either on genuine jackd2 or pipewire-jack.

suedwestlicht commented 6 months ago

I tried on different machines:

So I might be related to a different behavior of qt5.

suedwestlicht commented 6 months ago

No, it's not Qt5/Qt6. I installed Qt6 and dependent packages from https://launchpad.net/~savoury1 and built Qtractor with Qt6, Same problem.

Must be some libs or other voodoo.

suedwestlicht commented 6 months ago

Using Qt6 and deleting Qtractor.conf seemed to help on my Core i7 machine. I'll do the same on the weaker Core i5 machine tomorrow.

suedwestlicht commented 6 months ago

The combination of recompiling Qtractor with qt6 and deleting Qtractor.conf has cured the problem.

suedwestlicht commented 6 months ago

So I think we can close this issue.