[Sound-open-firmware] [PATCH] platform: add trace code for debug
Wu Zhigang
zhigang.wu at linux.intel.com
Tue Jun 19 10:18:41 CEST 2018
1. add the trace code for easy to debug the case:
when the xrun happen in capture/playback working at the same time.
we could confirm the xrun's direction easily.
2. fix typo error in mixer.
Signed-off-by: Wu Zhigang <zhigang.wu at linux.intel.com>
---
test with:
apl-gpmrb with tdf8532 codec
linux topic/sof-dev: 0d51a5ed28c5
sof master: 48d2a1c551d7
soft master: 2cc3ad2a9287
pass the regression test:
Minnowboard Turbo
UP^2
CNL-RVP
---
src/audio/mixer.c | 2 +-
src/audio/src.c | 4 ++++
src/audio/volume.c | 4 ++++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/audio/mixer.c b/src/audio/mixer.c
index ac6b7f9..3ddea0a 100644
--- a/src/audio/mixer.c
+++ b/src/audio/mixer.c
@@ -255,7 +255,7 @@ static int mixer_copy(struct comp_dev *dev)
comp_underrun(dev, sources[i], sources[i]->avail,
md->period_bytes);
} else if (res > 0) {
- trace_mixer_error("xru");
+ trace_mixer_error("xro");
comp_overrun(dev, sources[i], sink->free,
md->period_bytes);
}
diff --git a/src/audio/src.c b/src/audio/src.c
index c19828a..e641874 100644
--- a/src/audio/src.c
+++ b/src/audio/src.c
@@ -800,10 +800,14 @@ static int src_copy(struct comp_dev *dev)
*/
if (source->avail < need_source) {
trace_src_error("xru");
+ trace_error_value(source->source->comp.type);
+ trace_error_value(sink->sink->comp.type);
return -EIO; /* xrun */
}
if (sink->free < need_sink) {
trace_src_error("xro");
+ trace_error_value(source->source->comp.type);
+ trace_error_value(sink->sink->comp.type);
return -EIO; /* xrun */
}
diff --git a/src/audio/volume.c b/src/audio/volume.c
index 9e2968d..a9efbaf 100644
--- a/src/audio/volume.c
+++ b/src/audio/volume.c
@@ -356,11 +356,15 @@ static int volume_copy(struct comp_dev *dev)
*/
if (source->avail < cd->source_period_bytes) {
trace_volume_error("xru");
+ trace_error_value(source->source->comp.type);
+ trace_error_value(sink->sink->comp.type);
comp_underrun(dev, source, cd->source_period_bytes, 0);
return -EIO; /* xrun */
}
if (sink->free < cd->sink_period_bytes) {
trace_volume_error("xro");
+ trace_error_value(source->source->comp.type);
+ trace_error_value(sink->sink->comp.type);
comp_overrun(dev, sink, cd->sink_period_bytes, 0);
return -EIO; /* xrun */
}
--
2.17.1
More information about the Sound-open-firmware
mailing list