]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: qcom: q6asm-dai: Add SNDRV_PCM_INFO_BATCH flag
authorStephan Gerhold <stephan@gerhold.net>
Mon, 30 Mar 2020 17:52:10 +0000 (19:52 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 31 Mar 2020 18:23:54 +0000 (19:23 +0100)
commit39bf2572d88a65d013a3171a9b2c3a136f336000
treef06978dfa7699bf3c78541b14635445976c40838
parent8578eb6057cb09aa450915bb4a6afb4c5ac4ce3f
ASoC: qcom: q6asm-dai: Add SNDRV_PCM_INFO_BATCH flag

At the moment, playing audio with PulseAudio with the qdsp6 driver
results in distorted sound. It seems like its timer-based scheduling
does not work properly with qdsp6 since setting tsched=0 in
the PulseAudio configuration avoids the issue.

Apparently this happens when the pointer() callback is not accurate
enough. There is a SNDRV_PCM_INFO_BATCH flag that can be used to stop
PulseAudio from using timer-based scheduling by default.

According to https://www.alsa-project.org/pipermail/alsa-devel/2014-March/073816.html:

    The flag is being used in the sense explained in the previous audio
    meeting -- the data transfer granularity isn't fine enough but aligned
    to the period size (or less).

q6asm-dai reports the position as multiple of

    prtd->pcm_count = snd_pcm_lib_period_bytes(substream)

so it indeed just a multiple of the period size.

Therefore adding the flag here seems appropriate and makes audio
work out of the box.

Fixes: ce4b211809c3 ("ASoC: qdsp6: q6asm: Add q6asm dai driver")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200330175210.47518-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/qdsp6/q6asm-dai.c