<?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>i.MX ProcessorsのトピックRe: SAI TDM channel offset bug</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/SAI-TDM-channel-offset-bug/m-p/2027707#M232997</link>
    <description>&lt;DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;This is defined on &lt;A href="https://github.com/nxp-imx/linux-imx/blob/b586a521770e508d1d440ccb085c7696b9d6d387/Documentation/devicetree/bindings/sound/tdm-slot.txt#L4" target="_blank"&gt;device tree&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;dai-tdm-slot-tx-mask : Transmit direction slot mask, optional&lt;/P&gt;
&lt;P&gt;dai-tdm-slot-rx-mask : Receive direction slot mask, optional&lt;/P&gt;
&lt;P&gt;There is a .of_xlate_tdm_slot_mask() to specify an explicit mapping of the channels and the slots. If it's absent the default snd_soc_of_xlate_tdm_slot_mask() will be used to generating the tx and rx masks.&lt;/P&gt;
&lt;P&gt;Best regards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Tue, 14 Jan 2025 17:36:45 GMT</pubDate>
    <dc:creator>JorgeCas</dc:creator>
    <dc:date>2025-01-14T17:36:45Z</dc:date>
    <item>
      <title>SAI TDM channel offset bug</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/SAI-TDM-channel-offset-bug/m-p/2027087#M232951</link>
      <description>&lt;P&gt;I have seen some other posts on this subject, but with no solutions or suggestions from NXP.&lt;/P&gt;&lt;P&gt;So, I am bringing it up again.&lt;/P&gt;&lt;P&gt;With SAI setup as TDM, the channels can become unaligned under various circumstances.&lt;/P&gt;&lt;P&gt;For example, with TDM8, you always expect channel 1 to be directly after the FS transition.&lt;/P&gt;&lt;P&gt;But if the BCK/FS clocks are stopped and restarted, the IMX8 will re-arrange the channels in a seemingly random way. For example, everything will be shifted backwards, so channel 1 is in channel 8's slot.&lt;/P&gt;&lt;P&gt;So from a software perspective, we cannot get the expected data because the channels are shifted around.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another condition that has caused this shift to happen: an xrun on SAI2 (normal I2S) results in channel rearrangement on SAI5 (TDM8). This should not happen, of course.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This all seems to be due to either incorrect SAI or SDMA driver code, or perhaps a combination of both.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 00:33:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/SAI-TDM-channel-offset-bug/m-p/2027087#M232951</guid>
      <dc:creator>inojosh</dc:creator>
      <dc:date>2025-01-14T00:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAI TDM channel offset bug</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/SAI-TDM-channel-offset-bug/m-p/2027707#M232997</link>
      <description>&lt;DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;This is defined on &lt;A href="https://github.com/nxp-imx/linux-imx/blob/b586a521770e508d1d440ccb085c7696b9d6d387/Documentation/devicetree/bindings/sound/tdm-slot.txt#L4" target="_blank"&gt;device tree&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;dai-tdm-slot-tx-mask : Transmit direction slot mask, optional&lt;/P&gt;
&lt;P&gt;dai-tdm-slot-rx-mask : Receive direction slot mask, optional&lt;/P&gt;
&lt;P&gt;There is a .of_xlate_tdm_slot_mask() to specify an explicit mapping of the channels and the slots. If it's absent the default snd_soc_of_xlate_tdm_slot_mask() will be used to generating the tx and rx masks.&lt;/P&gt;
&lt;P&gt;Best regards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Jan 2025 17:36:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/SAI-TDM-channel-offset-bug/m-p/2027707#M232997</guid>
      <dc:creator>JorgeCas</dc:creator>
      <dc:date>2025-01-14T17:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAI TDM channel offset bug</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/SAI-TDM-channel-offset-bug/m-p/2027711#M232998</link>
      <description>&lt;P&gt;As addressed in other posts on this topic, this isn't really relevant to the bug in question.&lt;/P&gt;&lt;P&gt;I am using TDM8, and all slots are active, so the mask serves no purpose.&lt;/P&gt;&lt;P&gt;The problem is that the channels are re-arranged during runtime, when either of the two things occur (and probably other things, but these are the two I know of):&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1. The BCK/FS clocks are stopped and restarted. For example, when the SAI is slave, and the clocks are externally generated by a DSP, etc. In this case the iMX8 driver code does not recognize the resyncing of FS, and the channels are offset within the TDM frame.&lt;/P&gt;&lt;P&gt;2. There is an xrun. In my case, I can see an xrun occuring on a&amp;nbsp;&lt;EM&gt;different&amp;nbsp;&lt;/EM&gt;SAI running I2S results in a channel shift on a&amp;nbsp;SAI running TDM.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 17:48:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/SAI-TDM-channel-offset-bug/m-p/2027711#M232998</guid>
      <dc:creator>inojosh</dc:creator>
      <dc:date>2025-01-14T17:48:13Z</dc:date>
    </item>
  </channel>
</rss>

