Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaud Mouiche <arnaud.mouiche@invoxia.com>
To: Yann CARDAILLAC <yann.cardaillac@smile.fr>, alsa-devel@alsa-project.org
Subject: Re: Multiple codecs on one sound card for multi-channel sound card
Date: Mon, 18 Feb 2019 09:32:19 +0100	[thread overview]
Message-ID: <cd655481-e7e0-855d-1c70-068f01b29c27@invoxia.com> (raw)
In-Reply-To: <CAA984JVfAY_DYpiU7G3RdUWpZMi1ExhUtGWey+nBmdOmRXj3HA@mail.gmail.com>

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

  reply	other threads:[~2019-02-18  8:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
  -- 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cd655481-e7e0-855d-1c70-068f01b29c27@invoxia.com \
    --to=arnaud.mouiche@invoxia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=yann.cardaillac@smile.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox