Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipeline: fail to recover from xrun in pipeline_task #2926

Merged

Conversation

brentlu
Copy link
Contributor

@brentlu brentlu commented May 12, 2020

The pipeline is in active state so pipeline_prepare() always fail and
the pipeline_task() stops the pipeline. A stop trigger could move the
pipeline to prepare state for pipeline_prepare() to run successfully.

Signed-off-by: Brent Lu brent.lu@intel.com

@brentlu
Copy link
Contributor Author

brentlu commented May 12, 2020

What steps will reproduce the problem?

  1.  Play Youtube video on Chrome book and connect to the monitor with Type C to DP dongle
    
  2.  Press monitor power button to turn off the monitor
    
  3.  Press monitor power button again to turn on the monitor
    
  4.  Play Youtube video and to check function
    
  5.  No sound comes out from monitor speaker when turn on external monitor
    

What is the expected output?
Sound comes out from monitor speaker after clicking play Youtube video

What do you see instead?
No sound comes out from monitor speaker after clicking play Youtube video

How frequently does this problem reproduce? (Always, sometimes, hard to
reproduce?)
Sometimes, Failed rate:2/15

HW: Chromebook Fleex (GLK)
Kernel: Chrome-v4.14
SOF: according to the README in google's FW blob (sof-binary-1.11-glk.tar.bz2), should be the HEAD of glk-012-stable-branch

According to the trace, the pipeline_task() tries to recover the xrun but fail because the pipeline state is in active so pipeline_prepare fails.

0      2          DAI 5.31    162569273.489583         3.072917      src/audio/dai.c:519 	dai_comp_trigger(), START
0      1          DMA         162569488.854167       215.364578 intel/cavs/hda-dma.c:284 	hda-dmac: 5 wait for buffer full timeout
0      1         HOST         162569494.531250         5.677083     src/audio/host.c:792 	host_copy() error: dma_copy() failed, ret = 4294967234
0      1         PIPE         162569500.208333         5.677083 src/audio/pipeline.c:732 	pipeline_copy() error: ret = -62, start->comp.id = 31, dir = 1
0      1         PIPE 5.32    162569506.770833         6.562500 src/audio/pipeline.c:843 	pipeline_xrun_recover()
0      2         PIPE 5.32    162569511.354167         4.583333 src/audio/pipeline.c:352 	pipeline_prepare()
0      2         HOST         162569514.427083         3.072917     src/audio/host.c:635 	host_prepare()
0      1         COMP         162569517.968750         3.541667 rc/audio/component.c:197 	comp_set_state() error: wrong state = 5, COMP_TRIGGER_PREPARE
0      1         PIPE         162569523.177083         5.208333 src/audio/pipeline.c:359 	pipeline_prepare() error: ret = -22,dev->comp.id = 27
0      1         PIPE 5.32    162569528.906250         5.729167 src/audio/pipeline.c:850 	pipeline_xrun_recover() error: pipeline_prepare() failed, ret = -22
0      1         PIPE 5.32    162569534.114583         5.208333 src/audio/pipeline.c:919 	pipeline_task(): xrun recover failed! pipeline will be stopped!

This log is captured from patched FW. It recovers from underrun and the audio stream does not break. I can hear the audio from HDMI output.

0      2          DAI 5.31     73067260.260417         3.125000      src/audio/dai.c:519 	dai_comp_trigger(), START
0      1          DMA          73067475.572917       215.312500 intel/cavs/hda-dma.c:284 	hda-dmac: 5 wait for buffer full timeout
0      1         HOST          73067481.250000         5.677083     src/audio/host.c:792 	host_copy() error: dma_copy() failed, ret = 4294967234
0      1         PIPE          73067487.031250         5.781250 src/audio/pipeline.c:732 	pipeline_copy() error: ret = -62, start->comp.id = 31, dir = 1
0      1         PIPE 5.32     73067493.593750         6.562500 src/audio/pipeline.c:843 	pipeline_xrun_recover()
0      2         PIPE 5.32     73067498.125000         4.531250 src/audio/pipeline.c:579 	pipeline_trigger()
0      2         HOST          73067501.458333         3.333333     src/audio/host.c:283 	host_trigger()
0      2          DMA          73067505.104167         3.645833 intel/cavs/hda-dma.c:637 	hda-dmac: 5 channel 0 -> stop
0      2       VOLUME          73067508.385417         3.281250   src/audio/volume.c:488 	volume_trigger()
0      2          DAI 5.31     73067511.614583         3.229167      src/audio/dai.c:508 	dai_comp_trigger(), command = 0
0      2          DAI 5.31     73067514.843750         3.229167      src/audio/dai.c:572 	dai_comp_trigger(), PAUSE/STOP
0      2          DMA          73067517.864583         3.020833 intel/cavs/hda-dma.c:637 	hda-dmac: 7 channel 0 -> stop
0      2         PIPE 5.32     73067523.385417         5.520833 src/audio/pipeline.c:352 	pipeline_prepare()
0      2         HOST          73067526.510417         3.125000     src/audio/host.c:635 	host_prepare()
0      2         COMP          73067529.479167         2.968750 rc/audio/component.c:129 	comp_set_state(), state already set to 3
0      2         PIPE 5.32     73067532.812500         3.333333 src/audio/pipeline.c:579 	pipeline_trigger()
0      2         HOST          73067535.833333         3.020833     src/audio/host.c:283 	host_trigger()
0      2          DMA          73067539.166667         3.333333 intel/cavs/hda-dma.c:543 	hda-dmac: 5 channel 0 -> start
0      2          DMA          73067542.187500         3.020833 intel/cavs/hda-dma.c:379 	hda-dmac: 5 channel 0 -> enable
0      2       VOLUME          73067589.166667        46.979168   src/audio/volume.c:488 	volume_trigger()
0      2          DAI 5.31     73067592.447917         3.281250      src/audio/dai.c:508 	dai_comp_trigger(), command = 1
0      2          DAI 5.31     73067595.468750         3.020833      src/audio/dai.c:519 	dai_comp_trigger(), START
0      2          DMA          73068405.312500       809.843750 intel/cavs/hda-dma.c:543 	hda-dmac: 7 channel 0 -> start

Regards,
Brent

@paulstelian97
Copy link
Collaborator

There used to be in-firmware code for doing this recovery. Recently the responsibility has been shifted to the userspace to do said recovery.

Whenever this happens, does refreshing the YouTube page recover the xrun?

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @fkaczmar @lbetlej @mmaka1 this one belongs to you

@brentlu
Copy link
Contributor Author

brentlu commented May 14, 2020

pipeline_task() just returns and the host driver seems not being aware of it. CRAS tries to resolve it by sending more data but not working since the pipeline is already closed in SOF side. User needs to restart the Youtube page so the pcm device will be open again.

One thing I'd like to point out is that this patch is targeting glk-012-stable-branch instead of master.

@jajanusz
Copy link
Contributor

Before merging this, we should tag current top as some X.0 glk release and then this as X.1. We shouldn't just push to stable branches.

@jajanusz
Copy link
Contributor

@mrajwa @keyonjie was this branch released or you just push there for some reason? I see that top of it is not equal to any of release/glk/* tags

@keyonjie
Copy link
Contributor

@brentlu can you try if disabling FW internal xrun recovery works for you, which is aligned with the master branch?

-- #define NO_XRUN_RECOVERY 0
++ #define NO_XRUN_RECOVERY 1

@jajanusz I think this is for the last GLK release(v1.2), looks we didn't add tag for it.

@brentlu
Copy link
Contributor Author

brentlu commented May 19, 2020

Hi Keyon,

I didn't observe recovery in kernel level. Should it be done in application?

Regards,
Brent

2020-05-19T09:40:36.179748+08:00 DEBUG kernel: [ 313.030148] sound pcmC0D5p: snd_pcm_common_ioctl: START
2020-05-19T09:40:36.179750+08:00 DEBUG kernel: [ 313.030151] HDMI1: ASoC: pre trigger FE HDMI1 cmd 1
2020-05-19T09:40:36.179751+08:00 DEBUG kernel: [ 313.030155] sof-audio-pci 0000:00:0e.0: pcm: trigger stream 5 dir 0 cmd 1
2020-05-19T09:40:36.179752+08:00 DEBUG kernel: [ 313.030162] sof-audio-pci 0000:00:0e.0: ipc tx: 0x60040000: GLB_STREAM_MSG: TRIG_START
2020-05-19T09:40:36.179754+08:00 DEBUG kernel: [ 313.030611] sof-audio-pci 0000:00:0e.0: ipc tx succeeded: 0x60040000: GLB_STREAM_MSG: TRIG_START
2020-05-19T09:40:36.179755+08:00 DEBUG kernel: [ 313.030613] iDisp1: ASoC: trigger BE iDisp1 cmd 1
2020-05-19T09:40:36.179756+08:00 DEBUG kernel: [ 313.030616] sof-audio-pci 0000:00:0e.0: In hda_link_pcm_trigger cmd=1
2020-05-19T09:40:36.179757+08:00 DEBUG kernel: [ 313.030631] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 4096 avail 12368
2020-05-19T09:40:36.179759+08:00 DEBUG kernel: [ 313.030687] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 5648 avail 10816
2020-05-19T09:40:36.180016+08:00 DEBUG kernel: [ 313.030773] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 5648 avail 10816
2020-05-19T09:40:36.180021+08:00 DEBUG kernel: [ 313.030987] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 5648 avail 10816
2020-05-19T09:40:36.181027+08:00 DEBUG kernel: [ 313.031068] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 9744 avail 6720
2020-05-19T09:40:36.181038+08:00 DEBUG kernel: [ 313.031344] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 9744 avail 6720
2020-05-19T09:40:36.181042+08:00 DEBUG kernel: [ 313.031495] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 9744 avail 6720
2020-05-19T09:40:36.181044+08:00 DEBUG kernel: [ 313.031529] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 9744 avail 6720
2020-05-19T09:40:36.188970+08:00 DEBUG kernel: [ 313.038135] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 9744 avail 6720
2020-05-19T09:40:36.189013+08:00 DEBUG kernel: [ 313.038425] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 9744 avail 6720
2020-05-19T09:40:36.189018+08:00 DEBUG kernel: [ 313.038462] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 9744 avail 6720
2020-05-19T09:40:36.265101+08:00 DEBUG kernel: [ 313.115195] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 9744 avail 6720
2020-05-19T09:40:36.265135+08:00 DEBUG kernel: [ 313.115979] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 9744 avail 6720
2020-05-19T09:40:36.265139+08:00 DEBUG kernel: [ 313.116018] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 9744 avail 6720
2020-05-19T09:40:36.265151+08:00 DEBUG kernel: [ 313.116059] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 9744 avail 6720
2020-05-19T09:40:36.266035+08:00 DEBUG kernel: [ 313.116240] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 9744 avail 6720
2020-05-19T09:40:36.266046+08:00 DEBUG kernel: [ 313.116341] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 13840 avail 2624
2020-05-19T09:40:36.288036+08:00 DEBUG kernel: [ 313.138123] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 13840 avail 2624
2020-05-19T09:40:36.288069+08:00 DEBUG kernel: [ 313.138499] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 13840 avail 2624
2020-05-19T09:40:36.288073+08:00 DEBUG kernel: [ 313.138536] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 13840 avail 2624
2020-05-19T09:40:36.350457+08:00 DEBUG kernel: [ 313.200532] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 13840 avail 2624
2020-05-19T09:40:36.351016+08:00 DEBUG kernel: [ 313.201185] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 13840 avail 2624
2020-05-19T09:40:36.351027+08:00 DEBUG kernel: [ 313.201224] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 13840 avail 2624
2020-05-19T09:40:36.351032+08:00 DEBUG kernel: [ 313.201338] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 13840 avail 2624
2020-05-19T09:40:36.351034+08:00 DEBUG kernel: [ 313.201498] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 13840 avail 2624
2020-05-19T09:40:36.351035+08:00 DEBUG kernel: [ 313.201585] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 16464 avail 0

@keyonjie
Copy link
Contributor

@brentlu I want to understand what really going, can you explain why the xrun(underrun?) happen here? does the CRAS stop sending data when the monitor is turned off? @kv2019i @libinyang IIRC, our DP/HDMI supports silent playback(e.g. even the monitor is turned off, we will keep sending audio samples to i915...)?

@brentlu
Copy link
Contributor Author

brentlu commented May 19, 2020

Hi Keyon,

I think it's not related to silent playback. When monitor is turned off, CRAS switches path to speaker so it closes the PCM device of HDMI (pcmC0D5p). When the monitor is turned on, CRAS will open the HDMI PCM device again and starts sending data.

Regards,
Brent

@keyonjie
Copy link
Contributor

keyonjie commented May 19, 2020 via email

@brentlu
Copy link
Contributor Author

brentlu commented May 19, 2020

Hi Keyon,

According to the log, the underrun happens after it got the START trigger so I think the pcm device is opened on the Linux side.

0 2 DAI 5.31 162569273.489583 3.072917 src/audio/dai.c:519 dai_comp_trigger(), START
0 1 DMA 162569488.854167 215.364578 intel/cavs/hda-dma.c:284 hda-dmac: 5 wait for buffer full timeout

From the Linux log, it seems SOF reads only 96 samples then stops working.
2020-05-19T09:40:36.179752+08:00 DEBUG kernel: [ 313.030162] sof-audio-pci 0000:00:0e.0: ipc tx: 0x60040000: GLB_STREAM_MSG: TRIG_START
=> START trigger sent to FW
2020-05-19T09:40:36.179757+08:00 DEBUG kernel: [ 313.030631] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 4096 avail 12368
=> 4K sample written by CRAS, 96 read by SOF
...
...
2020-05-19T09:40:36.351035+08:00 DEBUG kernel: [ 313.201585] sound pcmC0D5p: pos 96 hw_ptr 96 appl_ptr 16464 avail 0
=> buffer full, still 96 read by SOF

@keyonjie
Copy link
Contributor

keyonjie commented May 19, 2020 via email

@brentlu
Copy link
Contributor Author

brentlu commented May 19, 2020

Hi Keyon,

The patched firmware isn't working even for non-hda playback. Maybe there is more patches to merge.

347ee08 hda-dma: change preload from blocking to repeating
9b70458 pipeline: update pipeline idle task
c44a454 scheduler: enable idle task to be executed more than once
7546c0f hda-dma: add more granular functions for status checking

Regards,
Brent

@keyonjie
Copy link
Contributor

Hi Keyon,

The patched firmware isn't working even for non-hda playback. Maybe there is more patches to merge.

347ee08 hda-dma: change preload from blocking to repeating
9b70458 pipeline: update pipeline idle task
c44a454 scheduler: enable idle task to be executed more than once
7546c0f hda-dma: add more granular functions for status checking

oops, then the solution taking should be up to you @jajanusz @mrajwa. If we can figure out a fix with backporting commits from the master branch, it will be easier for maintaining.

@tlauda
Copy link
Contributor

tlauda commented May 19, 2020

Hi Keyon,
The patched firmware isn't working even for non-hda playback. Maybe there is more patches to merge.
347ee08 hda-dma: change preload from blocking to repeating
9b70458 pipeline: update pipeline idle task
c44a454 scheduler: enable idle task to be executed more than once
7546c0f hda-dma: add more granular functions for status checking

oops, then the solution taking should be up to you @jajanusz @mrajwa. If we can figure out a fix with backporting commits from the master branch, it will be easier for maintaining.

Entire pipeline preload has been removed. Backporting the current solution is almost impossible.

@brentlu
Copy link
Contributor Author

brentlu commented May 26, 2020

Hi,

Just wondering if this patch will be merged because customer is asking. Thanks.

Regards,
Brent

@keyonjie
Copy link
Contributor

I would suggest to take it, @jajanusz @mrajwa

Let's add a tags like releases/glk/v12.0 and releases/glk/v12.1 before and after applied it.

@brentlu
Copy link
Contributor Author

brentlu commented Jun 15, 2020

Hi,

We've got escalated by customer for this issue. Is there any progress? Thanks.

@mrajwa
Copy link
Contributor

mrajwa commented Jun 15, 2020

@brentlu, if your intention is prepare the stream again I would suggest to .free() it after the stop so we don't leak anything. Also such things should be controlled by the driver, and not sole FW decision.

@keyonjie, why the STOP and FREE commands are not send by the driver?

@plbossart
Copy link
Member

@brentlu can you clarify for me what is different from what you reported on the alsa-devel mailing list:

What steps will reproduce the problem?
1.      Play YouTube video on Chromebook and connect it to external monitor with Type C to DP dongle
2.      Press monitor power button to turn off the monitor
3.      Press monitor power button again to turn on the monitor
4.      Continue to play YouTube video and check audio playback
5.      No sound comes out from built-in speaker of external monitor when turn on external monitor

Is this needed in addition to the RIRB fix at the kernel level?

@brentlu
Copy link
Contributor Author

brentlu commented Jun 15, 2020

Hi Pierre,

They are different issues although the result is the same: no audio output.

The RIRB issue happens in PREPARE stage when host sending verbs to codec.
The issue of this pull request is FW preload fail in the beginning of RUNNING stage.

@plbossart
Copy link
Member

Hi Pierre,

They are different issues although the result is the same: no audio output.

The RIRB issue happens in PREPARE stage when host sending verbs to codec.
The issue of this pull request is FW preload fail in the beginning of RUNNING stage.

ok, thanks for the precision @brentlu

@mmaka1
Copy link

mmaka1 commented Jun 15, 2020

Since negative error code returned by the t/o'ed host component triggers pipeline_xrun_recover() while components are in active state, so this flow would always result in failure and must be fixed. However a component (host in this case) is expected to call comp_underrun() upon detecting underrun (atm only dai does it). comp_underrun() calls pipeline_xrun() which triggers required state transition (forced by the stop trigger in the proposed solution).

@brentlu
Copy link
Contributor Author

brentlu commented Jun 16, 2020

@mrajwa the resource is allocated in .params so if I insert an .reset here then next .prepare will fail

0      2         PIPE 6.39    107799257.031250        12.291667 src/audio/pipeline.c:579 	pipeline_trigger()
0      2         HOST         107799260.468750         3.437500     src/audio/host.c:283 	host_trigger()
0      2          DMA         107799264.114583         3.645833 intel/cavs/hda-dma.c:543 	hda-dmac: 5 channel 0 -> start
0      2          DMA         107799267.239583         3.125000 intel/cavs/hda-dma.c:379 	hda-dmac: 5 channel 0 -> enable
0      2       VOLUME         107799314.843750        47.604168   src/audio/volume.c:488 	volume_trigger()
0      2          DAI 6.38    107799318.125000         3.281250      src/audio/dai.c:508 	dai_comp_trigger(), command = 1
0      2          DAI 6.38    107799321.145833         3.020833      src/audio/dai.c:519 	dai_comp_trigger(), START
0      1          DMA         107799536.927083       215.781250 intel/cavs/hda-dma.c:284 	hda-dmac: 5 wait for buffer full timeout
0      1         HOST         107799542.916667         5.989583     src/audio/host.c:792 	host_copy() error: dma_copy() failed, ret = 4294967234
0      1         PIPE         107799548.854167         5.937500 src/audio/pipeline.c:732 	pipeline_copy() error: ret = -62, start->comp.id = 38, dir = 1
0      1         PIPE 6.39    107799555.156250         6.302083 src/audio/pipeline.c:843 	pipeline_xrun_recover()
0      2         PIPE 6.39    107799559.791667         4.635417 src/audio/pipeline.c:579 	pipeline_trigger()
0      2         HOST         107799563.177083         3.385417     src/audio/host.c:283 	host_trigger()
0      2          DMA         107799566.666667         3.489583 intel/cavs/hda-dma.c:637 	hda-dmac: 5 channel 0 -> stop
0      2       VOLUME         107799570.416667         3.750000   src/audio/volume.c:488 	volume_trigger()
0      2          DAI 6.38    107799573.645833         3.229167      src/audio/dai.c:508 	dai_comp_trigger(), command = 0
0      2          DAI 6.38    107799576.718750         3.072917      src/audio/dai.c:572 	dai_comp_trigger(), PAUSE/STOP
0      2          DMA         107799579.843750         3.125000 intel/cavs/hda-dma.c:637 	hda-dmac: 7 channel 1 -> stop
0      2         PIPE 6.39    107799585.312500         5.468750 src/audio/pipeline.c:634 	pipeline_reset()
0      2         HOST         107799588.437500         3.125000     src/audio/host.c:699 	host_reset()
0      2          DMA         107799591.666667         3.229167 intel/cavs/hda-dma.c:637 	hda-dmac: 5 channel 0 -> stop
0      2       VOLUME         107799597.604167         5.937500   src/audio/volume.c:632 	volume_reset()
0      2          DAI 6.38    107799600.781250         3.177083      src/audio/dai.c:486 	dai_reset()
0      2         PIPE 6.39    107799605.781250         5.000000 src/audio/pipeline.c:352 	pipeline_prepare()
0      2         HOST         107799608.958333         3.177083     src/audio/host.c:635 	host_prepare()
0      2       VOLUME         107799621.197917        12.239583   src/audio/volume.c:546 	volume_prepare()
0      2          DAI 6.38    107799643.020833        21.822916      src/audio/dai.c:445 	dai_prepare()
0      1          DAI 6.38    107799646.093750         3.072917      src/audio/dai.c:458 	dai_prepare() error: Missing dd->config.elem_array.elems.
0      1         PIPE         107799651.510417         5.416667 src/audio/pipeline.c:359 	pipeline_prepare() error: ret = -22,dev->comp.id = 34
0      1         PIPE 6.39    107799657.239583         5.729167 src/audio/pipeline.c:869 	pipeline_xrun_recover() error: pipeline_prepare() failed, ret = -22
0      1         PIPE 6.39    107799662.395833         5.156250 src/audio/pipeline.c:938 	pipeline_task(): xrun recover failed! pipeline will be stopped!

And the kernel is Chrome 4.14 which is pretty outdated. FW is 'glk-012-stable-branch' branch which is behind master for around 2200+ commits...

Regards,
Brent

@jajanusz
Copy link
Contributor

@brentlu please update PR with changes proposed by @mmaka1 AFAIK it works for you

Calling comp_underrun() in host component to recover from XRUN caused
by preload fail.

Signed-off-by: Brent Lu <brent.lu@intel.com>
@mrajwa
Copy link
Contributor

mrajwa commented Jun 17, 2020

This is better but lacks a check for direction:

diff --git a/src/audio/host.c b/src/audio/host.c
index 9b85d931..b214df8f 100644
--- a/src/audio/host.c
+++ b/src/audio/host.c
@@ -790,6 +790,12 @@ static int host_copy(struct comp_dev *dev)
                if (ret < 0) {
                        trace_host_error("host_copy() error: dma_copy() "
                                         "failed, ret = %u", ret);
+
+                       if (dev->params.direction == SOF_IPC_STREAM_PLAYBACK)
+                               comp_underrun(dev, hd->dma_buffer, hd->dma_buffer->size, 0);
+                       else
+                               comp_overrun(dev, hd->dma_buffer, hd->dma_buffer->size, 0);
+
                        return ret;
                }
        }

@mmaka1 mmaka1 merged commit 324efb1 into thesofproject:glk-012-stable-branch Jun 18, 2020
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.

9 participants