Repository navigation
[BUG][Zephyr] multiple-pipeline-capture-200.sh fails on ADLP-NOCODEC #5556
Copy link
Copy link
Closed
Labels
ADLApplies to Alder Lake platformApplies to Alder Lake platformP1Blocker bugs or important featuresBlocker bugs or important featuresTGLApplies to Tiger LakeApplies to Tiger LakeZephyrIssues only observed with Zephyr integratedIssues only observed with Zephyr integratedbugSomething isn't working as expectedSomething isn't working as expected
Milestone
Description
Describe the bug
To Reproduce
TPLG=/lib/firmware/intel/sof-tplg/sof-adl-nocodec.tplg MODEL=ADLP_RVP_NOCODEC_ZEPHYR ~/sof-test/test-case/multiple-pipeline.sh -f c -l 200
Reproduction Rate
100% (with 200 iterations)
Expected behavior
Test passes
Impact
Recording fails.
Environment
- sof-2.1 stable branch SOF+Zephyr
- Name of the topology file
- Topology: sof-cavs-nocodec
- Name of the platform(s) on which the bug is observed.
- Platform: ADLP, TGLP
Screenshots or console output
[ 52109.633346] ( 22.187500) c2 ssp-dai 1.0 /drivers/intel/ssp/ssp.c:962 INFO ssp_early_start(): SSE set for SSP0
[ 52253.227090] ( 143.593750) c2 ssp-dai 1.0 /drivers/intel/ssp/ssp.c:1079 INFO ssp_trigger() cmd 1
[ 52273.331256] ( 20.104166) c2 ssp-dai 1.0 /drivers/intel/ssp/ssp.c:977 INFO ssp_start()
[ 80064.788485] ( 27791.457031) c0 sa src/lib/agent.c:83 WARN validate(), ll drift detected, delta = 40517
[ 86218.694491] ( 6153.905762) c0 sa src/lib/agent.c:83 WARN validate(), ll drift detected, delta = 40763
[ 136613.588321] ( 50394.894531) c0 sa src/lib/agent.c:83 WARN validate(), ll drift detected, delta = 40503
[ 148851.712835] ( 12238.125000) c0 sa src/lib/agent.c:83 WARN validate(), ll drift detected, delta = 41096
[ 195152.388079] ( 46300.675781) c0 sa src/lib/agent.c:83 WARN validate(), ll drift detected, delta = 40399
[ 197192.440081] ( 2040.052002) c0 sa src/lib/agent.c:83 WARN validate(), ll drift detected, delta = 40367
[ 213275.356109] ( 16082.916016) c0 sa src/lib/agent.c:83 WARN validate(), ll drift detected, delta = 40700
[ 221436.084951] ( 8160.729004) c0 sa src/lib/agent.c:83 WARN validate(), ll drift detected, delta = 41717
[ 229411.605467] ( 7975.520508) c0 sa src/lib/agent.c:83 WARN validate(), ll drift detected, delta = 40619
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ADLApplies to Alder Lake platformApplies to Alder Lake platformP1Blocker bugs or important featuresBlocker bugs or important featuresTGLApplies to Tiger LakeApplies to Tiger LakeZephyrIssues only observed with Zephyr integratedIssues only observed with Zephyr integratedbugSomething isn't working as expectedSomething isn't working as expected
Activity
kv2019i commentedon Mar 16, 2022
Some tidbits so far:
ranj063 commentedon Mar 16, 2022
@kv2019i this must also include DMIC capture no? not just SSP capture? Interestingly, the chrome team brought an issue on ADL with DMIC capture (with noise cancellation on core 1) and HDMI playback with similar logs. Of course it doesnt use zephyr.
lgirdwood commentedon Mar 16, 2022
@kv2019i can we try the following patch to show the IRQs enabled and the status. We may see the culprit....
lgirdwood commentedon Mar 16, 2022
@kv2019i I think we need to disable agent (so we only have 1 IRQ user for the timer - no context sharing) and add some checks like (untested).
kv2019i commentedon Mar 16, 2022
The timer tick does not seem to be systematically late at all. There is definitely some minor jitter in waking up the per-core threads (and this has increased lately, is less severe before the spinlock change), but when I've traced what happens on the n+1 cycle after agent notices the jitter, we always catch up.
So it could be the actual failure is caused by too much "agent traffic" and then some DMA runs out of data. Like here:
So in summary, we probably need to try removing the agent. It's adding to the problem here and if we have load issues, the DSP load traces will catch that.
kv2019i commentedon Mar 16, 2022
#5557 did not help. Logs are less cluttered, but there's a still failure in configuring SSP1 DAI (on core3).
kv2019i commentedon Mar 17, 2022
@lgirdwood Some log data with your patches. First the IRQs. The status doesn't change during any tests when measured at agent. Probably if some irq is blocked, that would have to be observed outside the agent:
[ 25633407.734375] ( 9.739583) c0 sa src/lib/agent.c:87 WARN irq enabled 10040 status 222
[ 25641487.421875] ( 10.520833) c0 sa src/lib/agent.c:87 WARN irq enabled 10040 status 222
[ 25645529.895833] ( 11.119792) c0 sa src/lib/agent.c:87 WARN irq enabled 10040 status 222
1 remaining item
kv2019i commentedon Mar 17, 2022
Managed to reproduce on one of the CI machines now. There's a Zephyr OS panic. Debugging it now.
kv2019i commentedon Mar 17, 2022
Status update:
- running out of memory allocating a new pipe
- no panic, no out-of-mem, just xrun in the FW log
Bisect shows the spinlock #5286 makes this problem easier to reproduce.
kv2019i commentedon Mar 17, 2022
Another update:
kv2019i commentedon Mar 21, 2022
There's a draft workaround for the Zephyr timer reliability, but unfortunately the error is still happening with that workaround in place. There's still unexplained spikes in timer invocation, so there can still be a connection, but at least the error in timer average time does not explain the multiple-pipeline-capture fail.
lgirdwood commentedon Mar 21, 2022
@kv2019i Could be IRQs OFF in locks ?
could we have a hack in
k_spin_unlock()that doeskv2019i commentedon Mar 21, 2022
I'll resume the IRQ timing tomorrow. I spent today with DW-DMA. The variety of symptoms still leaves me puzzling. Sometime the error happens at state transitions (either a Zephyr OS panic via invalid load or a timed out IPC), but often time the main failure is an xrun in stable state. There are four streams running on four cores, all using DW-DMA. Traces like these are very common:
[ 374512296.472385] ( 18.750000) c2 ssp-dai 1.0 /drivers/intel/ssp/ssp.c:1001 INFO ssp_start() OUT
[ 374849807.761057] ( 1738.541626) c2 zll-schedule ......../zephyr_domain.c:125 INFO domain tick avg 38400, max 41351
[ 376558874.411895] ( 11971.875000) c2 zll-schedule src/schedule/zephyr_ll.c:142 INFO ll task 0xbe081f80 pipe-task avg 4581, max 8032
[ 376558910.088977] ( 35.677082) c2 zll-schedule ......../zephyr_domain.c:89 INFO ll timer avg 4845, max 8375, overruns 0
[ 376560620.453492] ( 1710.364502) c2 dw-dma src/drivers/dw/dma.c:1146 INFO dw_dma_get_data_size(): avail 3188078672 free 3188078676
[ 376560639.411825] ( 18.958332) c2 dw-dma src/drivers/dw/dma.c:1148 INFO dw_dma_get_data_size(): av n1 496 n2 520 n3 520
Note: sof-logger run with 19.2 clock reference, so timestamp are off by 2X in the output.
The last trace is a local modification that prints the "avail bytes" value in three last invocations to get_data_size(). So previous iterations have been normal, but suddenly in middle of stable streaming state, the DW-DMA goes crazy (avail
3188078672 ). One soon after this, the streams on other cores start returning errors.
kv2019i commentedon Mar 23, 2022
Status update:
kv2019i commentedon Mar 23, 2022
Status update:
zephyr: ll-scheduler: k_sem handle must be in coherent memory
kv2019i commentedon Mar 25, 2022
Performed a bisect of sort on all current fixes and it turns out the k_sem coherency fix is the key change. Others are probably valid fixed, but not required for this bug. Test details at #5588
zephyr: ll-scheduler: k_sem handle must be in coherent memory
kv2019i commentedon Mar 29, 2022
No errors in Intel daily plan 11433, so potentially fixed by the fix to #5556.
kv2019i commentedon Apr 1, 2022
Not seen in Intel daily testing for multiple days, closing.