On 2018年06月19日 18:41, Liam Girdwood wrote:
On Tue, 2018-06-19 at 16:18 +0800, Wu Zhigang wrote:
- 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.
This should be two patches.
OK, I will split this patch.
Signed-off-by: Wu Zhigang zhigang.wu@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);
Best to use component ID here. Btw if this is high frequency then it should also be made verbose trace.
Liam
I also think about it. Component ID is not convenient for engineer to distinguish the source and sink type quickly during debug. The ID is dynamic, but the type is fixed. Even in future, one pipeline has multiple same components, it will not cause confusion using component type. Not sure my thought is proper. Maybe you have another concern. Thanks ~zhigang
return -EIO; /* xrun */
} if (sink->free < need_sink) { trace_src_error("xro");
trace_error_value(source->source->comp.type);
return -EIO; /* xrun */ }trace_error_value(sink->sink->comp.type);
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);
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(sink->sink->comp.type);
trace_error_value(source->source->comp.type);
comp_overrun(dev, sink, cd->sink_period_bytes, 0); return -EIO; /* xrun */ }trace_error_value(sink->sink->comp.type);
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware