[alsa-devel] non-interleaved mode

Jaroslav Kysela perex at suse.cz
Wed Jul 11 19:44:24 CEST 2007

On Wed, 11 Jul 2007, Steve Longerbeam wrote:

> Last night I ran an experiment.  I created a 16-bit stereo .wav file 
> with all left samples = 0x5555, and all right samples = 0xAAAA. I then 
> played the .wav using aplay, and just before trigger start in my driver 
> I searched the DMA buffer for the first occurrence of 0xAAAA. The right 
> samples didn't start until exactly half-way through the entire DMA buffer!

Yes, it's the right non-interleaved behaviour. You can imagine this layout 
as separate "mono" ring buffers for each channels - see 
snd_pcm_lib_ioctl_channel_info() in pcm_lib.c . Driver might modify 
info->offset if required (see hdsp.c driver for example).


Jaroslav Kysela <perex at suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

More information about the Alsa-devel mailing list