From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuninori Morimoto Subject: Re: How to handle stream rates if CPU supports many channels ? Date: Tue, 6 Jun 2017 23:41:14 +0000 Message-ID: <87efuw4rkv.wl%kuninori.morimoto.gx@renesas.com> References: <87tw3uymhu.wl%kuninori.morimoto.gx@renesas.com> <6d1e2ca9-2a3f-ff12-28c4-c96224760913@sakamocchi.jp> <874lvtzjo5.wl%kuninori.morimoto.gx@renesas.com> <39b056b5-2085-5583-d440-9fa075db04d1@sakamocchi.jp> 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 relmlie4.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa0.perex.cz (Postfix) with ESMTP id 636FD26681D for ; Wed, 7 Jun 2017 01:41:21 +0200 (CEST) In-Reply-To: <39b056b5-2085-5583-d440-9fa075db04d1@sakamocchi.jp> 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: Takashi Sakamoto Cc: Linux-ALSA , Mark Brown , Hiroyuki Yokoyama List-Id: alsa-devel@alsa-project.org Hi Sakamoto-san > > Here, I'm not yet 100% understanding about these value. > > I think, above are constraints of whole driver (= it supports both 2ch, 8ch). > > It's not my intension. I don't know exactly where you implement > 'struct snd_soc_pcm_stream' data in your driver. Perhaps as a part of > 'struct snd_soc_dai_driver' data. OK, thank you for your help I will investigate it. > > About rate_min/max and rates. > > is this "rate_min" 48000 (= maximum rate of min case = 8ch) ?? not 8000 ? > > (For example, if 2ch supports 8000-192000, 8ch supports 8000-48000) > > > > And is .rates "SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_192000" ? > > not SNDRV_PCM_RATE_8000_192000 ? > > In my code snippets, I assumed that the hardware supports just two > modes; 8ch/48.0kHz and 2ch/192.0kHz. You can expand the snippets as > your case. Even if using SNDRV_PCM_RATE_8000_192000, role of the > 'hw_rule_rate()' and the 'hw_rule_channels()' is invariant. The former > checks channels parameters and constrains rate parameter with valid > interval. The latter checks and constraints vice versa with valid > list. Sorry for my un-understandable example. Thank you for your detail explanation, it is very helpful for me. I will invariant and try to implement this feature Best regards --- Kuninori Morimoto