[alsa-devel] Understanding _snd_pcm_channel_area Struct (PCM Interface)!

Takashi Iwai tiwai at suse.de
Tue Jun 30 17:13:03 CEST 2009


At Tue, 30 Jun 2009 12:01:53 -0300,
Guilherme wrote:
> 
> Hum...
> 
> so .. the code
> 
> if ((areas[chn].step % 16) !=0 )
> 
> is because a 16bits format's been used.
> 
> If I wanted a 32bits sample format I should change that for
> if ((areas[chn].step % 32) !=0 ) ??

Depends.

The step field doesn't specify the sample format.  It specifies
the bits to the next sample of the given channel.

For such a purpose, checking the sample format bits via
snd_pcm_format_width() or snd_pcm_format_physical_width() would be
more suitable.

> and the offset for the first doen's need any changes, is it?
> 
> Just a opinion about all this, I think that alsa developers should design graphs for these things, as has in gstreamer documentation. 
> It is a lot easer to understand that way. 
> 
> It is because I dont understand very well yet, but as I am going to work with sound stuff especially in linux environment, Ill be very soon offering help for this!

Well, usually you don't have to care about the channel_info.  It's
just for mmap, and unless you really do want it inevitably, the mmap
access isn't needed.


Takashi


More information about the Alsa-devel mailing list