mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
ALSA: pcm_dmaengine: always get stream position from DMA driver
This patch fixup that the wrong position when dma desc status is DONE. even if the desc status is DONE, it is still able to get the position from the dma driver. so, just remove the judgement. Change-Id: I40e92bae09a002f4f5f0b2fab8b0e99fd3ee269d Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
This commit is contained in:
parent
dfa5695f0c
commit
8345433418
|
|
@ -250,16 +250,13 @@ snd_pcm_uframes_t snd_dmaengine_pcm_pointer(struct snd_pcm_substream *substream)
|
|||
{
|
||||
struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream);
|
||||
struct dma_tx_state state;
|
||||
enum dma_status status;
|
||||
unsigned int buf_size;
|
||||
unsigned int pos = 0;
|
||||
|
||||
status = dmaengine_tx_status(prtd->dma_chan, prtd->cookie, &state);
|
||||
if (status == DMA_IN_PROGRESS || status == DMA_PAUSED) {
|
||||
buf_size = snd_pcm_lib_buffer_bytes(substream);
|
||||
if (state.residue > 0 && state.residue <= buf_size)
|
||||
pos = buf_size - state.residue;
|
||||
}
|
||||
dmaengine_tx_status(prtd->dma_chan, prtd->cookie, &state);
|
||||
buf_size = snd_pcm_lib_buffer_bytes(substream);
|
||||
if (state.residue > 0 && state.residue <= buf_size)
|
||||
pos = buf_size - state.residue;
|
||||
|
||||
return bytes_to_frames(substream->runtime, pos);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user