All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Multiple codecs on one sound card for multi-channel sound card
@ 2019-02-12 10:55 Yann CARDAILLAC
  2019-02-18  8:32 ` Arnaud Mouiche
  0 siblings, 1 reply; 13+ messages in thread
From: Yann CARDAILLAC @ 2019-02-12 10:55 UTC (permalink / raw)
  To: alsa-devel

Hi guys,

Where are we now with TDM on several codecs on the same TDM channel ?
I'm sorry to dig out this old thread but I couldn't really find any
proper information about that.

I only plan to use 4 channel TDM with two codecs. I'm using IMX6's SSI
as master for both codec.

What I've got working today is 1 codec with ssi as I2S master.

Do you have any pointer on what is achieved so far and how to implement it ?

I'm using kernel *v4.14.78*.

Any pointer to DTS achieving that or audio card doing that kind of
thing would already be an amazing first hint.!

Regards,

Yann

>Got it.  Thanks Arnaud.

>-Caleb
>

>On Thu, Sep 17, 2015 at 9:09 AM, arnaud.mouiche at invoxia.com <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>
><arnaud.mouiche at invoxia.com <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>> wrote:
>>>>>*> Le 17/09/2015 17:34, Caleb Crome a écrit :
*>>>>>>* On Thu, Sep 17, 2015 at 7:33 AM, arnaud.mouiche at
invoxia.com <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>
*>>>* <arnaud.mouiche at invoxia.com
<http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>> wrote:
*>>>>>>>>* hello,
*>>>>>>>*> Le 17/09/2015 15:38, Caleb Crome a écrit :
*>>>>>>>>>>* On Thu, Sep 17, 2015 at 1:51 AM, arnaud.mouiche at
invoxia.com <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>
*>>>>>* <arnaud.mouiche at invoxia.com
<http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>> wrote:
*>>>>>>>>>>>>* Hello Caleb,
*>>>>>>>>>>>>* freescale SSI is fine with more than 2 channels.
*>>>>>>* I have planed to publish a set of patch in this direction but we still
*>>>>>>* have
*>>>>>>* some corner cases to fix first (rare issues with channels alignment)
*>>>>>>>>>>* I'd love to see anything you're willing to show :-)
*>>>>>>>>>>>* Yet, this following is far enough to have it working.
*>>>>>>* And since the max/min rate is at the end the intersection of what the
*>>>>>>* SSI,
*>>>>>>* the codec and the card are declaring, it will not change anything until
*>>>>>>* you
*>>>>>>* connect the SSI to a codec with more than 2 channels, or a multi-codec
*>>>>>>* solution.
*>>>>*>
*>>>>* What if I change channels_max to 16 for capture and playback?  Last
*>>>>>* time I tried, it would not keep the channels synchronized on the TDM
*>>>>>* bus.  I tried playing with the FIFO settings, which helped, but it
*>>>>>* still would not start each channel in the right slot reliably.
*>>>>>* Perhaps I was using an older kernel.
*>>>>>>>>* you put the finger on what's hurting !  ;)
*>>>>>>>>* In fact, we made 8 channels working in reliable way on imx50, with
*>>>>* predictive latency  ... with an old kernel (3.17) ... based on freescale
*>>>>* BSP... on sound/soc/imx/imx-ssi.c (something that doesn't exist outside
*>>>>* freescale BSP)
*>>>>>>>>* Well, just to say it is doable on any recent imx since the
hardware is
*>>>>* not
*>>>>* the issue. But the job was a set of awful hacks.
*>>>>>>* Sorry, I don't quite understand.  Are you saying that on a recent
*>>>* kernel (say 4.1 or 4.2), you think it will just work.  Or are yo
*>>>* saying that even on a modern kernel it's a set of awful hacks?  And
*>>>* should I use fsl_ssi.c or imx-ssi.c (device tree/non device tree)
*>>>* version?
*>>>>* - I'm saying it is working on recent upstream kernel, using
*>>* sound/soc/fsl/fsl_ssi.c, but with
*>>* some channel sync issues in rare conditions (at least 4 channels case,
*>>* opening multiple SSI at the same time).
*>>* So, you should test on your side with you setup, and simply be prepared to
*>>* not see it working as a charm.
*>>>>* - we made it work perfectly, but on an old freescale BSP, where freescale
*>>* rewrites a SSI driver different from the already 2 drivers (device tree/non
*>>* device tree) available today in upstream + lot of awful hacks =>
so, this is
*>>* not a hardware issue.
*>>>>* - when I will have time, I will start from the upstream driver,
and make it
*>>* work correctly with 8 channels (or more)
*>>>>* arnaud
*>>>>>>>>* In short, what's your best current recommendation to get it
working today?
*>>>>>>>* My plan was to re-do all this job on an upstream kernel, in
a way it can
*>>>>* be
*>>>>* accepted.
*>>>>* Unfortunately you will have to wait, I'm under pressure for other stuff
*>>>>* right now.
*>>>>>>* Heh, understood.  If there's anything I can do to help, let me know.
*>>>>>>* Thanks,
*>>>* -Caleb
*>>>>>>>* Regards,
*>>>>* arnaud
*>>>>>>>>>>>>>* I'll give it a try again.  Like I said, we'd love to get our
*>>>>>* 16-channel board up and running on the MX6, so I'm definitely
*>>>>>* motivated to put some work in to get it reliable.
*>>>>>>>>>>* Thanks,
*>>>>>*    -Caleb
*>>>>>>>



-- 
[image: SMILE] <http://www.smile.eu/>

20 rue des Jardins
92600 Asnières-sur-Seine
*Yann CARDAILLAC*
Ingénieur Linux Embarqué

[image: email] yann.cardaillac@smile.fr
[image: url] http://www.smile.eu

[image: Twitter] <https://twitter.com/GroupeSmile> [image: Facebook]
<https://www.facebook.com/smileopensource> [image: LinkedIn]
<https://www.linkedin.com/company/smile> [image: Github]
<https://github.com/Smile-SA>


[image: eco] Pour la planète, n'imprimez ce mail que si c'est nécessaire
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Multiple codecs on one sound card for multi-channel sound card
  2019-02-12 10:55 Multiple codecs on one sound card for multi-channel sound card Yann CARDAILLAC
@ 2019-02-18  8:32 ` Arnaud Mouiche
  0 siblings, 0 replies; 13+ messages in thread
From: Arnaud Mouiche @ 2019-02-18  8:32 UTC (permalink / raw)
  To: Yann CARDAILLAC, alsa-devel

Hello Yann,

Everything should now be a question of DTS.

Here you will find a post from Caleb with a DTS which set a TDM 
configuration on imx6
https://medium.com/@caleb_22836/how-to-get-the-mx6-ssi-port-up-and-running-in-tdm-mode-dbce02a15e81

Yet, It was for test purpose only and use a dummy codec (snd-soc-dummy) 
as single multi slots pseudo codec.
At least it gives you some entries to set the SSI in TDM mode...

For the multi-codec part, I don't have working example tested right now, but
- sound/soc/soc-core.c::snd_soc_of_get_dai_link_codecs() is used when 
parsing the device tree to build the list of codecs. You can use it as a 
starting point to review how everything is working.
- few Documentation device tree example are using the multi-codec 
notation. yet, samsung,odroid.txt is one. you will find:

     codec {
         sound-dai = <&hdmi>, <&max98090>;
     };


My advise:
- make it working in TDM with one codec.
- once working fine, enable mode codecs in DTS simply by adding the 
second codec in "sound-dai" list. Then check how ALSA controls/widgets 
are made available for useland (ie. run "amixer ccontents")


Please, don't forget to provide you working DTS and experience in this 
mailing list for reference.

Regards,
Arnaud


On 12/02/2019 11:55, Yann CARDAILLAC wrote:
> Hi guys,
>
> Where are we now with TDM on several codecs on the same TDM channel ?
> I'm sorry to dig out this old thread but I couldn't really find any
> proper information about that.
>
> I only plan to use 4 channel TDM with two codecs. I'm using IMX6's SSI
> as master for both codec.
>
> What I've got working today is 1 codec with ssi as I2S master.
>
> Do you have any pointer on what is achieved so far and how to implement it ?
>
> I'm using kernel *v4.14.78*.
>
> Any pointer to DTS achieving that or audio card doing that kind of
> thing would already be an amazing first hint.!
>
> Regards,
>
> Yann
>
>> Got it.  Thanks Arnaud.
>> -Caleb
>>
>> On Thu, Sep 17, 2015 at 9:09 AM, arnaud.mouiche at invoxia.com <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>
>> <arnaud.mouiche at invoxia.com <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>> wrote:
>>>>>> *> Le 17/09/2015 17:34, Caleb Crome a écrit :
> *>>>>>>* On Thu, Sep 17, 2015 at 7:33 AM, arnaud.mouiche at
> invoxia.com <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>
> *>>>* <arnaud.mouiche at invoxia.com
> <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>> wrote:
> *>>>>>>>>* hello,
> *>>>>>>>*> Le 17/09/2015 15:38, Caleb Crome a écrit :
> *>>>>>>>>>>* On Thu, Sep 17, 2015 at 1:51 AM, arnaud.mouiche at
> invoxia.com <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>
> *>>>>>* <arnaud.mouiche at invoxia.com
> <http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>> wrote:
> *>>>>>>>>>>>>* Hello Caleb,
> *>>>>>>>>>>>>* freescale SSI is fine with more than 2 channels.
> *>>>>>>* I have planed to publish a set of patch in this direction but we still
> *>>>>>>* have
> *>>>>>>* some corner cases to fix first (rare issues with channels alignment)
> *>>>>>>>>>>* I'd love to see anything you're willing to show :-)
> *>>>>>>>>>>>* Yet, this following is far enough to have it working.
> *>>>>>>* And since the max/min rate is at the end the intersection of what the
> *>>>>>>* SSI,
> *>>>>>>* the codec and the card are declaring, it will not change anything until
> *>>>>>>* you
> *>>>>>>* connect the SSI to a codec with more than 2 channels, or a multi-codec
> *>>>>>>* solution.
> *>>>>*>
> *>>>>* What if I change channels_max to 16 for capture and playback?  Last
> *>>>>>* time I tried, it would not keep the channels synchronized on the TDM
> *>>>>>* bus.  I tried playing with the FIFO settings, which helped, but it
> *>>>>>* still would not start each channel in the right slot reliably.
> *>>>>>* Perhaps I was using an older kernel.
> *>>>>>>>>* you put the finger on what's hurting !  ;)
> *>>>>>>>>* In fact, we made 8 channels working in reliable way on imx50, with
> *>>>>* predictive latency  ... with an old kernel (3.17) ... based on freescale
> *>>>>* BSP... on sound/soc/imx/imx-ssi.c (something that doesn't exist outside
> *>>>>* freescale BSP)
> *>>>>>>>>* Well, just to say it is doable on any recent imx since the
> hardware is
> *>>>>* not
> *>>>>* the issue. But the job was a set of awful hacks.
> *>>>>>>* Sorry, I don't quite understand.  Are you saying that on a recent
> *>>>* kernel (say 4.1 or 4.2), you think it will just work.  Or are yo
> *>>>* saying that even on a modern kernel it's a set of awful hacks?  And
> *>>>* should I use fsl_ssi.c or imx-ssi.c (device tree/non device tree)
> *>>>* version?
> *>>>>* - I'm saying it is working on recent upstream kernel, using
> *>>* sound/soc/fsl/fsl_ssi.c, but with
> *>>* some channel sync issues in rare conditions (at least 4 channels case,
> *>>* opening multiple SSI at the same time).
> *>>* So, you should test on your side with you setup, and simply be prepared to
> *>>* not see it working as a charm.
> *>>>>* - we made it work perfectly, but on an old freescale BSP, where freescale
> *>>* rewrites a SSI driver different from the already 2 drivers (device tree/non
> *>>* device tree) available today in upstream + lot of awful hacks =>
> so, this is
> *>>* not a hardware issue.
> *>>>>* - when I will have time, I will start from the upstream driver,
> and make it
> *>>* work correctly with 8 channels (or more)
> *>>>>* arnaud
> *>>>>>>>>* In short, what's your best current recommendation to get it
> working today?
> *>>>>>>>* My plan was to re-do all this job on an upstream kernel, in
> a way it can
> *>>>>* be
> *>>>>* accepted.
> *>>>>* Unfortunately you will have to wait, I'm under pressure for other stuff
> *>>>>* right now.
> *>>>>>>* Heh, understood.  If there's anything I can do to help, let me know.
> *>>>>>>* Thanks,
> *>>>* -Caleb
> *>>>>>>>* Regards,
> *>>>>* arnaud
> *>>>>>>>>>>>>>* I'll give it a try again.  Like I said, we'd love to get our
> *>>>>>* 16-channel board up and running on the MX6, so I'm definitely
> *>>>>>* motivated to put some work in to get it reliable.
> *>>>>>>>>>>* Thanks,
> *>>>>>*    -Caleb
> *>>>>>>>
>
>
>

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Multiple codecs on one sound card for multi-channel sound card
  2015-09-17 16:09               ` arnaud.mouiche
@ 2015-09-17 17:39                 ` Caleb Crome
  0 siblings, 0 replies; 13+ messages in thread
From: Caleb Crome @ 2015-09-17 17:39 UTC (permalink / raw)
  To: arnaud.mouiche; +Cc: alsa-devel

Got it.  Thanks Arnaud.

-Caleb


On Thu, Sep 17, 2015 at 9:09 AM, arnaud.mouiche@invoxia.com
<arnaud.mouiche@invoxia.com> wrote:
>
>
> Le 17/09/2015 17:34, Caleb Crome a écrit :
>>
>> On Thu, Sep 17, 2015 at 7:33 AM, arnaud.mouiche@invoxia.com
>> <arnaud.mouiche@invoxia.com> wrote:
>>>
>>> hello,
>>>
>>> Le 17/09/2015 15:38, Caleb Crome a écrit :
>>>>
>>>> On Thu, Sep 17, 2015 at 1:51 AM, arnaud.mouiche@invoxia.com
>>>> <arnaud.mouiche@invoxia.com> wrote:
>>>>>
>>>>> Hello Caleb,
>>>>>
>>>>> freescale SSI is fine with more than 2 channels.
>>>>> I have planed to publish a set of patch in this direction but we still
>>>>> have
>>>>> some corner cases to fix first (rare issues with channels alignment)
>>>>>
>>>> I'd love to see anything you're willing to show :-)
>>>>
>>>>> Yet, this following is far enough to have it working.
>>>>> And since the max/min rate is at the end the intersection of what the
>>>>> SSI,
>>>>> the codec and the card are declaring, it will not change anything until
>>>>> you
>>>>> connect the SSI to a codec with more than 2 channels, or a multi-codec
>>>>> solution.
>>>>
>>>> What if I change channels_max to 16 for capture and playback?  Last
>>>> time I tried, it would not keep the channels synchronized on the TDM
>>>> bus.  I tried playing with the FIFO settings, which helped, but it
>>>> still would not start each channel in the right slot reliably.
>>>> Perhaps I was using an older kernel.
>>>
>>> you put the finger on what's hurting !  ;)
>>>
>>> In fact, we made 8 channels working in reliable way on imx50, with
>>> predictive latency  ... with an old kernel (3.17) ... based on freescale
>>> BSP... on sound/soc/imx/imx-ssi.c (something that doesn't exist outside
>>> freescale BSP)
>>>
>>> Well, just to say it is doable on any recent imx since the hardware is
>>> not
>>> the issue. But the job was a set of awful hacks.
>>
>> Sorry, I don't quite understand.  Are you saying that on a recent
>> kernel (say 4.1 or 4.2), you think it will just work.  Or are yo
>> saying that even on a modern kernel it's a set of awful hacks?  And
>> should I use fsl_ssi.c or imx-ssi.c (device tree/non device tree)
>> version?
>
> - I'm saying it is working on recent upstream kernel, using
> sound/soc/fsl/fsl_ssi.c, but with
> some channel sync issues in rare conditions (at least 4 channels case,
> opening multiple SSI at the same time).
> So, you should test on your side with you setup, and simply be prepared to
> not see it working as a charm.
>
> - we made it work perfectly, but on an old freescale BSP, where freescale
> rewrites a SSI driver different from the already 2 drivers (device tree/non
> device tree) available today in upstream + lot of awful hacks => so, this is
> not a hardware issue.
>
> - when I will have time, I will start from the upstream driver, and make it
> work correctly with 8 channels (or more)
>
> arnaud
>
>>
>> In short, what's your best current recommendation to get it working today?
>>
>>> My plan was to re-do all this job on an upstream kernel, in a way it can
>>> be
>>> accepted.
>>> Unfortunately you will have to wait, I'm under pressure for other stuff
>>> right now.
>>
>> Heh, understood.  If there's anything I can do to help, let me know.
>>
>> Thanks,
>> -Caleb
>>
>>> Regards,
>>> arnaud
>>>
>>>
>>>> I'll give it a try again.  Like I said, we'd love to get our
>>>> 16-channel board up and running on the MX6, so I'm definitely
>>>> motivated to put some work in to get it reliable.
>>>>
>>>> Thanks,
>>>>    -Caleb
>>>>
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Multiple codecs on one sound card for multi-channel sound card
  2015-09-17 15:34             ` Caleb Crome
@ 2015-09-17 16:09               ` arnaud.mouiche
  2015-09-17 17:39                 ` Caleb Crome
  0 siblings, 1 reply; 13+ messages in thread
From: arnaud.mouiche @ 2015-09-17 16:09 UTC (permalink / raw)
  To: Caleb Crome; +Cc: alsa-devel



Le 17/09/2015 17:34, Caleb Crome a écrit :
> On Thu, Sep 17, 2015 at 7:33 AM, arnaud.mouiche@invoxia.com
> <arnaud.mouiche@invoxia.com> wrote:
>> hello,
>>
>> Le 17/09/2015 15:38, Caleb Crome a écrit :
>>> On Thu, Sep 17, 2015 at 1:51 AM, arnaud.mouiche@invoxia.com
>>> <arnaud.mouiche@invoxia.com> wrote:
>>>> Hello Caleb,
>>>>
>>>> freescale SSI is fine with more than 2 channels.
>>>> I have planed to publish a set of patch in this direction but we still
>>>> have
>>>> some corner cases to fix first (rare issues with channels alignment)
>>>>
>>> I'd love to see anything you're willing to show :-)
>>>
>>>> Yet, this following is far enough to have it working.
>>>> And since the max/min rate is at the end the intersection of what the
>>>> SSI,
>>>> the codec and the card are declaring, it will not change anything until
>>>> you
>>>> connect the SSI to a codec with more than 2 channels, or a multi-codec
>>>> solution.
>>> What if I change channels_max to 16 for capture and playback?  Last
>>> time I tried, it would not keep the channels synchronized on the TDM
>>> bus.  I tried playing with the FIFO settings, which helped, but it
>>> still would not start each channel in the right slot reliably.
>>> Perhaps I was using an older kernel.
>> you put the finger on what's hurting !  ;)
>>
>> In fact, we made 8 channels working in reliable way on imx50, with
>> predictive latency  ... with an old kernel (3.17) ... based on freescale
>> BSP... on sound/soc/imx/imx-ssi.c (something that doesn't exist outside
>> freescale BSP)
>>
>> Well, just to say it is doable on any recent imx since the hardware is not
>> the issue. But the job was a set of awful hacks.
> Sorry, I don't quite understand.  Are you saying that on a recent
> kernel (say 4.1 or 4.2), you think it will just work.  Or are yo
> saying that even on a modern kernel it's a set of awful hacks?  And
> should I use fsl_ssi.c or imx-ssi.c (device tree/non device tree)
> version?
- I'm saying it is working on recent upstream kernel, using 
sound/soc/fsl/fsl_ssi.c, but with
some channel sync issues in rare conditions (at least 4 channels case, 
opening multiple SSI at the same time).
So, you should test on your side with you setup, and simply be prepared 
to not see it working as a charm.

- we made it work perfectly, but on an old freescale BSP, where 
freescale rewrites a SSI driver different from the already 2 drivers 
(device tree/non device tree) available today in upstream + lot of awful 
hacks => so, this is not a hardware issue.

- when I will have time, I will start from the upstream driver, and make 
it work correctly with 8 channels (or more)

arnaud
>
> In short, what's your best current recommendation to get it working today?
>
>> My plan was to re-do all this job on an upstream kernel, in a way it can be
>> accepted.
>> Unfortunately you will have to wait, I'm under pressure for other stuff
>> right now.
> Heh, understood.  If there's anything I can do to help, let me know.
>
> Thanks,
> -Caleb
>
>> Regards,
>> arnaud
>>
>>
>>> I'll give it a try again.  Like I said, we'd love to get our
>>> 16-channel board up and running on the MX6, so I'm definitely
>>> motivated to put some work in to get it reliable.
>>>
>>> Thanks,
>>>    -Caleb
>>>

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Multiple codecs on one sound card for multi-channel sound card
  2015-09-17 14:33           ` arnaud.mouiche
@ 2015-09-17 15:34             ` Caleb Crome
  2015-09-17 16:09               ` arnaud.mouiche
  0 siblings, 1 reply; 13+ messages in thread
From: Caleb Crome @ 2015-09-17 15:34 UTC (permalink / raw)
  To: arnaud.mouiche; +Cc: alsa-devel

On Thu, Sep 17, 2015 at 7:33 AM, arnaud.mouiche@invoxia.com
<arnaud.mouiche@invoxia.com> wrote:
> hello,
>
> Le 17/09/2015 15:38, Caleb Crome a écrit :
>>
>> On Thu, Sep 17, 2015 at 1:51 AM, arnaud.mouiche@invoxia.com
>> <arnaud.mouiche@invoxia.com> wrote:
>>>
>>> Hello Caleb,
>>>
>>> freescale SSI is fine with more than 2 channels.
>>> I have planed to publish a set of patch in this direction but we still
>>> have
>>> some corner cases to fix first (rare issues with channels alignment)
>>>
>> I'd love to see anything you're willing to show :-)
>>
>>> Yet, this following is far enough to have it working.
>>> And since the max/min rate is at the end the intersection of what the
>>> SSI,
>>> the codec and the card are declaring, it will not change anything until
>>> you
>>> connect the SSI to a codec with more than 2 channels, or a multi-codec
>>> solution.
>>
>> What if I change channels_max to 16 for capture and playback?  Last
>> time I tried, it would not keep the channels synchronized on the TDM
>> bus.  I tried playing with the FIFO settings, which helped, but it
>> still would not start each channel in the right slot reliably.
>> Perhaps I was using an older kernel.
>
> you put the finger on what's hurting !  ;)
>
> In fact, we made 8 channels working in reliable way on imx50, with
> predictive latency  ... with an old kernel (3.17) ... based on freescale
> BSP... on sound/soc/imx/imx-ssi.c (something that doesn't exist outside
> freescale BSP)
>
> Well, just to say it is doable on any recent imx since the hardware is not
> the issue. But the job was a set of awful hacks.

Sorry, I don't quite understand.  Are you saying that on a recent
kernel (say 4.1 or 4.2), you think it will just work.  Or are yo
saying that even on a modern kernel it's a set of awful hacks?  And
should I use fsl_ssi.c or imx-ssi.c (device tree/non device tree)
version?

In short, what's your best current recommendation to get it working today?

>
> My plan was to re-do all this job on an upstream kernel, in a way it can be
> accepted.
> Unfortunately you will have to wait, I'm under pressure for other stuff
> right now.

Heh, understood.  If there's anything I can do to help, let me know.

Thanks,
-Caleb

> Regards,
> arnaud
>
>
>>
>> I'll give it a try again.  Like I said, we'd love to get our
>> 16-channel board up and running on the MX6, so I'm definitely
>> motivated to put some work in to get it reliable.
>>
>> Thanks,
>>   -Caleb
>>
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Multiple codecs on one sound card for multi-channel sound card
  2015-09-17 13:38         ` Caleb Crome
@ 2015-09-17 14:33           ` arnaud.mouiche
  2015-09-17 15:34             ` Caleb Crome
  0 siblings, 1 reply; 13+ messages in thread
From: arnaud.mouiche @ 2015-09-17 14:33 UTC (permalink / raw)
  To: Caleb Crome; +Cc: alsa-devel

hello,

Le 17/09/2015 15:38, Caleb Crome a écrit :
> On Thu, Sep 17, 2015 at 1:51 AM, arnaud.mouiche@invoxia.com
> <arnaud.mouiche@invoxia.com> wrote:
>> Hello Caleb,
>>
>> freescale SSI is fine with more than 2 channels.
>> I have planed to publish a set of patch in this direction but we still have
>> some corner cases to fix first (rare issues with channels alignment)
>>
> I'd love to see anything you're willing to show :-)
>
>> Yet, this following is far enough to have it working.
>> And since the max/min rate is at the end the intersection of what the SSI,
>> the codec and the card are declaring, it will not change anything until you
>> connect the SSI to a codec with more than 2 channels, or a multi-codec
>> solution.
> What if I change channels_max to 16 for capture and playback?  Last
> time I tried, it would not keep the channels synchronized on the TDM
> bus.  I tried playing with the FIFO settings, which helped, but it
> still would not start each channel in the right slot reliably.
> Perhaps I was using an older kernel.
you put the finger on what's hurting !  ;)

In fact, we made 8 channels working in reliable way on imx50, with 
predictive latency  ... with an old kernel (3.17) ... based on freescale 
BSP... on sound/soc/imx/imx-ssi.c (something that doesn't exist outside 
freescale BSP)

Well, just to say it is doable on any recent imx since the hardware is 
not the issue. But the job was a set of awful hacks.

My plan was to re-do all this job on an upstream kernel, in a way it can 
be accepted.
Unfortunately you will have to wait, I'm under pressure for other stuff 
right now.

Regards,
arnaud

>
> I'll give it a try again.  Like I said, we'd love to get our
> 16-channel board up and running on the MX6, so I'm definitely
> motivated to put some work in to get it reliable.
>
> Thanks,
>   -Caleb
>

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Multiple codecs on one sound card for multi-channel sound card
  2015-09-17  8:51       ` arnaud.mouiche
@ 2015-09-17 13:38         ` Caleb Crome
  2015-09-17 14:33           ` arnaud.mouiche
  0 siblings, 1 reply; 13+ messages in thread
From: Caleb Crome @ 2015-09-17 13:38 UTC (permalink / raw)
  To: arnaud.mouiche; +Cc: alsa-devel

On Thu, Sep 17, 2015 at 1:51 AM, arnaud.mouiche@invoxia.com
<arnaud.mouiche@invoxia.com> wrote:
> Hello Caleb,
>
> freescale SSI is fine with more than 2 channels.
> I have planed to publish a set of patch in this direction but we still have
> some corner cases to fix first (rare issues with channels alignment)
>

I'd love to see anything you're willing to show :-)

> Yet, this following is far enough to have it working.
> And since the max/min rate is at the end the intersection of what the SSI,
> the codec and the card are declaring, it will not change anything until you
> connect the SSI to a codec with more than 2 channels, or a multi-codec
> solution.

What if I change channels_max to 16 for capture and playback?  Last
time I tried, it would not keep the channels synchronized on the TDM
bus.  I tried playing with the FIFO settings, which helped, but it
still would not start each channel in the right slot reliably.
Perhaps I was using an older kernel.

I'll give it a try again.  Like I said, we'd love to get our
16-channel board up and running on the MX6, so I'm definitely
motivated to put some work in to get it reliable.

Thanks,
 -Caleb


