Re: [alsa-devel] [PATCH linux-next v2 9/9] ASoC: rsnd: add busif property to dai stream
From: Kuninori Morimoto
Date: Tue Oct 09 2018 - 20:16:24 EST
Hi Jiada
> >> 1ch: (tdm_slots < 4) Basic mode, (tdm_slots >= 4) TDM Split mode
> >> 2ch: (2 <= tdm_slots < 8) Basic mode, (tdm_slots >= 8) TDM Ex-Split mode
> >> 4ch: (4 <= tdm_slots < 8) Basic mode, (tdm_slots >= 8) TDM Ex-Split mode
> >> 6ch: (6 <= tdm_slots < 8) Basic mode, (tdm_slots == 8) TDM Extended
> >> mode, (8 < tdm_slots) TDM Ex-Split mode
> >> 8ch: (6 <= tdm_slots < 8) TDM Extended mode, (8 <= tdm_slots < 16)
> >> Basic mode, (tdm_slots == 16) TDM Ex-Split
> >> 10ch: TDM Ex-Split mode
> >> 16ch: Basic Mode
> > Sorry, but I couldn't understand what this table means ?
> > For example, what does "1ch" mean ?
> > It looks like "1ch playback by TDM"...
> sorry for vague explanation,
> by "1ch" I mean runtime 1 channel playback
> for example:
> if user plays 1 channel stream, by checking tdm_slots value,
> if it is < 4, then it can't be working in Split mode, so driver will
> automatically set SSI to work in Basic mode, otherwise, SSI will
> work in TDM Split mode.
Hmm... ??
Maybe, we are misunderstanding each other...
In my understanding, if platform can use TDM 8ch Split mode,
user interface will be for example dai0, dai1, dai2, dai3 (= for TDM 8ch).
Here, each daiX can handle stereo sound only.
Then, user can playback like this
aplay -D plughw:0,0 xxx.wav (= will be 1ch, 2ch)
aplay -D plughw:0,1 xxx.wav (= will be 3ch, 4ch)
aplay -D plughw:0,2 xxx.wav (= will be 5ch, 6ch)
aplay -D plughw:0,3 xxx.wav (= will be 7ch, 8ch)
1ch sound will be converted to 2ch by alsalib, and daiX will receive
converted 2ch sound.
SSI always playbacks it as part of TDM 8ch Split mode.
In this platform, it can handle stereo sound only on each daiX,
and always works as TDM Split mode, never works as Basic Mode / TDM Ex-Split mode.
If DAI was dai0, dai1 only, it will be TDM Ex-Split mode.
It depends on tdm-slots, I think.
if tdm-slots was 6ch...
aplay -D plughw:0,0 xxx.wav (= will be 1ch, 2ch, 3ch, 4ch)
aplay -D plughw:0,1 xxx.wav (= will be 5ch, 6ch)
if tdm-slots was 8ch...
aplay -D plughw:0,0 xxx.wav (= will be 1ch, 2ch, 3ch, 4ch, 5ch, 6ch)
aplay -D plughw:0,1 xxx.wav (= will be 7ch, 8ch)
something like this, is my understanding.
> > sound {
> > compatible = "simple-scu-audio-card or new card";
> > ...
> > simple-audio-card,convert-channels = <8>;
> > ...
> > busif0: simple-audio-card,cpu@0 { sound-dai = <&rcar_sound 0>; };
> > busif1: simple-audio-card,cpu@1 { sound-dai = <&rcar_sound 1>; };
> > busif2: simple-audio-card,cpu@2 { sound-dai = <&rcar_sound 2>; };
> > busif3: simple-audio-card,cpu@3 { sound-dai = <&rcar_sound 3>; };
> > simple-audio-card,codec { sound-dai = <&xxx>; };
> > };
> >
> > rcar_sound {
> > dai0 { playback = <&ssiu0 ssi0>; }
> > dai1 { playback = <&ssiu1 ssi0>; }
> > dai2 { playback = <&ssiu2 ssi0>; }
> > dai3 { playback = <&ssiu3 ssi0>; }
> > };
> After re-think about BUSIFx selection, I agree with you,
> it shouldn't be random, and select it via device-tree, as you have
> already demonstrated
> is a good idea
Thank you for understanding my idea.
Nice to know
Best regards
---
Kuninori Morimoto