thesofproject / sof-test

BSD 3-Clause "New" or "Revised" License
13 stars 46 forks source link

volume-basic-test.sh: switch to .tplg parsing to test topologies v2 #1193

Closed marc-hb closed 6 months ago

marc-hb commented 6 months ago

4 commits

Until now this test was "screen-scraping" amixer output. This was not compatible with v2 topologies which means the test was always SKIP for everything developped on the main branch. Switch to parsing topologies to extract volume kcontrols.

Fixes: https://github.com/thesofproject/sof-test/issues/1069, see also discussion in earlier attempt https://github.com/thesofproject/sof-test/pull/1068.

marc-hb commented 6 months ago

In some test configurations there are many more "volume" kcontrols than found in the topology. Is this expected?

Probably the most extreme example is on stable-v2.2 / topology v1:

jf-cml-hel-rt5682-05:~$ amixer | grep -B1 Capabilities:.*volume

38 "volume" controls!! for instance:

numid=2,iface=MIXER,name='CBJ Boost Volume'
numid=1,iface=MIXER,name='DAC1 Playback Volume'
...

The vast majority of these are NOT in sof-tplg/sof-cml-rt1011-rt5682.tplg which has only PGA1 to PGA7.

Similarly, https://sof-ci.01.org/softestpr/PR1193/build420/devicetest/index.html?model=LNLM_SDW_AIOC&testcase=volume-basic-test

ba-lnlm-rvp-sdw-03:~$ amixer | grep -B1 Capabilities:.*volume

23 volume controls, among others:

'Pre Mixer Deepbuffer Jack Out', 'rt1316-1 Left I Tag Select', 'rt711 FU15 Gain', 'rt714 FU0C Boost', etc.

Yet sof-ipc4-tplg/sof-lnl-rt711-l0-rt1316-l23-rt714-l1.tplg has only 5 PGAs gain.N.M:

PGA: gain.0.1
Pre Mixer Jack Out Playback Volume
PGA: gain.1.1
Post Mixer Jack Out Playback Volume
PGA: gain.15.1
Pre Mixer Deepbuffer Jack Out Volume
PGA: gain.20.1
Amplifier Volume
PGA: gain.21.1
Main Amplifier Volume
plbossart commented 6 months ago
numid=2,iface=MIXER,name='CBJ Boost Volume'
numid=1,iface=MIXER,name='DAC1 Playback Volume'

Those are codec kcontrols.

marc-hb commented 6 months ago

Those are codec kcontrols.

Thanks, @ranj063 just told me: no need to test codec kcontrols (at least not in this "basic" test)

marc-hb commented 6 months ago

Those are codec kcontrols.

Wait, is numid=9,iface=MIXER,name='Master Playback Volume' really a codec kcontrol? The name really does not sound like it (and it's not in sof-ipc4-tplg/sof-hda-generic-ace1-4ch.tplg)

https://sof-ci.01.org/softestpr/PR1193/build420/devicetest/index.html?model=LNLM_RVP_HDA&testcase=volume-basic-test

plbossart commented 6 months ago

You could skip the SOF driver with 'options snd-intel-dspcfg dsp_driver=1' and you would see which controls are from the codec. 'Master Playback' is rather typical of HDaudio codecs.

That said, we should indeed have added an SOF prefix to make all firmware-controls self-explanatory.

marc-hb commented 6 months ago

@ranj063 , @plbossart , I flipped the NO_WNAME setting so one .tplg file goes past the 44 characters limit in order to test the kcontrol truncation issue spotted in:

jf-adlp-rvp-nocodec-8:~/$ amixer controls

numid=14,iface=MIXER,name='gain.17.1 Post Demux Port0 2nd Capture Volu'
numid=15,iface=MIXER,name='gain.18.1 Post Demux DMIC SFX1 Capture Volu'

Then I ran the new test in this PR. It passes without any issue because either amixer or the kernel truncates on BOTH output AND input. In other words, this command works just fine:

$ amixer cget name='gain.17.1 Post Demux Port0 2nd Capture VoluTRUNCATED_DOES_NOT_MATTER'
numid=14,iface=MIXER,name='gain.17.1 Post Demux Port0 2nd Capture Volu'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=45,step=0
  : values=45,45
  | dBscale-min=-90.00dB,step=2.00dB,mute=1

Note the name inside the .tplg file is NOT truncated.

marc-hb commented 6 months ago

volume-basic test results look good, this is ready.

plbossart commented 6 months ago

jf-lnlm-rvp-sdw-1 seems to be in bad shape @fredoh9, was the BIOS revert applied?

[  233.238872] kernel: soundwire sdw-master-0-2: Controller Timed out on bank switch
[  233.238996] kernel: soundwire sdw-master-0-2: multi link bank switch failed: -110
fredoh9 commented 6 months ago

jf-lnlm-rvp-sdw-1 seems to be in bad shape @fredoh9, was the BIOS revert applied?

[  233.238872] kernel: soundwire sdw-master-0-2: Controller Timed out on bank switch
[  233.238996] kernel: soundwire sdw-master-0-2: multi link bank switch failed: -110

I did and run-all-tests.sh tested. I will move it to maintenance mode and double check again.

marc-hb commented 6 months ago

SOFCI TEST