Re: Sound userspace drivers (fishing for insight)

From: Jaroslav Kysela
Date: Wed Mar 08 2006 - 03:42:00 EST


On Tue, 7 Mar 2006, John Richard Moser wrote:

> In general, transporting sound data in and out of kernel space is a
> horrid thought. Consider the latencies, which all real-time audio
> people will quickly get angry about. Write sound; context switch; sound
> in driver; context switch back. This over and over? Now we all know
> better than that.

Nope. If you have a cache coherent architecture like x86, ALSA mmaps
directly the DMA buffer to application and even pointers to this buffer
are mmaped, thus there is no content switch when apps are doing r/w and
there is "zero data copy". The only contents switch is when apps call
poll(), but you should do it, otherwise you'll eat all cpu time.

> into the kernel; with alsa it's written to a /proc interface, which

Using /proc? Where? I've not noticed it :-)

Jaroslav

-----
Jaroslav Kysela <perex@xxxxxxx>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/