Skip to content

Commit f54e077

Browse files
Sugar Zhangrkhuangtao
authored andcommitted
ASoC: rockchip: pcm: fix wrong voice_inactive_frames when playback
Change-Id: I07a70aa95fa075819d5dd96570c0b3c52f44593e Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
1 parent 6a9bb29 commit f54e077

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

sound/core/pcm_dmaengine.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ static void dmaengine_pcm_dma_complete(void *arg)
136136
struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream);
137137

138138
#ifdef CONFIG_SND_SOC_ROCKCHIP_VAD
139-
if (snd_pcm_vad_attached(substream)) {
139+
if (snd_pcm_vad_attached(substream) &&
140+
substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
140141
void *buf = substream->runtime->dma_area + prtd->pos;
141142

142143
snd_pcm_vad_preprocess(substream, buf,

sound/soc/rockchip/rockchip_multi_dais_pcm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ static void dmaengine_mpcm_dma_complete(void *arg)
9494
#ifdef CONFIG_SND_SOC_ROCKCHIP_VAD
9595
struct dmaengine_mpcm_runtime_data *prtd = substream_to_prtd(substream);
9696

97-
if (snd_pcm_vad_attached(substream)) {
97+
if (snd_pcm_vad_attached(substream) &&
98+
substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
9899
void *buf = substream->runtime->dma_area + prtd->pos;
99100

100101
snd_pcm_vad_preprocess(substream, buf,

0 commit comments

Comments
 (0)