Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1869794ybh; Tue, 14 Jul 2020 09:21:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXtm2+40BSWAH+SqxOb5rxcgK22PuF6gEWkHbfhMA7l+t3lxNooVBWaCY8HKlTqC5CdcU2 X-Received: by 2002:a17:906:5008:: with SMTP id s8mr5088134ejj.147.1594743671139; Tue, 14 Jul 2020 09:21:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594743671; cv=none; d=google.com; s=arc-20160816; b=EA7ti2ivKuG37qgLW1jbYsYEKT02nZ94LBGkKwPvFloA8mUJAbG2Dgt4quT/oGDMb1 J+91RBqJ4HtYLt1GBlImp4ITKJP4ZVJNe0OHKS3cdcXM9vzuUrM6IBNeSxYk6A4keDw1 hhsSct2nbE20x40CXyKsVOIz/T1WrtS+TA5oUcosh3DmV3rrWdvs4OXhIq0h27qAPhhC fQ7f//ATZDfhnbEoagZ1CI6D+MpFpIBqvKmSw1Lz/rLuRJE3RZsKZRwk2lG0VTGwFmzH HPmKvEDs6KwM0/B/ZWbL8r3XqIjALB/r4Mv3L7HTWT52I2c1VGtP03h8zB0JMySvH0hO l5NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:references:cc:to:from:subject; bh=PQw53yVj+lnlGlBCt8So8Rg4WPOROa8S0wgVMmHa0Qg=; b=Zp9CMboYsuraTrvNs4E3hSjEe2yrzmMWNuFu+1xxkibXjluWOdnE8VhZ2JVM+Wo1Zn J+YS22L/edNRiIYhnxhVq7S9GnS4Pe6sA3dSOctL9DYFCI4orVAv80JWizkbhC0AzcWK qSITXOpkuxrFuPisAKNbOCM6MSbN32NHIe9WtMymA6VUq21wvGhvI0VpjkvGkpbhGfOC vOsbU3XEs0139lJzyMjBLc2yN/aeDAE71AIXKed0pgZ1GzQkbZoxfxNvan07PtYbeBXW w19hUWCzCInKa8jiq82XlEGs7AyeZ1Z++CUxSSrAp6Qc1tDoAqaxgWDJIkdHkpfBedAq Qqhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p8si9745657ejf.634.2020.07.14.09.20.47; Tue, 14 Jul 2020 09:21:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727028AbgGNQUj (ORCPT + 99 others); Tue, 14 Jul 2020 12:20:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbgGNQUi (ORCPT ); Tue, 14 Jul 2020 12:20:38 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1993DC061755 for ; Tue, 14 Jul 2020 09:20:38 -0700 (PDT) Received: from [IPv6:2a01:e35:2fb5:1510:f10e:b079:5246:a11f] (unknown [IPv6:2a01:e35:2fb5:1510:f10e:b079:5246:a11f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aferraris) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id A35752A0870; Tue, 14 Jul 2020 17:20:35 +0100 (BST) Subject: Re: [PATCH 0/4] ASoC: fsl_asrc: allow selecting arbitrary clocks From: Arnaud Ferraris To: Nicolin Chen Cc: alsa-devel@alsa-project.org, Timur Tabi , Xiubo Li , linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Rob Herring , Mark Brown , kernel@collabora.com, Fabio Estevam References: <20200702142235.235869-1-arnaud.ferraris@collabora.com> <20200702184226.GA23935@Asurada-Nvidia> <3f39a0bb-a766-f646-28b3-a51cf9983c6b@collabora.com> Autocrypt: addr=arnaud.ferraris@collabora.com; keydata= mQINBF6V3oEBEADExzr1s9YngScJ0KNMGen7k3cH1sn0h7tf7AFlXA94jXBgFyzIMT5lqey0 9LwcO6AIkFF+gRVAKIblkeacsy5W6OQXgdFMitx936oAcU0XYQ2X5NxCQHzEsWYzkLIZnFTB Ur3CW9HtAjAircED5KVJzA1GM8BEFfG3LoonWsw0CO9UN2arwT1uLARSPgL6LPpmo1IOSwJh D6vtOyzlRrLkw4KHzUobEiIjxzjXttH8TC3I6OSb8kavG08cmA+DMf/nLFxK0QbdOP2wSZ0w UTU6RBikuLmDBaT4PphuwtAgVwhO9l0PNRoYzugrXuRF0RCLpmJN05tz/o/w7Y8ieLgQE8Om xGKXJyo0T4wlUl9ARM9Y0ZIRhdI1alFspBcF63oyZmOAT+2fPLr6W0fEfmtMBhDaZun2ZdKR M1JwTTkh8jVLs3svM3Ch2JjiH0kgYA0oza5fXaB9s4Fa4fxpmacx8fawKR5r/BhmYNK15PPd YxIZJqnTJgCDI2G4tQ9K+Eev1rBo6i8n96rDqxTxdyQixMhxMmGtj6/bknpVIN947ABKDHdt UsWa4E+qwFrYDXT7RxhL+JGn4VrtIR1kpTJHfmVXnn+RW7JKdDkalvEuXJSOArszcgpDlYRq +ZT/ybdcmdtuz8+Ev0fig/9WdPBHwg5oKDlT6+iN0oISAzoFSQARAQABtC9Bcm5hdW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Dd9NfDGVWZX2PZrHPkxiC6kJlq+ 9skF89liUCOGeIbfT4Gp/GNOWPRp1q2lj/12AT3yh97E9PghVdOOkxdHfFRIxt6qfcinl3w0 ihwz588Q48GmFzJw0LOidtCC5tW4m2CX01Gq7qdGd92R0+S36Zjxl8n2jhypQ1zRmrngf7M5 xZQG6fKWuIur3RI= Message-ID: <3fea8912-63df-ff27-0c29-6284a85107ab@collabora.com> Date: Tue, 14 Jul 2020 18:20:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <3f39a0bb-a766-f646-28b3-a51cf9983c6b@collabora.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nic, Le 03/07/2020 à 11:38, Arnaud Ferraris a écrit : > Hi Nic, > > Le 02/07/2020 à 20:42, Nicolin Chen a écrit : >> Hi Arnaud, >> >> On Thu, Jul 02, 2020 at 04:22:31PM +0200, Arnaud Ferraris wrote: >>> The current ASRC driver hardcodes the input and output clocks used for >>> sample rate conversions. In order to allow greater flexibility and to >>> cover more use cases, it would be preferable to select the clocks using >>> device-tree properties. >> >> We recent just merged a new change that auto-selecting internal >> clocks based on sample rates as the first option -- ideal ratio >> mode is the fallback mode now. Please refer to: >> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20200702&id=d0250cf4f2abfbea64ed247230f08f5ae23979f0 > > That looks interesting, thanks for pointing this out! > I'll rebase and see how it works for my use-case, will keep you informed. > > Regards, > Arnaud > I finally got some time to test and debug clock auto-selection on my system, and unfortunately couldn't get it to work. Here's some background about my use case: the i.MX6 board acts as a Bluetooth proxy between a phone and a headset. It has 2 Bluetooth modules (one for each connected device), with audio connected to SSI1 & SSI2. Audio sample rate can be either 8 or 16kHz, and bclk can be either 512 or 1024kHz, all depending of the capabilities of the headset and phone. In our case we want SSI2 to be the input clock to the ASRC and SSI1 the output clock, but there is no way to force that with auto-selection: both clocks are multiples of both 8k and 16k, so the algorithm will always select the SSI1 clock. I don't think auto-selection can be made smart enough to cover this case, which is why I believe we still need a way to manually setup the input and output clocks to be used by ASRC, falling back to auto-selecting the clocks if not setup manually. If not using DT bindings, what do you think would be the best way to implement that? Regards, Arnaud