[pulseaudio-discuss] Problem using the Simple API

Lennart Poettering lennart at poettering.net
Fri Oct 30 17:29:20 PDT 2009


On Fri, 30.10.09 17:19, eric (ekilfoil at gmail.com) wrote:

> 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.

I am sorry, please elaborate on what exactly here doesn't work as
expected?

Note that PA can return data to you that was recorded *before* your
stream actually was created.

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4



More information about the pulseaudio-discuss mailing list