From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7CC0C433DF for ; Tue, 14 Jul 2020 20:28:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7D23D2072D for ; Tue, 14 Jul 2020 20:28:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594758485; bh=O20GcOLOg0ZHMThXbLDLtb0d8nA0bfVDYgFNb7RkvkQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=yiRaRLRn18fSutsFEp7QSZ9B1Nf/mrv8s2QEQXC/dh3j2rW/4tLc+iXflPFiAVZQE K/WYtvL4LE0tI8pX+FiV+L16BUP31vFdpd4pRLs1x5vpnxK2YZGyUN6MY2214iI8wM rlsEhyYVrHILTPwysL714iadqNJ/DuvZJih0GVFo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726834AbgGNU2E (ORCPT ); Tue, 14 Jul 2020 16:28:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:48366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726788AbgGNU2D (ORCPT ); Tue, 14 Jul 2020 16:28:03 -0400 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B09CD206F5; Tue, 14 Jul 2020 20:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594758483; bh=O20GcOLOg0ZHMThXbLDLtb0d8nA0bfVDYgFNb7RkvkQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QwYkfz5vHa0na1sEdlHRsjcxFA5xtFj89EgYrkqMn8rPUwU1u4UiTYO2ESyrq0LT7 xE8GWdhqU8LkgcYvIcZPd9abQDDz8/RcPwC8Ly/ViIawesFSdMhUb/PTzEKCtFsNWv 3H2HCwuRbAh86KdqQ+bhjXpeRZkITDAH9/eKWpmw= Date: Tue, 14 Jul 2020 21:27:53 +0100 From: Mark Brown To: Nicolin Chen Cc: Arnaud Ferraris , alsa-devel@alsa-project.org, Timur Tabi , Xiubo Li , linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Rob Herring , kernel@collabora.com, Fabio Estevam Subject: Re: [PATCH 0/4] ASoC: fsl_asrc: allow selecting arbitrary clocks Message-ID: <20200714202753.GM4900@sirena.org.uk> References: <20200702142235.235869-1-arnaud.ferraris@collabora.com> <20200702184226.GA23935@Asurada-Nvidia> <3f39a0bb-a766-f646-28b3-a51cf9983c6b@collabora.com> <3fea8912-63df-ff27-0c29-6284a85107ab@collabora.com> <20200714201544.GA10501@Asurada-Nvidia> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Nj4mAaUCx+wbOcQD" Content-Disposition: inline In-Reply-To: <20200714201544.GA10501@Asurada-Nvidia> X-Cookie: Your password is pitifully obvious. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Nj4mAaUCx+wbOcQD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jul 14, 2020 at 01:15:45PM -0700, Nicolin Chen wrote: > On Tue, Jul 14, 2020 at 06:20:32PM +0200, Arnaud Ferraris wrote: > > 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. > Anything wrong with ASRC selecting SSI1 clock for both cases? The > driver calculates the divisors based on the given clock rate, so > the final internal rate should be the same. If there's a problem, > I feel that's a separate bug. The nominal rate might be the same but if they're in different clock domains then the actual rates might be different (hence the desire for an ASRC I guess). I can see the system wanting to choose one clock or the other on the basis of some system specific property (quality of the clock sources, tolerances of the devices involved or something) though it's a rather fun edge case configuration :/ . --Nj4mAaUCx+wbOcQD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl8OFUkACgkQJNaLcl1U h9DuHAf/TDGYWuygKrfJ8bywVG9u74SpJ9heHBWUzyeOwBeMmD2EcIZQTbcYbFy0 R2f5uRyhd5nQrLyrkVLq/o5HEgVV8Zpfi0OGQ25q5ehRQU3ni+8fkcHYtq3/uaI7 z8tQG2zuZiUDmN+thLC9a/H6SWEZSySVThHUsyFg+zU7WXVTmrMGnCIcjV5IlXPf ErlMV1E0eWVn+Ti6rIYbG3RhGi7B4ATv3AY+0BT628Bel2zqknmTkFYH+SXMPspc FzT/bvTQxCOOFl75BY8+qSS2H2MEVzdVSrhEEvopDBXCvspyHMMBX50CqcNJnFHc 4q3Oyckri7vWm5rmbqcwsCwbohRa0w== =/XN2 -----END PGP SIGNATURE----- --Nj4mAaUCx+wbOcQD-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEE70C433DF for ; Tue, 14 Jul 2020 20:29:11 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4A59E2072D for ; Tue, 14 Jul 2020 20:29:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="FIFcvAXB"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="QwYkfz5v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4A59E2072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CDC4215F2; Tue, 14 Jul 2020 22:28:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CDC4215F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1594758549; bh=O20GcOLOg0ZHMThXbLDLtb0d8nA0bfVDYgFNb7RkvkQ=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FIFcvAXBLLdMVep+zESNI7BRIbxH4whOq0aGBKOD6knHhXa0Ii/qivFXvdNMtKHa/ vt8AydLJ3VkvUlo2q/I860yOhHYbLHnYpL/Qs0vRpR40Q72cO7StoIhfIaK13Opi8B 0xH0bUrW0UwKdVQmqQ6MvvXVYCNFHml2coYeZ534= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 52D0CF8016F; Tue, 14 Jul 2020 22:28:19 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B35A4F801EC; Tue, 14 Jul 2020 22:28:14 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9BD97F800E5 for ; Tue, 14 Jul 2020 22:28:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9BD97F800E5 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="QwYkfz5v" Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B09CD206F5; Tue, 14 Jul 2020 20:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594758483; bh=O20GcOLOg0ZHMThXbLDLtb0d8nA0bfVDYgFNb7RkvkQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QwYkfz5vHa0na1sEdlHRsjcxFA5xtFj89EgYrkqMn8rPUwU1u4UiTYO2ESyrq0LT7 xE8GWdhqU8LkgcYvIcZPd9abQDDz8/RcPwC8Ly/ViIawesFSdMhUb/PTzEKCtFsNWv 3H2HCwuRbAh86KdqQ+bhjXpeRZkITDAH9/eKWpmw= Date: Tue, 14 Jul 2020 21:27:53 +0100 From: Mark Brown To: Nicolin Chen Subject: Re: [PATCH 0/4] ASoC: fsl_asrc: allow selecting arbitrary clocks Message-ID: <20200714202753.GM4900@sirena.org.uk> References: <20200702142235.235869-1-arnaud.ferraris@collabora.com> <20200702184226.GA23935@Asurada-Nvidia> <3f39a0bb-a766-f646-28b3-a51cf9983c6b@collabora.com> <3fea8912-63df-ff27-0c29-6284a85107ab@collabora.com> <20200714201544.GA10501@Asurada-Nvidia> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Nj4mAaUCx+wbOcQD" Content-Disposition: inline In-Reply-To: <20200714201544.GA10501@Asurada-Nvidia> X-Cookie: Your password is pitifully obvious. User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Arnaud Ferraris , Timur Tabi , alsa-devel@alsa-project.org, Xiubo Li , Liam Girdwood , linux-kernel@vger.kernel.org, Takashi Iwai , Rob Herring , kernel@collabora.com, Fabio Estevam X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" --Nj4mAaUCx+wbOcQD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jul 14, 2020 at 01:15:45PM -0700, Nicolin Chen wrote: > On Tue, Jul 14, 2020 at 06:20:32PM +0200, Arnaud Ferraris wrote: > > 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. > Anything wrong with ASRC selecting SSI1 clock for both cases? The > driver calculates the divisors based on the given clock rate, so > the final internal rate should be the same. If there's a problem, > I feel that's a separate bug. The nominal rate might be the same but if they're in different clock domains then the actual rates might be different (hence the desire for an ASRC I guess). I can see the system wanting to choose one clock or the other on the basis of some system specific property (quality of the clock sources, tolerances of the devices involved or something) though it's a rather fun edge case configuration :/ . --Nj4mAaUCx+wbOcQD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl8OFUkACgkQJNaLcl1U h9DuHAf/TDGYWuygKrfJ8bywVG9u74SpJ9heHBWUzyeOwBeMmD2EcIZQTbcYbFy0 R2f5uRyhd5nQrLyrkVLq/o5HEgVV8Zpfi0OGQ25q5ehRQU3ni+8fkcHYtq3/uaI7 z8tQG2zuZiUDmN+thLC9a/H6SWEZSySVThHUsyFg+zU7WXVTmrMGnCIcjV5IlXPf ErlMV1E0eWVn+Ti6rIYbG3RhGi7B4ATv3AY+0BT628Bel2zqknmTkFYH+SXMPspc FzT/bvTQxCOOFl75BY8+qSS2H2MEVzdVSrhEEvopDBXCvspyHMMBX50CqcNJnFHc 4q3Oyckri7vWm5rmbqcwsCwbohRa0w== =/XN2 -----END PGP SIGNATURE----- --Nj4mAaUCx+wbOcQD--