Topic: Linux: Native PulseAudio support

Hi, I'm wondering if there is any plan for native PulseAudio support in Linux.  I ask because when using PulseAudio (via the ALSA option in PianoTeq) I get sporadic clicks and pops in the audio output.  This happens almost never when using direct ALSA support (with Pulseaudio stopped).  I suspect native Pulse support would probably take care of this.

Re: Linux: Native PulseAudio support

Something else must be amiss because I have no probs with pulseaudio + pianoteq on several machines (oldest one being nearly 10 y.o. and the fastest one being an i5, couple of y.o.). I experienced clicks/pops on some systems and the fix was to turn CPU throttling off (setting a fixed CPU clock frequency). I also use the low latency kernels.

3/2 = 5

Re: Linux: Native PulseAudio support

SteveLy wrote:

Something else must be amiss because I have no probs with pulseaudio + pianoteq on several machines (oldest one being nearly 10 y.o. and the fastest one being an i5, couple of y.o.). I experienced clicks/pops on some systems and the fix was to turn CPU throttling off (setting a fixed CPU clock frequency). I also use the low latency kernels.

Thanks for your reply SteveLy.  This is an i5 6600 system so there should be no issue with horsepower.  I'll try disabling CPU throttling and see if that helps.  It's surprising that none of this is necessary with pure ALSA but I suppose pulse is also adding another layer which could be all it takes to cause the occasional hiccup in low latency audio.

Re: Linux: Native PulseAudio support

merc68k wrote:

Thanks for your reply SteveLy.  This is an i5 6600 system so there should be no issue with horsepower.  I'll try disabling CPU throttling and see if that helps.  It's surprising that none of this is necessary with pure ALSA but I suppose pulse is also adding another layer which could be all it takes to cause the occasional hiccup in low latency audio.

It's all very hardware dependent. I don't know enough about what's going on under the hood in various linux (or windows) sound card drivers. I mentioned CPU frequency tweak as something's that's come up for me. Your issue may well be unrelated. But the CPU frequency switching did cause glitches for me on an i5 - also plenty horsepower, but the freq switch would make the system pause for long enough to disrupt Ptq. My strategy for getting the most out of Ptq on a given machine is trial and error tweaking and making use of the "Perf" window (esp the live CPU load graph) along with some "torture" testing.

3/2 = 5

Re: Linux: Native PulseAudio support

SteveLy wrote:
merc68k wrote:

Thanks for your reply SteveLy.  This is an i5 6600 system so there should be no issue with horsepower.  I'll try disabling CPU throttling and see if that helps.  It's surprising that none of this is necessary with pure ALSA but I suppose pulse is also adding another layer which could be all it takes to cause the occasional hiccup in low latency audio.

It's all very hardware dependent. I don't know enough about what's going on under the hood in various linux (or windows) sound card drivers. I mentioned CPU frequency tweak as something's that's come up for me. Your issue may well be unrelated. But the CPU frequency switching did cause glitches for me on an i5 - also plenty horsepower, but the freq switch would make the system pause for long enough to disrupt Ptq. My strategy for getting the most out of Ptq on a given machine is trial and error tweaking and making use of the "Perf" window (esp the live CPU load graph) along with some "torture" testing.

Well, that seems to have actually done the trick in my case as well, I played for a good 20 minutes hiccup free and then switched back to the powersave governor and immediately had a few.  So thanks!  Now to write a little script to launch PianoTeq with throttling disabled...

Re: Linux: Native PulseAudio support

Steve-- Thanks for mentioning that you use Pianoteq with the PulseAudio sound server and its ALSA interactivity. I had always presumed that in Linux it might be better to select JACK for audio rather than PulseAudio for lower latencies and more dependable audio input/output. However, just out of curiosity, after reading your post above I have been trying Pianoteq using the ALSA backend and PulseAudio server, and the performance (CPU load) is very good (rarely above 30%), audio buffer size and latencies low (~5 ms or lower), with no Xruns (so far).

I have an Intel i7 six-core machine, and like you, the only customization I have done for the sake of audio is to use a low-latency linux kernel and disable CPU throttling (in my case, by adding the option "intel_pstate=disable" to the kernel command line that boots the computer.

I'm very pleased. Thanks for the nudge.

Last edited by Stephen_Doonan (23-05-2016 14:05)
--
Linux, Pianoteq Pro, Organteq

Re: Linux: Native PulseAudio support

I experimented with JACK also, but got better results without it (i.e., with pulseaudio + ALSA). Integration with the rest of the system is also more seamless: Ptq does not interfere with other processes needing to use the sound card. With jack I'd always have to manually stuff around with the "connections" and even then some programs would refuse to produce any sound. I've found jack useful for other things but pianoteq seems to work better without it.

3/2 = 5

Re: Linux: Native PulseAudio support

SteveLy wrote:

I've found jack useful for other things but pianoteq seems to work better without it.

The modeled Hammond B3 organ I use (SetBfree) requires jack, and some other audio applications for jack seem to require jack, but I'm very happy with using ALSA  instead of JACK with Pianoteq so far.

In Pianoteq, after setting the backend to ALSA instead of JACK, I have (among other options such as using the motherboard's built-in audio, which I never use) the option to send Pianoteq's audio output to the external USB soundcard (a Focusrite Scarlett 2i4, 96000 Hz, 24-bit) "directly without conversion."

I've discovered that in Pianoteq, if I set the recording and playback option to use that direct-to-soundcard communication instead of setting it to use the PulseAudio (or JACK) audio server, I can set the sample rate higher and buffer size lower in Pianoteq (96000 Hz, 64 sample buffer) for virtually instantaneous and (so far) glitch-free performance. Using PulseAudio the performance is still very good, although I need to boost the samples per buffer to 256 or higher to avoid overruns, producing a slightly greater (but still very responsive and acceptable) sound-delay latency.

If I need to route the audio to and from one or more other applications within the computer (from Pianoteq to Ardour (digital-audio recorder application) for example), then a sound server such as PulseAudio or JACK is needed, but for piano practice, live performance or MIDI recording/playback within Pianoteq, the ability to connect directly from Pianoteq to the external USB audio interface for extremely low latency and high performance is great.

Pianoteq's accommodation of and integration with Linux is very thoughtful and admirable.

Last edited by Stephen_Doonan (23-05-2016 17:25)
--
Linux, Pianoteq Pro, Organteq