[pulseaudio-discuss] Very strange behavior in pa_simple API test

Bill Cox waywardgeek at gmail.com
Sun Dec 20 14:15:08 PST 2009


I wrote a super-simple test using the pa_simple API.  I have some
sound data in a static array.  I call getchar(), and then call
pa_simple_write, in an infinite loop.  When I run this, and just hit
enter several times, I expect to hear the sound played once each time
I press enter.  Instead, it plays nothing the first time, but then
plays it twice the second time I press enter, nothing the third time,
twice on the fourth and so on.

I ran this in gdb, and saw something super-strange.  The first two
times pa_simple_write was called, no sounds was played.  However, when
the next call the getchar() was made, both sounds played!  Somehow
getchar() is interacting with the sound queues!

I ran this test in Ubuntu Karmic.  Can anyone else confirm this
strange behavior?  If nothing else, I'd love to find out if this is
Ubuntu specific.  I've attached the source code.  Just type 'make' in
the keyspeak directory.

Thanks,
Bill
-------------- next part --------------
A non-text attachment was scrubbed...
Name: keyspeak.tar.gz
Type: application/x-gzip
Size: 7662 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20091220/e787166b/attachment.bin>


More information about the pulseaudio-discuss mailing list