Skip to content

Conversation

@plbossart
Copy link
Member

I am not happy with the nocodec topologies on cAVS platforms!

a) the DMIC tests are only a subset of what we use in actual platforms (no IIR, 2ch only, no DMIC 16kHz)
b) the SSP configurations are all over the place (formats, etc).
c) there's copy-paste everywhere for no good reason
d) there's no support for multi-cores.
e) not all platforms are supported.
f) there is a mixer only for APL (WHY?)

We can align with more macros. This PR suggests a SINGLE sof-cavs-nocodec.m4 which uses the PLATFORM information to infer which SSPs to use and which cores to schedule things on.

This is still WIP, e.g. the APL mixer was removed as an initial step, hence the draft status.

I smoke-tested this on APL-Up2 and the data shows up on the connector. The only change is that we now have 2 dmic devices and the SSP5 is shown as device2, port5. More tests are required before merge.

**** List of PLAYBACK Hardware Devices ****
card 0: sofnocodec [sof-nocodec], device 0: Port0 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofnocodec [sof-nocodec], device 1: Port1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofnocodec [sof-nocodec], device 2: Port5 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
root@plb-UP-APL01:~# arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: sofnocodec [sof-nocodec], device 0: Port0 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofnocodec [sof-nocodec], device 1: Port1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofnocodec [sof-nocodec], device 2: Port5 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofnocodec [sof-nocodec], device 10: DMIC (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofnocodec [sof-nocodec], device 11: DMIC16kHz (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
root@plb-UP-APL01:~# 

@plbossart
Copy link
Member Author

Up2 has two reported problems on my machine - only one reported by CI:

simultaneous-playback-capture; suspend-resume;

@ranj063 do we still have an issue with nocodec+dynamic pipelines on APL?

+ /root/sof-test/test-case/check-suspend-resume.sh -l 1
2021-06-18 21:48:41 UTC Sub-Test: [INFO] Current suspend/resume type mode: s2idle [deep]
2021-06-18 21:48:42 UTC Sub-Test: [INFO] ===== Round(1/1) =====
2021-06-18 21:48:42 UTC Sub-Test: [COMMAND] Run the command: rtcwake -m mem -s 5
rtcwake: assuming RTC uses UTC ...
rtcwake: wakeup from "mem" using /dev/rtc0 at Fri Jun 18 21:48:48 2021
2021-06-18 21:48:50 UTC Sub-Test: [COMMAND] sleep for 5
2021-06-18 21:48:55 UTC Sub-Test: [INFO] Check for the kernel log status
declare -- cmd="journalctl_cmd --since=@1624052917"
2021-06-18 21:48:55 UTC [ERROR] Caught kernel log error
===========================>>
[ 2007.195527] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: ipc error for 0x80010000 size 12
[ 2007.195591] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: failed resetting DAI config for SSP0.OUT
[ 2007.272755] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: ipc error for 0x30010000 size 20
[ 2007.272773] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: failed to load widget SSP0.IN
[ 2007.272782] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: failed setting up DAI widget SSP0.IN
[ 2007.272791] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: ASoC: error at snd_soc_pcm_dai_prepare on SSP0 Pin: -22
[ 2007.272801] kernel:  NoCodec-0: ASoC: soc_pcm_prepare() failed (-22)
[ 2007.272810] kernel:  Port0: ASoC: dpcm_be_dai_prepare() failed (-22)
[ 2007.272820] kernel:  Port0: ASoC: dpcm_fe_dai_prepare() failed (-22)
[ 2007.275293] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: ipc error for 0x30010000 size 20
[ 2007.275310] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: failed to load widget SSP0.IN
[ 2007.276040] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: failed widget list set up for pcm 0 dir 1
[ 2007.276054] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: ASoC: error at snd_soc_pcm_component_hw_params on 0000:00:0e.0: -22
[ 2007.276095] kernel:  Port0: ASoC: soc_pcm_hw_params() failed (-22)
[ 2007.276120] kernel:  Port0: ASoC: dpcm_fe_dai_hw_params failed (-22)
[ 2007.277428] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: ipc error for 0x30010000 size 20
[ 2007.277446] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: failed to load widget SSP0.IN
[ 2007.278149] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: failed widget list set up for pcm 0 dir 1
[ 2007.278162] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: ASoC: error at snd_soc_pcm_component_hw_params on 0000:00:0e.0: -22
[ 2007.278203] kernel:  Port0: ASoC: soc_pcm_hw_params() failed (-22)
[ 2007.278228] kernel:  Port0: ASoC: dpcm_fe_dai_hw_params failed (-22)
[ 2007.279703] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: ipc error for 0x30010000 size 20
[ 2007.279719] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: failed to load widget SSP0.IN
[ 2007.280421] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: failed widget list set up for pcm 0 dir 1
[ 2007.280433] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: ASoC: error at snd_soc_pcm_component_hw_params on 0000:00:0e.0: -22
[ 2007.280473] kernel:  Port0: ASoC: soc_pcm_hw_params() failed (-22)
[ 2007.280498] kernel:  Port0: ASoC: dpcm_fe_dai_hw_params failed (-22)
[ 2007.281963] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: ipc error for 0x30010000 size 20
[ 2007.281979] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: failed to load widget SSP0.IN
[ 2007.282767] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: error: failed widget list set up for pcm 0 dir 1
[ 2007.282781] kernel: sof-audio-pci-intel-apl 0000:00:0e.0: ASoC: error at snd_soc_pcm_component_hw_params on 0000:00:0e.0: -22
[ 2007.282822] kernel:  Port0: ASoC: soc_pcm_hw_params() failed (-22)
[ 2007.282888] kernel:  Port0: ASoC: dpcm_fe_dai_hw_params failed (-22)
<<===========================
2021-06-18 21:48:55 UTC Sub-Test: [ERROR] Caught error in kernel log
2021-06-18 21:48:55 UTC Sub-Test: [ERROR] Starting func_exit_handler(), exit status=1, FUNCNAME stack:
2021-06-18 21:48:55 UTC Sub-Test: [ERROR]  die()  @  /root/sof-test/test-case/../case-lib/lib.sh
2021-06-18 21:48:55 UTC Sub-Test: [ERROR]  main()  @  /root/sof-test/test-case/check-suspend-resume.sh:91

@plbossart
Copy link
Member Author

@aiChaoSONG @fredoh9 the simultaneous playback-capture error is an sof-test issue. The scripts are trying to use a non-existent device hw:0,10 on playback.

https://sof-ci.01.org/sofpr/PR4378/build9433/devicetest/?model=APL_UP2_NOCODEC&testcase=simultaneous-playback-capture

Test Case URL: https://github.com/thesofproject/sof-test/tree/master/test-case/simultaneous-playback-capture.sh
cmd: TPLG=sof-apl-nocodec.tplg ~/sof-test/test-case/simultaneous-playback-capture.sh
====================
framework load: ssh  ubuntu@sh-apl-up2-nocodec-04.sh.intel.com  'nohup bash -c "TPLG=sof-apl-nocodec.tplg ~/sof-test/test-case/simultaneous-playback-capture.sh 2>&1 | nc -N 10.239.156.45 59429" >/dev/null &'
====================
framework run: 'netcat -l -k 59429'
====================
2021-06-18 21:46:41 UTC [REMOTE_INFO] /home/ubuntu/sof-test/test-case/simultaneous-playback-capture.sh will use topology /lib/firmware/intel/sof-tplg/sof-apl-nocodec.tplg to run the test case
2021-06-18 21:46:41 UTC [REMOTE_INFO] Pipeline list to ignore is specified, will ignore 'pcm=HDA Digital' in test case
2021-06-18 21:46:41 UTC [REMOTE_INFO] Run command to get pipeline parameters
2021-06-18 21:46:41 UTC [REMOTE_COMMAND] sof-tplgreader.py /lib/firmware/intel/sof-tplg/sof-apl-nocodec.tplg -f 'id:0,1,2' -b ' pcm:HDA Digital' -s 0 -e
/usr/bin/jq
2021-06-18 21:46:42 UTC [REMOTE_INFO] Starting /usr/local/bin/sof-logger -t -l /etc/sof/sof-apl.ldc -o /home/ubuntu/sof-test/logs/simultaneous-playback-capture/2021-06-18-21:46:41-23177/slogger.txt
2021-06-18 21:46:42 UTC [REMOTE_INFO] ===== Testing: (Loop: 1/1) =====
2021-06-18 21:46:42 UTC [REMOTE_COMMAND] aplay -D hw:0,10 -c 4 -r 48000 -f S16_LE /dev/zero -q &
aplay: main:830: audio open error: No such file or directory
2021-06-18 21:46:42 UTC [REMOTE_COMMAND] arecord -D hw:0,11 -c 4 -r 16000 -f S16_LE /dev/null -q &
2021-06-18 21:46:42 UTC [REMOTE_INFO] Preparing to sleep for 5
2021-06-18 21:46:47 UTC [REMOTE_INFO] check pipeline after 5s
/home/ubuntu/sof-test/test-case/simultaneous-playback-capture.sh: line 104: kill: (13081) - No such process
2021-06-18 21:46:47 UTC [REMOTE_ERROR] Error in aplay process after sleep.
/home/ubuntu/sof-test/test-case/simultaneous-playback-capture.sh: line 66: kill: (13081) - No such process
2021-06-18 21:46:47 UTC [REMOTE_ERROR] Starting func_exit_handler(), exit status=1, FUNCNAME stack:
2021-06-18 21:46:47 UTC [REMOTE_ERROR]  func_error_exit()  @  /home/ubuntu/sof-test/test-case/simultaneous-playback-capture.sh
2021-06-18 21:46:47 UTC [REMOTE_ERROR]  main()  @  /home/ubuntu/sof-test/test-case/simultaneous-playback-capture.sh:105
2021-06-18 21:46:47 UTC [REMOTE_INFO] Starting /usr/local/bin/sof-logger  -l /etc/sof/sof-apl.ldc -o /home/ubuntu/sof-test/logs/simultaneous-playback-capture/2021-06-18-21:46:41-23177/etrace.txt
2021-06-18 21:46:50 UTC [REMOTE_INFO] pkill -TERM sof-logger
Terminated
2021-06-18 21:46:51 UTC [REMOTE_INFO] nlines=3 /home/ubuntu/sof-test/logs/simultaneous-playback-capture/2021-06-18-21:46:41-23177/etrace.txt
2021-06-18 21:46:51 UTC [REMOTE_INFO] Test Result: FAIL!

