Bug 102370 - [CI] Failed assertion: eld_is_valid() in igt@kms_hdmi_inject@inject-audio
Summary: [CI] Failed assertion: eld_is_valid() in igt@kms_hdmi_inject@inject-audio
Status: REOPENED
Alias: None
Product: DRI
Classification: Unclassified
Component: IGT (show other bugs)
Version: XOrg git
Hardware: Other All
: medium normal
Assignee: Intel GFX Bugs mailing list
QA Contact:
URL:
Whiteboard: ReadyForDev
Keywords:
: 105111 110842 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-08-23 11:20 UTC by Martin Peres
Modified: 2019-06-18 11:48 UTC (History)
6 users (show)

See Also:
i915 platform: CFL, GLK, ICL, SKL
i915 features: display/audio


Attachments
Test execution errors (1.85 KB, text/plain)
2019-03-15 11:06 UTC, Ida
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Peres 2017-08-23 11:20:56 UTC
On CI_DRM_2993, the machine shard-snb2 produced the following error while running igt@kms_hdmi_inject@inject-audio:

(kms_hdmi_inject:1606) CRITICAL: Test assertion failure function hdmi_inject_audio, file kms_hdmi_inject.c:236:
(kms_hdmi_inject:1606) CRITICAL: Failed assertion: eld_is_valid()
(kms_hdmi_inject:1606) CRITICAL: Last errno: 2, No such file or directory

Full logs: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_2993/shard-snb2/igt@kms_hdmi_inject@inject-audio.html
Comment 1 Chris Wilson 2017-08-23 14:41:48 UTC
diff --git a/tests/kms_hdmi_inject.c b/tests/kms_hdmi_inject.c
index cb916ac..cb55d2b 100644
--- a/tests/kms_hdmi_inject.c
+++ b/tests/kms_hdmi_inject.c
@@ -246,6 +246,12 @@ hdmi_inject_audio(int drm_fd, drmModeConnector *connector)
        free(edid);
 }
 
