diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-08-15 06:20:44 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-08-15 06:20:44 -0400 |
commit | 08229de4b42816079ed5d15f0689fcd0af946d5e (patch) | |
tree | 7126dc7b220fbbce745cb5d9a8864e9690587da4 /sound/core/pcm_native.c | |
parent | fbb474dedab871c7382858c374acd287dad4ab38 (diff) | |
parent | 2a708137fd7d3e0928f27157aaed8aba404b11c9 (diff) |
Merge branch 'for-2.6.32' into mxc
Conflicts:
sound/soc/Makefile
Diffstat (limited to 'sound/core/pcm_native.c')
-rw-r--r-- | sound/core/pcm_native.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index b5da656d1ece..ac2150e0670d 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -312,9 +312,18 @@ int snd_pcm_hw_refine(struct snd_pcm_substream *substream, | |||
312 | 312 | ||
313 | hw = &substream->runtime->hw; | 313 | hw = &substream->runtime->hw; |
314 | if (!params->info) | 314 | if (!params->info) |
315 | params->info = hw->info; | 315 | params->info = hw->info & ~SNDRV_PCM_INFO_FIFO_IN_FRAMES; |
316 | if (!params->fifo_size) | 316 | if (!params->fifo_size) { |
317 | params->fifo_size = hw->fifo_size; | 317 | if (snd_mask_min(¶ms->masks[SNDRV_PCM_HW_PARAM_FORMAT]) == |
318 | snd_mask_max(¶ms->masks[SNDRV_PCM_HW_PARAM_FORMAT]) && | ||
319 | snd_mask_min(¶ms->masks[SNDRV_PCM_HW_PARAM_CHANNELS]) == | ||
320 | snd_mask_max(¶ms->masks[SNDRV_PCM_HW_PARAM_CHANNELS])) { | ||
321 | changed = substream->ops->ioctl(substream, | ||
322 | SNDRV_PCM_IOCTL1_FIFO_SIZE, params); | ||
323 | if (changed < 0) | ||
324 | return changed; | ||
325 | } | ||
326 | } | ||
318 | params->rmask = 0; | 327 | params->rmask = 0; |
319 | return 0; | 328 | return 0; |
320 | } | 329 | } |
@@ -587,14 +596,15 @@ int snd_pcm_status(struct snd_pcm_substream *substream, | |||
587 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 596 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
588 | status->avail = snd_pcm_playback_avail(runtime); | 597 | status->avail = snd_pcm_playback_avail(runtime); |
589 | if (runtime->status->state == SNDRV_PCM_STATE_RUNNING || | 598 | if (runtime->status->state == SNDRV_PCM_STATE_RUNNING || |
590 | runtime->status->state == SNDRV_PCM_STATE_DRAINING) | 599 | runtime->status->state == SNDRV_PCM_STATE_DRAINING) { |
591 | status->delay = runtime->buffer_size - status->avail; | 600 | status->delay = runtime->buffer_size - status->avail; |
592 | else | 601 | status->delay += runtime->delay; |
602 | } else | ||
593 | status->delay = 0; | 603 | status->delay = 0; |
594 | } else { | 604 | } else { |
595 | status->avail = snd_pcm_capture_avail(runtime); | 605 | status->avail = snd_pcm_capture_avail(runtime); |
596 | if (runtime->status->state == SNDRV_PCM_STATE_RUNNING) | 606 | if (runtime->status->state == SNDRV_PCM_STATE_RUNNING) |
597 | status->delay = status->avail; | 607 | status->delay = status->avail + runtime->delay; |
598 | else | 608 | else |
599 | status->delay = 0; | 609 | status->delay = 0; |
600 | } | 610 | } |
@@ -2410,6 +2420,7 @@ static int snd_pcm_delay(struct snd_pcm_substream *substream, | |||
2410 | n = snd_pcm_playback_hw_avail(runtime); | 2420 | n = snd_pcm_playback_hw_avail(runtime); |
2411 | else | 2421 | else |
2412 | n = snd_pcm_capture_avail(runtime); | 2422 | n = snd_pcm_capture_avail(runtime); |
2423 | n += runtime->delay; | ||
2413 | break; | 2424 | break; |
2414 | case SNDRV_PCM_STATE_XRUN: | 2425 | case SNDRV_PCM_STATE_XRUN: |
2415 | err = -EPIPE; | 2426 | err = -EPIPE; |