Repository navigation
[Bug][CML][UCM]UCM stop work after plug headset during suspend. (intermittent) #915
Description
Describe the bug
UCM stop work when wake up from suspend.
To Reproduce
1.Enter suspended via "sudo rtcwake -m mem -s 15"
2. Do HDMI & DP hot-plug during suspended.
3.Wake up and check the UCM. Enter suspended again via "sudo rtcwake -m mem -s 15"
4. Do headset hot plug during suspended.
5.Check the Sound setting after wake up
Expected behavior
UCM works normally when wake up from suspended.
Impact
After step 3, UCM works well after wak up.
After step 5, UCM not work anymore after wake up from suspended.
Reproduce rate
2/50
Environment
Rander UCM https://github.com/RanderWang/intel-UCM
Kernel repo:c99938c https://github.com/thesofproject/linux/tree/release/sof-v5.0
Firmware repo: 05d4e19 https://github.com/thesofproject/sof/commits/master |
Topology: https://github.com/thesofproject/sof/commits/master . Same as above SOF repo
file: tools/topology/sof-hda-generic.m4, sof-hda-generic-2ch.tplg
SOF logger error log
0 1 DMA 1452986.770833 1452986.750000 intel/cavs/hda-dma.c:480 hda-dmac: 4 no free channel 1
0 1 HOST 1452993.437500 6.666667 src/audio/host.c:601 host_params() error: hd->chan < 0
0 1 PIPE 1452998.854167 5.416667 src/audio/pipeline.c:329 pipeline_params() error: ret = -19, host->comp.id = 9
0 1 IPC 1453005.104167 6.250000 src/ipc/handler.c:317 ipc: pipe 2 comp 9 params failed -19
0 1 DMA 1453020.208333 15.104167 intel/cavs/hda-dma.c:616 hda-dmac: 4 invalid channel -19
0 1 DMA 1462257.187500 9236.979492 intel/cavs/hda-dma.c:616 hda-dmac: 4 invalid channel -1
dmesg log
[ 3846.540122] sof-audio-pci 0000:00:1f.3: pcm: prepare stream 0 dir 1
[ 3846.540124] sof-audio-pci 0000:00:1f.3: pcm: hw params stream 0 dir 1
[ 3846.540168] sof-audio-pci 0000:00:1f.3: period_bytes:0x3fc0
[ 3846.540169] sof-audio-pci 0000:00:1f.3: periods:4
[ 3846.540202] sof-audio-pci 0000:00:1f.3: stream_tag 2
[ 3846.540207] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS
[ 3846.540381] sof-audio-pci 0000:00:1f.3: error: ipc error for 0x60010000 size 20
[ 3846.540386] sof-audio-pci 0000:00:1f.3: error: hw params ipc failed for stream 2
[ 3846.540387] sof-audio-pci 0000:00:1f.3: error: set pcm hw_params after resume
[ 3846.540390] sof-audio-pci 0000:00:1f.3: ASoC: platform prepare error: -22
[ 3846.540392] HDA Analog: ASoC: prepare FE HDA Analog failed
[ 3846.542281] sof-audio-pci 0000:00:1f.3: pcm: open stream 6 dir 1
[ 3846.542285] sof-audio-pci 0000:00:1f.3: period min 192 max 16384 bytes
[ 3846.542286] sof-audio-pci 0000:00:1f.3: period count 2 max 16
[ 3846.542288] sof-audio-pci 0000:00:1f.3: buffer max 65536 bytes
[ 3846.542415] sof-audio-pci 0000:00:1f.3: pcm: hw params stream 6 dir 1
[ 3846.542419] sof-audio-pci 0000:00:1f.3: generating page table for 00000000a293dba2 size 0xffc0 pages 16
[ 3846.542459] sof-audio-pci 0000:00:1f.3: period_bytes:0x3fc0
[ 3846.542460] sof-audio-pci 0000:00:1f.3: periods:4
[ 3846.542477] sof-audio-pci 0000:00:1f.3: stream_tag 3
[ 3846.542490] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS
[ 3846.542680] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS
[ 3846.542684] sof-audio-pci 0000:00:1f.3: pcm: stream dir 1, posn mailbox offset is 790604
[ 3846.542802] sof-audio-pci 0000:00:1f.3: pcm: trigger stream 6 dir 1 cmd 1
[ 3846.542812] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60040000: GLB_STREAM_MSG: TRIG_START
Activity
mengdonglin commentedon May 9, 2019
@RanderWang Please provide clues by check the error log.
RanderWang commentedon May 9, 2019
It should be a driver issue. There is a HDMI monitor connected, I don't know whether this would affect the issue.
mengdonglin commentedon May 10, 2019
@RanderWang @libinyang to check with HDMI support on CML
RanderWang commentedon May 10, 2019
The error sequence is:
(1) pcm: prepare stream 0 dir 1
(2) pcm: hw params stream 0 dir 1
(3) pcm: trigger stream 0 dir 1 start
(4) pcm: trigger stream 0 dir 1 cmd stop
// miss pcm free
(5) pcm: prepare stream 0 dir 1
(6) pcm: hw params stream 0 dir 1
error: hda dma is not free for application didn't free this hda dma by calling pcm free.
This bug is hard to be reproduced, so I can't make sure it is caused by application or ASoC.
ClarexZhou commentedon May 10, 2019
@RanderWang
Found one way to reproduce ipc error for 0x60010000 . Same dmesg and error sof logger. But UCM still works after these steps.
To Reproduce
Terminal output

dmesg
error logger

ipcError_dmesg.log
ipcError_All_logger.log
libinyang commentedon May 10, 2019
hmm, it seems to be the pcm FE/BE resume issue. It may be caused by one Ranjani's patch. This is what I'm concerning when I reviewed Ranjani's patch. There is one argument state not precise. I will submit a patch next week after my HDMI jack task finished.
wenqingfu commentedon May 10, 2019
how often can these steps trigger the error? 100% or still intermittent? @ClarexZhou
ClarexZhou commentedon May 13, 2019
These steps can 100% trigger ipc error for 0x60010000 . But UCM still works after ipc error for 0x60010000 .
@RanderWang Need to analysis if they are same root cause.
YvonneYang2 commentedon May 13, 2019
Split the bug that 100% reproduce ipc error for 0x60010000 to #934
ClarexZhou commentedon May 13, 2019
Original UCM stop work issue still occurred twice (reproduce frequency:2/20)via below steps:
Environment
Rander UCM https://github.com/RanderWang/intel-UCM
Kernel repo:3cfd789 https://github.com/thesofproject/linux/tree/release/sof-v5.0
Firmware repo: 3f1b929 https://github.com/thesofproject/sof/commits/master |
Topology: https://github.com/thesofproject/sof/commits/master . Same as above SOF repo
file: tools/topology/sof-hda-generic.m4, sof-hda-generic-2ch.tplg
libinyang commentedon May 13, 2019
@ClarexZhou Please check if patch #936 can fix this bug or not.
ClarexZhou commentedon May 15, 2019
Error not occurred with patch #936 during daily test. Close.