+static bool has_proc_asound(void)
+{
+       struct stat st;
+       return stat("/proc/asound", &st) == 0;
+}
+
 igt_main
 {
        int drm_fd;
@@ -263,8 +269,10 @@ igt_main
        igt_subtest("inject-4k")
                hdmi_inject_4k(drm_fd, connector);
 
-       igt_subtest("inject-audio")
+       igt_subtest("inject-audio") {
+               igt_require(has_proc_asound());
                hdmi_inject_audio(drm_fd, connector);
+       }
 
        igt_fixture {
                drmModeFreeConnector(connector);
Comment 2 Martin Peres 2017-08-24 12:39:29 UTC
(In reply to Chris Wilson from comment #1)
> diff --git a/tests/kms_hdmi_inject.c b/tests/kms_hdmi_inject.c
> index cb916ac..cb55d2b 100644
> --- a/tests/kms_hdmi_inject.c
> +++ b/tests/kms_hdmi_inject.c
> @@ -246,6 +246,12 @@ hdmi_inject_audio(int drm_fd, drmModeConnector
> [...]

I can't find this patch on the list. Are you asking me to test it before you cook a proper patch?
Comment 3 Chris Wilson 2017-08-24 12:58:07 UTC
Yes, not even close to being sure what is intended by this test and what its requirements should be.
Comment 4 Martin Peres 2017-08-24 13:41:06 UTC
(In reply to Chris Wilson from comment #3)
> Yes, not even close to being sure what is intended by this test and what its
> requirements should be.

$ stat /proc/asound/
  File: /proc/asound/
  Size: 0               Blocks: 0          IO Block: 1024   directory
Device: 4h/4d   Inode: 4026532007  Links: 4
Access: (0555/dr-xr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2017-08-24 16:30:30.516462761 +0300
Modify: 2017-08-24 16:30:30.516462761 +0300
Change: 2017-08-24 16:30:30.516462761 +0300
 Birth: -

So, I guess this is not the issue.
Comment 5 Jani Nikula 2017-09-21 09:10:39 UTC
Please retest with current drm-tip. Possibly fixed by:

commit ac6c35a4d8c77083525044a192cb1a8711381e94
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Mon Sep 18 21:20:03 2017 +0300

    drm: add backwards compatibility support for drm_kms_helper.edid_firmware

commit 53fd40a90f3c0bdad86ec266ee5df833f54ace39
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Tue Sep 12 11:19:26 2017 +0300

    drm: handle override and firmware EDID at drm_do_get_edid() level
Comment 6 Martin Peres 2017-09-21 16:09:01 UTC
No failures in the last 11 runs, when it used to be 100% reproducible. Seems fixed!
Comment 7 Jani Nikula 2017-09-25 14:10:42 UTC
(In reply to Martin Peres from comment #6)
> No failures in the last 11 runs, when it used to be 100% reproducible. Seems
> fixed!

Thanks! For completeness, it's possible this is fixed by

commit d81fb7fd9436e81fda67e5bc8ed0713aa28d3db2
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Tue Sep 19 18:38:13 2017 +0300

    drm/i915: always update ELD connector type after get modes

instead of the ones mentioned in comment #5.
Comment 8 Marta Löfstedt 2018-03-12 12:17:04 UTC
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_3903/fi-cfl-s2/igt@kms_hdmi_inject@inject-audio.html

(kms_hdmi_inject:1543) CRITICAL: Test assertion failure function hdmi_inject_audio, file kms_hdmi_inject.c:236:
(kms_hdmi_inject:1543) CRITICAL: Failed assertion: eld_is_valid()
(kms_hdmi_inject:1543) CRITICAL: Last errno: 2, No such file or directory
Subtest inject-audio failed.
Comment 10 Marta Löfstedt 2018-03-19 07:05:56 UTC
https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_1/fi-bsw-n3050/igt@kms_hdmi_inject@inject-audio.html

https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_1/fi-ivb-3770/igt@kms_hdmi_inject@inject-audio.html


(kms_hdmi_inject:1707) CRITICAL: Test assertion failure function hdmi_inject_audio, file ../tests/kms_hdmi_inject.c:236:
(kms_hdmi_inject:1707) CRITICAL: Failed assertion: eld_is_valid()
(kms_hdmi_inject:1707) CRITICAL: Last errno: 2, No such file or directory
Subtest inject-audio failed.
Comment 11 Marta Löfstedt 2018-03-26 06:42:50 UTC
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_3975/shard-snb7/igt@kms_hdmi_inject@inject-audio.html

(kms_hdmi_inject:2853) CRITICAL: Test assertion failure function hdmi_inject_audio, file ../tests/kms_hdmi_inject.c:236:
(kms_hdmi_inject:2853) CRITICAL: Failed assertion: eld_is_valid()
(kms_hdmi_inject:2853) CRITICAL: Last errno: 2, No such file or directory
Subtest inject-audio failed.
Comment 12 Martin Peres 2018-04-19 07:23:49 UTC
Also on glk: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_4066/shard-glk8/igt@kms_hdmi_inject@inject-audio.html

(kms_hdmi_inject:1272) CRITICAL: Test assertion failure function hdmi_inject_audio, file ../tests/kms_hdmi_inject.c:236:
(kms_hdmi_inject:1272) CRITICAL: Failed assertion: eld_is_valid()
(kms_hdmi_inject:1272) CRITICAL: Last errno: 2, No such file or directory
Subtest inject-audio failed.
Comment 13 Lakshmi 2018-09-25 09:05:40 UTC
*** Bug 105111 has been marked as a duplicate of this bug. ***
Comment 14 Imre Deak 2018-11-07 10:45:16 UTC
*** Bug 105595 has been marked as a duplicate of this bug. ***
Comment 15 Ida 2019-03-15 11:06:44 UTC
Created attachment 143675 [details]
Test execution errors
Comment 16 Ida 2019-03-15 11:07:41 UTC
This issue is still reproducible on ICL U, errors are in attachments.
(kms_hdmi_inject:5266) CRITICAL: Test assertion failure function hdmi_inject_audio, file ../tests/kms_hdmi_inject.c:236:
Comment 17 Martin Peres 2019-04-11 07:07:25 UTC
Arek checked the test and could not figure out what it is supposed to test. Some of the asserts are lacking any information.

Adding Abdiel and Petri who reviewed the patch that introduced the test. Please explain to us what the test is doing and what the failure means.

Once we have this information, we'll continue with the user impact assessment!
Comment 18 Martin Peres 2019-04-11 07:09:45 UTC
Bumping the priority to high because we don't have any other audio test right now, until the chamelium tests from Simon Ser land!

Looking forward to it though :p
Comment 19 Lakshmi 2019-04-19 18:46:45 UTC
(In reply to Martin Peres from comment #17)
> Arek checked the test and could not figure out what it is supposed to test.
> Some of the asserts are lacking any information.
> 
> Adding Abdiel and Petri who reviewed the patch that introduced the test.
> Please explain to us what the test is doing and what the failure means.
> 
> Once we have this information, we'll continue with the user impact
> assessment!

@Petri/Abdiel can you explain how the failure impacts the user?
Comment 20 Arek Hiler 2019-05-06 11:08:58 UTC
Mika to explain what the test is doing and what are our guesses on why it fails.

Meanwhile, according to what we have discussed in person this is exploring one of the theories: https://patchwork.freedesktop.org/series/60319/
Comment 21 emersion 2019-05-06 14:03:22 UTC
The EDID used advertises no audio support.

(But the kernel seems to happily expose the audio sink on some platforms since the test doesn't always fail? But maybe this is a kernel workaround for bad EDIDs?)

The test will pick the first disconnected HDMI-A connector, force an EDID on it, and check it appears as an ELD in one of the audio cards.

It would help to add more debug information to eld_entry_is_igt and eld_is_valid.
Comment 22 Mika Kahola 2019-05-10 13:01:05 UTC
The tests tries to check if we have valid eld in sound systems /proc/asound/HDMI. Some monitors doesn't support audio so the test first reads EDID from the monitors and then forces audio support on that EDID and computes a new checksum. Finally, this EDID is forced to use. 

The display connector is forced on and the test checks afterwards if we have valid eld on /proc/asound/HDMI/eld#0.0.

This test seems to fail because we are not able to register pins such as

snd_hda_codec_hdmi hdaudioC0D2: HDMI: pin nid 5 not registered
Comment 23 Jani Saarinen 2019-05-24 14:55:32 UTC
This was tested today with ICL-Y and HDMI with monitor and sound was heard, I propose dropping priority and focus on fix the test proper.
Comment 24 CI Bug Log 2019-06-05 08:30:18 UTC
A CI Bug Log filter associated to this bug has been updated:

{- all machines: igt@kms_hdmi_inject@inject-audio - fail - Failed assertion: eld_is_valid() -}
{+ all machines: igt@kms_hdmi_inject@inject-audio - fail - Failed assertion: eld_has_igt() +}


  No new failures caught with the new filter
Comment 25 Martin Peres 2019-06-05 08:30:36 UTC
*** Bug 110842 has been marked as a duplicate of this bug. ***
Comment 27 Lakshmi 2019-06-07 11:36:31 UTC
https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_301/fi-bsw-n3050/igt@kms_hdmi_inject@inject-audio.html
Starting subtest: inject-audio
(kms_hdmi_inject:1429) CRITICAL: Test assertion failure function hdmi_inject_audio, file ../tests/kms_hdmi_inject.c:255:
(kms_hdmi_inject:1429) CRITICAL: Failed assertion: eld_is_valid()
(kms_hdmi_inject:1429) CRITICAL: Last errno: 2, No such file or directory
Subtest inject-audio failed.
Comment 28 Jani Saarinen 2019-06-12 06:40:24 UTC
Mika, Simon, there is now audio tests in Chamelium. Is this test anymore valid?
Comment 29 emersion 2019-06-12 07:52:34 UTC
Yes, these tests are still useful. They don't require a Chamelium device and are faster so they can be run more often.
Comment 30 Mika Kahola 2019-06-13 13:43:30 UTC
At the moment the test is not very useful. We can play audio, for example, with aplay but the test is unable to find a valid ELD.
Comment 31 emersion 2019-06-13 13:47:57 UTC
(In reply to Mika Kahola from comment #30)
> At the moment the test is not very useful. We can play audio, for example,
> with aplay but the test is unable to find a valid ELD.

I'm not sure I understand.

The test checks that ALSA correctly parses EDIDs that advertise audio support. What do you mean by "We can play audio, for example, with aplay"? Playing audio during the injection test isn't very helpful, because we have no way to know it works. Playing audio on a disconnected connector just discards the signal.
Comment 32 Mika Kahola 2019-06-18 10:51:58 UTC
I mean we can play audio with aplay if we have such a monitor connected that has speakers. With the same setup the IGT test case 'kms_hdmi_inject --run-subtest inject-audio' fails. Based on this it seems that parsing EDID is erroneous on the IGT test.
Comment 33 emersion 2019-06-18 10:55:02 UTC
(In reply to Mika Kahola from comment #32)
> I mean we can play audio with aplay if we have such a monitor connected that
> has speakers. With the same setup the IGT test case 'kms_hdmi_inject
> --run-subtest inject-audio' fails. Based on this it seems that parsing EDID
> is erroneous on the IGT test.

I don't think so, because it just werks™ on some other hardware.
Comment 34 emersion 2019-06-18 10:56:04 UTC
(Additionally, I've been using the exact same EDID for playing audio with the Chamelium, and it also works.)
Comment 35 Mika Kahola 2019-06-18 11:13:21 UTC
I forgot to mention that this was discovered, when we were looking audio issues. The first thought, of course, was that there really is an audio issue. This turned out to be not true as aplay can play audio just fine. Therefore, I think this is more a test issue.
Comment 36 emersion 2019-06-18 11:48:04 UTC
Agreed, this is a test issue.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.