Equivalent of jack's "periods per buffer" in Alsa backend?

Over the years I have used a couple usb audio interfaces with jack, and had been recommended to use 3 periods per buffer for best performance. Experience supported this. I currently really like Ardour4’s internal Alsa backend (I really don’t connect to external programs in my workflow). I don’t se an equivalent setting for the alsa backend, and I am wondering if it is even needed, or is perhaps done automatically. I do seem to get better performance (less static and x-runs) if I use jack with 3 perids per buffer vs the Alsa backend with similar buffer size (of course, this leads to a higher latency which might explain the difference). I guess I’m just curious how the Alsa backend works compared to jack, and is ther any way to optimize its use for usb interfaces?

Ardour’s ALSA backend currently hardcodes 2 buffers/period. There is currently no setting for this.

The reason why -p3 works better with some USB devices is because USB URBs are scheduled at 1ms sec intervals and with most (buffersizes / samplerate) come out on even 1ms when multiplied by 3: see also https://www.linuxmusicians.com/viewtopic.php?f=47&t=10707

Thanks for the clear answer - just what I needed.

To be even clearer: I meant -n 3 (not -p3)

At some point in the future Ardour may allow to configure this for the ALSA backend.
Currently this is a trade-off: Ardour provides a “simple” setup GUI. Power-users can use qjackctl.

Hi,

I think in the interest in Ardour for new users on garden variety distributions that don’t come with JACK pre-installed would be much greater if the Ardour ALSA backend had the ability to at least simply select 2 or 3 frames per period. Many people who are interested in making music with Linux may likely already have a USB Audio device and with the vastly improved support for Focusrite, Presonus etc. etc. over the last couple of years I think it could safely be assumed that as many people will use Ardour with USB Audio as without so I would suggest it should be a high priority to bring more flexibility to ALSA users.

The OP makes a good point that with Ardour (and Mixbus3) both providing MIDI support now the ability to take advantage of JACK’s external connectivity is less of a ‘need’ (although still an incredible asset) and as x42 said still readily available to those who want it. In other words for more users than ever Ardour will be monolithic enough to be self-contained so why not make ALSA an even easier option to configure properly for all potential devices?

Ooops,

I mistakenly referred to period/buffers as ‘frames per period’ which is a different setting than the number of buffers, sorry for any confusion.

@GMaq: you’re in good company. I made the same mistake in my first post :slight_smile:

For now, with my USB devices (an Alesis Multimix 4 and a Zoom R16 which is now supported in kernel 4.4, woohoo!), the info in the link x42 provided (and in wiki form here: http://wiki.linuxaudio.org/wiki/list_of_jack_frame_period_settings_ideal_for_usb_interface) made it clear I need to use jack for now. Using Cadence to type in buffer size, and realizing I really can’t even choose to use 44100 as a sample rate to get good latency was very helpful. The ( 240 / 48000 ) * 2 = 10 gave very usable latency on a Mixbus project I tried it with. By way of comparison, Tracktion’s alsa backend has a dropdown with many possible buffer sizes (not just 128, 256, 512, etc.). It is still a fairly simple to use setup screen (not too different than the Ardour’s) and allows easy selection of a buffer size that gives an even multiple of 1 ms latency. I know it isn’t a huge burden to use jack, and I have for many years, but the simplicity of using the Alsa backend (especially with my workflow, not using external programs) is very nice and as GMaq has said, it would simplify the initial use of Ardour and Mixbus for those with USB devices. I’m currently moving back to working fully in Linux and with native programs after a period of using Reaper with wineasio and then using Windows (with the R16 prior to its functioning with Linux). I really think Ardour and Mixbus are amazing and beautiful programs, and since I have experience with jack I am happy to use it. But if I didn’t already know jack, I would be frustrated that I can’t get the latency I expect via the Alsa backend.I guess there needs to be a balance between keeping it simple to use and learn, and making a slightly complicated thing (like usb devices need to use multiples of 1 ms) possible. Even all those extra buffer sizes in Tracktion aren’t helpful if the user doesn’t know what they are loooking for. Maybe a checkbox for “USB Interface” that then changes the avalable options?

Just noticed these have been added to the latest interim release of Mixbus, and I assume are in Ardour as well :slight_smile: I haven’t had a chance to test it yet, but amazing developers. Happy Eric.

-New option to configure period size (improve performance of USB devices)
-Allow latency-calibration without restarting the backend (ALSA) … this helps with USB devices whose latency changes with each start/stop.