[pulseaudio-discuss] Help with code

Jonathan Andrews jon at jonshouse.co.uk
Mon Jan 9 09:54:16 PST 2012


Hi all, hope this is the correct place to ask.

I've written some code to distribute 8 channels of 22.05khz mono audio
over a network via UDP broadcast.

The receiver decodes packets and sends them to 8 connections to pulse
audio via pa_simple_write.

My problem is simple(ish).  Sometimes on some clients the reported
latency creeps up, read via (pa_simple_get_latency).

In order to try and bring the latency back down I've tried dropping
packets and not sending to pa_write for a while as well as various
combinations of pa_simple_flush.

My question is two part.

1) What is the blocking arrangement for applications?  Can I ask pulse
if a stream is full before I commit to a pa_simple_write ? sometimes my
main loop (get latency, write) slows down to a crawl.  strace -c reveals
a lot of time spent in some futex thingi I don't pretend to understand.

2) Once latency has crept up can I force it back down?, i've tried
pa_simple_free but the latency remains the same.  Im guessing pulse has
let the playback buffer size creep up, but I need it wound back down
even at the cost of glitching.

I'd like to avoid the full API if possible, but if needs must.

Any help gratefully received.

Thanks,
Jon




More information about the pulseaudio-discuss mailing list