07-23-2018, 09:02 AM | #1 |
Human being with feelings
Join Date: Nov 2011
Posts: 971
|
ALSA vs JACK latency experiences
My understanding is audio apps run with lower latencies with JACK than with ALSA. What has been everyone's experiences with this? My initial testing seemed to confirm this, but I wanted to know what everyone else was experiencing.
Thanks! |
07-23-2018, 09:57 AM | #2 |
Human being with feelings
Join Date: Mar 2012
Posts: 610
|
I don't think this is the case as JACK runs on top of ALSA. I have not tested myself.
__________________
----------> Debian Linux Distribution = Computing Joy & Freedom <---------- |
07-23-2018, 11:19 AM | #3 | |
Human being with feelings
Join Date: Nov 2011
Posts: 971
|
Quote:
So, what is everyone's experiences when running in ALSA vs JACK? How low can you get your latency before XRuns when using each technology? |
|
07-23-2018, 11:37 AM | #4 |
Human being with feelings
Join Date: Nov 2011
Posts: 971
|
Continuing with my research on this topic, I found the following conversation from the Mixxx Community Forums to be interesting:
https://www.mixxx.org/forums/viewtopic.php?f=1&t=460 This seems to indicate that there is NO added latency, which would indicate that JACK itself is at least equal to ALSA latency-wise. I suppose it is still possible for badly behaving apps in the JACK chain to cause latency. And it is also possible, I suppose, that when an app is tuned better for a particular technology (ie ALSA vs JACK) than another, then things could run better on one vs the other. That clears up a lot! So, it comes down to this: Does "REAPER" run with lower latency and less Xruns when using straight ALSA, or through JACK when tested on the same REAPER project? |
07-23-2018, 11:57 AM | #5 |
Human being with feelings
Join Date: Aug 2007
Location: Luxembourg/Spain
Posts: 1,922
|
I think that would need testing and might even differ between systems.
FWIW, I suspect that ALSA might have the edge, as reaper then has exclusive access to device, with JACK there might be other clients and there is some code overhead.
__________________
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. :) |
07-23-2018, 01:41 PM | #6 |
Human being with feelings
Join Date: Nov 2011
Posts: 971
|
It is definitely confirmed that ALSA has the edge with CPU cycles. The developers themselves have confirmed that JACK uses more CPU cycles than ALSA alone. But they strongly affirm that JACK itself causes no latency. So ALSA definitely has the edge in that area. :-)
|
07-23-2018, 02:07 PM | #7 |
Human being with feelings
Join Date: Aug 2007
Location: Luxembourg/Spain
Posts: 1,922
|
The latency will be the same, given by buffer / samplerate (+ hardware latency), JACK doesn't add any latency as such.
Though it might make the audio processing thread run a little longer, thus bringing it closer to the deadline.
__________________
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. :) |
10-10-2018, 07:08 PM | #8 |
Human being with feelings
Join Date: Sep 2018
Location: Brazil
Posts: 17
|
How Linux Audio Works vs. Windows
There is a very good explanation about ALSA and JACK. Link below:
https://www.learndigitalaudio.com/ho...ows-audio-2017 Best Regards |
10-10-2018, 07:31 PM | #9 |
Human being with feelings
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
|
Currently I get much better performance with JACK than I do using ALSA.
Last edited by Glennbo; 10-11-2018 at 05:37 PM. |
10-10-2018, 10:00 PM | #10 |
Human being with feelings
Join Date: Aug 2011
Location: Near a big lake
Posts: 3,943
|
Let's see how that changes as of tomorrow's build.
|
10-10-2018, 10:42 PM | #11 |
Human being with feelings
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
|
I'm real curious to see the results of that test as well!
|
10-11-2018, 02:35 PM | #12 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
5.96+dev1011 has the ALSA updates, give that a try. I tested it on a laptop built-in audio (3 periods), a Zoom R24 USB (3 periods), and a RME HDSP PCI (2 periods) and it seems to improve the laptop built-in audio, and have no real effect on the other two.
|
10-11-2018, 03:11 PM | #13 |
Human being with feelings
Join Date: Aug 2011
Location: Near a big lake
Posts: 3,943
|
Realtime xruns now "calm down" by themselves after the CPU spikes stop. Thanks! Also now with my "stress test" of many instances of ReaPitch, it seems I can reliably use more plugins than before, at least as many as when I used x64 Windows. Let's see what Glennbo says...
|
10-11-2018, 05:37 PM | #14 | |
Human being with feelings
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
|
Quote:
EDIT: I now know why ALSA has never performed as well as JACK at least on my system. Selecting JACK with 2 periods results in different reported latency in REAPER than selecting ALSA with 2 periods. JACK with 2 periods results in 1.4/2.9ms ALSA with 2 periods results in 1.4/1.4ms But interestingly . . . ALSA with 3 periods results in 1.4/2.9ms This totally explains why using ALSA resulted in sputtering with my system when JACK with the exact same setting did not. What it does NOT explain is why the difference in reported latency in REAPER. Last edited by Glennbo; 10-12-2018 at 08:00 AM. |
|
10-11-2018, 06:30 PM | #15 |
Human being with feelings
Join Date: Aug 2011
Location: Near a big lake
Posts: 3,943
|
Ok I'll install JACK and do a comparison.
Oops I forgot I'd already installed JACK. Ok comparison done. Performance with Reaper talking to ALSA directly is approximately the same as using JACK talking to ALSA (when using the same blocksize/numbers/samplerate). The only difference is that the output latency figure is a bit larger when using JACK. (My test is solely playing audio and using a bunch of ReaPitch instances to max out the CPU. I get it to around 85% and it still works smoothly, and that's when I stop adding plugins.) Last edited by JamesPeters; 10-11-2018 at 06:37 PM. |
10-11-2018, 07:12 PM | #16 | |
Human being with feelings
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
|
Quote:
You bring up something I hadn't looked at. I get asymmetrical latency numbers with JACK, which is also what I see in Windows using ASIO, but with ALSA I am getting symmetrical values, which are slightly lower on one side. This is what REAPER displays with JACK and with ALSA. 1.4/2.9ms with JACK 1.4/1.4ms with ALSA I just tried setting ALSA to use three periods, and it now displays 1.4/2.9ms like JACK does with two periods, and after hammering on REAPER while playing back the song it seems as though that might have fixed the frazzing. I'm also noticing that rather than saying 2/2ch like it does with JACK, it is reading 12/10ch, which makes me wonder if I can now access both cards directly from within REAPER. Previously the only way I could get both cards to be seen by REAPER was to use Qjackctrl with it's patchbay/router, otherwise the second card would never get any audio into REAPER for times when I'm recording 4 channel acoustic drums. Will do more testing, but I've now had the song playing in a constant loop the whole time I've been typing this in and it has not gone into frazz mode. Three MIDI interfaces (two on the two M-Audio cards, and one USB from an Akai pad controller) plus four channel simultaneous audio inputs will be my mission for tomorrow! Last edited by Glennbo; 10-11-2018 at 07:17 PM. |
|
10-11-2018, 07:19 PM | #17 |
Human being with feelings
Join Date: Aug 2011
Location: Near a big lake
Posts: 3,943
|
The lowest latency in ALSA I've gotten without the audio cutting out was 5.8ms/11ms at 44.1KHz (at 24 bits or 32 bits, no difference). That's 256 sample buffer x3. It's approximately the lowest latency setting I got using the same device in Windows 7 with ASIO. It's an Asus Xonar DX card.
With JACK (talking to ALSA) it was 5.8ms/17ms using those same buffer and sample rate settings. I imagine I could get lower latency by stepping up the sample rate, but I don't use higher sample rates. And if I used a realtime kernel maybe I could improve that number. I'm just not tempted too much to swap kernels at the moment. |
10-11-2018, 07:47 PM | #18 | |
Human being with feelings
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
|
Quote:
I'm REALLY hoping that REAPER will see the two cards now as one device using ALSA, which is what I see using ASIO in Windows. I'm not going to mess with it tonight, but it would be GREAT if I didn't have to worry about running REAPER after launching Qjackctrl to make the routing happen that allows me to use all four inputs from the two stereo cards. It has already bitten me once when I recorded some acoustic drums and when playing back the take realized that I had forgotten to start Qjackctrl first, so only two of the four tracks recorded anything. I had to play and record that whole drum part a second time! |
|
10-11-2018, 08:05 PM | #19 |
Human being with feelings
Join Date: Aug 2011
Location: Near a big lake
Posts: 3,943
|
So I just tried the Liquorix kernel and appended limits.conf with:
james - rtprio 98 james - memlock unlimited (Yeah I'm real original with my username on my computer.) And then I rebooted, and tested Reaper again. I'm not able to set any lower latency with the sound card. The CPU usage increased slightly. However Reaper remains more responsive when it's loaded down at 80%+. That's the only difference I noticed. I'm probably going to undo those changes, go back to the stock MX Linux kernel. I was getting the same low latency as in Windows already with the stock kernel, so I wasn't expecting miracles in that regard. I'm pretty sure this card wasn't really intended to be as low latency as 1.5ms/1.5ms. (edit) man changing this stuff is fast! I reverted to the stock kernel and removed that stuff from limits.conf. CPU usage went down in Reaper. Responsiveness is actually about the same overall. Lesson learned for that kernel. I wonder if the more recent kernels are just better at this sort of thing. I'm a bit late to the game to know. I'm guessing you have two of "the same" audio device and their driver in Windows allows them to work (sync) together. I've seen that with M-Audio devices. Anyway that'd be great for anyone who wants that functionality, another win for Linux audio. Last edited by JamesPeters; 10-11-2018 at 08:27 PM. |
10-11-2018, 08:50 PM | #20 | ||
Human being with feelings
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
|
Quote:
Quote:
I have a 4-channel template setup for my acoustic drums that gets the first two channels from the first card and the second two channels from the second card. Actually I have the same thing setup in REAPER for Linux, but it currently requires me to fire up Qjackctrl to get all four channels of input. Here's what the routing looks like in Qjackctrl, that I am hoping can be achieved with just REAPER and ALSA. |
||
10-11-2018, 09:28 PM | #21 |
Human being with feelings
Join Date: Aug 2011
Location: Near a big lake
Posts: 3,943
|
For a budget card, the audio on this Xonar DX is crazy good. It's actually one of the best audio devices I've ever used on any system (not just my own), although it's very limited for features and i/o. So I'll accept the current latency and be happy. I had to know if a different kernel would allow me to lower the blocksize/buffers though. That would've bothered me if I didn't test it.
|
10-12-2018, 07:19 AM | #22 |
Human being with feelings
Join Date: Feb 2017
Location: Brussels
Posts: 149
|
Never was able to connect Jack properly, always had issues with tons of stuff
However, ALSA works out of the box, works fine for me, had no problem with latency |
10-17-2018, 08:59 PM | #23 |
Human being with feelings
Join Date: Sep 2018
Location: Brazil
Posts: 17
|
RT priority
Usually I use jack, and today I just test (with alsa) in the section audio device and set the RT priority to 50 (default hardware priority) and I had very good results.
Last edited by Beco; 10-29-2018 at 06:11 AM. |
05-14-2020, 05:43 PM | #24 |
Human being with feelings
Join Date: Mar 2007
Posts: 14
|
ALSA vs JACK
But with straight ALSA, can you route multiple application outputs to multiple application inputs like you can with JACK?
Bryan |
05-17-2020, 06:40 AM | #25 |
Human being with feelings
Join Date: Apr 2018
Location: Karlsruhe
Posts: 486
|
No, that's not possible. Alsa can only be used by one app. If you want to listen to a youtube video you have to stop the audio engine in Reaper (using Alsa).
__________________
https://soundcloud.com/lilith_93 https://open.spotify.com/intl-de/art...SMSwCW9VkqAN9Q MX Linux, Behringer UMC 204 HD, Neumann KH120 |
05-17-2020, 07:40 AM | #26 | |
Human being with feelings
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
|
Quote:
For REAPER I have an outboard rack mount USB audio device, and I have it totally disabled in Pulse Audio. I frequently play along through REAPER with music coming from YouTube videos. Just about 20 minutes ago I was playing my new bass through REAPER, playing along with Taxman by the Beatles. Both audios playing on my JBL monitors, but coming from two different audio devices. REAPER using ALSA to the USB device and motherboard computer audio using Pulse that is riding on ALSA. |
|
05-17-2020, 07:41 AM | #27 | |
Human being with feelings
Join Date: Apr 2018
Location: Karlsruhe
Posts: 486
|
Quote:
__________________
https://soundcloud.com/lilith_93 https://open.spotify.com/intl-de/art...SMSwCW9VkqAN9Q MX Linux, Behringer UMC 204 HD, Neumann KH120 |
|
05-17-2020, 07:46 AM | #28 | |
Human being with feelings
Join Date: Mar 2008
Location: Planet Earth
Posts: 9,055
|
Quote:
I always have run my DAW like that, all the way back to Windows 98 and Cakewalk Pro Audio. By letting the computer sound own the built-in audio on the motherboard, there is never any contention for the pro audio device that REAPER will use. |
|
08-23-2022, 09:21 PM | #29 |
Human being with feelings
Join Date: Jun 2008
Location: Philippines
Posts: 54
|
Xruns or sound interruption
if i am using jack , i have xruns coming from time to time by groups of 10 or 20 , uif i use Alsa , it will be a sound interruption while playing a project.i had the best result with alsa 48000 , 512 ,3 , MB internal HD snd device , no-RT.Some time i can play the whole project without anything happening.What is giving me sometime these troubles , any idea?
|
08-25-2022, 10:39 AM | #30 |
Human being with feelings
Join Date: Mar 2017
Posts: 859
|
Hi, I would look at the list of apps and services that 'auto-start' and remove all that are verified as not system critical, and just start them if needed when not recording. Before starting a session, I would unplug any ethernet cable, and turn off any bluetooth apps/hardware, then unmount and unplug any extra external drives.
I have an i7 4-core 8-thread cpu, @ 3.40 ghz and use 44100/128/2 settings, with 3 to 6 ms latency. There are some software effects and instruments that make noises seemingly unrelated to available resources, and need special attention when used. Core and thread coding among daws and plugins also vary quite a bit. Reaper leaning towards the excellent end of the spectrum. https://www.cpubenchmark.net/cpu.php...0+3.40GHz&id=1 If this behavior is new to your system, and was better in the past, then some updates, upgrades and new versions might include troublemakers. Your package manager might have a log to inspect. If you can install an extra avlinux/ubuntu-studio distro on an external drive, they have a config well tuned at the outset, for an easy comparison. Cheers
__________________
Songs I've made with linux and Reaper, a qwerty forehead danger zone: https://www.youtube.com/watch?v=NtlO...RvGI8-_TqqZ7ij https://franklincheney.bandcamp.com/ Last edited by 4duhwinnn; 08-25-2022 at 12:06 PM. Reason: useful link |
Thread Tools | |
Display Modes | |
|
|