Old 05-05-2019, 09:05 AM   #1
HihiDanni
Human being with feelings
 
HihiDanni's Avatar
 
Join Date: May 2019
Posts: 7
Default PulseAudio buffer size?

Hi there! I stumbled across Reaper out of curiosity while looking at updated Linux DAW offerings. Turns out this software now has a Linux version, which is pretty cool! But what really grabbed my attention is the fact that it is the first Linux DAW I've seen with PulseAudio support!

My setup is fairly ordinary/"consumer", just a custom-built PC with integrated audio, no professional audio hardware. I have a sound card that I used to use because it provided hardware audio mixing, thus allowing me to run multiple ALSA programs at once without needing PulseAudio, but due to issues with the drivers I had to stop using it. The result is that working with my previous DAW suddenly became a lot less fun. I had to manually start a JACK server before opening the DAW (or everything would mess up), and to get other applications playing audio I had to manually reroute them to the JACK server one-by-one via pavucontrol. Neither the DAW nor other applications had particularly good latency under this system, contrary to what is often said about JACK. It was honestly kind of miserable.

So now I've been trying out Reaper, and so far it seems pretty good for my use case (mostly VST-based). The PulseAudio support works in the sense that it outputs audio, it doesn't seem to Xrun, and other applications can play audio. But the latency leaves a little to be desired. It feels like there's about 150ms latency. Problem is, no matter what I set as the buffer size, it doesn't seem like my setting is honored. I can set it as low as 16 or as high as 2048 but the result is the same.

I do have a workaround for this - I can switch to ALSA, which means I can't play audio in other programs but the latency is much better. It's not a dealbreaker because Reaper makes it easy to get at the audio output driver settings so I can switch between the two on the fly, but it's still a nuisance. The ALSA output automatically suspends PulseAudio, but I feel like it shouldn't really have to. Overall I'd be happy with either the latency under Pulse getting fixed or the ALSA backend gaining an option for non-exclusive device use. After all, most applications use non-exclusive ALSA and this ends up getting mixed through PulseAudio via the compatibility layer, and they work fine. And I have quite a few programs with this setup that have very good latency compared to what Reaper's current Pulse support offers. Is this something that the developers could investigate?

One thing that seems curious to me - the ALSA backend is showing the correct value for latency in the menubar, but the Pulse backend is showing "~3.5/0.0 ms" for Pulse - see attached.
Attached Images
File Type: png Screenshot_20190505_112628.png (7.4 KB, 32 views)
File Type: png Screenshot_20190505_112720.png (8.4 KB, 32 views)
HihiDanni is offline   Reply With Quote
Old 05-07-2019, 08:08 AM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 12,196
Default

Pulseaudio is always terrible from a latency perspective, from what I've seen. The blocksize REAPER defines is used for internal processing, Pulse still ends up making things long.

The best solution I've seen is to use JACK with a plug-in to allow PulseAudio apps to be routed through JACK. I forget how I set it up, I believe there was a debian package to do just this, and you launch JACK w/ qjackctl and it runs the necessary scripts... It gives you low latency REAPER and also allows other apps to play.
Justin is offline   Reply With Quote
Old 05-07-2019, 09:52 AM   #3
Stringer
Human being with feelings
 
Stringer's Avatar
 
Join Date: May 2006
Location: State of California
Posts: 529
Default

I am running Reaper in Linux Mint 18.3 using Alsa (no Jack). If I switch to another application that uses PulseAudio, such as a web browser or Audacity, they work fine, even if Reaper is still running. Reaper/Alsa and PulseAudio do not seem to conflict.
__________________
One thing led to another and somehow I ended up on Linux.
https://guitarsophist.com/
Stringer is offline   Reply With Quote
Old 05-07-2019, 02:58 PM   #4
HihiDanni
Human being with feelings
 
HihiDanni's Avatar
 
Join Date: May 2019
Posts: 7
Default

Quote:
Originally Posted by Justin View Post
Pulseaudio is always terrible from a latency perspective, from what I've seen. The blocksize REAPER defines is used for internal processing, Pulse still ends up making things long.

The best solution I've seen is to use JACK with a plug-in to allow PulseAudio apps to be routed through JACK. I forget how I set it up, I believe there was a debian package to do just this, and you launch JACK w/ qjackctl and it runs the necessary scripts... It gives you low latency REAPER and also allows other apps to play.
I addressed this in my original post. This is the configuration I'm trying to get away from. From my own experience I've consistently gotten better latency and less Xruns through Pulse than Jack. After all, both are mixing servers that sit on top of ALSA...

