Re: Understanding _snd_pcm_channel_area Struct (PCM Interface)!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Fri, 26 Jun 2009 23:56:43 -0300,
Guilherme wrote:
> 
> Takashi...
> 
> The base_address and the step sounds pretty clear to me.... just the 
> offset I could not understand.
> 
> What the difference in being  .first = 0 or .first = 2??? Could you 
> provide please a more in depth explanation. I tried really hard find 
> this but there is nothing related in the documentation.
> 
> area[0].addr = base_address;
> 	addr[0].first = 0;
> 	addr[0].step = 4;
> 	addr[1].addr = base_address;
> 	addr[1].first = 2;
> 	addr[1].step = 4;
> 
> P.S. being a stereo or a mono pipeline I understand... just the way the offset works that is not so clear to me.

Actually, the non-interleaved formats can be represented also with
a single base_address (and is so in the actual implementation).

	addr[0].addr = base_addr;
	addr[0].first = 0;
	addr[0].step = 2;
	addr[1].addr = base_addr;
	addr[1].first = mono_buffer_len;
	addr[1].step = 2;
	addr[2].addr = base_addr;
	addr[2].first = mono_buffer_len * 2;
	addr[2].step = 2;
	...

The "first" is the offset of the first sample.  The address of the
first sample of the channel is simply calculated as addr + first.
This is because just we want to keep the base address same to all
channels as much as possible especially in mmap mode.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux