Skip to content

Commit 7f2430c

Browse files
stephan-ghbroonie
authored andcommitted
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: 2a9e92d ("ASoC: qdsp6: q6asm: Add q6asm dai driver") Signed-off-by: Stephan Gerhold <[email protected]> Reviewed-by: Srinivas Kandagatla <[email protected]> Cc: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 7f95581 commit 7f2430c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/soc/qcom/qdsp6/q6asm-dai.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct q6asm_dai_data {
7878
};
7979

8080
static const struct snd_pcm_hardware q6asm_dai_hardware_capture = {
81-
.info = (SNDRV_PCM_INFO_MMAP |
81+
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_BATCH |
8282
SNDRV_PCM_INFO_BLOCK_TRANSFER |
8383
SNDRV_PCM_INFO_MMAP_VALID |
8484
SNDRV_PCM_INFO_INTERLEAVED |
@@ -100,7 +100,7 @@ static const struct snd_pcm_hardware q6asm_dai_hardware_capture = {
100100
};
101101

102102
static struct snd_pcm_hardware q6asm_dai_hardware_playback = {
103-
.info = (SNDRV_PCM_INFO_MMAP |
103+
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_BATCH |
104104
SNDRV_PCM_INFO_BLOCK_TRANSFER |
105105
SNDRV_PCM_INFO_MMAP_VALID |
106106
SNDRV_PCM_INFO_INTERLEAVED |

0 commit comments

Comments
 (0)