[PD] Pd and pulseaudio

Hans-Christoph Steiner hans at at.or.at
Fri Feb 1 16:37:51 CET 2013


On 02/01/2013 06:29 AM, Roman Haefeli wrote:
> On Don, 2013-01-31 at 13:12 -0500, Hans-Christoph Steiner wrote:
>> Does it happen with Pd-vanilla 0.43.4 or 0.44?  I just take that code directly
>> from Miller since I've never done anything with programming audio interfaces.
>>  Pd definitely does not place nice with pulseaudio,
> 
> Pd 0.44 _does_ play nice with pulseaudio (input and output) when using
> portaudio as backend and "pulse" as devcice. 
> One can also launch Pd with the option '-pa'.
> N.B.: '-pa' stands for portaudio which is not to be confused with
> pulseaudio.

The situation is improved, but not quite usable on my machine.  I'm on Linux
Mint Maya amd64 (Ubuntu/precise).  Many other apps are happy to play at the
same time, like Youtube, browser+flash, Twinkle voip phone, skype, mumble,
etc.  If I have rhythmbox playing music, and start 'pd -pa', Pd outputs chunky
audio and I get tons of these in the console:

ALSA lib pcm.c:7339:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7339:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7339:(snd_pcm_recover) underrun occurred

After 10ish seconds, it settles in and works decently.  Until I close the Test
Audio patch, then I get tons of these again until I turn off DSP:

ALSA lib pcm.c:7339:(snd_pcm_recover) underrun occurred



>>  so make sure its not
>> running when using Pd.  I use this to temporarily suspend pulse:
>>
>> pasuspender pd-extended
>>
>> Many people who use Pd a lot uninstall pulseaudio entirely.
> 
> Ok, let's clear some dust here. There seems a strong notion that
> pulseaudio is interfering a lot with other audio applications and is
> causing lots of troubles. Let me point out a few facts from a standard
> Ubuntu 12.04 installation:
> 
> * When no pulseaudio client is playing, the sound device is not occupied
> and thus non-compliant applications like Pd are _not_ blocked from
> accessing the device. This is even the case when you pause a Youtube
> movie in the browser. 
> 
> * pasuspender is actually not necessary in most cases. Only when some
> pulseaudio client is actually playing, you may want to use pasuspender.
> However, using pasuspender does not harm, even if it is not necessary
> 
> * Use "pasuspender -- pd-extended" instead of "pasuspender pd-extended",
> so that options passed to pd-extended are bypassed by pasuspender.
> 
> * Uninstalling pulseaudio is completely unnecessary, as it doesn't solve
> any problem. OTOH, it also doesn't harm. However, when pulseaudio is
> installed and Firefox is playing some Youtube movie, you still are able
> to grant Pd access to the sound device by using pasuspender. With no
> pulseaudio installed, the flash-plugin might use ALSA directly and there
> is no other way to stop it from blocking the sound device than to stop
> firefox. If you don't know which application is currently using the
> device, good luck with hunting. 
> My point is: With pulseaudio it is actually easier to guarantee Pd
> access to the sound device.
> 
> * Jackd (qjackctl, respectively) behaves similar to Pd: When no pulse
> client is playing, you can just start it without any troubles.


Yeah, that sounds like my experience as well.  One thing I've heard is that
pulseaudio can use jack as the backend instead of ALSA.  That sounds like an
ideal situation.  Anyone messed with that?

.hc



More information about the Pd-list mailing list