Question regarding HDMI Audio support on i.MX6 with vanilla kernel

Luís Mendes luis.p.mendes at gmail.com
Tue Nov 7 10:00:48 UTC 2017


Hi Russell,

Sorry for sending all these emails, but to me dw_hdmi device driver is
broken regarding HDMI detection and audio support. I don't want to waste
your time, but I would like to have your opinion since you're so involved
in the ARM support for the Linux kernel.

First of all dw_hdmi module only enables audio if it is able to read the
edid and decode it properly, otherwise it will be always disabled even when
an EDID is forced through drm_kms_helper.edid_firmware=edid/ktc_edid.bin,
because dw_hdmi_connector_get_modes(...) won't get called, causing  the
edid not to be parsed for audio suppport, nor for the HDMI connector
support. As a result DVI mode will always be used.

I was able to force HDMI audio to work by modifying dw_hdmi.c like this:
static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
{
...
if (edid) {
...
} else {
   hdmi->sink_is_hdmi = 1;
   hdmi->sink_has_audio = 1;
   dev_dbg(hdmi_dev, "failed to get edid\n");
}

Summarizing the issues IMHO with dw_hdmi:
- dw_hdmi fails to read edid even when xf86_video_armada and get-edid are
able to read and decode it
- dw_hdmi should parse the edid when it is forced by
drm_kms_helper.edid_firmware=edid/ktc_edid.bin
- dw_hdmi should provide kernel parameters that allow to force HDMI audio,
like suggested in previous email

With the dw_hdmi code modified with the above I have the audio working, as
shown here:
[    7.244617] dwhdmi-imx 120000.hdmi: Detected HDMI TX controller v1.30a
with HDCP (DWC HDMI 3D TX PHY)
[    7.255293] imx-spdif sound-spdif: snd-soc-dummy-dai <-> 2004000.spdif
mapping ok
[    7.257805] hdmi_set_clk_regenerator:521: dwhdmi-imx 120000.hdmi:
hdmi_set_clk_regenerator: fs=48000Hz ftdms=74.250MHz N=6144 cts=74250
[    7.258519] dw_hdmi_irq:2148: dwhdmi-imx 120000.hdmi: EVENT=plugin
[    7.260120] imx-drm display-subsystem: bound 120000.hdmi (ops
dw_hdmi_imx_ops [dw_hdmi_imx])
[    7.307021] dw_hdmi_connector_get_modes:1919: dwhdmi-imx 120000.hdmi:
failed to get edid
[    7.424568] fsl-asoc-card sound: sgtl5000 <-> 2028000.ssi mapping ok
[    7.588144] dw_hdmi_setup:1679: dwhdmi-imx 120000.hdmi: Non-CEA mode
used in HDMI
[    7.588180] hdmi_av_composer:1495: dwhdmi-imx 120000.hdmi: final pixclk
= 173106000
[    7.588247] dw_hdmi_phy_power_off:1096: dwhdmi-imx 120000.hdmi: PHY
powered down in 0 iterations
[    7.642643] dw_hdmi_phy_power_on:1133: dwhdmi-imx 120000.hdmi: PHY PLL
locked 1 iterations
[    7.642683] dw_hdmi_phy_power_off:1096: dwhdmi-imx 120000.hdmi: PHY
powered down in 0 iterations
[    7.691042] dw_hdmi_phy_power_on:1133: dwhdmi-imx 120000.hdmi: PHY PLL
locked 1 iterations
--> Point 1
[    7.691081] dw_hdmi_setup:1729: dwhdmi-imx 120000.hdmi: sink has audio
support
[    7.691173] hdmi_set_clk_regenerator:521: dwhdmi-imx 120000.hdmi:
hdmi_set_clk_regenerator: fs=48000Hz ftdms=173.106MHz N=6144 cts=173106
--> Point 2
[    7.691237] dw_hdmi_setup:1738: dwhdmi-imx 120000.hdmi: dw_hdmi_setup
HDMI mode

Regards,
Luís


On Tue, Nov 7, 2017 at 9:21 AM, Luís Mendes <luis.p.mendes at gmail.com> wrote:

> It is also interesting that I have forced the EDID by specifying the
> drm_kms_helper.edid_firmware=edid/ktc_edid.bin in the kernel command
> line, and dw_hdmi is still convinced it has no audio, nor HDMI.
>
> [  223.043957] dwhdmi-imx 120000.hdmi: Detected HDMI TX controller v1.30a with HDCP (DWC HDMI 3D TX PHY)
> [  223.047497] hdmi_set_clk_regenerator:521: dwhdmi-imx 120000.hdmi: hdmi_set_clk_regenerator: fs=48000Hz ftdms=74.250MHz N=6144 cts=74250
> [  223.048323] dw_hdmi_irq:2146: dwhdmi-imx 120000.hdmi: EVENT=plugin
> [  223.055143] imx-drm display-subsystem: bound 120000.hdmi (ops dw_hdmi_imx_ops [dw_hdmi_imx])
> [  223.057152] [drm] Got external EDID base block and 1 extension from "edid/ktc_edid.bin" for connector "HDMI-A-1"
> [  223.080466] dw_hdmi_setup:1679: dwhdmi-imx 120000.hdmi: Non-CEA mode used in HDMI
> [  223.080501] hdmi_av_composer:1495: dwhdmi-imx 120000.hdmi: final pixclk = 65000000
> [  223.080552] dw_hdmi_phy_power_off:1096: dwhdmi-imx 120000.hdmi: PHY powered down in 0 iterations
> [  223.091885] dw_hdmi_phy_power_on:1133: dwhdmi-imx 120000.hdmi: PHY PLL locked 1 iterations
> [  223.091910] dw_hdmi_phy_power_off:1096: dwhdmi-imx 120000.hdmi: PHY powered down in 0 iterations
> [  223.103160] dw_hdmi_phy_power_on:1133: dwhdmi-imx 120000.hdmi: PHY PLL locked 1 iterations
>
> -->Here:
>
> [  223.103193] dw_hdmi_setup:1744: dwhdmi-imx 120000.hdmi: dw_hdmi_setup DVI mode
> [  223.140906] Console: switching to colour frame buffer device 128x48
> [  223.152326] imx-drm display-subsystem: fb0:  frame buffer device
> [  223.185475] [drm] Initialized imx-drm 1.0.0 20120507 for display-subsystem on minor 1
> [  224.226887] [drm] Got external EDID base block and 1 extension from "edid/ktc_edid.bin" for connector "HDMI-A-1"
>
>
> On Tue, Nov 7, 2017 at 8:38 AM, Luís Mendes <luis.p.mendes at gmail.com>
> wrote:
>
>> It is interesting that xf86-video-armada is able to get the EDID data,
>> also if I run get-edid from the command line I get:
>> #sudo get-edid > tv.edid
>> This is read-edid version 3.0.2. Prepare for some fun.
>> Attempting to use i2c interface
>> No EDID on bus 0
>> No EDID on bus 2
>> 1 potential busses found: 1
>> 256-byte EDID successfully retrieved from i2c bus 1
>> Looks like i2c was successful. Have a good day.
>>
>> parse-edid shows that the read data is from the TV and is correct.
>>
>> Fabio prepared the DTS files and they look correct too, that is:
>> imx6qdl-wandboard.dtsi
>> ...
>> &hdmi {
>>     ddc-i2c-bus = <&i2c1>;
>>     status = "okay";
>> }
>> ...
>>
>> Could it be that EDID is being read before i2c is initialized? Or a bug
>> in dw-hdmi?
>>
>> Anyway wouldn't it make sense to add a kernel parameter
>> has_audio={-1,0,1}?
>> -1 = auto
>> 0 = force no audio
>> 1 = force audio
>>
>> Then if the user has a kernel command line like:
>> video=HDMI-A-1:1024x768M at 60 dw_hdmi.has_audio=1, then:
>> 1 - dw_hdmi should accept there is a HDMI connection despite it is unable
>> to read the EDID, because video=HDMI-A-1
>> 2 - since dw_hdmi.has_audio=1 then audio and HDMI should be enabled.
>>
>> What do you think? Does it make sense for me do create a patch for this?
>>
>> On Mon, Nov 6, 2017 at 11:46 PM, Russell King - ARM Linux <
>> linux at armlinux.org.uk> wrote:
>>
>>> On Mon, Nov 06, 2017 at 11:33:18PM +0000, Luís Mendes wrote:
>>> > I've enable dynamic debug in the kernel module and got this log below.
>>> > Is it my impression or dw_hdmi goes into DVI mode because is unable to
>>> get
>>> > edid, which is why I don't get sound?
>>> > According to the module code in dw_hdmi_connector_get_modes of
>>> dw-hdmi.c:
>>> > hdmi->sink_is_hdmi and hdmi->sink_has_audio is only set when EDID can
>>> be
>>> > read via I2C DDC.
>>>
>>> Yep, that'll be it then.  I think you need to solve the EDID reading
>>> first.  I'd say, check your pinmux settings.
>>>
>>> If you're using a normal I2C controller rather than dw-hdmi's built-in
>>> DDC, then (iirc) you need different pinmux settings - at least on
>>> imx6q/d/sl that's the case.
>>>
>>> --
>>> RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
>>> FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down
>>> 630kbps up
>>> According to speedtest.net: 8.21Mbps down 510kbps up
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/etnaviv/attachments/20171107/74aa4f5f/attachment-0001.html>


More information about the etnaviv mailing list