Open Animtim opened 7 years ago
I'll check it out. Sounds like the input part of the process callback might delaying the output part.
Do you have a small MIDI file that demos the issue?
Chris
-------- Animtim 03:57 Mon 24 Apr --------
TLDR: jack midi is less precise than alsa midi here, not precise enough to play with it. As long as it happens, we really need to keep the alsa option :) (also, if you need, I'm ready to test changes to fix this issue)
I tested on two different computers with different distros, and I always notice small "timing drops" (I'm not sure how to call that) when using jack midi. There is no xrun, but just playing a regular kick with a high bpm, it's easy to notice the time between kicks is not perfectly regular. Using alsa midi, it always works as expected. Also I tested with different audio sources (from ardour5 to standalone ones), and always notice this issue, so it must come from seq64.
Maybe I miss something in my system setup to improve jack midi, but if so I don't know what (I already have all tweaks from realtimeconfigquickscan and an rt kernel on one of the systems, tested with nohz on or off... I'm out of idea).
-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/ahlstromcj/sequencer64/issues/73
-- Q: Why did the astrophysicist order three hamburgers? A: Because he was hungry.
Here is a little demo file. Play pattern q or 1 sent to a midi track in ardour5 with zynaddsubfx Drumskit1 preset. Also I'm not using jack transport.
With jack midi, I can notice a subtle timing shift when the pattern loops. With alsa midi, it doesn't seem to happen.
Note: the difference is maybe even easier to hear when using a drumkit soundfont, which has more predictable sounds (using Calf Fluidsynth here, on an ardour track..).
Oh, I just noticed this timing issue is highly depending on jack buffer size. I initially had it set to 1024 (and 3 periods). Issue is subtle but can be heard. Then I tested with 256, and couldn't really hear the issue (but then I have occasional xruns, very few but still). Then I tested with 2048, and the issue gets really worse, really easy to hear it.
That's great information, thanks!
I set the JACK frame size (in qjackctl) to 2048 and heard the issue clearly. I then reduce the periods/buffer from 5 to 2, and that basically eliminated the issue. Still researching this topic with an eye to seeing if this issue is something a client can minimize.
Another way to reduce the artifact is to double the sampling rate from 48000 to 96000. What is ideal? Inquiring minds want to know!
it also depends of MIDI driver used — ALSA-sequencer or ALSA-rawMIDI. check your configuration (somewhere in qjackctl or cadence settings). in general, using of ALSA-sequencer driver with jack MIDI should be avoided.
Hi, Actually I always had Midi driver set to None in my jack settings.
The issue with using ALSA Raw-midi there, is that then my usb controller doesn't appear anymore in the patchbay, neither with ALSA midi bridge nor as jack native ports.
(for info, when using Midi driver: none, the alsa midi bridge works. And when using Midi driver: ALSA sequencer, I have native jack port for the controller and alsa midi bridge also works for it...)
TLDR: jack midi is less precise than alsa midi here, not precise enough to play with it. As long as it happens, we really need to keep the alsa option :) (also, if you need, I'm ready to test changes to fix this issue)
I tested on two different computers with different distros, and I always notice small "timing drops" (I'm not sure how to call that) when using jack midi. There is no xrun, but just playing a regular kick with a high bpm, it's easy to notice the time between kicks is not perfectly regular. Using alsa midi, it always works as expected. Also I tested with different audio sources (from ardour5 to standalone ones), and always notice this issue, so it must come from seq64.
Maybe I miss something in my system setup to improve jack midi, but if so I don't know what (I already have all tweaks from realtimeconfigquickscan and an rt kernel on one of the systems, tested with nohz on or off... I'm out of idea).