>
> Arnaud
>
> diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
> index c25a1e8..26e980b 100644
> --- a/sound/soc/fsl/fsl_ssi.c
> +++ b/sound/soc/fsl/fsl_ssi.c
> @@ -1082,14 +1082,14 @@ static struct snd_soc_dai_driver
> fsl_ssi_dai_template = {
>         .playback = {
>                 .stream_name = "CPU-Playback",
>                 .channels_min = 1,
> -               .channels_max = 2,
> +               .channels_max = 4,
>                 .rates = FSLSSI_I2S_RATES,
>                 .formats = FSLSSI_I2S_FORMATS,
>         },
>         .capture = {
>                 .stream_name = "CPU-Capture",
>                 .channels_min = 1,
> -               .channels_max = 2,
> +               .channels_max = 4,
>                 .rates = FSLSSI_I2S_RATES,
>                 .formats = FSLSSI_I2S_FORMATS,
>         },
>
>
>
> Le 17/09/2015 00:07, Caleb Crome a écrit :
>>
>> Ah Ha!  thank you Arnaud!  I'll understand this stuff eventually.
>> I'll implement as you've shown and see how it goes.
>>
>> I see that you have 'fsl,imx-audio-foo', using an SSI.  from what I
>> can see the SSIs only support channels_max=2.  How do you get
>> multi-channel TDM to work with the freescale SSI port?  I need to get
>> this TDM working on both TI & Freescale, and the freescale has been
>> quite problematic because the multi-channel doesn't seem to be
>> supported in the driver.
>>
>> I have just checked out and verified that
>>
>> http://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/
>>
>> sound/soc/fsl/*ssi*
>>
>> all have channels_max = 2
>>
>> We're very motivated to get this working on the freescale MX6, and
>> getting it to work sure does not seem as simple as changing 2 to a
>> bigger number :-)
>>
>>
>> Thanks,
>>    -Caleb
>>
>>
>> On Wed, Sep 16, 2015 at 2:57 AM, arnaud.mouiche@invoxia.com
>> <arnaud.mouiche@invoxia.com> wrote:
>>>
>>> Hello Caleb,
>>>
>>> Multi-codec support is now working fine the current linux releases.
>>> for previous releases, check if commit
>>>      [PATCH] ASoC: dapm: Don't add prefix to widget stream name
>>> is included. I remember this is the last required patch.
>>>
>>> After that, I don't know if the "simple-card" can be configured for multi
>>> codec support as you wish.
>>>
>>> On my side, I cooked a particular sound card for the purpose.
>>> here is some tips:
>>>
>>>
>>>      struct snd_soc_dai_link_component codecs[2];
>>>      struct snd_soc_codec_conf codecs_conf[2];
>>> [...]
>>>      for (num_codecs=0; num_codecs<2; num_codecs++) {
>>>          struct device_node *of_node;
>>>          of_node = of_parse_phandle(pdev->dev.of_node, "audio-codec",
>>> num_codecs);
>>>          if (!of_node) break;
>>>          data->codecs[num_codecs].of_node = of_node;
>>>          data->codecs[num_codecs].dai_name = "tlv320aic3x-foo";
>>>
>>>          /* add a "C2" name prefix for every control of the 2nd codec */
>>>          data->codecs_conf[num_codecs].of_node = of_node;
>>>          if (num_codecs == 1) {
>>>              data->codecs_conf[num_codecs].name_prefix = "C2";
>>>          }
>>>      }
>>> [...]
>>>      data->dai.codecs = data->codecs;
>>>      data->dai.num_codecs = num_codecs;
>>>      data->card.dai_link = &data->dai;
>>>      data->card.codec_conf = data->codecs_conf;
>>>      data->card.num_configs = num_codecs;
>>> [...]
>>>
>>>
>>> On DTS side, I have something like
>>>
>>>      sound@0 {
>>>          compatible = "fsl,imx-audio-foo";
>>>          model = "foo-audio";
>>>          ssi-controller = <&ssi1>;
>>>
>>>          /*
>>>           * list phandles for the 2 codecs used in the same TDM network
>>>           */
>>>          audio-codec = <&codec1>, <&codec2>;
>>>
>>>          [...]
>>>
>>>      };
>>>
>>>
>>> You also need to have a particular hw_params() method to dispatch the TDM
>>> and sysclk configuration to your codecs, making the difference between
>>> your
>>> first codec (your bus master) and the others.
>>>
>>>
>>> Arnaud
>>>
>>>
>>> Le 15/09/2015 03:07, Caleb Crome a écrit :
>>>>
>>>> (re-sending hope it's not a duplicate -- I think I must have had HTML
>>>> in my previous email and it was ignored)
>>>>
>>>>    Hi all,
>>>>       What are the current best practices to specify multiple codecs on
>>>> one sound card, with all codecs sharing a single TDM bus?
>>>>
>>>>    I have a card with up to 32 TLV320AIC33 codecs on it.  For the
>>>> moment, we can limit the discussion to only 16 codecs, so we don't
>>>> have to get extra serializers involved...
>>>>
>>>>    I currently have something like this in my am335x-boneblack.dts file:
>>>>
>>>>    (i.e. attempting to set tdm slot width and num in the i2c codec)
>>>>
>>>>    but it doesn't seem to be picking up the fact that I want all the
>>>> codecs linked together as one.
>>>>
>>>>    (FYI, the first codec, i.e. tlv32aic3x_a should be the master, and
>>>> all others including the CPU will be slaves).
>>>>
>>>>    Thanks for any help!
>>>>
>>>>    BTW, I'm happy to use whatever kernel will support me with the
>>>> minimal amount of effort, currently using 4.1
>>>>
>>>>
>>>>
>>>> Thank you!
>>>>      -Caleb
>>>>
>>>> &i2c1 {
>>>>    ...
>>>> tlv320aic3x_a: tlv320aic3x@18 {
>>>> #sound-dai-cells = <1>;
>>>> compatible = "ti,tlv320aic3x";
>>>> reg = <0x18>;
>>>> tdm-offset = <0>;
>>>> status = "okay";
>>>> };
>>>> tlv320aic3x_b: tlv320aic3x@19 {
>>>> #sound-dai-cells = <1>;
>>>> compatible = "ti,tlv320aic3x";
>>>> reg = <0x19>;
>>>> tdm-offset = <32>;
>>>> status = "okay";
>>>> };
>>>> tlv320aic3x_c: tlv320aic3x@1a {
>>>> #sound-dai-cells = <1>;
>>>> compatible = "ti,tlv320aic3x";
>>>> reg = <0x1a>;
>>>> tdm-offset = <64>;
>>>> status = "okay";
>>>> };
>>>> tlv320aic3x_d: tlv320aic3x@1b {
>>>> #sound-dai-cells = <1>;
>>>> compatible = "ti,tlv320aic3x";
>>>> reg = <0x1b>;
>>>> tdm-offset = <96>;
>>>> status = "okay";
>>>> };
>>>> };
>>>>
>>>> &mcasp0 {
>>>> #sound-dai-cells = <0>;
>>>> pinctrl-names = "default";
>>>> pinctrl-0 = <&mcasp_0_pins_default>;
>>>> status = "okay";
>>>>
>>>> op-mode = <0>;          /* MCASP_IIS_MODE */
>>>> tdm-slots = <16>;
>>>> num-serializer = <16>;
>>>> serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
>>>> 0 0 1 2
>>>> 0 0 0 0
>>>> 0 0 0 0
>>>> 0 0 0 0
>>>>>
>>>>> ;
>>>>
>>>> tx-num-evt = <1>;
>>>> rx-num-evt = <1>;
>>>> };
>>>>
>>>> / {
>>>> sound {
>>>> compatible = "simple-audio-card";
>>>> simple-audio-card,name = "puppy-audio";
>>>> simple-audio-card,mclk-fs = <256>;
>>>> system-clock-frequency = <12288000>;
>>>> status = "okay";
>>>> simple-audio-card,bitclock-master = <&tlv320aic3x_a>;
>>>>         simple-audio-card,frame-master    = <&tlv320aic3x_a>;
>>>> simple-audio-card,widgets =
>>>> "Line", "Line Out",
>>>> "Line", "Line In";
>>>> simple-audio-card,routing =
>>>> "Line Out",       "HPLOUT",
>>>> "Line Out",       "HPROUT",
>>>> "Line In",        "LINE1L",
>>>> "Line In",        "LINE1R";
>>>>
>>>> simple-audio-card,dai-link@0 {
>>>> format = "left_j";
>>>> cpu {
>>>> sound-dai = <&mcasp0>;
>>>> };
>>>> codec {
>>>> sound-dai = <&tlv320aic3x_a 0>;
>>>> dai-tdm-slot-num = <0>;
>>>> dai-tdm-slot-width = <16>;
>>>> };
>>>> };
>>>> /**** The stuff below doesn't work -- I can't figure out how to get
>>>> the name_prefixes set
>>>>    on each codec... .How do I set up so that each codec gets its own
>>>> name
>>>> prfix
>>>> and so that the soc core thinks all codecs are on the same DAI?
>>>> **** */
>>>>
>>>> // simple-audio-card,dai-link@1 {
>>>> // format = "left_j";
>>>> // cpu {
>>>> // sound-dai = <&mcasp0>;
>>>> // };
>>>> // codec {
>>>> // sound-dai = <&tlv320aic3x_b 0>;
>>>> // dai-tdm-slot-num = <2>;
>>>> // dai-tdm-slot-width = <16>;
>>>> // };
>>>> // };
>>>> // simple-audio-card,dai-link@2 {
>>>> // format = "left_j";
>>>> // cpu {
>>>> // sound-dai = <&mcasp0>;
>>>> // };
>>>> // codec {
>>>> // sound-dai = <&tlv320aic3x_c>;
>>>> // dai-tdm-slot-num = <4>;
>>>> // dai-tdm-slot-width = <16>;
>>>> // };
>>>> // };
>>>> // simple-audio-card,dai-link@3 {
>>>> // format = "left_j";
>>>> // cpu {
>>>> // sound-dai = <&mcasp0>;
>>>> // };
>>>> // codec {
>>>> // sound-dai = <&tlv320aic3x_d>;
>>>> // dai-tdm-slot-num = <6>;
>>>> // dai-tdm-slot-width = <16>;
>>>> // };
>>>> // };
>>>> };
>>>> };
>>>> _______________________________________________
>>>> Alsa-devel mailing list
>>>> Alsa-devel@alsa-project.org
>>>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>>
>>>
>>> _______________________________________________
>>> Alsa-devel mailing list
>>> Alsa-devel@alsa-project.org
>>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Multiple codecs on one sound card for multi-channel sound card
  2015-09-16 22:07     ` Caleb Crome
@ 2015-09-17  8:51       ` arnaud.mouiche
  2015-09-17 13:38         ` Caleb Crome
  0 siblings, 1 reply; 13+ messages in thread
From: arnaud.mouiche @ 2015-09-17  8:51 UTC (permalink / raw)
  To: Caleb Crome; +Cc: alsa-devel

Hello Caleb,

freescale SSI is fine with more than 2 channels.
I have planed to publish a set of patch in this direction but we still 
have some corner cases to fix first (rare issues with channels alignment)

Yet, this following is far enough to have it working.
And since the max/min rate is at the end the intersection of what the 
SSI, the codec and the card are declaring, it will not change anything 
until you connect the SSI to a codec with more than 2 channels, or a 
multi-codec solution.

Arnaud

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index c25a1e8..26e980b 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -1082,14 +1082,14 @@ static struct snd_soc_dai_driver 
fsl_ssi_dai_template = {
         .playback = {
                 .stream_name = "CPU-Playback",
                 .channels_min = 1,
-               .channels_max = 2,
+               .channels_max = 4,
                 .rates = FSLSSI_I2S_RATES,
                 .formats = FSLSSI_I2S_FORMATS,
         },
         .capture = {
                 .stream_name = "CPU-Capture",
                 .channels_min = 1,
-               .channels_max = 2,
+               .channels_max = 4,
                 .rates = FSLSSI_I2S_RATES,
                 .formats = FSLSSI_I2S_FORMATS,
         },


Le 17/09/2015 00:07, Caleb Crome a écrit :
> Ah Ha!  thank you Arnaud!  I'll understand this stuff eventually.
> I'll implement as you've shown and see how it goes.
>
> I see that you have 'fsl,imx-audio-foo', using an SSI.  from what I
> can see the SSIs only support channels_max=2.  How do you get
> multi-channel TDM to work with the freescale SSI port?  I need to get
> this TDM working on both TI & Freescale, and the freescale has been
> quite problematic because the multi-channel doesn't seem to be
> supported in the driver.
>
> I have just checked out and verified that
>
> http://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/
>
> sound/soc/fsl/*ssi*
>
> all have channels_max = 2
>
> We're very motivated to get this working on the freescale MX6, and
> getting it to work sure does not seem as simple as changing 2 to a
> bigger number :-)
>
>
> Thanks,
>    -Caleb
>
>
> On Wed, Sep 16, 2015 at 2:57 AM, arnaud.mouiche@invoxia.com
> <arnaud.mouiche@invoxia.com> wrote:
>> Hello Caleb,
>>
>> Multi-codec support is now working fine the current linux releases.
>> for previous releases, check if commit
>>      [PATCH] ASoC: dapm: Don't add prefix to widget stream name
>> is included. I remember this is the last required patch.
>>
>> After that, I don't know if the "simple-card" can be configured for multi
>> codec support as you wish.
>>
>> On my side, I cooked a particular sound card for the purpose.
>> here is some tips:
>>
>>
>>      struct snd_soc_dai_link_component codecs[2];
>>      struct snd_soc_codec_conf codecs_conf[2];
>> [...]
>>      for (num_codecs=0; num_codecs<2; num_codecs++) {
>>          struct device_node *of_node;
>>          of_node = of_parse_phandle(pdev->dev.of_node, "audio-codec",
>> num_codecs);
>>          if (!of_node) break;
>>          data->codecs[num_codecs].of_node = of_node;
>>          data->codecs[num_codecs].dai_name = "tlv320aic3x-foo";
>>
>>          /* add a "C2" name prefix for every control of the 2nd codec */
>>          data->codecs_conf[num_codecs].of_node = of_node;
>>          if (num_codecs == 1) {
>>              data->codecs_conf[num_codecs].name_prefix = "C2";
>>          }
>>      }
>> [...]
>>      data->dai.codecs = data->codecs;
>>      data->dai.num_codecs = num_codecs;
>>      data->card.dai_link = &data->dai;
>>      data->card.codec_conf = data->codecs_conf;
>>      data->card.num_configs = num_codecs;
>> [...]
>>
>>
>> On DTS side, I have something like
>>
>>      sound@0 {
>>          compatible = "fsl,imx-audio-foo";
>>          model = "foo-audio";
>>          ssi-controller = <&ssi1>;
>>
>>          /*
>>           * list phandles for the 2 codecs used in the same TDM network
>>           */
>>          audio-codec = <&codec1>, <&codec2>;
>>
>>          [...]
>>
>>      };
>>
>>
>> You also need to have a particular hw_params() method to dispatch the TDM
>> and sysclk configuration to your codecs, making the difference between your
>> first codec (your bus master) and the others.
>>
>>
>> Arnaud
>>
>>
>> Le 15/09/2015 03:07, Caleb Crome a écrit :
>>> (re-sending hope it's not a duplicate -- I think I must have had HTML
>>> in my previous email and it was ignored)
>>>
>>>    Hi all,
>>>       What are the current best practices to specify multiple codecs on
>>> one sound card, with all codecs sharing a single TDM bus?
>>>
>>>    I have a card with up to 32 TLV320AIC33 codecs on it.  For the
>>> moment, we can limit the discussion to only 16 codecs, so we don't
>>> have to get extra serializers involved...
>>>
>>>    I currently have something like this in my am335x-boneblack.dts file:
>>>
>>>    (i.e. attempting to set tdm slot width and num in the i2c codec)
>>>
>>>    but it doesn't seem to be picking up the fact that I want all the
>>> codecs linked together as one.
>>>
>>>    (FYI, the first codec, i.e. tlv32aic3x_a should be the master, and
>>> all others including the CPU will be slaves).
>>>
>>>    Thanks for any help!
>>>
>>>    BTW, I'm happy to use whatever kernel will support me with the
>>> minimal amount of effort, currently using 4.1
>>>
>>>
>>>
>>> Thank you!
>>>      -Caleb
>>>
>>> &i2c1 {
>>>    ...
>>> tlv320aic3x_a: tlv320aic3x@18 {
>>> #sound-dai-cells = <1>;
>>> compatible = "ti,tlv320aic3x";
>>> reg = <0x18>;
>>> tdm-offset = <0>;
>>> status = "okay";
>>> };
>>> tlv320aic3x_b: tlv320aic3x@19 {
>>> #sound-dai-cells = <1>;
>>> compatible = "ti,tlv320aic3x";
>>> reg = <0x19>;
>>> tdm-offset = <32>;
>>> status = "okay";
>>> };
>>> tlv320aic3x_c: tlv320aic3x@1a {
>>> #sound-dai-cells = <1>;
>>> compatible = "ti,tlv320aic3x";
>>> reg = <0x1a>;
>>> tdm-offset = <64>;
>>> status = "okay";
>>> };
>>> tlv320aic3x_d: tlv320aic3x@1b {
>>> #sound-dai-cells = <1>;
>>> compatible = "ti,tlv320aic3x";
>>> reg = <0x1b>;
>>> tdm-offset = <96>;
>>> status = "okay";
>>> };
>>> };
>>>
>>> &mcasp0 {
>>> #sound-dai-cells = <0>;
>>> pinctrl-names = "default";
>>> pinctrl-0 = <&mcasp_0_pins_default>;
>>> status = "okay";
>>>
>>> op-mode = <0>;          /* MCASP_IIS_MODE */
>>> tdm-slots = <16>;
>>> num-serializer = <16>;
>>> serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
>>> 0 0 1 2
>>> 0 0 0 0
>>> 0 0 0 0
>>> 0 0 0 0
>>>> ;
>>> tx-num-evt = <1>;
>>> rx-num-evt = <1>;
>>> };
>>>
>>> / {
>>> sound {
>>> compatible = "simple-audio-card";
>>> simple-audio-card,name = "puppy-audio";
>>> simple-audio-card,mclk-fs = <256>;
>>> system-clock-frequency = <12288000>;
>>> status = "okay";
>>> simple-audio-card,bitclock-master = <&tlv320aic3x_a>;
>>>         simple-audio-card,frame-master    = <&tlv320aic3x_a>;
>>> simple-audio-card,widgets =
>>> "Line", "Line Out",
>>> "Line", "Line In";
>>> simple-audio-card,routing =
>>> "Line Out",       "HPLOUT",
>>> "Line Out",       "HPROUT",
>>> "Line In",        "LINE1L",
>>> "Line In",        "LINE1R";
>>>
>>> simple-audio-card,dai-link@0 {
>>> format = "left_j";
>>> cpu {
>>> sound-dai = <&mcasp0>;
>>> };
>>> codec {
>>> sound-dai = <&tlv320aic3x_a 0>;
>>> dai-tdm-slot-num = <0>;
>>> dai-tdm-slot-width = <16>;
>>> };
>>> };
>>> /**** The stuff below doesn't work -- I can't figure out how to get
>>> the name_prefixes set
>>>    on each codec... .How do I set up so that each codec gets its own name
>>> prfix
>>> and so that the soc core thinks all codecs are on the same DAI?
>>> **** */
>>>
>>> // simple-audio-card,dai-link@1 {
>>> // format = "left_j";
>>> // cpu {
>>> // sound-dai = <&mcasp0>;
>>> // };
>>> // codec {
>>> // sound-dai = <&tlv320aic3x_b 0>;
>>> // dai-tdm-slot-num = <2>;
>>> // dai-tdm-slot-width = <16>;
>>> // };
>>> // };
>>> // simple-audio-card,dai-link@2 {
>>> // format = "left_j";
>>> // cpu {
>>> // sound-dai = <&mcasp0>;
>>> // };
>>> // codec {
>>> // sound-dai = <&tlv320aic3x_c>;
>>> // dai-tdm-slot-num = <4>;
>>> // dai-tdm-slot-width = <16>;
>>> // };
>>> // };
>>> // simple-audio-card,dai-link@3 {
>>> // format = "left_j";
>>> // cpu {
>>> // sound-dai = <&mcasp0>;
>>> // };
>>> // codec {
>>> // sound-dai = <&tlv320aic3x_d>;
>>> // dai-tdm-slot-num = <6>;
>>> // dai-tdm-slot-width = <16>;
>>> // };
>>> // };
>>> };
>>> };
>>> _______________________________________________
>>> Alsa-devel mailing list
>>> Alsa-devel@alsa-project.org
>>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>
>> _______________________________________________
>> Alsa-devel mailing list
>> Alsa-devel@alsa-project.org
>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: Multiple codecs on one sound card for multi-channel sound card
  2015-09-16  9:57   ` arnaud.mouiche
@ 2015-09-16 22:07     ` Caleb Crome
  2015-09-17  8:51       ` arnaud.mouiche
  0 siblings, 1 reply; 13+ messages in thread
From: Caleb Crome @ 2015-09-16 22:07 UTC (permalink / raw)
  To: arnaud.mouiche; +Cc: alsa-devel

Ah Ha!  thank you Arnaud!  I'll understand this stuff eventually.
I'll implement as you've shown and see how it goes.

I see that you have 'fsl,imx-audio-foo', using an SSI.  from what I
can see the SSIs only support channels_max=2.  How do you get
multi-channel TDM to work with the freescale SSI port?  I need to get
this TDM working on both TI & Freescale, and the freescale has been
quite problematic because the multi-channel doesn't seem to be
supported in the driver.

I have just checked out and verified that

http://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/

sound/soc/fsl/*ssi*

all have channels_max = 2

We're very motivated to get this working on the freescale MX6, and
getting it to work sure does not seem as simple as changing 2 to a
bigger number :-)


Thanks,
  -Caleb


On Wed, Sep 16, 2015 at 2:57 AM, arnaud.mouiche@invoxia.com
<arnaud.mouiche@invoxia.com> wrote:
> Hello Caleb,
>
> Multi-codec support is now working fine the current linux releases.
> for previous releases, check if commit
>     [PATCH] ASoC: dapm: Don't add prefix to widget stream name
> is included. I remember this is the last required patch.
>
> After that, I don't know if the "simple-card" can be configured for multi
> codec support as you wish.
>
> On my side, I cooked a particular sound card for the purpose.
> here is some tips:
>
>
>     struct snd_soc_dai_link_component codecs[2];
>     struct snd_soc_codec_conf codecs_conf[2];
> [...]
>     for (num_codecs=0; num_codecs<2; num_codecs++) {
>         struct device_node *of_node;
>         of_node = of_parse_phandle(pdev->dev.of_node, "audio-codec",
> num_codecs);
>         if (!of_node) break;
>         data->codecs[num_codecs].of_node = of_node;
>         data->codecs[num_codecs].dai_name = "tlv320aic3x-foo";
>
>         /* add a "C2" name prefix for every control of the 2nd codec */
>         data->codecs_conf[num_codecs].of_node = of_node;
>         if (num_codecs == 1) {
>             data->codecs_conf[num_codecs].name_prefix = "C2";
>         }
>     }
> [...]
>     data->dai.codecs = data->codecs;
>     data->dai.num_codecs = num_codecs;
>     data->card.dai_link = &data->dai;
>     data->card.codec_conf = data->codecs_conf;
>     data->card.num_configs = num_codecs;
> [...]
>
>
> On DTS side, I have something like
>
>     sound@0 {
>         compatible = "fsl,imx-audio-foo";
>         model = "foo-audio";
>         ssi-controller = <&ssi1>;
>
>         /*
>          * list phandles for the 2 codecs used in the same TDM network
>          */
>         audio-codec = <&codec1>, <&codec2>;
>
>         [...]
>
>     };
>
>
> You also need to have a particular hw_params() method to dispatch the TDM
> and sysclk configuration to your codecs, making the difference between your
> first codec (your bus master) and the others.
>
>
> Arnaud
>
>
> Le 15/09/2015 03:07, Caleb Crome a écrit :
>>
>> (re-sending hope it's not a duplicate -- I think I must have had HTML
>> in my previous email and it was ignored)
>>
>>   Hi all,
>>      What are the current best practices to specify multiple codecs on
>> one sound card, with all codecs sharing a single TDM bus?
>>
>>   I have a card with up to 32 TLV320AIC33 codecs on it.  For the
>> moment, we can limit the discussion to only 16 codecs, so we don't
>> have to get extra serializers involved...
>>
>>   I currently have something like this in my am335x-boneblack.dts file:
>>
>>   (i.e. attempting to set tdm slot width and num in the i2c codec)
>>
>>   but it doesn't seem to be picking up the fact that I want all the
>> codecs linked together as one.
>>
>>   (FYI, the first codec, i.e. tlv32aic3x_a should be the master, and
>> all others including the CPU will be slaves).
>>
>>   Thanks for any help!
>>
>>   BTW, I'm happy to use whatever kernel will support me with the
>> minimal amount of effort, currently using 4.1
>>
>>
>>
>> Thank you!
>>     -Caleb
>>
>> &i2c1 {
>>   ...
>> tlv320aic3x_a: tlv320aic3x@18 {
>> #sound-dai-cells = <1>;
>> compatible = "ti,tlv320aic3x";
>> reg = <0x18>;
>> tdm-offset = <0>;
>> status = "okay";
>> };
>> tlv320aic3x_b: tlv320aic3x@19 {
>> #sound-dai-cells = <1>;
>> compatible = "ti,tlv320aic3x";
>> reg = <0x19>;
>> tdm-offset = <32>;
>> status = "okay";
>> };
>> tlv320aic3x_c: tlv320aic3x@1a {
>> #sound-dai-cells = <1>;
>> compatible = "ti,tlv320aic3x";
>> reg = <0x1a>;
>> tdm-offset = <64>;
>> status = "okay";
>> };
>> tlv320aic3x_d: tlv320aic3x@1b {
>> #sound-dai-cells = <1>;
>> compatible = "ti,tlv320aic3x";
>> reg = <0x1b>;
>> tdm-offset = <96>;
>> status = "okay";
>> };
>> };
>>
>> &mcasp0 {
>> #sound-dai-cells = <0>;
>> pinctrl-names = "default";
>> pinctrl-0 = <&mcasp_0_pins_default>;
>> status = "okay";
>>
>> op-mode = <0>;          /* MCASP_IIS_MODE */
>> tdm-slots = <16>;
>> num-serializer = <16>;
>> serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
>> 0 0 1 2
>> 0 0 0 0
>> 0 0 0 0
>> 0 0 0 0
>>>
>>> ;
>>
>> tx-num-evt = <1>;
>> rx-num-evt = <1>;
>> };
>>
>> / {
>> sound {
>> compatible = "simple-audio-card";
>> simple-audio-card,name = "puppy-audio";
>> simple-audio-card,mclk-fs = <256>;
>> system-clock-frequency = <12288000>;
>> status = "okay";
>> simple-audio-card,bitclock-master = <&tlv320aic3x_a>;
>>        simple-audio-card,frame-master    = <&tlv320aic3x_a>;
>> simple-audio-card,widgets =
>> "Line", "Line Out",
>> "Line", "Line In";
>> simple-audio-card,routing =
>> "Line Out",       "HPLOUT",
>> "Line Out",       "HPROUT",
>> "Line In",        "LINE1L",
>> "Line In",        "LINE1R";
>>
>> simple-audio-card,dai-link@0 {
>> format = "left_j";
>> cpu {
>> sound-dai = <&mcasp0>;
>> };
>> codec {
>> sound-dai = <&tlv320aic3x_a 0>;
>> dai-tdm-slot-num = <0>;
>> dai-tdm-slot-width = <16>;
>> };
>> };
>> /**** The stuff below doesn't work -- I can't figure out how to get
>> the name_prefixes set
>>   on each codec... .How do I set up so that each codec gets its own name
>> prfix
>> and so that the soc core thinks all codecs are on the same DAI?
>> **** */
>>
>> // simple-audio-card,dai-link@1 {
>> // format = "left_j";
>> // cpu {
>> // sound-dai = <&mcasp0>;
>> // };
>> // codec {
>> // sound-dai = <&tlv320aic3x_b 0>;
>> // dai-tdm-slot-num = <2>;
>> // dai-tdm-slot-width = <16>;
>> // };
>> // };
>> // simple-audio-card,dai-link@2 {
>> // format = "left_j";
>> // cpu {
>> // sound-dai = <&mcasp0>;
>> // };
>> // codec {
>> // sound-dai = <&tlv320aic3x_c>;
>> // dai-tdm-slot-num = <4>;
>> // dai-tdm-slot-width = <16>;
>> // };
>> // };
>> // simple-audio-card,dai-link@3 {
>> // format = "left_j";
>> // cpu {
>> // sound-dai = <&mcasp0>;
>> // };
>> // codec {
>> // sound-dai = <&tlv320aic3x_d>;
>> // dai-tdm-slot-num = <6>;
>> // dai-tdm-slot-width = <16>;
>> // };
>> // };
>> };
>> };
>> _______________________________________________
>> Alsa-devel mailing list
>> Alsa-devel@alsa-project.org
>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Multiple codecs on one sound card for multi-channel sound card
  2015-09-15  1:07 ` Caleb Crome
@ 2015-09-16  9:57   ` arnaud.mouiche
  2015-09-16 22:07     ` Caleb Crome
  0 siblings, 1 reply; 13+ messages in thread
From: arnaud.mouiche @ 2015-09-16  9:57 UTC (permalink / raw)
  To: alsa-devel

Hello Caleb,

Multi-codec support is now working fine the current linux releases.
for previous releases, check if commit
     [PATCH] ASoC: dapm: Don't add prefix to widget stream name
is included. I remember this is the last required patch.

After that, I don't know if the "simple-card" can be configured for 
multi codec support as you wish.

On my side, I cooked a particular sound card for the purpose.
here is some tips:


     struct snd_soc_dai_link_component codecs[2];
     struct snd_soc_codec_conf codecs_conf[2];
[...]
     for (num_codecs=0; num_codecs<2; num_codecs++) {
         struct device_node *of_node;
         of_node = of_parse_phandle(pdev->dev.of_node, "audio-codec", 
num_codecs);
         if (!of_node) break;
         data->codecs[num_codecs].of_node = of_node;
         data->codecs[num_codecs].dai_name = "tlv320aic3x-foo";

         /* add a "C2" name prefix for every control of the 2nd codec */
         data->codecs_conf[num_codecs].of_node = of_node;
         if (num_codecs == 1) {
             data->codecs_conf[num_codecs].name_prefix = "C2";
         }
     }
[...]
     data->dai.codecs = data->codecs;
     data->dai.num_codecs = num_codecs;
     data->card.dai_link = &data->dai;
     data->card.codec_conf = data->codecs_conf;
     data->card.num_configs = num_codecs;
[...]


On DTS side, I have something like

     sound@0 {
         compatible = "fsl,imx-audio-foo";
         model = "foo-audio";
         ssi-controller = <&ssi1>;

         /*
          * list phandles for the 2 codecs used in the same TDM network
          */
         audio-codec = <&codec1>, <&codec2>;

         [...]

     };


You also need to have a particular hw_params() method to dispatch the 
TDM and sysclk configuration to your codecs, making the difference 
between your first codec (your bus master) and the others.


Arnaud

Le 15/09/2015 03:07, Caleb Crome a écrit :
> (re-sending hope it's not a duplicate -- I think I must have had HTML
> in my previous email and it was ignored)
>
>   Hi all,
>      What are the current best practices to specify multiple codecs on
> one sound card, with all codecs sharing a single TDM bus?
>
>   I have a card with up to 32 TLV320AIC33 codecs on it.  For the
> moment, we can limit the discussion to only 16 codecs, so we don't
> have to get extra serializers involved...
>
>   I currently have something like this in my am335x-boneblack.dts file:
>
>   (i.e. attempting to set tdm slot width and num in the i2c codec)
>
>   but it doesn't seem to be picking up the fact that I want all the
> codecs linked together as one.
>
>   (FYI, the first codec, i.e. tlv32aic3x_a should be the master, and
> all others including the CPU will be slaves).
>
>   Thanks for any help!
>
>   BTW, I'm happy to use whatever kernel will support me with the
> minimal amount of effort, currently using 4.1
>
>
>
> Thank you!
>     -Caleb
>
> &i2c1 {
>   ...
> tlv320aic3x_a: tlv320aic3x@18 {
> #sound-dai-cells = <1>;
> compatible = "ti,tlv320aic3x";
> reg = <0x18>;
> tdm-offset = <0>;
> status = "okay";
> };
> tlv320aic3x_b: tlv320aic3x@19 {
> #sound-dai-cells = <1>;
> compatible = "ti,tlv320aic3x";
> reg = <0x19>;
> tdm-offset = <32>;
> status = "okay";
> };
> tlv320aic3x_c: tlv320aic3x@1a {
> #sound-dai-cells = <1>;
> compatible = "ti,tlv320aic3x";
> reg = <0x1a>;
> tdm-offset = <64>;
> status = "okay";
> };
> tlv320aic3x_d: tlv320aic3x@1b {
> #sound-dai-cells = <1>;
> compatible = "ti,tlv320aic3x";
> reg = <0x1b>;
> tdm-offset = <96>;
> status = "okay";
> };
> };
>
> &mcasp0 {
> #sound-dai-cells = <0>;
> pinctrl-names = "default";
> pinctrl-0 = <&mcasp_0_pins_default>;
> status = "okay";
>
> op-mode = <0>;          /* MCASP_IIS_MODE */
> tdm-slots = <16>;
> num-serializer = <16>;
> serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
> 0 0 1 2
> 0 0 0 0
> 0 0 0 0
> 0 0 0 0
>> ;
> tx-num-evt = <1>;
> rx-num-evt = <1>;
> };
>
> / {
> sound {
> compatible = "simple-audio-card";
> simple-audio-card,name = "puppy-audio";
> simple-audio-card,mclk-fs = <256>;
> system-clock-frequency = <12288000>;
> status = "okay";
> simple-audio-card,bitclock-master = <&tlv320aic3x_a>;
>        simple-audio-card,frame-master    = <&tlv320aic3x_a>;
> simple-audio-card,widgets =
> "Line", "Line Out",
> "Line", "Line In";
> simple-audio-card,routing =
> "Line Out",       "HPLOUT",
> "Line Out",       "HPROUT",
> "Line In",        "LINE1L",
> "Line In",        "LINE1R";
>
> simple-audio-card,dai-link@0 {
> format = "left_j";
> cpu {
> sound-dai = <&mcasp0>;
> };
> codec {
> sound-dai = <&tlv320aic3x_a 0>;
> dai-tdm-slot-num = <0>;
> dai-tdm-slot-width = <16>;
> };
> };
> /**** The stuff below doesn't work -- I can't figure out how to get
> the name_prefixes set
>   on each codec... .How do I set up so that each codec gets its own name prfix
> and so that the soc core thinks all codecs are on the same DAI?
> **** */
>
> // simple-audio-card,dai-link@1 {
> // format = "left_j";
> // cpu {
> // sound-dai = <&mcasp0>;
> // };
> // codec {
> // sound-dai = <&tlv320aic3x_b 0>;
> // dai-tdm-slot-num = <2>;
> // dai-tdm-slot-width = <16>;
> // };
> // };
> // simple-audio-card,dai-link@2 {
> // format = "left_j";
> // cpu {
> // sound-dai = <&mcasp0>;
> // };
> // codec {
> // sound-dai = <&tlv320aic3x_c>;
> // dai-tdm-slot-num = <4>;
> // dai-tdm-slot-width = <16>;
> // };
> // };
> // simple-audio-card,dai-link@3 {
> // format = "left_j";
> // cpu {
> // sound-dai = <&mcasp0>;
> // };
> // codec {
> // sound-dai = <&tlv320aic3x_d>;
> // dai-tdm-slot-num = <6>;
> // dai-tdm-slot-width = <16>;
> // };
> // };
> };
> };
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Multiple codecs on one sound card for multi-channel sound card
  2015-09-09  1:02 Caleb Crome
  2015-09-10 18:26 ` Caleb Crome
@ 2015-09-15  1:07 ` Caleb Crome
  2015-09-16  9:57   ` arnaud.mouiche
  1 sibling, 1 reply; 13+ messages in thread
From: Caleb Crome @ 2015-09-15  1:07 UTC (permalink / raw)
  To: alsa-devel

(re-sending hope it's not a duplicate -- I think I must have had HTML
in my previous email and it was ignored)

 Hi all,
    What are the current best practices to specify multiple codecs on
one sound card, with all codecs sharing a single TDM bus?

 I have a card with up to 32 TLV320AIC33 codecs on it.  For the
moment, we can limit the discussion to only 16 codecs, so we don't
have to get extra serializers involved...

 I currently have something like this in my am335x-boneblack.dts file:

 (i.e. attempting to set tdm slot width and num in the i2c codec)

 but it doesn't seem to be picking up the fact that I want all the
codecs linked together as one.

 (FYI, the first codec, i.e. tlv32aic3x_a should be the master, and
all others including the CPU will be slaves).

 Thanks for any help!

 BTW, I'm happy to use whatever kernel will support me with the
minimal amount of effort, currently using 4.1



Thank you!
   -Caleb

&i2c1 {
 ...
tlv320aic3x_a: tlv320aic3x@18 {
#sound-dai-cells = <1>;
compatible = "ti,tlv320aic3x";
reg = <0x18>;
tdm-offset = <0>;
status = "okay";
};
tlv320aic3x_b: tlv320aic3x@19 {
#sound-dai-cells = <1>;
compatible = "ti,tlv320aic3x";
reg = <0x19>;
tdm-offset = <32>;
status = "okay";
};
tlv320aic3x_c: tlv320aic3x@1a {
#sound-dai-cells = <1>;
compatible = "ti,tlv320aic3x";
reg = <0x1a>;
tdm-offset = <64>;
status = "okay";
};
tlv320aic3x_d: tlv320aic3x@1b {
#sound-dai-cells = <1>;
compatible = "ti,tlv320aic3x";
reg = <0x1b>;
tdm-offset = <96>;
status = "okay";
};
};

