Skip to contentSkip to conversation

ASoC: compress: propagate the error code from the

PATCH Superseded Raghu Bankapur 2 participants 3 messages Feb 24, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover ASoC: compress: propagate the error code from the

Propagate the error code from the compress framework for the timestamp query. This error code will be used by the client to handle the error case scenarios gracefully.

This propgated error is used by direct client like Audio HAL through IOCTL -SNDRV_COMPRESS_TSTAMP response, further this response is sent to upper layer, based on this error audio related usecases related to render position and presentation are handled.

Raghu Bankapur (1):
ASoC: compress: propagate the error code from the compress framework

 sound/core/compress_offload.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 ASoC: compress: propagate the error code from the compress framework

Propagate the error code from the compress framework for the timestamp query. This error code will be used by the client to handle the error case scenarios gracefully.

---
 sound/core/compress_offload.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
sound/core/compress_offload.c +4 -1
index de514ec8c83d..b89adbf666b1 100644
@@ -166,9 +166,12 @@ static int snd_compr_free(struct inode *inode, struct file *f)
 static int snd_compr_update_tstamp(struct snd_compr_stream *stream,
 		struct snd_compr_tstamp *tstamp)
 {
+	int ret = 0;
 	if (!stream->ops->pointer)
 		return -ENOTSUPP;
-	stream->ops->pointer(stream, tstamp);
+	ret = stream->ops->pointer(stream, tstamp);
+	if (ret)
+		return ret;
 	pr_debug("dsp consumed till %d total %d bytes\n",
 		tstamp->byte_offset, tstamp->copied_total);
 	if (stream->direction == SND_COMPRESS_PLAYBACK)
Signature · 1 line
2.17.1
maintainer
#2 lore raw

Re: [PATCH V1 1/1] ASoC: compress: propagate the error code from the compress framework

Quoted 14 lines · Raghu Bankapur

Propagate the error code from the compress framework for the timestamp query. This error code will be used by the client to handle the error case scenarios gracefully.

---
 sound/core/compress_offload.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
sound/core/compress_offload.c +0 -0
index de514ec8c83d..b89adbf666b1 100644

sound/core/compress_offload.c static int snd_compr_free(struct inode *inode, struct file *f) · line 169

Quoted 4 lines
sound/core/compress_offload.c +1 -0
@@ -166,9 +166,12 @@ static int snd_compr_free(struct inode *inode, struct file *f)
 static int snd_compr_update_tstamp(struct snd_compr_stream *stream,
 		struct snd_compr_tstamp *tstamp)
 {
+	int ret = 0;

why initialize here, also pls leave an empty line here

Quoted 11 lines
sound/core/compress_offload.c +3 -1
 	if (!stream->ops->pointer)
 		return -ENOTSUPP;
-	stream->ops->pointer(stream, tstamp);
+	ret = stream->ops->pointer(stream, tstamp);
+	if (ret)
+		return ret;
 	pr_debug("dsp consumed till %d total %d bytes\n",
 		tstamp->byte_offset, tstamp->copied_total);
 	if (stream->direction == SND_COMPRESS_PLAYBACK)
Signature · 1 line
2.17.1
Signature · 1 line
~Vinod