Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Question about TDM "slot"
@ 2015-11-17  8:49 Kuninori Morimoto
  2015-11-17 10:52 ` Mark Brown
  0 siblings, 1 reply; 12+ messages in thread
From: Kuninori Morimoto @ 2015-11-17  8:49 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Simon, Liam Girdwood


Hi

I would like to ask you about what does TDM "slot" mean on
snd_soc_of_parse_tdm_slot() / snd_soc_dai_set_tdm_slot().
Is slot = 3 in this case ?

  |     |--- 2ch --> |       |
  | CPU |--- 2ch --> | Codec |
  |     |--- 2ch --> |       |  total 6ch

If this is correct, I have other question about slot_width.
snd_soc_dai_set_tdm_slot comments say

	slot_width: Width in bits for each slot.

Does this mean it will be 2ch x system word bit ?
I know some codec chip have below style.
Does it unexpected ?

  |     |--- 8ch --> |       |
  | CPU |--- 4ch --> | Codec | total 12ch

Best regards
---
Kuninori Morimoto

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

* Re: Question about TDM "slot"
  2015-11-17  8:49 Question about TDM "slot" Kuninori Morimoto
@ 2015-11-17 10:52 ` Mark Brown
  2015-11-18  7:27   ` Kuninori Morimoto
                     ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Mark Brown @ 2015-11-17 10:52 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Simon, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 380 bytes --]

On Tue, Nov 17, 2015 at 08:49:20AM +0000, Kuninori Morimoto wrote:

> I would like to ask you about what does TDM "slot" mean on
> snd_soc_of_parse_tdm_slot() / snd_soc_dai_set_tdm_slot().
> Is slot = 3 in this case ?

>   |     |--- 2ch --> |       |
>   | CPU |--- 2ch --> | Codec |
>   |     |--- 2ch --> |       |  total 6ch

No, 6 - it's expected to be one slot per channel.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: Question about TDM "slot"
  2015-11-17 10:52 ` Mark Brown
@ 2015-11-18  7:27   ` Kuninori Morimoto
  2015-11-18  7:27   ` Kuninori Morimoto
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Kuninori Morimoto @ 2015-11-18  7:27 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Simon, Liam Girdwood


Hi Mark

> > snd_soc_of_parse_tdm_slot() / snd_soc_dai_set_tdm_slot().
> > Is slot = 3 in this case ?
> 
> >   |     |--- 2ch --> |       |
> >   | CPU |--- 2ch --> | Codec |
> >   |     |--- 2ch --> |       |  total 6ch
> 
> No, 6 - it's expected to be one slot per channel.

Thanks. We can have total channel number.
Then do we have common DT settings/method to indicate below ?
I guess we need this settings on both CPU/Codec.

6ch
 - 2ch x 3
 - 6ch x 1
 - ...

12ch
 - 4ch x 3
 - 12ch x 1
 - 8ch x 1 + 4ch x 1
 - ...

Moreover, my IP can output 6ch x 1 sound via 8ch wide
(= with empty 2ch).
I guess I need this settings on both CPU/Codec too.
Do we have common settings/method ?

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

* Re: Question about TDM "slot"
  2015-11-17 10:52 ` Mark Brown
  2015-11-18  7:27   ` Kuninori Morimoto
@ 2015-11-18  7:27   ` Kuninori Morimoto
  2015-11-18  7:28   ` Kuninori Morimoto
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Kuninori Morimoto @ 2015-11-18  7:27 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Simon, Liam Girdwood


Hi Mark

> > snd_soc_of_parse_tdm_slot() / snd_soc_dai_set_tdm_slot().
> > Is slot = 3 in this case ?
> 
> >   |     |--- 2ch --> |       |
> >   | CPU |--- 2ch --> | Codec |
> >   |     |--- 2ch --> |       |  total 6ch
> 
> No, 6 - it's expected to be one slot per channel.

Thanks. We can have total channel number.
Then do we have common DT settings/method to indicate below ?
I guess we need this settings on both CPU/Codec.

6ch
 - 2ch x 3
 - 6ch x 1
 - ...

12ch
 - 4ch x 3
 - 12ch x 1
 - 8ch x 1 + 4ch x 1
 - ...

Moreover, my IP can output 6ch x 1 sound via 8ch wide
(= with empty 2ch).
I guess I need this settings on both CPU/Codec too.
Do we have common settings/method ?

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

* Re: Question about TDM "slot"
  2015-11-17 10:52 ` Mark Brown
  2015-11-18  7:27   ` Kuninori Morimoto
  2015-11-18  7:27   ` Kuninori Morimoto
@ 2015-11-18  7:28   ` Kuninori Morimoto
  2015-11-18  7:29   ` Kuninori Morimoto
  2015-11-18  7:37   ` Kuninori Morimoto
  4 siblings, 0 replies; 12+ messages in thread
From: Kuninori Morimoto @ 2015-11-18  7:28 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Simon, Liam Girdwood


Hi Mark

> > snd_soc_of_parse_tdm_slot() / snd_soc_dai_set_tdm_slot().
> > Is slot = 3 in this case ?
> 
> >   |     |--- 2ch --> |       |
> >   | CPU |--- 2ch --> | Codec |
> >   |     |--- 2ch --> |       |  total 6ch
> 
> No, 6 - it's expected to be one slot per channel.

Thanks. We can have total channel number.
Then do we have common DT settings/method to indicate below ?
I guess we need this settings on both CPU/Codec.

6ch
 - 2ch x 3
 - 6ch x 1
 - ...

12ch
 - 4ch x 3
 - 12ch x 1
 - 8ch x 1 + 4ch x 1
 - ...

Moreover, my IP can output 6ch x 1 sound via 8ch wide
(= with empty 2ch).
I guess I need this settings on both CPU/Codec too.
Do we have common settings/method ?

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

* Re: Question about TDM "slot"
  2015-11-17 10:52 ` Mark Brown
                     ` (2 preceding siblings ...)
  2015-11-18  7:28   ` Kuninori Morimoto
@ 2015-11-18  7:29   ` Kuninori Morimoto
  2015-11-18  7:37   ` Kuninori Morimoto
  4 siblings, 0 replies; 12+ messages in thread
From: Kuninori Morimoto @ 2015-11-18  7:29 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Simon, Liam Girdwood


Hi Mark

> > snd_soc_of_parse_tdm_slot() / snd_soc_dai_set_tdm_slot().
> > Is slot = 3 in this case ?
> 
> >   |     |--- 2ch --> |       |
> >   | CPU |--- 2ch --> | Codec |
> >   |     |--- 2ch --> |       |  total 6ch
> 
> No, 6 - it's expected to be one slot per channel.

Thanks. We can have total channel number.
Then do we have common DT settings/method to indicate below ?
I guess we need this settings on both CPU/Codec.

6ch
 - 2ch x 3
 - 6ch x 1
 - ...

12ch
 - 4ch x 3
 - 12ch x 1
 - 8ch x 1 + 4ch x 1
 - ...

Moreover, my IP can output 6ch x 1 sound via 8ch wide
(= with empty 2ch).
I guess I need this settings on both CPU/Codec too.
Do we have common settings/method ?

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

* Re: Question about TDM "slot"
  2015-11-17 10:52 ` Mark Brown
                     ` (3 preceding siblings ...)
  2015-11-18  7:29   ` Kuninori Morimoto
@ 2015-11-18  7:37   ` Kuninori Morimoto
  2015-11-18 11:30     ` Mark Brown
  4 siblings, 1 reply; 12+ messages in thread
From: Kuninori Morimoto @ 2015-11-18  7:37 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Simon, Liam Girdwood


Hi Mark

> > snd_soc_of_parse_tdm_slot() / snd_soc_dai_set_tdm_slot().
> > Is slot = 3 in this case ?
> 
> >   |     |--- 2ch --> |       |
> >   | CPU |--- 2ch --> | Codec |
> >   |     |--- 2ch --> |       |  total 6ch
> 
> No, 6 - it's expected to be one slot per channel.

Thanks. We can have total channel number.
Then do we have common DT settings/method to indicate below ?
I guess we need this settings on both CPU/Codec.

6ch
 - 2ch x 3
 - 6ch x 1
 - ...

12ch
 - 4ch x 3
 - 12ch x 1
 - 8ch x 1 + 4ch x 1
 - ...

Moreover, my IP can output 6ch x 1 sound via 8ch wide
(= with empty 2ch).
I guess I need this settings on both CPU/Codec too.
Do we have common settings/method ?

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

* Re: Question about TDM "slot"
  2015-11-18  7:37   ` Kuninori Morimoto
@ 2015-11-18 11:30     ` Mark Brown
  2015-11-19  0:33       ` Kuninori Morimoto
  0 siblings, 1 reply; 12+ messages in thread
From: Mark Brown @ 2015-11-18 11:30 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Simon, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 535 bytes --]

On Wed, Nov 18, 2015 at 07:37:51AM +0000, Kuninori Morimoto wrote:

> Thanks. We can have total channel number.
> Then do we have common DT settings/method to indicate below ?

There's some stuff already supported for simple-card - see
snd_soc_of_parse_tdm_slot().  This won't cover all uses but it should be
good for simple uses.

> I guess we need this settings on both CPU/Codec.

Yes.

> I guess I need this settings on both CPU/Codec too.
> Do we have common settings/method ?

Well, the current API should be consistent over all

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: Question about TDM "slot"
  2015-11-18 11:30     ` Mark Brown
@ 2015-11-19  0:33       ` Kuninori Morimoto
  2015-11-27  8:55         ` Kuninori Morimoto
  0 siblings, 1 reply; 12+ messages in thread
From: Kuninori Morimoto @ 2015-11-19  0:33 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Simon, Liam Girdwood


Hi Mark

Thank you for your help.
But I still want to ask about TDM settings

> > Thanks. We can have total channel number.
> > Then do we have common DT settings/method to indicate below ?
> 
> There's some stuff already supported for simple-card - see
> snd_soc_of_parse_tdm_slot().  This won't cover all uses but it should be
> good for simple uses.

In my check, it is caring about
 - tdm slot		: total channel number
 - tdm slot width	: bit width for each channel (?)
 - tdm tx/rx mask	: active slot (?)

tx/rx mask seems care about active/non-active.
We can use it if it sends 6ch sound by using 8ch slot (?).

But it doesn't care about dai connection (?) (= I mean 6ch x 1 or 2ch x 3 etc)
"simple card" should be simple, but CPU/Codec need this "dai connection" information ?
Otherwise, my CPU/Codec can't setup for TDM (= 6ch x 1 or 2ch x 3 etc).
I guess this can be common method, but what do you think ?

And this snd_soc_of_parse_tdm_slot() is called under asoc_simple_card_sub_parse_of().
This means DT is like this ?

	sound {
		compatible = "simple-audio-card";
		...

		cpu {
			sound-dai = <&xxx>;
			dai-tdm-slot-xxx = <xx>;
			dai-tdm-slot-xxx = <xx>;
		};
		codec {
			sound-dai = <&xxx>;
			dai-tdm-slot-xxx = <xx>;
			dai-tdm-slot-xxx = <xx>;
		};
	};

But I wonder it should be this ?

	sound {
		compatible = "simple-audio-card";
		...

		dai-tdm-slot-xxx = <xx>;
		dai-tdm-slot-xxx = <xx>;

		cpu {
			sound-dai = <&xxx>;
		};
		codec {
			sound-dai = <&xxx>;
		};
	};

In my check this "dai-tdm-slot-xxx" is implemented, but no one is using ?
${LINUX}/Documentation/devicetree/bindings/sound/st,sti-asoc-card.txt
is including dai-tdm-slot-width, but it seems it is ignored today ?

I would like to expand dai-tdm-slot-xxx
  1) use common settings for both CPU/Codec
  2) add dai connect information

Best regards
---
Kuninori Morimoto

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

* Re: Question about TDM "slot"
  2015-11-19  0:33       ` Kuninori Morimoto
@ 2015-11-27  8:55         ` Kuninori Morimoto
  2015-11-27 11:36           ` Mark Brown
  0 siblings, 1 reply; 12+ messages in thread
From: Kuninori Morimoto @ 2015-11-27  8:55 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown, Liam Girdwood, Simon


Hi Mark again

> > > Thanks. We can have total channel number.
> > > Then do we have common DT settings/method to indicate below ?
> > 
> > There's some stuff already supported for simple-card - see
> > snd_soc_of_parse_tdm_slot().  This won't cover all uses but it should be
> > good for simple uses.

If my understanding was correct, tdm_slots is not enough for me.
Because my CPU/Codec needs to know 6ch by (6ch) or (2ch + 2ch + 2ch)
(My CPU can output both style)
How to select this ?

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

* Re: Question about TDM "slot"
  2015-11-27  8:55         ` Kuninori Morimoto
@ 2015-11-27 11:36           ` Mark Brown
  2015-11-29 23:49             ` Kuninori Morimoto
  0 siblings, 1 reply; 12+ messages in thread
From: Mark Brown @ 2015-11-27 11:36 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Simon, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 556 bytes --]

On Fri, Nov 27, 2015 at 08:55:01AM +0000, Kuninori Morimoto wrote:

> If my understanding was correct, tdm_slots is not enough for me.
> Because my CPU/Codec needs to know 6ch by (6ch) or (2ch + 2ch + 2ch)
> (My CPU can output both style)
> How to select this ?

I think we'd currently expect the three two channel interfaces to appear
as separate DAIs with their own TDM slots, though with routing within
the CPU you could just always configure them as a single DAI and then
let the choice of connection to the front end DAIs select what gets
routed out.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: Question about TDM "slot"
  2015-11-27 11:36           ` Mark Brown
@ 2015-11-29 23:49             ` Kuninori Morimoto
  0 siblings, 0 replies; 12+ messages in thread
From: Kuninori Morimoto @ 2015-11-29 23:49 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Simon, Liam Girdwood


Hi Mark

Thank you for your help

> > If my understanding was correct, tdm_slots is not enough for me.
> > Because my CPU/Codec needs to know 6ch by (6ch) or (2ch + 2ch + 2ch)
> > (My CPU can output both style)
> > How to select this ?
> 
> I think we'd currently expect the three two channel interfaces to appear
> as separate DAIs with their own TDM slots, though with routing within
> the CPU you could just always configure them as a single DAI and then
> let the choice of connection to the front end DAIs select what gets
> routed out.

Ahh.. OK I understand

Best regards
---
Kuninori Morimoto

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

end of thread, other threads:[~2015-11-29 23:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-17  8:49 Question about TDM "slot" Kuninori Morimoto
2015-11-17 10:52 ` Mark Brown
2015-11-18  7:27   ` Kuninori Morimoto
2015-11-18  7:27   ` Kuninori Morimoto
2015-11-18  7:28   ` Kuninori Morimoto
2015-11-18  7:29   ` Kuninori Morimoto
2015-11-18  7:37   ` Kuninori Morimoto
2015-11-18 11:30     ` Mark Brown
2015-11-19  0:33       ` Kuninori Morimoto
2015-11-27  8:55         ` Kuninori Morimoto
2015-11-27 11:36           ` Mark Brown
2015-11-29 23:49             ` Kuninori Morimoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox