[pulseaudio-discuss] data exchange using shared memory

Lennart Poettering lennart at poettering.net
Thu Oct 25 14:49:08 PDT 2007


On Wed, 17.10.07 16:37, Deb Briggs (Deb.Briggs at palm.com) wrote:

> http://www.kernel.org/doc/ols/2007/ols2007v2-pages-145-150.pdf says that
> local clients can exchange audio data with a local PulseAudio daemon
> through shared memory IPC - is there any example code that shows
> this?

This is not directly exposed in the API. You can see it in a way if
you use "strace". 

> Asking because we're seeing quite high CPU usage (30%+) when using
> memcpy in the read callback that we install via
> pa_stream_set_read_callback.

This might have different reasons. Small block sizes. Resampling on
slow CPUs and so on. Only a valgrind/gprof/sprof could bring light
into what's slowing PA down that much.

Please note that SHM is not magic wand to lower your CPU load (memcpy
is pretty fast these days). It's more one that decreases the pressure
on the CPU cache, lowers memory consumption, and lowers latency (a
bit). Don't expect wonders from it, especially not in when it comes to
total CPU utilization.

Lennart

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



More information about the pulseaudio-discuss mailing list