[pulseaudio-discuss] pulse support not working properly in application on F12,
gryt2 at q.com
Wed Oct 7 10:31:51 PDT 2009
I am adding (trying to add) pulse support to an application I author.
But no matter what I do, I can't get it to play correct sound. Here is
the sordid history.
I first added pa_simple support as this seemed tailor made for what I
want to do - send buffers of data at regular intervals to a sound
device. I used the sample from the web page and looked at
implementations from several other applications - Csound, sox,
helix-player. It compiled cleanly, gave every indication it was
working, but the sound that came out sounded like a dying whale. I
traced it in gdb to the point of writing the buffer as a chunk
someplace, and everything looked fine.
So I upgraded to using the standard model - I copied the
xmms-pulse plugin.c as a template and modified it until it compiled on
my system without issues. Same problem, sound is horrible. To
actually use callbacks would require a complete change in architecture
for the application, and I'm not going there.
I then put in modifications to tweak the buffer sizes on the server
from the defaults with the same result. I check writable, and sleep
until there is enough space for a buffer of sound, write it and
generate the next buffer.
From this list I discovered the pacmd interface. I turned on logging
to level 4 and set source line flagging. I now see messages about
being unable to push to the queue, and the line is 1355 in
I'm using standard 44100, 2 ch, S16LE in interleaved format. This is
the default from the /etc/pulse/daemon.conf file. The buffer in pulse
is receiving it fine from looking at it in gdb.
I've added my user to the pulse, pulse-rt, and pulse-access groups.
gnash works, and I'm pretty sure it is using pulse. I hear system
If I use the default sound device, it plays correctly. Because of the
alsa_pulse.conf in /etc/alsa this is pulse I think.
So, I'm baffled. What's wrong?
Some bugs/issues I've found along the way.
The xmms-pulse plugin.c call to pa_stream_write has
PA_SEEK_STREAM_RELATIVE and offset reversed from the template in the
stream.h header file.
Configure complains about the /usr/include/pulse/stream.h file unless
the following two includes are added:
Configure complains about the /usr/include/pulse/ext-stream-restore.h
file unless the following two includes are added:
This is taking waaaayyy too long. It is peripheral to the purpose of
my app, and I'd rather be adding new features. So I would be grateful
for any insight.
More information about the pulseaudio-discuss