-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer underflow in every second with JACK @96K #11341
Comments
Config in QJackCtl: Driver: alsa Interface: Roland Rubix 24, USB |
I put my notebook in a special performance mode and in that v2.5.0-alpha also works flawlessly. edit: *correctly: v2.3.3-121-gd1f63374fc |
via CPU governor? |
turning off wifi with hardware switch cpupower frequency-set -g performance systemctl stop cron AND: running Ardour in the background for additional processing with: This "CPU DMA latency" one additionally means a lot. |
With the same mixxx.cfg file there should be no performance regression with the 2.4 or main branch compared to our stable 2.3.4 release. If this is the case, we should reopen the bug and find out when the performance regression has happened. |
@daschuer probably you are right. That fix not fixes the issue. Unfortunately even my performance mode not solves it. In my performance mode I'm using another QJackCtl profile. So this issue is bound to the mentioned QJackCtl settings. The issue seem to be not present with the following settings: Driver: alsa |
Additionally I managed to reproduce the issue with v2.3.4. |
Built them. This is before the jack-api-check-rebase happened and works without problems: This is the one where the "jack-api-check-rebase" happened and with this the problem is present: So the problem arises from this: |
What is your JACK period size set to? Before that PR Mixxx would ignore the JACK server's settings and always used a 'virtual' period with a size corresponding to the grayed out latency setting in the audio settings tab. Now PortAudio should use the period size configured on the the JACK server (like you'd expect from a JACK application). |
@robbert-vdh settings in QjackCtl: produces buffer underflow: jackd -dalsa -r96000 -p2048 -n3 -D -Chw:Rubix24 -Phw:Rubix24 Sample Rate: 96000 works correctly: jackd -dalsa -r96000 -p1024 -n3 -D -Chw:Rubix24 -Phw:Rubix24 Sample Rate: 96000 |
Please confirm: Mixxx 2.3.4 works with 96 kHz/1024 frames/period and produces buffer underflow with 96 kHz/2048 frames/period. Mixxx 2.3.3 up to https://github.com/mixxxdj/mixxx/tree/4834e90e13a62a1d865237e4c62756c965f04137 In the later case, Portaudio uses an extra buffer and Mixxx is running with it's default 1024 frames/period. Do you use native Jack or Pipewire? |
yes |
Is there something logged in the mixxx.log when the underflow happens? |
nothing strange |
if it matters: with both jack settings Mixxx's system reported latency is: |
How do you identify the underflow? Does the underflow counter count in Mixxx? Is it a playback or input underflow? Do you use input channels in Mixxx like mic and aux? |
|
please ignore the post where I mentioned the 4.47392e+07 ms, because it is when the utility named jack-passthru is used without that, directly, the latency is: the underflow happens independent of jack-passthru |
Interestingly this problem seems be there without audible effects. |
When you start Mixxx with "./mixxx --developer" it will print an underflow code to the terminal output. |
|
So it originates from here: |
I have prepared a fix here: |
Strange, at least I can reproduce a similar issue printing @atskler Can you please provide a full mixxx.log of a faulty run using #11366? you can find it at |
Oh I forget, I need a mixxx.log from "./mixxx --developer" to see the "underflowHappened" numbers. |
Jack is running still with Frame/Period: 2048? This is interesting, because the "Network stream" runs initial with the same value:
This means my PR has no effect here. |
I will rebuild you PR - maybe I misdone something before.
... |
I have just prepared a new commit with more debug output. Please use that. |
Yes, 48kHz does the same.
|
I downloaded and built it again, and the problem is still there. Here is the log: |
I do not see the additional debug messages. |
That is "checksum match" with what I downloaded and built. And it has additional info in the log:
|
Oh yes, now I see it. |
We see a buffer and empty buffer after these times in unregulated intervals: outChunkSize is 2048 which is strange, because if the period = 2048 and we have two channels, it is expected to be 4096. The available space until sync is 4114. |
I have updated #11366 with another overflow check (25) and even more debug messages. |
With that build I created two logs. The simple one is just starting Mixxx and exiting. The other one is starting Mixxx, then loading decks, then clicking qiuckly and repeatedly on the taskbar entry of Mixxx to show (maximize) and hide (minimize) its window. Because I observed that sometimes loading the decks stops the buffer underflows for a while, and then it seems it can be triggered again by repeatedly clicking on Mixxx's entry on the taskbar to show and hide its window. But there seems to be loose causality here, it could be just coincidence, so it could be totally irrelevant. mixxx_log.log |
I have found the issue : -) When using the Jack buffer, Portaudio uses an internal buffer of 1024 frames: Mixxx is not yet designed for this. Maybe we can detect this situation somehow. What is the Maximum period size Jackd allows? |
Thank You!
I don't know. It will start even with 16384 but it will not work eventually. For example Audacity crashes, Reaper produces a Jack crash. The max working value seems to be 8192 with my setup. |
Mixxx can't support more than 4096 frames. Please test. |
@daschuer thank you. With the 4096 option the problem goes away but with 2048 it is still there. From the logs it seems that option 2048 sets: |
Good catch, there was a copy and paste issue. This is now fixed. Please retry: #11366 |
Thank you. The gh11341 6a4c5df seems to fix the issue correctly. I have just one observation: |
The behavior is correct, but I will have a look to avoid the misleading debug message. |
Now it prints the following: |
Thank you. As far as I can tell everything seems to be good now - from my side as a user. |
Thank you very much for your patience and help with fixing this bug. |
Bug Description
I just observed that the current Mixxx main (Mixxx 2.5.0-alpha) compared to the v2.3.4* produces constant buffer underflow in every one second, especially when none of the decks are loaded. It produces it with JACK running at 96kHz and deck 1 is configured to interface channels 1-2 and deck two to interface channels 3-4.
edit: *correctly: v2.3.3-121-gd1f63374fc
Version
2.5.0-alpha, 2.3.4
OS
OpenSUSE Tumbleweed
The text was updated successfully, but these errors were encountered: