<?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 HDMI Audio pitch not consistent between video modes in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/HDMI-Audio-pitch-not-consistent-between-video-modes/m-p/246327#M21475</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On an i.MX6Q embedded Linux device, I have an application with two different video modes available: 1280x1024 and 800x600.&amp;nbsp; Here are the mode specs from /etc/fb.modes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mode "1280x1024 60Hz 24bit"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # D: 107.99 MHz, H: 64.281 KHz, V: 60.08 Hz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometry 1280 1024 1280 5120 24&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; timings 9260 128 128 40 2 144 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; hsync high&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vsync high&lt;/P&gt;&lt;P&gt;endmode&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mode "800x600 59Hz 24bit"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # D: 41.38 MHz, H: 37.754 kHz, V: 59.93 Hz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometry 800 600 1280 5120 24&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; timings 22727 128 96 24 2 144 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; hsync high&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vsync high&lt;/P&gt;&lt;P&gt;endmode&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I use the speaker test to generate a sine wave, e.g. using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;speaker-test -D plughw:0,0 --test sine&lt;/P&gt;&lt;P&gt;(Note: in my hardware/kernel HDMI is the only audio device.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get a different tone (pitch/frequency) depending on which video mode is selected, even though the speaker test is supposed to generate a default frequency of 440 Hz (music note A4) for the sine wave.&amp;nbsp; The difference between the two in the different video modes is easily noticeable.&amp;nbsp; Off hand, I'm not sure if or which one is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know why different frequencies are being output?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Dec 2013 21:54:09 GMT</pubDate>
    <dc:creator>maxj</dc:creator>
    <dc:date>2013-12-05T21:54:09Z</dc:date>
    <item>
      <title>HDMI Audio pitch not consistent between video modes</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/HDMI-Audio-pitch-not-consistent-between-video-modes/m-p/246327#M21475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On an i.MX6Q embedded Linux device, I have an application with two different video modes available: 1280x1024 and 800x600.&amp;nbsp; Here are the mode specs from /etc/fb.modes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mode "1280x1024 60Hz 24bit"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # D: 107.99 MHz, H: 64.281 KHz, V: 60.08 Hz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometry 1280 1024 1280 5120 24&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; timings 9260 128 128 40 2 144 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; hsync high&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vsync high&lt;/P&gt;&lt;P&gt;endmode&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mode "800x600 59Hz 24bit"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # D: 41.38 MHz, H: 37.754 kHz, V: 59.93 Hz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometry 800 600 1280 5120 24&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; timings 22727 128 96 24 2 144 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; hsync high&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vsync high&lt;/P&gt;&lt;P&gt;endmode&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I use the speaker test to generate a sine wave, e.g. using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;speaker-test -D plughw:0,0 --test sine&lt;/P&gt;&lt;P&gt;(Note: in my hardware/kernel HDMI is the only audio device.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get a different tone (pitch/frequency) depending on which video mode is selected, even though the speaker test is supposed to generate a default frequency of 440 Hz (music note A4) for the sine wave.&amp;nbsp; The difference between the two in the different video modes is easily noticeable.&amp;nbsp; Off hand, I'm not sure if or which one is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know why different frequencies are being output?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 21:54:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/HDMI-Audio-pitch-not-consistent-between-video-modes/m-p/246327#M21475</guid>
      <dc:creator>maxj</dc:creator>
      <dc:date>2013-12-05T21:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: HDMI Audio pitch not consistent between video modes</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/HDMI-Audio-pitch-not-consistent-between-video-modes/m-p/246328#M21476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Max,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Neither 1280x1024 or 800x600 is a CEA video mode, so neither is likely to have a proper audio divisor.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.0.35_4.1.0/drivers/video/mxc/mxc_edid.c#L41" style="font-size: 10pt; line-height: 1.5em;" title="https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.0.35_4.1.0/drivers/video/mxc/mxc_edid.c#L41"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; linux-imx6/drivers/video/mxc/mxc_edid.c at boundary-imx_3.0.35_4.1.0 · boundarydevices/linux-imx6 · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The CEA mode indexes are used in a relatively long chain to calculate some divisors in the HDMI PHY:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.0.35_4.1.0/drivers/mfd/mxc-hdmi-core.c#L498" title="https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.0.35_4.1.0/drivers/mfd/mxc-hdmi-core.c#L498"&gt;linux-imx6/drivers/mfd/mxc-hdmi-core.c at boundary-imx_3.0.35_4.1.0 · boundarydevices/linux-imx6 · GitHub&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 22:28:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/HDMI-Audio-pitch-not-consistent-between-video-modes/m-p/246328#M21476</guid>
      <dc:creator>EricNelson</dc:creator>
      <dc:date>2013-12-05T22:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: HDMI Audio pitch not consistent between video modes</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/HDMI-Audio-pitch-not-consistent-between-video-modes/m-p/246329#M21477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Eric.&amp;nbsp; These changes have been applied to mxc-hdmi-core.c in order to get the audio for these video modes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;diff -Naur '--exclude=compile*' '--exclude=mxc_hdmi.c' linux-3.0.35.orig/drivers/mfd/mxc-hdmi-core.c linux-3.0.35/drivers/mfd/mxc-hdmi-core.c&lt;/P&gt;&lt;P&gt;--- linux-3.0.35.orig/drivers/mfd/mxc-hdmi-core.c 2013-09-11 13:04:35.000000000 -0700&lt;/P&gt;&lt;P&gt;+++ linux-3.0.35/drivers/mfd/mxc-hdmi-core.c 2013-11-05 13:34:05.000000000 -0800&lt;/P&gt;&lt;P&gt;@@ -502,15 +502,32 @@&lt;/P&gt;&lt;P&gt;&amp;nbsp; clk_n = hdmi_compute_n(sample_rate, pixel_clk_rate, hdmi_ratio);&lt;/P&gt;&lt;P&gt;&amp;nbsp; clk_cts = hdmi_compute_cts(sample_rate, pixel_clk_rate, hdmi_ratio);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // If pixel-clock isn't one of the Freescale out-of-the-box ones,&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // estimate cts and n values&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( clk_cts == 0 ){&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // From ADV7511 Programming guide:&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // 128 *Fs = Ftmds_clk * (n/cts)&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned int temp;&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clk_n = 6272;&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clk_cts = clk_n * (pixel_clk_rate / (128 * sample_rate));&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // known working values for 99MHz pixel_clk_rate:&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //clk_cts = 110000;&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //clk_n = 6272;&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;+ pr_info("%s: samplerate=%d&amp;nbsp; ratio=%d&amp;nbsp; pixelclk=%d&amp;nbsp; N=%d&amp;nbsp; cts=%d\n",&lt;/P&gt;&lt;P&gt;+ __func__, sample_rate, hdmi_ratio, (int)pixel_clk_rate,&lt;/P&gt;&lt;P&gt;+ clk_n, clk_cts);&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (clk_cts == 0) {&lt;/P&gt;&lt;P&gt;- pr_debug("%s: pixel clock not supported: %d\n",&lt;/P&gt;&lt;P&gt;+ pr_info("%s: pixel clock not supported: %d\n",&lt;/P&gt;&lt;P&gt;&amp;nbsp; __func__, (int)pixel_clk_rate);&lt;/P&gt;&lt;P&gt;&amp;nbsp; return;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Please ignore the unused variable.)&lt;/P&gt;&lt;P&gt;I know in advance that the sample rate is 44100 Hz, which is why (so I believe) I can get away with the hard-coded 6272.&lt;/P&gt;&lt;P&gt;There are also some changes to mxc_edid.c that have been made, but I'm not sure if they're significant.&amp;nbsp; Please let me know if you need to see that as well.&lt;/P&gt;&lt;P&gt;Perhaps this change is also causing the problem?&lt;/P&gt;&lt;P&gt;Anything else that might be missing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 18:58:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/HDMI-Audio-pitch-not-consistent-between-video-modes/m-p/246329#M21477</guid>
      <dc:creator>maxj</dc:creator>
      <dc:date>2013-12-06T18:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: HDMI Audio pitch not consistent between video modes</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/HDMI-Audio-pitch-not-consistent-between-video-modes/m-p/246330#M21478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Max&lt;/P&gt;&lt;P&gt;Had your issue got resolved? If yes, we are going to close the discussion in 3 days. If you still need help, please feel free to reply with an update to this discussion.&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Yixing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2014 06:57:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/HDMI-Audio-pitch-not-consistent-between-video-modes/m-p/246330#M21478</guid>
      <dc:creator>YixingKong</dc:creator>
      <dc:date>2014-02-21T06:57:22Z</dc:date>
    </item>
  </channel>
</rss>

