[PATCH 4/4] ASoC: SOF: compress: Set compress data offset
Daniel Baluta
daniel.baluta at oss.nxp.com
Tue Jan 17 13:13:07 CET 2023
From: Daniel Baluta <daniel.baluta at nxp.com>
Because now snd_sof_set_stream_data_offset has compress
support we use it to set posn_offset for compress stream.
Reviewed-by: Paul Olaru <paul.olaru at nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan at nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan at linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta at nxp.com>
---
sound/soc/sof/compress.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/sound/soc/sof/compress.c b/sound/soc/sof/compress.c
index 8e1a9ba111ad..8d205eb16d2f 100644
--- a/sound/soc/sof/compress.c
+++ b/sound/soc/sof/compress.c
@@ -10,6 +10,7 @@
#include "sof-audio.h"
#include "sof-priv.h"
#include "sof-utils.h"
+#include "ops.h"
static void sof_set_transferred_bytes(struct sof_compr_stream *sstream,
u64 host_pos, u64 buffer_size)
@@ -237,6 +238,14 @@ static int sof_compr_set_params(struct snd_soc_component *component,
goto out;
}
+ ret = snd_sof_set_stream_data_offset(sdev, &spcm->stream[cstream->direction],
+ ipc_params_reply.posn_offset);
+ if (ret < 0) {
+ dev_err(component->dev, "Invalid stream data offset for Compr %d\n",
+ spcm->pcm.pcm_id);
+ goto out;
+ }
+
sstream->sampling_rate = params->codec.sample_rate;
sstream->channels = params->codec.ch_out;
sstream->sample_container_bytes = pcm->params.sample_container_bytes;
--
2.25.1
More information about the Alsa-devel
mailing list