|
@@ -587,14 +587,15 @@ int snd_pcm_status(struct snd_pcm_substream *substream,
|
|
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
|
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
|
status->avail = snd_pcm_playback_avail(runtime);
|
|
status->avail = snd_pcm_playback_avail(runtime);
|
|
if (runtime->status->state == SNDRV_PCM_STATE_RUNNING ||
|
|
if (runtime->status->state == SNDRV_PCM_STATE_RUNNING ||
|
|
- runtime->status->state == SNDRV_PCM_STATE_DRAINING)
|
|
|
|
|
|
+ runtime->status->state == SNDRV_PCM_STATE_DRAINING) {
|
|
status->delay = runtime->buffer_size - status->avail;
|
|
status->delay = runtime->buffer_size - status->avail;
|
|
- else
|
|
|
|
|
|
+ status->delay += runtime->delay;
|
|
|
|
+ } else
|
|
status->delay = 0;
|
|
status->delay = 0;
|
|
} else {
|
|
} else {
|
|
status->avail = snd_pcm_capture_avail(runtime);
|
|
status->avail = snd_pcm_capture_avail(runtime);
|
|
if (runtime->status->state == SNDRV_PCM_STATE_RUNNING)
|
|
if (runtime->status->state == SNDRV_PCM_STATE_RUNNING)
|
|
- status->delay = status->avail;
|
|
|
|
|
|
+ status->delay = status->avail + runtime->delay;
|
|
else
|
|
else
|
|
status->delay = 0;
|
|
status->delay = 0;
|
|
}
|
|
}
|
|
@@ -2404,6 +2405,7 @@ static int snd_pcm_delay(struct snd_pcm_substream *substream,
|
|
n = snd_pcm_playback_hw_avail(runtime);
|
|
n = snd_pcm_playback_hw_avail(runtime);
|
|
else
|
|
else
|
|
n = snd_pcm_capture_avail(runtime);
|
|
n = snd_pcm_capture_avail(runtime);
|
|
|
|
+ n += runtime->delay;
|
|
break;
|
|
break;
|
|
case SNDRV_PCM_STATE_XRUN:
|
|
case SNDRV_PCM_STATE_XRUN:
|
|
err = -EPIPE;
|
|
err = -EPIPE;
|