linux-stable/sound/soc/qcom
Srinivas Kandagatla adcc7c98ce ASoC: qcom: q6apm-dai: Add SNDRV_PCM_INFO_BATCH flag
[ Upstream commit aa759f3f9f ]

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).

q6apm-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.

Comment log inspired by Stephan Gerhold sent for q6asm-dai.c few years back.

Fixes: 9b4fe0f1cd ("ASoC: qdsp6: audioreach: add q6apm-dai support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230209122806.18923-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-10 09:33:21 +01:00
..
qdsp6 ASoC: qcom: q6apm-dai: Add SNDRV_PCM_INFO_BATCH flag 2023-03-10 09:33:21 +01:00
apq8016_sbc.c ASoC: qcom: Update to use set_fmt_new callback 2022-06-06 12:33:42 +01:00
apq8096.c ASoC: qcom: apq8096: Constify static snd_soc_ops 2021-10-01 19:35:05 +01:00
common.c ASoC: qcom: Fix building APQ8016 machine driver without SOUNDWIRE 2023-01-18 11:58:27 +01:00
common.h ASoC: qcom: Fix building APQ8016 machine driver without SOUNDWIRE 2023-01-18 11:58:27 +01:00
Kconfig ASoC: qcom: Fix building APQ8016 machine driver without SOUNDWIRE 2023-01-18 11:58:27 +01:00
lpass-apq8016.c ASoC: qcom: lpass: Fix apq8016 compat string to match yaml 2022-06-28 13:18:30 +01:00
lpass-cdc-dma.c ASoC: qcom: Add lpass CPU driver for codec dma control 2022-02-24 20:21:46 +00:00
lpass-cpu.c ASoC: qcom: lpass-cpu: Fix fallback SD line index handling 2023-01-18 11:58:12 +01:00
lpass-hdmi.c ASoC: qcom: lpass-hdmi: remove useless return 2021-03-10 13:01:49 +00:00
lpass-hdmi.h ASoC: qcom: Add support for lpass hdmi driver 2020-10-08 20:27:34 +01:00
lpass-ipq806x.c ASoC: qcom: lpass-ipq806x: fix bitwidth regmap field 2021-01-20 16:46:47 +00:00
lpass-lpaif-reg.h ASoC: qcom: Add register definition for codec rddma and wrdma 2022-02-24 20:21:42 +00:00
lpass-platform.c ASoC: qcom: lpass-platform: Update VMA access permissions in mmap callback 2022-06-01 12:24:10 +02:00
lpass-sc7180.c ASoC: qcom: Add checks for devm_kcalloc 2022-12-31 13:32:15 +01:00
lpass-sc7280.c ASoC: qcom: lpass-sc7280: Add platform driver for lpass audio 2022-02-24 20:21:48 +00:00
lpass.h ASoC: qcom: Add lpass CPU driver for codec dma control 2022-02-24 20:21:46 +00:00
Makefile ASoC: qcom: Fix building APQ8016 machine driver without SOUNDWIRE 2023-01-18 11:58:27 +01:00
sc7180.c ASoC: qcom: Update to use set_fmt_new callback 2022-06-06 12:33:42 +01:00
sc7280.c ASoC: qcom: Add driver support for audioreach solution 2022-06-28 15:14:25 +01:00
sc8280xp.c ASoC: qcom: Fix building APQ8016 machine driver without SOUNDWIRE 2023-01-18 11:58:27 +01:00
sdm845.c ASoC: qcom: Update to use set_fmt_new callback 2022-06-06 12:33:42 +01:00
sdw.c ASoC: qcom: Fix building APQ8016 machine driver without SOUNDWIRE 2023-01-18 11:58:27 +01:00
sdw.h ASoC: qcom: Fix building APQ8016 machine driver without SOUNDWIRE 2023-01-18 11:58:27 +01:00
sm8250.c ASoC: qcom: Fix building APQ8016 machine driver without SOUNDWIRE 2023-01-18 11:58:27 +01:00
storm.c ASoC: qcom: Set card->owner to avoid warnings 2020-08-21 16:12:10 +01:00