Quote:
Originally Posted by Stringer View Post
I am running Reaper in Linux Mint 18.3 using Alsa (no Jack). If I switch to another application that uses PulseAudio, such as a web browser or Audacity, they work fine, even if Reaper is still running. Reaper/Alsa and PulseAudio do not seem to conflict.
You could be using an audio device with hardware mixing, or you found a way to use ALSA non-exclusively. Could you post a screenshot of your Reaper audio output settings?
HihiDanni is offline   Reply With Quote
Old 05-07-2019, 03:10 PM   #5
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 12,196
Default

With PulseAudio there's always a few hundred milliseconds of latency, yeah. It's not usable for recording IMO.
Justin is offline   Reply With Quote
Old 05-07-2019, 03:48 PM   #6
HihiDanni
Human being with feelings
 
HihiDanni's Avatar
 
Join Date: May 2019
Posts: 7
Default

Again, not from my experience. This is 2019, and Pulse has seen many releases since over a decade ago when it was first introduced to Ubuntu. I'm able to set latencies fairly low in games, including in my global OpenAL configuration, and audio feels quite snappy. The only real limit here is how much CPU I'm willing to allocate to audio processing. I'd say that in most cases Pulse only adds a couple milliseconds of latency which is going to be unnoticeable to the vast majority of folks. Only exceptions I can think of are PulseAudio extensions that do additional processing (like EQ), or a couple one-off issues I've had with latency being slightly higher after waking my system from suspend, but a 'pulseaudio -k' cleared those up. And since then I suspect even that issue has been patched. I have seen programs that actually had their audio latency *reduced* just by switching from a pure ALSA setup to ALSA/PulseAudio and thus using the Pulse driver for output.

But in any case I really don't want to spend my time arguing about PulseAudio, because that just wears me down. What I want to know is whether the devs will look into the buffer size not being set properly in Reaper's PulseAudio backend, or if ALSA can be used non-exclusively.

Also I just want to put it out there that I don't want the devs to feel that my use of Reaper is contingent on this, because that's mean. I've already bought a Reaper license since the current situation is already an improvement over my previous DAW. In fact I would like to congratulate Cockos for their work on the Linux version - it feels a lot more polished than the "Experimental" label would have one believe. But I would like to be heard...

Edit: I got it to work! I just had to enter "pulse" as the ALSA output device and everything worked! So now I have both low-enough latency and multiple programs playing audio! Could this be documented somewhere?

Last edited by HihiDanni; 05-07-2019 at 04:15 PM. Reason: Solved own problem
HihiDanni is offline   Reply With Quote
Old 05-07-2019, 04:57 PM   #7
brainwreck
Human being with feelings
 
Join Date: Jul 2006
Posts: 20,659
Default

So you are running Reaper with other applications at low latency?
brainwreck is offline   Reply With Quote
Old 05-07-2019, 05:09 PM   #8
HihiDanni
Human being with feelings
 
HihiDanni's Avatar
 
Join Date: May 2019
Posts: 7
Default

Not exactly "low latency" but "low-enough latency":



This is with stock kernel and a fairly old CPU from 2010. Sound occasionally seems to cut in and out at the default buffer settings of ~11/23 ms so I raised it a bit. Might look into getting it set up for RT priority scheduling but for now it's good enough for my use case (MIDI keyboard, no recording, just Reaper and VSTs).
Attached Images
File Type: png Screenshot_20190507_200055.png (4.3 KB, 80 views)
HihiDanni is offline   Reply With Quote
Old 05-07-2019, 06:22 PM   #9
Stringer
Human being with feelings
 
Stringer's Avatar
 
Join Date: May 2006
Location: State of California
Posts: 529
Default

There is a checkbox in Preferences/Audio/Device that says "Auto-Suspend Pulse Audio." I have that checked.
__________________
One thing led to another and somehow I ended up on Linux.
https://guitarsophist.com/
Stringer is offline   Reply With Quote
Old 05-07-2019, 06:45 PM   #10
HihiDanni
Human being with feelings
 
HihiDanni's Avatar
 
Join Date: May 2019
Posts: 7
Default

You most likely have a hardware mixing card then, as everything would be routed through ALSA in that scenario.
HihiDanni is offline   Reply With Quote
Old 05-07-2019, 08:06 PM   #11
Stringer
Human being with feelings
 
Stringer's Avatar
 
Join Date: May 2006
Location: State of California
Posts: 529
Default

I have a Steinberg UR44 as an interface. Reaper input and output, using Alsa, goes through that. Latency is just ok, nothing spectacular. Other audio output goes through the computer's audio device, using PulseAudio.
__________________
One thing led to another and somehow I ended up on Linux.
https://guitarsophist.com/
Stringer is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:08 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.