[pulseaudio-discuss] Single char silence with Orca and pulseaudio
Lennart Poettering
lennart at poettering.net
Thu Dec 24 09:38:02 PST 2009
On Sun, 20.12.09 07:22, Bill Cox (waywardgeek at gmail.com) wrote:
> Hi.
>
> I'm trying to debug a problem in Ubuntu Lucid that appears to be
> pulseaudio related. When we set the speech rate of espeak to 100% in
> Orca, and enable key echo, the keys are not announced when pressed.
> Instead, when you type one key, no sound is played, but when you press
> another key, both keys are played.
>
> I've traced this bug from Espeak to libao and now to pulseaudio.
> Libao is using the pa_simple_write function to play speech sounds. I
> find that when sounds of over about 2000 samples are sent, then then
> sound is played. If sounds of less than 2000 samples are sent, then
> they are not played, and instead buffered somewhere until the next
> sample is passed to pa_simple_write.
>
> Would anyone have any idea of what might be causing this, or what area
> I should inspect more closely? Currently, I'm using fprintf commands
> to trace the pulseaudio source. So far, I've traced this from
> simple.c to stream.c to pstream.c, where I see the samples being
> queued. From there, I'm a bit lost about how the samples are moved
> along.
You probably figured this out already, given the other traffic on the
ML, but just to write this down here for all eternity (i.e. folks
googling through the mailing list archives): this is caused by the
prebuffering. By default PA will not start playback until the playback
buffer is filled at least once.
That is actually not much different with other audio engines, except
maybe that usually the PA buffers are larger than hw buffers. An
applicatin that makes assumptions about the start thresholds (alias
"prebuf") is broken and needs to be fixed, either by writing proper
silence, or by setting prebuf properly, or by triggering a
pa_stream_flush() call.
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