* how to combine mutil-channel in playback or capture?
@ 2013-03-22 8:08 Zhang wei
2013-03-22 8:20 ` Daniel Mack
0 siblings, 1 reply; 4+ messages in thread
From: Zhang wei @ 2013-03-22 8:08 UTC (permalink / raw)
To: ALSA development
I have already achieved the alsa-driver which can playback and capture function with two channel.
My board based on ARM9 which have 3 ADC & 1 DAC in IIS bus and all of them shared the same BCLK and LRCK. The pins figure Like this:
_________________
| BCLK |___________
| |
| LRCK |___________
| |
| ADCDAT0 |___________
| |
| ADCDAT1 |___________
| |
| ADCDAT2 |___________
| |
| DACDATA |___________
| |
|_______________|
Every ADCDATn(n=0,1,2) has two channel so the question is how can I get multi-channel audio data such as 4 or 6 in capture funciton?
BR
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: how to combine mutil-channel in playback or capture?
2013-03-22 8:08 how to combine mutil-channel in playback or capture? Zhang wei
@ 2013-03-22 8:20 ` Daniel Mack
[not found] ` <6B947C8AC4195040A8C6876A496C644A081956F9@BJ-MAIL-04.vimicro.com>
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Mack @ 2013-03-22 8:20 UTC (permalink / raw)
To: Zhang wei; +Cc: ALSA development, broonie, lgirdwood
Hi Zhang,
On 22.03.2013 09:08, Zhang wei wrote:
> I have already achieved the alsa-driver which can playback and
> capture function with two channel.
> My board based on ARM9 which have 3 ADC & 1 DAC in IIS bus and all
> of them shared the same BCLK and LRCK. The pins figure Like this:
>
> _________________
> | BCLK |___________
> | |
> | LRCK |___________
> | |
> | ADCDAT0 |___________
> | |
> | ADCDAT1 |___________
> | |
> | ADCDAT2 |___________
> | |
> | DACDATA |___________
> | |
> |_______________|
>
> Every ADCDATn(n=0,1,2) has two channel so the question is how can I
> get multi-channel audio data such as 4 or 6 in capture funciton?
It depends on how the whole setup looks like and what the driver for all
the DAIs support. If you have 4 different stereo Codecs, you would
usually instanciate 4 CPU DAI driver instances, each controlling one
bi-directional I2S bus, and then build links between each of them and
their Codec counterpart. If your Codec is capable of handling all 4
stereo pairs, you need to have support for the same in you CPU DAI.
So you need to be more specific about which components you are actually
using, and what kind of alsa-driver you have written.
In general, please also read up the documents in
Documentation/sound/alsa/soc/.
Daniel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 答复: how to combine mutil-channel in playback or capture?
[not found] ` <6B947C8AC4195040A8C6876A496C644A081956F9@BJ-MAIL-04.vimicro.com>
@ 2013-03-22 9:27 ` Daniel Mack
[not found] ` <6B947C8AC4195040A8C6876A496C644A08195768@BJ-MAIL-04.vimicro.com>
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Mack @ 2013-03-22 9:27 UTC (permalink / raw)
To: Zhang wei; +Cc: ALSA development, broonie, lgirdwood
On 22.03.2013 10:23, Zhang wei wrote:
> Thank you. Yes,you're right. I need 4 different stereo Codecs at
> least more than one on my board and i think that will be more funy
> than 1 Codec.In this case ,the struct snd_soc_card will be
> initialized as following: Struct snd_soc_card test_card= {
> .name=”Test Card”, .dai_link=&test_dai_codecs, .num_links=4; } As a
> result ,there would be 4 devices named pcmC0Dnp(n=0,1,2,3) under the
> directory /dev/snd. I wounder how and who combines the multi-channel
> audio data togother? Is it the plugin ?
Yes, you can use the alsa userspace for that.
See http://www.alsa-project.org/main/index.php/Asoundrc
Daniel
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 答复: 答复: how to combine mutil-channel in playback or capture?
[not found] ` <6B947C8AC4195040A8C6876A496C644A08195768@BJ-MAIL-04.vimicro.com>
@ 2013-03-22 10:19 ` Daniel Mack
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Mack @ 2013-03-22 10:19 UTC (permalink / raw)
To: Zhang wei; +Cc: ALSA development, broonie, lgirdwood
Hi,
please don't top-post.
On 22.03.2013 11:11, Zhang wei wrote:
> But what is the mechanism to synchronize the data from different
> channel,and maybe different channel pairs use different DMA buffer.
You can try and see if syncing the individual, non-combinded PCM streams
helps:
http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html#pcm_sync
> So, I guess ,about the combine ,according to the alsa.conf,the alsa-lib
> opened the 4 devices(in my case) and got every channel paris’s data in
> turns in a monent. And then combine them together in order as one frame?
It will feed the input to all pcm streams. I don't really know if it
uses the sync mechanism on that, but I'd guess so.
> Because all the CODEC have the same clock timing,so the different DMA
> buffer stored the different channel data for the same moment. Alsa-lib
> obtains the same size data from each buffer in turns in once.repeat it
> again and again.
>
> Right?
Yes, and so the streams won't drift.
Why don't you just go ahead and try it? You should play back some wav
file with a test pattern which you can recognize on a DSO or IIS
analyzer on the bus. Then see if they are in sync.
Daniel
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-03-22 10:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-22 8:08 how to combine mutil-channel in playback or capture? Zhang wei
2013-03-22 8:20 ` Daniel Mack
[not found] ` <6B947C8AC4195040A8C6876A496C644A081956F9@BJ-MAIL-04.vimicro.com>
2013-03-22 9:27 ` 答复: " Daniel Mack
[not found] ` <6B947C8AC4195040A8C6876A496C644A08195768@BJ-MAIL-04.vimicro.com>
2013-03-22 10:19 ` 答复: " Daniel Mack
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.