&mcasp0 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&mcasp_0_pins_default>;
status = "okay";

op-mode = <0>;          /* MCASP_IIS_MODE */
tdm-slots = <16>;
num-serializer = <16>;
serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
0 0 1 2
0 0 0 0
0 0 0 0
0 0 0 0
>;
tx-num-evt = <1>;
rx-num-evt = <1>;
};

/ {
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "puppy-audio";
simple-audio-card,mclk-fs = <256>;
system-clock-frequency = <12288000>;
status = "okay";
simple-audio-card,bitclock-master = <&tlv320aic3x_a>;
      simple-audio-card,frame-master    = <&tlv320aic3x_a>;
simple-audio-card,widgets =
"Line", "Line Out",
"Line", "Line In";
simple-audio-card,routing =
"Line Out",       "HPLOUT",
"Line Out",       "HPROUT",
"Line In",        "LINE1L",
"Line In",        "LINE1R";

simple-audio-card,dai-link@0 {
format = "left_j";
cpu {
sound-dai = <&mcasp0>;
};
codec {
sound-dai = <&tlv320aic3x_a 0>;
dai-tdm-slot-num = <0>;
dai-tdm-slot-width = <16>;
};
};
/**** The stuff below doesn't work -- I can't figure out how to get
the name_prefixes set
 on each codec... .How do I set up so that each codec gets its own name prfix
and so that the soc core thinks all codecs are on the same DAI?
**** */

// simple-audio-card,dai-link@1 {
// format = "left_j";
// cpu {
// sound-dai = <&mcasp0>;
// };
// codec {
// sound-dai = <&tlv320aic3x_b 0>;
// dai-tdm-slot-num = <2>;
// dai-tdm-slot-width = <16>;
// };
// };
// simple-audio-card,dai-link@2 {
// format = "left_j";
// cpu {
// sound-dai = <&mcasp0>;
// };
// codec {
// sound-dai = <&tlv320aic3x_c>;
// dai-tdm-slot-num = <4>;
// dai-tdm-slot-width = <16>;
// };
// };
// simple-audio-card,dai-link@3 {
// format = "left_j";
// cpu {
// sound-dai = <&mcasp0>;
// };
// codec {
// sound-dai = <&tlv320aic3x_d>;
// dai-tdm-slot-num = <6>;
// dai-tdm-slot-width = <16>;
// };
// };
};
};

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Multiple codecs on one sound card for multi-channel sound card
  2015-09-09  1:02 Caleb Crome
