[alsa-devel] How to handle stream rates if CPU supports many channels ?

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Tue Jun 6 02:48:22 CEST 2017


Hi ALSA ML

I want to ask you about struct snd_soc_pcm_stream::rates which
indicates available sampling rates (= SNDRV_PCM_RATE_xxxx).

Basic use case of my CPU driver is 2ch output,
but, it can handle 6ch, 8ch, 16ch sounds.
And it can be clock master.

In this case, for example, if CPU has 12288000 system clock
and it uses 32bit for each 1ch data (it has divider inside).

	Max 2ch sound Hz = 12288000 / 32 / 2 = 192000Hz
	Max 8ch sound Hz = 12288000 / 32 / 8 =  48000Hz

If my understanding was correct, struct snd_soc_pcm_stream::rates
is needed when sound device "open" timing
(= struct snd_soc_dai_ops::startup), but, we can receive used
channels number when "hw_params" timing ?

My question is that if system has 12288000, and if it can
support both 2ch and 8ch, what struct snd_soc_pcm_stream::rates
should have ??
	SNDRV_PCM_RATE_8000_192000 ?
	SNDRV_PCM_RATE_8000_48000  ?

Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list