Skip to contentSkip to conversation

alsa: compress_core: don't wake up on pause

PATCH Applied Vinod Koul 2 participants 3 messages Jun 12, 2012

Subsystems (2)
lore
Share & tools
lore

Vinod Koul

author
#0 lore raw

PATCH 1/2 alsa: compress_core: don't wake up on pause

during pause the core should maintain the status-quo on the device and pointers and not wake up. If app needs it should call DROP explcitly.

---
 sound/core/compress_offload.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
sound/core/compress_offload.c +1 -3
index a68aed7..375f7a0 100644
@@ -502,10 +502,8 @@ static int snd_compr_pause(struct snd_compr_stream *stream)
 	if (stream->runtime->state != SNDRV_PCM_STATE_RUNNING)
 		return -EPERM;
 	retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_PUSH);
-	if (!retval) {
+	if (!retval)
 		stream->runtime->state = SNDRV_PCM_STATE_PAUSED;
-		wake_up(&stream->runtime->sleep);
-	}
 	return retval;
 }
 
Signature · 1 line
1.7.0.4
author
#1 lore raw

PATCH 2/2 audio: compress_core: cleanup pointers on stop

as the start can be called after stop again, we need to reset state

---
 sound/core/compress_offload.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
sound/core/compress_offload.c +4 -0
index 375f7a0..ec2118d 100644
@@ -542,6 +542,10 @@ static int snd_compr_stop(struct snd_compr_stream *stream)
 	if (!retval) {
 		stream->runtime->state = SNDRV_PCM_STATE_SETUP;
 		wake_up(&stream->runtime->sleep);
+		stream->runtime->hw_pointer = 0;
+		stream->runtime->app_pointer = 0;
+		stream->runtime->total_bytes_available = 0;
+		stream->runtime->total_bytes_transferred = 0;
 	}
 	return retval;
 }
Signature · 1 line
1.7.0.4
Applied
#2 lore raw
In reply to Vinod Koul

At Tue, 12 Jun 2012 16:16:17 +0530,

Quoted 6 lines · Vinod Koul

during pause the core should maintain the status-quo on the device and pointers and not wake up. If app needs it should call DROP explcitly.

Thanks, applied these now.

Takashi

Quoted 23 lines
---
 sound/core/compress_offload.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
sound/core/compress_offload.c +1 -3
index a68aed7..375f7a0 100644
@@ -502,10 +502,8 @@ static int snd_compr_pause(struct snd_compr_stream *stream)
 	if (stream->runtime->state != SNDRV_PCM_STATE_RUNNING)
 		return -EPERM;
 	retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_PUSH);
-	if (!retval) {
+	if (!retval)
 		stream->runtime->state = SNDRV_PCM_STATE_PAUSED;
-		wake_up(&stream->runtime->sleep);
-	}
 	return retval;
 }
 
Signature · 1 line
1.7.0.4