Man, I managed to break just about everything today!

@marc-hb
Copy link
Collaborator

marc-hb commented Jun 18, 2021

@ranj063 do we still have an issue with nocodec+dynamic pipelines on APL?

Wasn't this reverted in #4323 ?

Man, I managed to break just about everything today!

If it's not tested then it does not work...

@fredoh9
Copy link
Contributor

fredoh9 commented Jun 19, 2021

@aiChaoSONG @fredoh9 the simultaneous playback-capture error is an sof-test issue. The scripts are trying to use a non-existent device hw:0,10 on playback.

Looks there is a bug on sof-test. it is supposed to look for 'both' pipeline, but hw:0,10 is DMIC. I will take a look.

@fredoh9
Copy link
Contributor

fredoh9 commented Jun 21, 2021

@aiChaoSONG @fredoh9 the simultaneous playback-capture error is an sof-test issue. The scripts are trying to use a non-existent device hw:0,10 on playback.

Looks there is a bug on sof-test. it is supposed to look for 'both' pipeline, but hw:0,10 is DMIC. I will take a look.

@chao made a fix for this, thesofproject/sof-test#713. Currently under review.

@plbossart
Copy link
Member Author

@aiChaoSONG @fredoh9 the simultaneous playback-capture error is an sof-test issue. The scripts are trying to use a non-existent device hw:0,10 on playback.

Looks there is a bug on sof-test. it is supposed to look for 'both' pipeline, but hw:0,10 is DMIC. I will take a look.

@chao made a fix for this, thesofproject/sof-test#713. Currently under review.

Oh my, we've been using hw:10 for a while for SoundWire topologies, not sure how we avoided this case.

PCM1   capture 	Jack In

PCM10  capture	DMIC
PCM11  capture	DMIC16kHz
PCM12  capture 	BufferedMic (aka KPB)
PCM13  playback Bluetooth
PCM14  capture 	Bluetooth

@plbossart
Copy link
Member Author

let's re-run this when the sof-test fix is merged. I tested it and so far no issues.

@lgirdwood
Copy link
Member

@fredoh9 can you ping this PR once test changes are merged. Thanks.

@ranj063
Copy link
Collaborator

ranj063 commented Jun 21, 2021

@ranj063 do we still have an issue with nocodec+dynamic pipelines on APL?

@plbossart yes. you need my thesofproject/linux#2974 to fix that. Please bear with me for one more day. I'm also adding support for multi-core with dynamic pipelines. I will update this one and create a new one ASAP

@marc-hb
Copy link
Collaborator

marc-hb commented Jun 21, 2021

Oh my, we've been using hw:10 for a while for SoundWire topologies, not sure how we avoided this case.

It's the usual "green failures" a.k.a. "not testing the tests". Writing them and getting them into production even when they have never ever FAILED once and never proved that they are capable of actually catching and reporting any failure. Not even locally on the system of neither the test author nor the feature author. This is much more harmful and costly than the more common lack of coverage.

For instance simply reverting a bug fix with a single commit and run a test again to check coverage is apparently something extraordinary that took 4 months in #3522 (comment)

Many other examples in thesofproject/sof-test#312, thesofproject/sof-test#702 and others.

@fredoh9
Copy link
Contributor

fredoh9 commented Jun 21, 2021

thesofproject/sof-test#715 is merged now

@plbossart
Copy link
Member Author

SOFCI TEST

@ranj063
Copy link
Collaborator

ranj063 commented Jun 21, 2021

@plbossart apart from sof-apl-nocodec, none of the other topologies changed here will get tested by the PR device test. Do we want to run a daily test instead?

@plbossart
Copy link
Member Author

@plbossart apart from sof-apl-nocodec, none of the other topologies changed here will get tested by the PR device test. Do we want to run a daily test instead?

There's no CNL nocodec test device so you'll have to trust my results.
For TGL/ADL we can ask for more tests. @fredoh9 can you help?

@fredoh9
Copy link
Contributor

fredoh9 commented Jun 21, 2021

For TGL/ADL nocodec, I can run a test today.

@ranj063
Copy link
Collaborator

ranj063 commented Jun 21, 2021

There's no CNL nocodec test device so you'll have to trust my results.

@plbossart how is cnl nocodec with dynamic pipelines and nulti-core passing for you?

Prepare for use of common file

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
We first want to enable the simplified topologies, then multi-core
then dynamic pipelines. The latter two cases will be handled in
follow-up patches.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Remove all the hard-coding and use macros.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Prepare for reuse across all platforms. For now this still uses
single-core.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
No idea what we add artificial limitations on formats

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart
Copy link
Member Author

As discussed, I removed the dynamic pipelines and multi-core. I still see errors on TGL-nocodec on my local test platforms, not sure why. CI is sill using the development/sof-tgl-nocodec-ci.tplg so the problems should not show with this PR until @fredoh9 changes the configurations

@lgirdwood
Copy link
Member

@fredoh9 can you rerun the CI after your CI changes are made and I'll merge tomorrow if all is well. Thanks !

use platform name to infer root clocks

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Prepare for use on APL to use SSP0,1, 5, all other platforms use SSP0,1,2

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add macros to quickly enable multi-core with DMICs

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
…ions

Not all devices have 4 cores, some only have 2 and even APL/GLK is
currently limited to a single core.

For now we still use a single core for all topologies, we will enable
multi-core in a follow-up patch.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The beginning of the end of insanity?

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Move the existing sof-apl-nocodec to the development folder, in case
SOF CI still wants to use it.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@keyonjie
Copy link
Contributor

@plbossart this changes the SSP counts on APL, it was 6 and now 3.

@lgirdwood
Copy link
Member

lgirdwood commented Jun 25, 2021

@plbossart this changes the SSP counts on APL, it was 6 and now 3.

I think this is good, APL has the smallest memory so it makes sense using the memory for testing different components instead of testing different SSP ports.

@lgirdwood
Copy link
Member

@fredoh9 CI all green, but APL HDA has not run - I'm assuming we need a reboot ?
@plbossart think we are good to merge if APL HDA is good, can you changes to non draft.

@plbossart
Copy link
Member Author

@plbossart this changes the SSP counts on APL, it was 6 and now 3.

No it doesn't. I tested on APL-up2 with SSP5, works fine.

The existing tests no longer test all SSPs anyways, we tested exactly four and now it's down to three.

Compare the initial sof-apl-nocodec

sof-apl-nocodec

with the new one.

sof-apl-nocodec (1)

The only changes are the removal of the mixer and removal of SSP3. I will re-add the mixer later later but one thing at a time.

@plbossart plbossart marked this pull request as ready for review June 25, 2021 15:14
@plbossart
Copy link
Member Author

plbossart commented Jun 25, 2021

@lgirdwood ready to merge IMHO.

we've tested on multiple platforms. @fredoh9 tested on ADL-nocodec, we don't see issuea reported.
I also replied to @keyonjie 's feedback, we did reduce the number of SSPs from 4 to 3, but kept SSP5 and added the 2 dmics, so overall I think there is no loss of coverage.

Next steps will be to add multicore, then dynamic pipelines, then a mixer.

@plbossart
Copy link
Member Author

I don't like to merge my own PRs, but the results seem to be fine (Up2-hda uses a different topology) and it's already beer-o'clock in multiple parts of the world. Will merge so that we see the complete results early next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants