[alsa-devel] [PATCH 4/4] ASoC: wm_adsp: Improve DSP error handling

Charles Keepax ckeepax at opensource.wolfsonmicro.com
Thu Mar 10 11:44:54 CET 2016


If we encounter an error on the DSP side whilst user-space is waiting on
the poll we should call snd_compr_fragment_elapsed, although data is
not actually available we want to wake user-space such that the error
can be propagated out quickly. Additionally some versions of the DSP
firmware are not super consistent about actually generating an IRQ if
they encounter an error, as such we will check the DSP error status
every time we run out of available data as well, to ensure we catch it.

Signed-off-by: Charles Keepax <ckeepax at opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm_adsp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index f28c244..3ee1c72 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -2861,10 +2861,10 @@ int wm_adsp_compr_handle_irq(struct wm_adsp *dsp)
 		goto out;
 	}
 
+out:
 	if (compr && compr->stream)
 		snd_compr_fragment_elapsed(compr->stream);
 
-out:
 	mutex_unlock(&dsp->pwr_lock);
 
 	return ret;
@@ -2926,6 +2926,10 @@ int wm_adsp_compr_pointer(struct snd_compr_stream *stream,
 					 ret);
 				goto out;
 			}
+
+			ret = wm_adsp_buffer_check_error(buf);
+			if (ret < 0)
+				goto out;
 		}
 	}
 
-- 
2.1.4



More information about the Alsa-devel mailing list