<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: imx8qx sai0 output problem in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/imx8qx-sai0-output-problem/m-p/1252144#M171475</link>
    <description>&lt;P&gt;Hi yildizberat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;one can look at wm8960 example&lt;/P&gt;
&lt;P&gt;&lt;A href="https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8qxp-mek-sof-wm8960.dts?h=imx_5.4.70_2.3.0" target="_blank"&gt;https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8qxp-mek-sof-wm8960.dts?h=imx_5.4.70_2.3.0&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and Figure 27. ALSA SoC Software Architecture&amp;nbsp; &lt;A style="box-sizing: border-box; background-color: transparent; color: #215bd6; text-decoration: none; cursor: pointer;" href="https://www.nxp.com/docs/en/reference-manual/IMX_REFERENCE_MANUAL.pdf" target="_blank" rel="noopener"&gt;i.MX Linux Reference Manual​&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;/P&gt;</description>
    <pubDate>Thu, 25 Mar 2021 11:41:37 GMT</pubDate>
    <dc:creator>igorpadykov</dc:creator>
    <dc:date>2021-03-25T11:41:37Z</dc:date>
    <item>
      <title>imx8qx sai0 output problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx8qx-sai0-output-problem/m-p/1252096#M171466</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a new problem. Can you help me?&lt;/P&gt;&lt;P&gt;I am trying to work imx8qx's sai0 output. At software side everything looks fine. But I cannot any signal sai0's output with&amp;nbsp;oscilloscope. My working stages at below.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Our imx8qx's sai0 pins connect to tas2770 codec. And i2c connect to tas2270 and i2c works.&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Our&amp;nbsp;using kernel version is =&amp;nbsp;5.4.y-1.0.0.&amp;nbsp;This kernel doesn't have&amp;nbsp;​tas2770 driver. For that I use ti's official driver and port to our current kernel. (driver =&amp;nbsp;&lt;A href="https://git.ti.com/cgit/tas2770sw-android/tas2770sw-android/" target="_blank" rel="noopener"&gt;https://git.ti.com/cgit/tas2770sw-android/tas2770sw-android/&lt;/A&gt;) (git =&amp;nbsp;&lt;A href="https://git.ti.com/git/tas2770sw-android/tas2770sw-android.git" target="_blank" rel="noopener"&gt;https://git.ti.com/git/tas2770sw-android/tas2770sw-android.git&lt;/A&gt;​). We can comminucate with tas2770 with i2c. &lt;STRONG&gt;Our porting diff file attached. &amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Then I configure my device-tree :&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sound {
compatible = "simple-audio-card";
simple-audio-card,bitclock-master = &amp;lt;&amp;amp;dailink_master&amp;gt;;
simple-audio-card,format = "i2s";
simple-audio-card,frame-master = &amp;lt;&amp;amp;dailink_master&amp;gt;;
simple-audio-card,name = "tas2770-Audio";   
dailink_master: simple-audio-card,codec {
              sound-dai = &amp;lt;&amp;amp;codec&amp;gt;;
              clocks = &amp;lt;&amp;amp;mclkout0_lpcg 0&amp;gt;;
            };
        cpusai: simple-audio-card,cpu {
            sound-dai = &amp;lt;&amp;amp;sai0&amp;gt;;
            dai-tdm-slot-num = &amp;lt;2&amp;gt;;
            dai-tdm-slot-width = &amp;lt;32&amp;gt;;
             };
};

&amp;amp;i2c1 {
    codec: tas2770@41 {
        compatible = "ti,tas2770";
        #sound-dai-cells = &amp;lt;0&amp;gt;;
        assigned-clocks = &amp;lt;&amp;amp;clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_PLL&amp;gt;,
&amp;lt;&amp;amp;clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_SLV_BUS&amp;gt;,
&amp;lt;&amp;amp;clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_MST_BUS&amp;gt;,
&amp;lt;&amp;amp;mclkout0_lpcg 0&amp;gt;;
assigned-clock-rates = &amp;lt;786432000&amp;gt;, &amp;lt;49152000&amp;gt;, &amp;lt;12000000&amp;gt;, &amp;lt;12000000&amp;gt;;
clocks = &amp;lt;&amp;amp;mclkout0_lpcg 0&amp;gt;;
clock-names = "mclk";
        reg = &amp;lt;0x41&amp;gt;;
        ti,asi-format = &amp;lt;0&amp;gt;;
        ti,left-slot = &amp;lt;0&amp;gt;;
        ti,right-slot = &amp;lt;1&amp;gt;;
        ti,imon-slot-no = &amp;lt;0&amp;gt;;
        ti,vmon-slot-no = &amp;lt;2&amp;gt;;
        #address-cells = &amp;lt;1&amp;gt;;
        #size-cells = &amp;lt;0&amp;gt;;
        ti,reset-gpio = &amp;lt;&amp;amp;portexp 19 GPIO_ACTIVE_LOW&amp;gt;;
        ti,irq-gpio = &amp;lt;&amp;amp;lsio_gpio3 0 GPIO_ACTIVE_LOW&amp;gt;;
    };
};

&amp;amp;sai0 {
#sound-dai-cells = &amp;lt;0&amp;gt;;
pinctrl-names = "default";
pinctrl-0 = &amp;lt;&amp;amp;pinctrl_sai0&amp;gt;;
status = "okay";
fsl,sai-asynchronous;
};

pinctrl_sai0: sai0grp {
fsl,pins = &amp;lt;
IMX8QXP_SPI0_SDI_ADMA_SAI0_TXD 0x06000040
IMX8QXP_SPI0_SCK_ADMA_SAI0_TXC 0x06000040
IMX8QXP_SPI0_SDO_ADMA_SAI0_TXFS 0x06000040
&amp;gt;;
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Before sai0's pins connect to&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;​M40_GPIO0_IO03 at my mex file. For be sure I can pinmux, I added&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;pad_force_mux&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;to scfw file. My scfw diff is :&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;@@ -252,6 +252,20 @@ void board_init(boot_phase_t phase)
         /* Configure SNVS button timing (ON-&amp;gt;OFF 5s, OFF-&amp;gt;ON 100ms) */
         SNVS_ButtonTime(SNVS_DRV_BTN_ON_100MS, SNVS_DRV_BTN_DEBOUNCE_100MS, SNVS_DRV_BTN_PRESS_5S);
 
+        pad_force_mux(SC_P_SPI0_SDO, 1, SC_PAD_CONFIG_OUT_IN,
+            SC_PAD_ISO_OFF);
+
+        pad_force_mux(SC_P_SPI0_SCK, 1, SC_PAD_CONFIG_OUT_IN,
+            SC_PAD_ISO_OFF);
+
+        pad_force_mux(SC_P_SPI0_SDI, 1, SC_PAD_CONFIG_OUT_IN,
+            SC_PAD_ISO_OFF);
+
+        pad_force_mux(SC_P_SPI0_CS0, 1, SC_PAD_CONFIG_OUT_IN,
+            SC_PAD_ISO_OFF);
+
+        board_print(3, "%s(BOOT_PHASE_FINAL_INIT SAI pins configurated - %u)\n", __func__, (unsigned)phase);
+
         break;
     case BOOT_PHASE_TEST_INIT: /* Init HW required for unit tests */
         board_print(3, "%s(BOOT_PHASE_TEST_INIT - %u)\n", __func__, (unsigned)phase);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;And for be sure m4 cortex not effect to sai pin's I generate new flash.bin from mkimage without m4 image. (make SOC=iMX8QX flash) / (flash -&amp;gt; SCU + AP)&lt;/LI&gt;&lt;LI&gt;Lastly everything looks fine at userspace :&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;root@tqma8xqp-mba8xx:~# dmesg | grep tas27 
[    2.219460] tas2770 16-0041: tas2770_i2c_probe enter
[    2.224527] tas2770 16-0041: ti,asi-format=0
[    2.224551] tas2770 16-0041: ti,reset-gpio=507
[    2.224568] tas2770 16-0041: ti,irq-gpio=96
[    2.224574] tas2770 16-0041: ti,left-slot=0
[    2.224580] tas2770 16-0041: ti,right-slot=1
[    2.224586] tas2770 16-0041: ti,imon-slot-no=0
[    2.224592] tas2770 16-0041: ti,vmon-slot-no=2
[    2.224610] tas2770 16-0041: irq = 233
[    2.261280] tas2770 16-0041: tas2770_register_codec, enter
[    3.716892] tas2770 16-0041: tas2770_codec_probe
[    3.721583] tas2770 16-0041: tas2770_codec_read, reg: 0xc, value: 0xa
[    3.721593] tas2770 16-0041: tas2770_codec_read, reg: 0xc, value: 0xa
[    3.721602] tas2770 16-0041: tas2770_codec_read, reg: 0xc, value: 0xa
[    3.721610] tas2770 16-0041: tas2770_codec_read, reg: 0xc, value: 0xa
[    3.721623] tas2770 16-0041: tas2770_codec_read, reg: 0x2, value: 0xe
[    3.721632] tas2770 16-0041: tas2770_codec_read, reg: 0x2, value: 0xe
[    3.721641] debugfs: Directory '59040000.sai' with parent 'tas2770-Audio' already present!
[    3.729954] tas2770 16-0041: tas2770_set_dai_fmt, format=0x1001
[    3.729960] tas2770 16-0041: ASI format master is not found
[    3.735543] tas2770 16-0041: INV format: NBNF
[    3.735551] tas2770 16-0041: tas2770_codec_read, reg: 0xb, value: 0x2
[    3.735558] tas2770 16-0041: tas2770_codec_read, reg: 0xb, value: 0x2
[    3.735565] tas2770 16-0041: tas2770_codec_read, reg: 0xd, value: 0x10
[    3.735571] tas2770 16-0041: tas2770_codec_read, reg: 0xd, value: 0x10
[    3.735578] tas2770 16-0041: tas2770_codec_read, reg: 0xd, value: 0x10
[    3.735583] tas2770 16-0041: slot value: 0x10
[    3.735667] asoc-simple-card sound: tas2770 ASI1 &amp;lt;-&amp;gt; 59040000.sai mapping ok
[    3.748553] tas2770 16-0041: tas2770_codec_read, reg: 0x2, value: 0xe
[    3.748584] tas2770 16-0041: tas2770_codec_read, reg: 0x2, value: 0xe
[    4.114813]   #0: tas2770-Audio
[    8.532424] tas2770 16-0041: tas2770_codec_read, reg: 0x3, value: 0x10
[    8.537366] tas2770 16-0041: tas2770_codec_write, reg: 0x3, 0x14
[    8.537509] tas2770 16-0041: tas2770_codec_read, reg: 0x5, value: 0x0
[    8.537546] tas2770 16-0041: tas2770_codec_read, reg: 0xc, value: 0xa
[    8.537573] tas2770 16-0041: tas2770_codec_read, reg: 0xc, value: 0xa
[    8.537880] tas2770 16-0041: tas2770_codec_write, reg: 0xc, 0x1a
[    8.537923] tas2770 16-0041: tas2770_codec_read, reg: 0x2, value: 0xe
[    8.537956] tas2770 16-0041: tas2770_codec_read, reg: 0x2, value: 0xe
[    8.599187] tas2770 16-0041: tas2770_codec_read, reg: 0x3, value: 0x14
[    8.599235] tas2770 16-0041: tas2770_codec_read, reg: 0x5, value: 0x0
[    8.599266] tas2770 16-0041: tas2770_codec_read, reg: 0xc, value: 0x1a
[    8.599290] tas2770 16-0041: tas2770_codec_read, reg: 0x2, value: 0xe
[    8.599313] tas2770 16-0041: tas2770_codec_read, reg: 0x2, value: 0xe&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;root@tqma8xqp-mba8xx:~# aplay -L

null

    Discard all samples (playback) or generate zero samples (capture)

sysdefault:CARD=tas2770Audio

    tas2770-Audio, 

    Default Audio Device

usbstream:CARD=tas2770Audio

    tas2770-Audio

    USB Stream Output&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;root@tqma8xqp-mba8xx:~# speaker-test 



speaker-test 1.1.9



Playback device is default

Stream parameters are 48000Hz, S16_LE, 1 channels

Using 16 octaves of pink noise

Rate set to 48000Hz (requested 48000Hz)

Buffer size range from 3840 to 5760

Period size range from 1920 to 1920

Using max buf[f e r20 s7i.z7e6 09577610]
 
 tPaesr27i7od0s  1=6- 400

4w1a:s  isrqet_ wpoerrki_ordou_stiiznee 

= 1920

was set buffer_size = 5760

 0 - Front Left

[  207.775724] tas2770 16-0041: IRQ status : 0x4, 0x0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cannot see any digital signal at my som's sai0 pins via oscilloscope.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wam waiting for your helps.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 10:47:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx8qx-sai0-output-problem/m-p/1252096#M171466</guid>
      <dc:creator>draven</dc:creator>
      <dc:date>2021-03-25T10:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: imx8qx sai0 output problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx8qx-sai0-output-problem/m-p/1252144#M171475</link>
      <description>&lt;P&gt;Hi yildizberat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;one can look at wm8960 example&lt;/P&gt;
&lt;P&gt;&lt;A href="https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8qxp-mek-sof-wm8960.dts?h=imx_5.4.70_2.3.0" target="_blank"&gt;https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8qxp-mek-sof-wm8960.dts?h=imx_5.4.70_2.3.0&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and Figure 27. ALSA SoC Software Architecture&amp;nbsp; &lt;A style="box-sizing: border-box; background-color: transparent; color: #215bd6; text-decoration: none; cursor: pointer;" href="https://www.nxp.com/docs/en/reference-manual/IMX_REFERENCE_MANUAL.pdf" target="_blank" rel="noopener"&gt;i.MX Linux Reference Manual​&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 11:41:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx8qx-sai0-output-problem/m-p/1252144#M171475</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2021-03-25T11:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: imx8qx sai0 output problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx8qx-sai0-output-problem/m-p/1256278#M172019</link>
      <description>&lt;P&gt;I wrote a simple machine driver and now it works.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 10:26:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx8qx-sai0-output-problem/m-p/1256278#M172019</guid>
      <dc:creator>draven</dc:creator>
      <dc:date>2021-04-02T10:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: imx8qx sai0 output problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx8qx-sai0-output-problem/m-p/1273774#M173752</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I have the same problem:&lt;/P&gt;&lt;P&gt;On a custom board I'm using a really simple codec (sgtl5000), connected via sai0 to an imx8qxp soc.&lt;/P&gt;&lt;P&gt;My audio codec plays well with 4.19 kernel, but with Yocto kernel 5.4.70 I can't see any signal (clock and data) on I2S bus.&lt;/P&gt;&lt;P&gt;At boot my codec is correctly recognized and linked to the sai0 controller.&lt;/P&gt;&lt;P&gt;With 5.4 kernel I can run "aplay test.vaw", but using the scope I can't see any signal at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please clarify what have you correct in your machine driver ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really many thanks in advance.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 15:40:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx8qx-sai0-output-problem/m-p/1273774#M173752</guid>
      <dc:creator>giuseppepagano1</dc:creator>
      <dc:date>2021-05-07T15:40:28Z</dc:date>
    </item>
  </channel>
</rss>

