alsa: compress_core: don't wake up on pause
Subsystems (2)
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.
Signed-off-by Namarta Kohli <[email protected]>
Signed-off-by Vinod Koul <[email protected]>
--- sound/core/compress_offload.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
sound/core/compress_offload.c +1 -3
@@ -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
PATCH 2/2 audio: compress_core: cleanup pointers on stop
as the start can be called after stop again, we need to reset state
Signed-off-by Namarta Kohli <[email protected]>
Signed-off-by Vinod Koul <[email protected]>
--- sound/core/compress_offload.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
sound/core/compress_offload.c +4 -0
@@ -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
Takashi Iwai
AppliedAt 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.
Signed-off-by Namarta Kohli <[email protected]>Signed-off-by Vinod Koul <[email protected]>
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@@ -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