Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff0543c7 authored by Kenneth Westfield's avatar Kenneth Westfield
Browse files

ALSA: pcm: call delay_blk op from DELAY ioctl



Call the delay_blk() pcm op from the
SNDRV_PCM_IOCTL_DELAY ioctl.  This will update the
runtime->delay field with the current DSP path
delay before it is used to return the total delay.

Change-Id: I485139666a639566782a93b566b30899f2f5e791
Signed-off-by: default avatarKenneth Westfield <kwestfie@codeaurora.org>
parent 32c2ea1f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -873,6 +873,7 @@ int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream,
int snd_pcm_update_state(struct snd_pcm_substream *substream,
			 struct snd_pcm_runtime *runtime);
int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream);
int snd_pcm_update_delay_blk(struct snd_pcm_substream *substream);
int snd_pcm_playback_xrun_check(struct snd_pcm_substream *substream);
int snd_pcm_capture_xrun_check(struct snd_pcm_substream *substream);
int snd_pcm_playback_xrun_asap(struct snd_pcm_substream *substream);
+5 −0
Original line number Diff line number Diff line
@@ -561,6 +561,11 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
	return snd_pcm_update_hw_ptr0(substream, 0);
}

int snd_pcm_update_delay_blk(struct snd_pcm_substream *substream)
{
	return substream->ops->delay_blk(substream);
}

/**
 * snd_pcm_set_ops - set the PCM operators
 * @pcm: the pcm instance
+6 −0
Original line number Diff line number Diff line
@@ -2608,6 +2608,12 @@ static int snd_pcm_delay(struct snd_pcm_substream *substream,
	int err;
	snd_pcm_sframes_t n = 0;

	/*
	 * Called outside irq lock, as this will block waiting for
	 * DSP to respond.
	 */
	snd_pcm_update_delay_blk(substream);

	snd_pcm_stream_lock_irq(substream);
	switch (runtime->status->state) {
	case SNDRV_PCM_STATE_DRAINING: