<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - [KBL] intel NUC6CAYH no LSPCON HDMI audio output"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=101583#c28">Comment # 28</a>
              on <a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - [KBL] intel NUC6CAYH no LSPCON HDMI audio output"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=101583">bug 101583</a>
              from <span class="vcard"><a class="email" href="mailto:jnuzman@gmail.com" title="Joseph Nuzman <jnuzman@gmail.com>"> <span class="fn">Joseph Nuzman</span></a>
</span></b>
        <pre>Posting to this bug, as <a class="bz_bug_link 
          bz_status_CLOSED  bz_closed"
   title="CLOSED DUPLICATE - [SKL] No HDMI audio on Intel NUC6i7KYK, experimental patch workaround"
   href="show_bug.cgi?id=101793">https://bugs.freedesktop.org/show_bug.cgi?id=101793</a> was
marked as duplicate.

I found some time to track down why ELD connector type was coming up as HDMI
rather than DP.

The ELD for a connector is set using the drm_edid_to_eld() routine (in i915,
reached by get_modes helper).  This drm routine leaves the connector type field
of the ELD for the driver to set.

[    2.172863] [drm:drm_edid_to_eld [drm]] ELD monitor SAMSUNG

Later, the intel_audio_codec_enable() routine sets the connector type field in
ELD correctly as DP.  Note, however, that the enable routine is only called
once.

[    2.429813] [drm:intel_audio_codec_enable [i915]] ELD on
[CONNECTOR:48:DP-1], [ENCODER:47:DDI B]

The audio driver will request a copy of the ELD.  But before that happens, the
drm_edid_to_eld() routine is invoked again, overwriting the ELD and resetting
the connector type previously set.

[    2.877015] [drm:drm_edid_to_eld [drm]] ELD monitor SAMSUNG

After this, the audio driver invokes a call back to get a copy of the ELD. 
This is already missing the corrected connector type field.

[    3.020995] [drm:i915_audio_component_get_eld [i915]] Not valid for port B

Both the drm_edid_to_eld() and i915_audio_component_get_eld() routines will be
called multiple times later, but the connector type field is never set again.

The attached patch sets the connector type field after each time the
intel_connector_update_modes() helper rewrites the ELD.  With the patch
applied, connector type is detected correctly by the audio driver as DP, and
HDMI audio works on my SKL NUC.

$ cat /proc/asound/card0/eld#2.0
monitor_present         1
eld_valid               1
monitor_name            SAMSUNG
connection_type         DisplayPort
eld_version             [0x2] CEA-861D or below
edid_version            [0x3] CEA-861-B, C or D
manufacture_id          0x2d4c
product_id              0xa7a
port_id                 0x0
support_hdcp            0
support_ai              1
audio_sync_delay        0
speakers                [0x1] FL/FR
sad_count               1
sad0_coding_type        [0x1] LPCM
sad0_channels           2
sad0_rates              [0xe0] 32000 44100 48000
sad0_bits               [0xe0000] 16 20 24


Note that the intel_audio_codec_enable() routine is also setting the audio
delay field in the ELD.  It may be that this field should also be set by the
intel_connector_update_modes() routine.  It seems that the audio driver only
uses this field to expose the audio_sync_delay in procfs.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>