[pulseaudio-discuss] zero copy

Lennart Poettering lennart at poettering.net
Wed Dec 10 10:34:14 PST 2008


On Wed, 10.12.08 10:44, apolinaire at poczta.fm (apolinaire at poczta.fm) wrote:

> Hello,
> 
> I am interested in how PulseAudio deal with zero copy.
> I have gone through paper "An Efficient Zero-Copy I/O Framework for UNIX" from 1995.
> I have review the PulseAudio code to look how it is implemented.
> 
> In the paper, authors presented that the only implementation of memory pool possible for them
> is on kernel side. The PulseAudio way is to make it shared memory on user side.
> 
> and I come with 2 questions
>  Is it sufficient to open shared memory and mmap it into the application address space?
>  How did you test the PulseAudio concerning zero copy of data?
> 
> I would be very thankful if you could explain it to me, please.

It is possible to get memory mapped access to most audio devices. That
means the DMA buffer of your sound card is directly accessible from
the process address space. Then, each client maintains its own SHM
region and PA will simply take the data out of those SHM regions, sum
them up, and place them in the DMA buffer. Altogether this is then "zero copy",
unless you count the summing as "copy"... But it's as good as it can get.

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