[Portaudio] PulseAudio Host API for Portaudio

Tuukka Pasanen pasanen.tuukka at gmail.com
Wed Dec 16 03:53:52 EST 2015

Thank you for the information. Nice it makes some ugly part go away (you 
mentioned many things why I started this hostapi) I have some questions 
so please read ahead.

15.12.2015, 19:17, sqweek kirjoitti:
> 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.
Which version of PulseAudio do you have? Can you gdb backtrace.
> 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.
Yes latency calculcations doesn't work because I have got time and 
motivation to
find out how it works. If someone knows how to make this work please 
Mixxx also need this info.
PulseAudio provides this so it's just how to signal it upstream.
> 3) when using blocking mode, I hear a huge glitch every time I start the stream
Is it allways the same? I have to check this because I fixed this once 
and I have find it way back..
You don't suffer clicks with ALSA I assume.
> 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.
Timing is provided from PulseAudio and if you keep stream playing only 
thing I can
figure out is PulseAudio time stream just goes on and on till the break 
of down and poor
application tries to keep on I try to say can you see in app what timing 
Portaudio provides?
> 5) Pa_Terminate takes noticeably longer to run
Ok what is noticeably? This is something that I have to make working 
better because again I try
to mimic ALSA in this and with PulseAudio it's not working very well.
> 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,
> -sqweek
> 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
> _______________________________________________
> Portaudio mailing list
> Portaudio at lists.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/portaudio

More information about the Portaudio mailing list