11-26-2018, 09:42 AM | #1 |
Human being with feelings
Join Date: Nov 2018
Posts: 15
|
Alsa/Jack Periods and a Feature Request
Hello to everyone,
In Reaper, I've noticed something strange: If I choose ALSA in the Device section and I set the Periods/buffer to 2 I get a reported latency of n/n (for example 2.6ms/2.6ms with a 128 buffer), while if I set it to 3, I get a latency of n/2n (2.6ms/5.3ms), which is fine. The strange thing is that if I start Jack with 2 Periods/buffer, I'll the get the same latency as Alsa with 3 Periods, so n/2n (2.6/5.3). This doesn't make much sense to me.. Apart from that: Justin, if you read this first of all thank you for making Reaper available on Linux! Second, I see that if I select Jack in the settings, I've got the ability to start it when I launch Reaper with a custom command, which is awesome.. would it be possible to get the same option to stop Jack on exit? This way I shouldn't remember to start/stop jack at all and I think it would be very useful. Thanks! |
11-26-2018, 09:52 AM | #2 | |
Human being with feelings
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
|
Quote:
It wasn't until I noticed that difference you mention that I realized I really get about the same performance using 3 periods with ALSA as I do using 2 with JACK. |
|
11-26-2018, 11:17 AM | #3 |
Human being with feelings
Join Date: Aug 2007
Location: Luxembourg/Spain
Posts: 1,922
|
This is because you are using JACK2 and it double buffers output by default. AFAIK this is needed for it's multi cpu support, click less connections, etc. This also allows the application more time to finish calculating the audio for the period, which can lead to less xruns. When it needs to send data to the soundcard, it will send the data calculated the previous period, though with the cost of increasing latency.
You can turn off this behavior in JACK2 by using the -S command line switch. JACK1 doesn't have this behavior and works the same way as reaper's alsa driver. When trying for the lowest latency it could pay off to try both 2/3 periods and 44k1/48k to see what gives the best result. Don't forget to check the real world loopback latency with reainsert, and to configure it in reaper's Audio->Record settings so that overdubbed material is properly aligned. The loopback latency is always higher than the one given by sample rate, buffer size and periods due to things like latency in the USB stack, digital to analog conversion time, etc. Sometimes the latency is negligible but in other situations it might be significant..
__________________
Reaper for Linux Documentation (WIP). Software: Archlinux/KDE, Fabfilter FX, Komplete 8, Nebula, Schwa/Stillwell, T-racks Max/Amplitube/SVX, etc. Gear: i7-2600k/4700HQ/16GB, RME Multiface/Babyface, Behringer X32, Genelec 8040, etc. :) |
11-26-2018, 11:47 AM | #4 |
Human being with feelings
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
|
For my setup, I have to use JACK because ALSA can't get a lock on my midi interfaces, and while I can get the slightly lower latency with 2 periods and no double buffering on the output, it only works without artifacts for a few tracks. Since Windows always showed asymmetrical latencies in REAPER using the genuine Avid drivers, I figure that it's not a bad thing to see the same thing in Linux with JACK.
I can still record guitars and basses while monitoring through REAPER, even if I have to push the latency up a bit by increasing the buffer size to 128 from the normal 64 samples I run. I only have to do this when I've mostly mixed a song and there are tons of plugins when I decide to re-record some part, but now that I'm veering away from using Windows plugins so much, I may not even run into that any longer. At least I can hope it will go that way. In Windows, I NEVER changed the latency in REAPER always running with a 64 samples latency, even with 100+ plugins. |
11-26-2018, 12:03 PM | #5 |
Human being with feelings
Join Date: Aug 2007
Location: Luxembourg/Spain
Posts: 1,922
|
Using double buffering on the output has the advantage that the program has more time to finish calculating audio.
Strange that alsa doesn't pick up your midi devices, probably worth a post in bugs thread? Hopefully the plugin situation on linux will improve, and we'll have all the toys people on windows/osx enjoy. I must say that as cool as it is running windows vsts on linux, it does have a performance penalty xrun/latency wise.
__________________
Reaper for Linux Documentation (WIP). Software: Archlinux/KDE, Fabfilter FX, Komplete 8, Nebula, Schwa/Stillwell, T-racks Max/Amplitube/SVX, etc. Gear: i7-2600k/4700HQ/16GB, RME Multiface/Babyface, Behringer X32, Genelec 8040, etc. :) |
11-26-2018, 12:25 PM | #6 | |||
Human being with feelings
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
|
Quote:
Quote:
Even if I could get midi to work with ALSA I would need to use JACK though, as QjackCtrl's routing matrix has been the only way I've been able to get both my M-Audio 2496 cards to be accessible in REAPER. Quote:
- |
|||
11-26-2018, 02:49 PM | #7 | ||
Human being with feelings
Join Date: Nov 2018
Posts: 15
|
Quote:
I've tried running Jack2 in synchronous mode (with jack2 the command is "jack_control eps sync true") with 3 periods/buffer instead of 2 and I get the same reported latency as before (non synchronous mode and 2 periods), but with no xruns at all, while with the previous setup I used to get some frequent and very annoying dropouts (had to increase the latency to record). This should definitely be mentioned on the Jack page of the Arch wiki. Quote:
|
||
Thread Tools | |
Display Modes | |
|
|