All monitor audio test cases are failed when the audio of the test machine is DMIC.

Bug #1875526 reported by Gabriel Zhi Chen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox Provider - Base
Fix Released
Medium
Bin Li

Bug Description

[Summary]
All monitor audio test cases are failed when the audio of the test machine is DMIC.
The issue affects audio related test cases:
          audio/1_playback_displayport;
          audio/1_playback_hdmi;
          audio/1_playback_type-c_hdmi;
          audio/1_playback_tpye-c_displayport;
          audio/1_playback_thunderbolt3

[Steps to reproduce]
1. Install OEM image on Jazz2.0-2
2. Login system and install checkbox
3. Execute checkbox and select 'sutton-full-test' to run
4. Select audio/1_playback_displayport_PCI_ID_0x9b41;
          audio/1_playback_hdmi_PCI_ID_0x9b41;
          audio/1_playback_type-c_hdmi_PCI_ID_0x9b41;
          audio/1_playback_tpye-c_displayport_PCI_ID_0x9b41;
          audio/1_playback_thunderbolt3_PCI_ID_0x9b41 to run
5. Verify the result

[Expected result]
All test cases should be passed

[Actual result]
All test cases are failed
Although the cases are failed, but actually, we can hear the test 'tone' from monitors.
The monitor audio works normally, just the test cases are failed.

INFO:===========================[ Saving audio settings ]============================
Traceback (most recent call last):
  File "/tmp/nest-f9gnhgdb.2f078cfefd9cd18aab34c547e2541b686e87352a67ace724aa377b7366841d08/audio_settings", line 9, in <module>
    sys.exit(main())
  File "/usr/lib/python3/dist-packages/checkbox_support/scripts/audio_settings.py", line 378, in main
    set_profile_hdmi()
  File "/usr/lib/python3/dist-packages/checkbox_support/scripts/audio_settings.py", line 133, in set_profile_hdmi
    card, profile = _guess_hdmi_profile(pactl_list)
  File "/usr/lib/python3/dist-packages/checkbox_support/scripts/audio_settings.py", line 71, in _guess_hdmi_profile
    for record in parse_pactl_output(pactl_list).record_list:
  File "/usr/lib/python3/dist-packages/checkbox_support/parsers/pactl.py", line 592, in parse_pactl_output
    return Document.Syntax.parseString(output, parseAll=True)[0]
  File "/usr/lib/python3/dist-packages/pyparsing.py", line 1632, in parseString
    raise exc
  File "/usr/lib/python3/dist-packages/pyparsing.py", line 1626, in parseString
    se._parse( instring, loc )
  File "/usr/lib/python3/dist-packages/pyparsing.py", line 1529, in _parseCache
    value = self._parseNoCache(instring, loc, doActions, callPreParse)
  File "/usr/lib/python3/dist-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/usr/lib/python3/dist-packages/pyparsing.py", line 3395, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/usr/lib/python3/dist-packages/pyparsing.py", line 1529, in _parseCache
    value = self._parseNoCache(instring, loc, doActions, callPreParse)
  File "/usr/lib/python3/dist-packages/pyparsing.py", line 1383, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/usr/lib/python3/dist-packages/pyparsing.py", line 3183, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pyparsing.ParseException: Expected end of text (at char 13360), (line:433, col:1)
ERROR:Failed to find status for device: hdmi
Attempting to initialize Gstreamer pipeline: audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! autoaudiosink
Pipeline initialized, now starting playback.
INFO:==========================[ Restoring audio settings ]==========================

[Failure rate]
100%

[Note]
The issue can reproduce on all DMIC audio platforms.
Please refer to Jazz2.0-2 and Ratchet2.0-2 sosreports in attachments.

[Additional information]
SKU:
Image: sutton-dijkstra-bionic-amd64-20200420-45
Manifest: canonical-oem-sutton-bionic-amd64-20200420-45+sutton-dijkstra-bionic-amd64+iso
system-manufacturer: LENOVO
system-product-name: 20T1Z5AFUS
bios-version: N2YET13W (1.02 )
CPU: Intel(R) Core(TM) i5-10310U CPU @ 1.70GHz (8x)
GPU: 00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:9b41] (rev 02)
kernel-version: 5.0.0-1047-oem-osp1

Related branches

Revision history for this message
Gabriel Zhi Chen (gabrielzchen) wrote :
Revision history for this message
Gabriel Zhi Chen (gabrielzchen) wrote :
Revision history for this message
Gabriel Zhi Chen (gabrielzchen) wrote :
Changed in plainbox-provider-checkbox:
importance: High → Medium
Revision history for this message
Gabriel Zhi Chen (gabrielzchen) wrote :
description: updated
Revision history for this message
Gabriel Zhi Chen (gabrielzchen) wrote :

We did a quick dig, found the pactl.py crash, it will parse the result of 'pactl list', now with DMIC support some format was changed from 'pactl list', so the script crash.

description: updated
Revision history for this message
Gabriel Zhi Chen (gabrielzchen) wrote :

Here is the script:

/usr/lib/python3/dist-packages/checkbox_support/parsers/pactl.py

It failed to check Ports of "Source #2". the '[' is error point.
the pyparsing.ParseException: Expected end of text (at char 13360), (line:433, col:1)

        Ports:
                [In] Headset Microphone: Headset Microphone (priority: 100, not available)

But on the non-dmic laptop, the ports is different, I thought it should be related this issue.

        Ports:
                analog-input-internal-mic: Internal Microphone (priority: 8900)
                analog-input-mic: Microphone (priority: 8700, not available)

Revision history for this message
Gabriel Zhi Chen (gabrielzchen) wrote :

When remove '[In]' or '[Out]' from 'pactl list', there are no crash errors again.

Here is an workaround patch to remove '[' or ']', after that no crash.

--- /usr/lib/python3/dist-packages/checkbox_support/scripts/audio_settings.py 2020-04-23 10:28:39.000000000 -0400
+++ audio_settings.py 2020-04-27 22:51:29.698223676 -0400
@@ -129,8 +129,9 @@
     """
     pactl_list = check_output(
         ['pactl', 'list'], universal_newlines=True, env=unlocalized_env())
+ new_pactl_list = pactl_list.replace("[", "").replace("]", "")

- card, profile = _guess_hdmi_profile(pactl_list)
+ card, profile = _guess_hdmi_profile(new_pactl_list)
     if not profile:
         logging.error('No available port found')
         return 1

Revision history for this message
Gabriel Zhi Chen (gabrielzchen) wrote :

For HDMI test case, <email address hidden> made a summary.

In Ports, we need get the Label name, the label name should not include
' ', '[' or ']', like "analog-input-internal-mic", it should not be
"[In] Headset Microphone".

[In] Headset Microphone: Headset Microphone (priority: 100, not
available)

So the parse script should support the ' ', '[' or ']' in Label name.

Revision history for this message
Bin Li (binli) wrote :

Found the root cause. There are several changes at DMIC devices.
1) The port-name should support the blank space.

For DMIC laptop, it like below, the port-name is "Headset Microphone".

[In] Headset Microphone: Headset Microphone (priority: 100, latency offset: 0 usec, not available)

Before the port-name is simple, it's just "hdmi-output-1".

hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, not available)

I attached the support_space.patch to fix this issue.

python3-checkbox-support: /usr/lib/python3/dist-packages/checkbox_support/parsers/pactl.py

Revision history for this message
Bin Li (binli) wrote :

Found the root cause. There are several changes at DMIC devices. (Con.)
2) The name of port-label changed, so the way to detect HDMI/DP should be changed.

Now
===

[Out] HDMI2: HDMI2/DP2 Output (priority: 400, latency offset: 0 usec, available)

Before
===
hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, not available)

Before we use "HDMI / DisplayPort", but it could not work now, the hdmi_port.patch fix this issue.

python3-checkbox-support: /usr/lib/python3/dist-packages/checkbox_support/scripts/audio_settings.py

Revision history for this message
Bin Li (binli) wrote :

Found the root cause. There are several changes at DMIC devices. (Con.)

3) Sink device name changed, it's not 'hdmi' like before.

Now
===
Name: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.Hdmi2__hw_sofsklhdacard_4__sink

Before
===
Name: alsa_output.pci-0000_01_00.1.hdmi-stereo

I ignore the case in the Hdmi_or_hdmi.patch.

plainbox-provider-checkbox: /usr/lib/plainbox-provider-checkbox/bin/gst_pipeline_test

Revision history for this message
Bin Li (binli) wrote :

I made two MP for this issue, please help review them, thanks!

Changed in plainbox-provider-checkbox:
assignee: nobody → Bin Li (binli)
Bin Li (binli)
Changed in plainbox-provider-checkbox:
status: New → In Progress
Changed in plainbox-provider-checkbox:
milestone: none → 0.54.0
status: In Progress → Fix Committed
Revision history for this message
Gabriel Zhi Chen (gabrielzchen) wrote :

The issue reproduce again on plainbox-provider-checkbox 0.54.0 rc3

When execute those monitor audio test cases, we can hear the test tone from the speaker of monitors, but each result of them is failed always.

Revision history for this message
Gabriel Zhi Chen (gabrielzchen) wrote :
Changed in plainbox-provider-checkbox:
status: Fix Committed → Confirmed
Changed in plainbox-provider-checkbox:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.