From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuninori Morimoto Subject: How to handle stream rates if CPU supports many channels ? Date: Tue, 6 Jun 2017 00:48:22 +0000 Message-ID: <87tw3uymhu.wl%kuninori.morimoto.gx@renesas.com> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id 14833266DCA for ; Tue, 6 Jun 2017 02:48:27 +0200 (CEST) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: Linux-ALSA , Hiroyuki Yokoyama List-Id: alsa-devel@alsa-project.org 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