aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/pcm_native.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/pcm_native.c')
-rw-r--r--sound/core/pcm_native.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index a3b2a647924..8bc7cb3db33 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -142,7 +142,7 @@ int snd_pcm_info_user(struct snd_pcm_substream *substream,
142 142
143#ifdef RULES_DEBUG 143#ifdef RULES_DEBUG
144#define HW_PARAM(v) [SNDRV_PCM_HW_PARAM_##v] = #v 144#define HW_PARAM(v) [SNDRV_PCM_HW_PARAM_##v] = #v
145char *snd_pcm_hw_param_names[] = { 145static const char * const snd_pcm_hw_param_names[] = {
146 HW_PARAM(ACCESS), 146 HW_PARAM(ACCESS),
147 HW_PARAM(FORMAT), 147 HW_PARAM(FORMAT),
148 HW_PARAM(SUBFORMAT), 148 HW_PARAM(SUBFORMAT),
@@ -864,6 +864,8 @@ static void snd_pcm_post_start(struct snd_pcm_substream *substream, int state)
864 struct snd_pcm_runtime *runtime = substream->runtime; 864 struct snd_pcm_runtime *runtime = substream->runtime;
865 snd_pcm_trigger_tstamp(substream); 865 snd_pcm_trigger_tstamp(substream);
866 runtime->hw_ptr_jiffies = jiffies; 866 runtime->hw_ptr_jiffies = jiffies;
867 runtime->hw_ptr_buffer_jiffies = (runtime->buffer_size * HZ) /
868 runtime->rate;
867 runtime->status->state = state; 869 runtime->status->state = state;
868 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && 870 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
869 runtime->silence_size > 0) 871 runtime->silence_size > 0)
@@ -978,6 +980,10 @@ static int snd_pcm_do_pause(struct snd_pcm_substream *substream, int push)
978{ 980{
979 if (substream->runtime->trigger_master != substream) 981 if (substream->runtime->trigger_master != substream)
980 return 0; 982 return 0;
983 /* some drivers might use hw_ptr to recover from the pause -
984 update the hw_ptr now */
985 if (push)
986 snd_pcm_update_hw_ptr(substream);
981 /* The jiffies check in snd_pcm_update_hw_ptr*() is done by 987 /* The jiffies check in snd_pcm_update_hw_ptr*() is done by
982 * a delta betwen the current jiffies, this gives a large enough 988 * a delta betwen the current jiffies, this gives a large enough
983 * delta, effectively to skip the check once. 989 * delta, effectively to skip the check once.
@@ -1988,6 +1994,8 @@ void snd_pcm_release_substream(struct snd_pcm_substream *substream)
1988 substream->ops->close(substream); 1994 substream->ops->close(substream);
1989 substream->hw_opened = 0; 1995 substream->hw_opened = 0;
1990 } 1996 }
1997 if (pm_qos_request_active(&substream->latency_pm_qos_req))
1998 pm_qos_remove_request(&substream->latency_pm_qos_req);
1991 if (substream->pcm_release) { 1999 if (substream->pcm_release) {
1992 substream->pcm_release(substream); 2000 substream->pcm_release(substream);
1993 substream->pcm_release = NULL; 2001 substream->pcm_release = NULL;