[Portaudio] PulseAudio Host API for Portaudio

sqweek sqweek at gmail.com
Tue Dec 15 12:17:57 EST 2015

Hi Tuukka,

Thanks for sharing! I've found portaudio to be less than perfect via
the ALSA backend, but I have a feeling a big part of that is due to
the alsa-pulse pcm plugin. So I'm keen to know if going directly to
pulseaudio gives better results!

I've just plugged your branch into my code, and found a few teething problems:

1) many times during startup it dies with "Assertion 'c->callback'
failed at pulsecore/socket-client.c:126, function do_call().
Aborting." I get this in both callback and blocking mode, regardless
of whether I'm actually trying to use the pulse host-api.

2) the latency doesn't seem to be properly advertised? 99% of the time
the defaultLowOutputLatency appears as 0 (which made my init code go
into an infinite loop so I thought it was frozen xD), but this time
around it is 1494927
(415 hours!). The audio still sounds fine though.

3) when using blocking mode, I hear a huge glitch every time I start the stream

4) I'm not sure if the timing information is all there? my app has a
visual cursor which follows playback, and the first time I start the
stream in blocking mode the cursor vanishes off the screen. I haven't
looked into detail on this one, could also be my fault.

5) Pa_Terminate takes noticeably longer to run

On the plus side, it appears more resilient than the ALSA host api
(aside from point #1). When using ALSA in callback mode I routinely
end up in a situation where playback hangs (the stream starts without
error but my callback never gets called), just by starting and
stopping the stream.

Similarly if I suspend/resume while my app is running the PulseAudio
stream still works, while the ALSA stream no longer starts. But I also
notice chromium has issues with audio after suspend/resume so my
assumption is this problem is due to alsa-pulse plugin or something
else with my setup.

Great work! I don't know if I'll have time to do any code review but
I'm certainly happy to keep testing.

Thanks again,

On 9 December 2015 at 14:26, Tuukka Pasanen <pasanen.tuukka at gmail.com> wrote:
> Hello,
> I've been slowly implementing PulseAudio HostApi. Because I couldn't get
> fork working in Assembla I uploaded code to Github.
> There is Pull Request in Github for tracking changes and comment code (I
> also welcome direct mails or mail list comments) which is located:
> https://github.com/illuusio/portaudio-pulseaudio/pull/1
> Branch for this is located
> https://github.com/illuusio/portaudio-pulseaudio/tree/hostapi-pulseaudio
> if you are not familiar with Git (like me I'm more Subversion background)
> git clone -b hostapi-pulseaudio
> https://github.com/illuusio/portaudio-pulseaudio
> and code is locate 'portaudio-pulseaudio/src/hostapi/pulseaudio'
> Work is mainly done to get PulseAudio better supported in Mixxx
> (http://mixxx.org) and it's still in beta stage (but working for me at
> least) and
> implements Callback and blocking interface. If you have time to review code
> or test it with your setup it would be more than welcome!
> and yes this in only relevant for Linux folks.
> Sincerely,
> Tuukka
> _______________________________________________
> Portaudio mailing list
> Portaudio at lists.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/portaudio

More information about the Portaudio mailing list