@ 2015-09-10 18:26 ` Caleb Crome
  2015-09-15  1:07 ` Caleb Crome
  1 sibling, 0 replies; 13+ messages in thread
From: Caleb Crome @ 2015-09-10 18:26 UTC (permalink / raw)
  To: alsa-devel

Hi Mark Brown,
    Looking back on my email notes, you helped me with this back in 2011
with an old kernel version.  I wonder if mutlti-codec-on-single-DAI
configuration is still unsupported by the ASOC core.  I don't see anything
obvious.

If I were to implement it 'properly', what's the right DTS format to go
with?  Something like what I suggest below (i.e. in the simple-audio-card
section, use multiple codecs in a single sound-dai?  If so, where should
the tdm-slot & clocking information go?  In the codec DTS section itself,
or in the sound-dai section?

Thanks again,
 -Caleb



On Tue, Sep 8, 2015 at 6:02 PM, Caleb Crome <caleb@crome.org> wrote:

> Hi all,
>    What's the current best practices to specify multiple codecs on one
> sound card, with all codecs sharing a single TDM bus?
>
> I have a card with up to 32 TLV320AIC33 codecs on it.  For the moment, we
> can limit the discussion to only 16 codecs, so we don't have to get extra
> serializers involved...
>
> I currently have something like this in my am335x-boneblack.dts file:
>
> (i.e. attempting to set tdm slot width and num in the i2c codec)
>
> but it doesn't seem to be pickin up the fact that I want all the codecs
> linked together as one.
>
> (FYI, the first codec, i.e. tlv32aic3x_a should be the master, and all
> others including the CPU will be slaves).
>
> Thanks for any help!
>
> BTW, I'm happy to use whatever kernel will support me with the minimal
> amount of effort!
>
> Sincerely,
>   -Caleb
>
>
> &i2c1 {
> clock-frequency = <100000>;
> status = "okay";
> pinctrl-names = "default";
> pinctrl-0 = <&i2c1_pins_default>;
> status="okay";
>
> tlv320aic3x_a: tlv320aic3x@18 {
>        #sound-dai-cells = <0>;
> compatible = "ti,tlv320aic3x";
> reg = <0x18>;
> status = "okay";
> dai-tdm-slot-width = <16>;
> dai-tdm-slot-num   = <0>;
> };
> tlv320aic3x_b: tlv320aic3x@19 {
>        #sound-dai-cells = <0>;
> compatible = "ti,tlv320aic3x";
> reg = <0x19>;
> status = "okay";
> dai-tdm-slot-width = <16>;
> dai-tdm-slot-num   = <2>;
> };
> tlv320aic3x_c: tlv320aic3x@1a {
> compatible = "ti,tlv320aic3x";
> reg = <0x1a>;
> status = "okay";
> dai-tdm-slot-width = <16>;
> dai-tdm-slot-num   = <4>;
> };
> tlv320aic3x_d: tlv320aic3x@1b {
> compatible = "ti,tlv320aic3x";
> reg = <0x1b>;
> status = "okay";
> dai-tdm-slot-width = <16>;
> dai-tdm-slot-num   = <6>;
> };
> };
>
> sound {
>      compatible = "simple-audio-card";
>      simple-audio-card,name = "puck audio";
>      // simple-audio-card,widgets=
>      // simple-audio-card,routing=
>      simple-audio-card,mclk-fs = <256>;
>      status="okay";
>      simple-audio-card,bitclock-master = <&tlv320aic3x_a>;
>      simple-audio-card,frame-master    = <&tlv320aic3x_a>;
>      simple-audio-card,dai-link@0 {
>           format = "left_j";
>   cpu {
>     sound-dai = <&mcasp0 0>;
>   };
>
> // *** Here's where I'm really confused -- this part doesn't seem to be
> supported to
> // have all the codecs on a single DAI.
> // The examples given  seem to be for different codec DAIs
> // sharing a single CPU DAI, but not used at the same time.
>
>   codec {
>     #sound-dai-cells = <0>;
>     sound-dai          = <
>     &tlv320aic3x_a
>     &tlv320aic3x_b
>     &tlv320aic3x_c
>       &tlv320aic3x_d
>     >;
>   };
>      };
> };
>
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Multiple codecs on one sound card for multi-channel sound card
@ 2015-09-09  1:02 Caleb Crome
  2015-09-10 18:26 ` Caleb Crome
  2015-09-15  1:07 ` Caleb Crome
  0 siblings, 2 replies; 13+ messages in thread
From: Caleb Crome @ 2015-09-09  1:02 UTC (permalink / raw)
  To: alsa-devel

Hi all,
   What's the current best practices to specify multiple codecs on one
sound card, with all codecs sharing a single TDM bus?

I have a card with up to 32 TLV320AIC33 codecs on it.  For the moment, we
can limit the discussion to only 16 codecs, so we don't have to get extra
serializers involved...

I currently have something like this in my am335x-boneblack.dts file:

(i.e. attempting to set tdm slot width and num in the i2c codec)

but it doesn't seem to be pickin up the fact that I want all the codecs
linked together as one.

(FYI, the first codec, i.e. tlv32aic3x_a should be the master, and all
others including the CPU will be slaves).

Thanks for any help!

BTW, I'm happy to use whatever kernel will support me with the minimal
amount of effort!

Sincerely,
  -Caleb


&i2c1 {
clock-frequency = <100000>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins_default>;
status="okay";

tlv320aic3x_a: tlv320aic3x@18 {
       #sound-dai-cells = <0>;
compatible = "ti,tlv320aic3x";
reg = <0x18>;
status = "okay";
dai-tdm-slot-width = <16>;
dai-tdm-slot-num   = <0>;
};
tlv320aic3x_b: tlv320aic3x@19 {
       #sound-dai-cells = <0>;
compatible = "ti,tlv320aic3x";
reg = <0x19>;
status = "okay";
dai-tdm-slot-width = <16>;
dai-tdm-slot-num   = <2>;
};
tlv320aic3x_c: tlv320aic3x@1a {
compatible = "ti,tlv320aic3x";
reg = <0x1a>;
status = "okay";
dai-tdm-slot-width = <16>;
dai-tdm-slot-num   = <4>;
};
tlv320aic3x_d: tlv320aic3x@1b {
compatible = "ti,tlv320aic3x";
reg = <0x1b>;
status = "okay";
dai-tdm-slot-width = <16>;
dai-tdm-slot-num   = <6>;
};
};

sound {
     compatible = "simple-audio-card";
     simple-audio-card,name = "puck audio";
     // simple-audio-card,widgets=
     // simple-audio-card,routing=
     simple-audio-card,mclk-fs = <256>;
     status="okay";
     simple-audio-card,bitclock-master = <&tlv320aic3x_a>;
     simple-audio-card,frame-master    = <&tlv320aic3x_a>;
     simple-audio-card,dai-link@0 {
          format = "left_j";
  cpu {
    sound-dai = <&mcasp0 0>;
  };

// *** Here's where I'm really confused -- this part doesn't seem to be
supported to
// have all the codecs on a single DAI.
// The examples given  seem to be for different codec DAIs
// sharing a single CPU DAI, but not used at the same time.

  codec {
    #sound-dai-cells = <0>;
    sound-dai          = <
    &tlv320aic3x_a
    &tlv320aic3x_b
    &tlv320aic3x_c
      &tlv320aic3x_d
    >;
  };
     };
};

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-02-18  8:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-12 10:55 Multiple codecs on one sound card for multi-channel sound card Yann CARDAILLAC
2019-02-18  8:32 ` Arnaud Mouiche
  -- strict thread matches above, loose matches on Subject: below --
2015-09-09  1:02 Caleb Crome
2015-09-10 18:26 ` Caleb Crome
2015-09-15  1:07 ` Caleb Crome
2015-09-16  9:57   ` arnaud.mouiche
2015-09-16 22:07     ` Caleb Crome
2015-09-17  8:51       ` arnaud.mouiche
2015-09-17 13:38         ` Caleb Crome
2015-09-17 14:33           ` arnaud.mouiche
2015-09-17 15:34             ` Caleb Crome
2015-09-17 16:09               ` arnaud.mouiche
2015-09-17 17:39                 ` Caleb Crome

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.