AnsweredAssumed Answered

Use of SSI/AUDMUX without a real codec

Question asked by Marco Oman on Mar 28, 2018
Latest reply on Apr 2, 2018 by igorpadykov

Hello everybody,

 

I am working on a QWKS-SCMIMX6DQ and I want to test SSI. I have followed what is written here:

[alsa-devel] Imx6 i2s master driver without i2c 

So I added a file to the kernel (attached) and modified the device tree. The most relevant part of the device tree is the end of the message, anyway attached there is the full file. I also disabled ecspi1 since shares some pins on the connector

 

It nearly works. I can see bit clock (AUD4_TXC), frame clock (AUD4_TXFS) but I do not see any data.

I added some printks to the kernel to see what is going on, below there is a sample. As you can see aplay terminates with an Input/Output error, it is aware of the fact that data did not passed through.

 

And finally to the key question: I am able to trace most things but I am missing how DMA enters into the game. Looks active but I do not know how (nor I added any info about it in the device tree - its is unclear to me how it could be done).

 

 root@imx6dqscm-1gb-qwks-rev3:~# aplay -v -D hw:2,0 Aria.wav
        sound/soc/fsl/fsl_ssi.c fsl_ssi_startup
Playing WAVE 'Aria.wav' : --> INNO imx-inno-hw-params NAME=2028000.ssi
 VALUE=0x00004001  SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS
Signed 16 bit Little Endian, Rate       sound/soc/fsl/fsl_ssi.c fsl_ssi_set_dai_fmt 00004001
 44100 Hz, Mono
        sound/soc/fsl/fsl_ssi.c fsl_ssi_setup_reg_vals, use_dma = 1
        sound/soc/fsl/fsl_ssi.c fsl_ssi_set_dai_fmt use_dma = 1, wm = 13
--> INNO imx-inno-hw-params set tdm slots channels=1, rate=44100
        sound/soc/fsl/fsl_ssi.c fsl_ssi_set_dai_tdm_slots
--> INNO imx-audmux-config set sysclk NAME=2028000.ssi
        sound/soc/fsl/fsl_ssi.c fsl_ssi_set_bclk
        sound/soc/fsl/fsl_ssi.c fsl_ssi_set_bclk
Hardware PCM card 2 'imx-audio-inno' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels      sound/soc/fsl/fsl_ssi.c fsl_ssi_trigger 1
        sound/soc/fsl/fsl_ssi.c fsl_ssi_tx_config 1
        sound/soc/fsl/fsl_ssi.c fsl_ssi_config scr_val = 00001190
        sound/soc/fsl/fsl_ssi.c fsl_ssi_config scr_val = 00001190, nr=0
        sound/soc/fsl/fsl_ssi.c fsl_ssi_config
        sound/soc/fsl/fsl_ssi.c fsl_ssi_config done for 0 streams, scr=00000003
        sound/soc/fsl/fsl_ssi.c fsl_ssi_config
                scr=00001193 sier=009031a3 srcr=0000034d stcr=000003ed
   : 1
  rate         : 44100
  exact rate   : 44100 (44100/1)

...

aplay: pcm_write:1940:  sound/soc/fsl/fsl_ssi.c fsl_ssi_trigger 0
        sound/soc/fsl/fsl_ssi.c fsl_ssi_tx_config 0
        sound/soc/fsl/fsl_ssi.c fsl_ssi_config scr_val = 00001193
        sound/soc/fsl/fsl_ssi.c fsl_ssi_config scr_val = 00001193, nr=1
        sound/soc/fsl/fsl_ssi.c fsl_ssi_config
        sound/soc/fsl/fsl_ssi.c fsl_ssi_config done for 1 streams, scr=00000003
        sound/soc/fsl/fsl_ssi.c fsl_ssi_config
                scr=00001190 sier=00003002 srcr=0000034d stcr=0000036d
write error: Input/output error

 

sound {
        compatible = "fsl,imx-audio-inno";
        model = "imx-inno";
        ssi-controller = <&ssi1>;
        audio-codec = <&codec_test>;
        mux-int-port = <1>;
        mux-ext-port = <4>;
        status = "okay";
    };
    codec_test: codec_test {
        compatible = "linux,snd-soc-dummy";
        #sound-dai-cells = <0>;
        status = "okay";
    };

 

...

 

&ssi1 {

    compatible = "fsl,imx51-ssi";
     fsl,mode="i2s-master";
    status = "okay";
};

 

&audmux {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_audmux_4>;
    status = "okay";
};

        pinctrl_audmux_4: audmux-4 {
            fsl,pins = <
                MX6QDL_PAD_DISP0_DAT20__AUD4_TXC  0x130b0
                MX6QDL_PAD_DISP0_DAT21__AUD4_TXD  0x110b0
                MX6QDL_PAD_DISP0_DAT22__AUD4_TXFS 0x130b0
                MX6QDL_PAD_DISP0_DAT23__AUD4_RXD  0x130b0
                    >;
            };

Outcomes