[Sound-open-firmware] [PATCH] FIX: Add dma_stop when receive trigger stop cmd in host

when ALSA lib detect xrun issue, it will send stop and start command to DSP without reset. it will hit error in hds_dma_start, if we did not add the dma_stop in the host_trigger function.
Signed-off-by: Wu Zhigang zhigang.wu@linux.intel.com
--- Test with: Apl-gpmrb with codec Linux sof-v4.14: 735b995d7b66 SOF master: 85ae8e74181f SOF-tools master: b327539e98f1 --- --- src/audio/host.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/audio/host.c b/src/audio/host.c index bee50ce..998c5ca 100644 --- a/src/audio/host.c +++ b/src/audio/host.c @@ -466,6 +466,7 @@ static int host_trigger(struct comp_dev *dev, int cmd)
switch (cmd) { case COMP_TRIGGER_STOP: + ret = dma_stop(hd->dma, hd->chan); ret = host_stop(dev); break; case COMP_TRIGGER_START:

On Wed, 2018-05-02 at 09:56 +0000, Jie, Yang wrote:
Can someone confirm on BYT too.
Thanks
Liam --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

On 5/2/2018 18:11, Liam Girdwood wrote:
BYT did not need this handler. The host dma for BYT is also GP-DMA and need to assign the DMA every host copy. When we trigger the host comp stop, there will no more host DMA. This problem is only shown on the APL/CNL platforms.
BTW, this bug is hit by the ALSA pcm lib xrun recovery. When ALSA trace the dma pointer position, it will wrongly though the DSP is in xrun and try to recover it by STOP/START pattern. Will the DSP be recovered from this kind of STOP/START?
Thanks Xiuli

On 2018年05月02日 21:09, Pan, Xiuli wrote:
Actually, It should be added. Because we cannot confirm the ALSA lib will not happen XRUN. In this situation, we have to recovered from this case. In the real environment, no one can confirm NO XRUN in ALSA. we have to make sure our DSP is rebust.
after fix this, there is still a xrun issue in the DSP. thanks ~zhigangw

On 5/3/2018 15:09, Liam Girdwood wrote:
Test with BYT and rt5651. no critical regression happen. Could not reproduce to the same ASLA xrun recover stop/start
Thanks Xiuli
Thanks
Liam

On 5/3/2018 3:09 PM, Liam Girdwood wrote:
You can apply this patch. the XRUN issue in the DSP is another kind of issue. they are different. I just want to highlight this issue over here. Maybe somebody could have time on this. thanks BR ~zhigangw
participants (7)
-
Jie, Yang
-
Liam Girdwood
-
Liam Girdwood
-
Pan, Xiuli
-
Wu Zhigang
-
Wu, Zhigang
-
zhigangw