[alsa-devel] Question about TDM "slot"
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
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.
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 ?
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 ?
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 ?
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 ?
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 ?
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
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
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 ?
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.
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
participants (2)
-
Kuninori Morimoto
-
Mark Brown