mirror of https://github.com/thesofproject/sof.git
audio: align error messages when sink buffer is insufficient
Align to provide same information for all audio processing, no reason to be creative here. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
This commit is contained in:
parent
ea4ba64bd0
commit
4b88635cfd
|
@ -569,9 +569,8 @@ static int asrc_prepare(struct comp_dev *dev)
|
|||
cd->sink_frames);
|
||||
|
||||
if (sinkb->stream.size < config->periods_sink * sink_period_bytes) {
|
||||
comp_err(dev, "asrc_prepare(), sink size=%d is insufficient, when periods=%d, period_bytes=%d",
|
||||
sinkb->stream.size, config->periods_sink,
|
||||
sink_period_bytes);
|
||||
comp_err(dev, "asrc_prepare(): sink buffer size %d is insufficient < %d * %d",
|
||||
sinkb->stream.size, config->periods_sink, sink_period_bytes);
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
|
|
@ -355,8 +355,8 @@ static int dcblock_prepare(struct comp_dev *dev)
|
|||
audio_stream_period_bytes(&sinkb->stream, dev->frames);
|
||||
|
||||
if (sinkb->stream.size < config->periods_sink * sink_period_bytes) {
|
||||
comp_err(dev, "dcblock_prepare(), sink buffer size %d is insufficient",
|
||||
sinkb->stream.size);
|
||||
comp_err(dev, "dcblock_prepare(): sink buffer size %d is insufficient < %d * %d",
|
||||
sinkb->stream.size, config->periods_sink, sink_period_bytes);
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
|
|
@ -720,7 +720,8 @@ static int eq_fir_prepare(struct comp_dev *dev)
|
|||
dev->frames);
|
||||
|
||||
if (sinkb->stream.size < config->periods_sink * sink_period_bytes) {
|
||||
comp_err(dev, "eq_fir_prepare(): sink buffer size is insufficient");
|
||||
comp_err(dev, "eq_fir_prepare(): sink buffer size %d is insufficient < %d * %d",
|
||||
sinkb->stream.size, config->periods_sink, sink_period_bytes);
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
|
|
@ -911,8 +911,8 @@ static int eq_iir_prepare(struct comp_dev *dev)
|
|||
dev->frames);
|
||||
|
||||
if (sinkb->stream.size < config->periods_sink * sink_period_bytes) {
|
||||
comp_err(dev, "eq_iir_prepare(), sink buffer size %d is insufficient",
|
||||
sinkb->stream.size);
|
||||
comp_err(dev, "eq_iir_prepare(): sink buffer size %d is insufficient < %d * %d",
|
||||
sinkb->stream.size, config->periods_sink, sink_period_bytes);
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
|
|
@ -177,7 +177,7 @@ static int mixer_params(struct comp_dev *dev,
|
|||
{
|
||||
struct sof_ipc_comp_config *config = dev_comp_config(dev);
|
||||
struct comp_buffer *sinkb;
|
||||
uint32_t period_bytes;
|
||||
uint32_t sink_period_bytes;
|
||||
int err;
|
||||
|
||||
comp_dbg(dev, "mixer_params()");
|
||||
|
@ -192,14 +192,15 @@ static int mixer_params(struct comp_dev *dev,
|
|||
source_list);
|
||||
|
||||
/* calculate period size based on config */
|
||||
period_bytes = dev->frames * audio_stream_frame_bytes(&sinkb->stream);
|
||||
if (period_bytes == 0) {
|
||||
sink_period_bytes = dev->frames * audio_stream_frame_bytes(&sinkb->stream);
|
||||
if (sink_period_bytes == 0) {
|
||||
comp_err(dev, "mixer_params(): period_bytes = 0");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (sinkb->stream.size < config->periods_sink * period_bytes) {
|
||||
comp_err(dev, "mixer_params(): sink buffer size is insufficient");
|
||||
if (sinkb->stream.size < config->periods_sink * sink_period_bytes) {
|
||||
comp_err(dev, "mixer_params(): sink buffer size %d is insufficient < %d * %d",
|
||||
sinkb->stream.size, config->periods_sink, sink_period_bytes);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
|
|
@ -464,7 +464,8 @@ static int selector_prepare(struct comp_dev *dev)
|
|||
sinkb->stream.channels);
|
||||
|
||||
if (sinkb->stream.size < config->periods_sink * cd->sink_period_bytes) {
|
||||
comp_err(dev, "selector_prepare(): sink buffer size is insufficient");
|
||||
comp_err(dev, "selector_prepare(): sink buffer size %d is insufficient < %d * %d",
|
||||
sinkb->stream.size, config->periods_sink, cd->sink_period_bytes);
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
|
|
@ -833,7 +833,8 @@ static int src_prepare(struct comp_dev *dev)
|
|||
dev->frames);
|
||||
|
||||
if (sinkb->stream.size < config->periods_sink * sink_period_bytes) {
|
||||
comp_err(dev, "src_prepare(): sink buffer size is insufficient");
|
||||
comp_err(dev, "src_prepare(): sink buffer size %d is insufficient < %d * %d",
|
||||
sinkb->stream.size, config->periods_sink, sink_period_bytes);
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue