[pulseaudio-discuss] Problem using the Simple API

eric ekilfoil at gmail.com
Fri Oct 30 17:19:49 PDT 2009


I am having an issue using the simple API since upgrading from 0.9.14
(ubuntu 0.9.04) to 0.9.19 (ubuntu 0.9.10).  After quite a bit of debugging,
I have been able to at least isolate the problem a little bit.  I've
confirmed with a few different users that this problem exists and
the (really horrible) workaround fixes it.  Here's the basics:

My application opens an input stream from pulse and then starts a thread to
read input from a source.  So I'm basically running pa_simple_new() and
starting a thread that runs pa_simple_read() until it sees a flag change to
tell it to stop.

My app has a loop which reads 640 bytes of input from the source and then
sends it into a pipe.  There is really nothing in between these functions.
 It's more or less just read 640 bytes and then send to the pipe.  Here is
the debug output:

main input iteration
reading 640 bytes from pulse source
iteration after 0.000006 seconds
reading 640 bytes from pulse source
iteration after 0.000014 seconds
reading 640 bytes from pulse source
iteration after 0.000020 seconds
reading 640 bytes from pulse source

This shows that I've read 640 bytes of PCM data (at 44.1khz) in 6
microseconds.  To preempt the question, no, this is not buffered data.  this
is consistently reading this way immediately after opening.

Now the really weird part is this: If I open up the PulseAudio Device
Chooser and open up the volume control app, it immediately starts working as
expected.  I get about 0.01 seconds of audio (640 bytes of PCM at 44.1khz) and
everything is perfect as shown here:

main input iteration
reading 640 bytes from pulse source
iteration after 0.010879 seconds
reading 640 bytes from pulse source
iteration after 0.010899 seconds
reading 640 bytes from pulse source

If anyone has any ideas as to what could be causing this, please let me
know.

Thanks,

Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20091030/550efe74/attachment.htm>


More information about the pulseaudio-discuss mailing list