Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2017140ybh; Tue, 14 Jul 2020 13:16:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQqZa8JZjWQRbOAVtMa9PHLK8DJvrq/1jqWyt8jywWY4HM535b9f9/3L3tvyOtzUzg9EvD X-Received: by 2002:a05:6402:1c07:: with SMTP id ck7mr6266169edb.297.1594757818479; Tue, 14 Jul 2020 13:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594757818; cv=none; d=google.com; s=arc-20160816; b=sqLENiYLl9glaUfMwUoyhLVWq0XmECnPsDFYor/UiOlQi652xaWSSznVgpgWKg+V/B emzL7F5pw31lNJDMRPvRSOWW/OcbvHtRVXSxC8xVVroD24mSzBn+wPHjVZ7982JGp48K zJ2ao+4YC4DV2ABTHxo3+Oep+4mVcz1hBloGBoXtedCXWWFiOIpAHmlJ5Iy3/le1o/34 m9SnRc+Kyk9FjLlCpGEvZAow1ZwstgVaNGQ72IPOi0ba6MT6TGARfSncIMQ1TkupdtOv qubpL5VxcsEOc9woXjqWe31jHYxoSctnzVk7Mwn/usjyGFOZctIOY1b8uDmGbMzRDRUD +UHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=isacsWKlY2hogV7o0KRbs8AppWDN/iG8vIZCQlmiM8c=; b=krFjtC5zKeDr6ahs80MJDKQ1uyzHEMxy10Z5pcTxId11rda43FqaUftaWek8ZGTaj2 wLIrK5lAjpxqTqeMwTgqhw0Urb0qzrqYxS+0CVOPzVvvkUBxyGuzBzyO2WQHd9/x1Vtc Ziy80M64uKeMxQ3I8ZYPGMiVTCGCSarQaELRx4S1KK1lasKi1dkZhMG3xL781ae+oFlB NF0UfU3q9msQcsjXzjhigpPhkVrE9hkeqsj3FhikEs65EOysHdpf4+3tEGrQhwqWB06M jteRw/zjQzlWdcc6x8LlY/T2sjJ8aaVnPcOPY6gPcJ4GHqBgxu48eizHRlV0QFthG+2t v7eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kfJX8RRg; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by19si11809477ejc.417.2020.07.14.13.16.35; Tue, 14 Jul 2020 13:16:58 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kfJX8RRg; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730387AbgGNUQM (ORCPT + 99 others); Tue, 14 Jul 2020 16:16:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730371AbgGNUQJ (ORCPT ); Tue, 14 Jul 2020 16:16:09 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9631C061755 for ; Tue, 14 Jul 2020 13:16:09 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id m9so8070795pfh.0 for ; Tue, 14 Jul 2020 13:16:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=isacsWKlY2hogV7o0KRbs8AppWDN/iG8vIZCQlmiM8c=; b=kfJX8RRgL3w39hgg+eFWjqDIkMxIHuOqN9XY3bPq9N9g+jinxvkDkmvu10fWdrWzkF rlj0sh1ktttzaUUvdLHwZoHH8IsKgZjFLqMeEeI72DXuRmmKzacsqISPv9e4Z0DGiya2 mAgSMVnRa6E8vJkyxMhwo1YRkEzY/NJo77QgqcmssBC3+psgls0rwCkY24T/u8BD5MRY LHJFfsPB235oyZYh8fmjQHMy6cHGfVaKoXFiYDJSWwgWT1OidYj1sc86fvR5OZS4ThuF 7pZv+3xlydLI2ndjEph9mpL+1mEeas9+CnOaEMlwyjiIiyEmWdjyzYVjn8GgGH1T9Ec/ OB5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=isacsWKlY2hogV7o0KRbs8AppWDN/iG8vIZCQlmiM8c=; b=L7g4DmnzkEsGMUbZNfW1dg010j2WdPeWT1PsPN+HbTSYqsiFdEvQZESoQg+9cvvDf4 XE0YltMg+D4q9qQHumXKPHb0j7+DaKXow40pz+jTQuEzRLmjtqfGYTsedtouwGlu0yUC 7Oy23e2RFRHszU2YDNTlU3RCkP3cjf1LFvNG5aHSEH1Cf4SCptzKvR8CHbc3xY5PqYvv gsgSp1yWXJjaka6FTn2Wx/ndeWlbdMElgc8m6D6wByEhjagPpUfuVs3b/J6lyin1mDao WeR/4QlTGgsjuXj+i5owS87ArZBXZE2OLHwSsMsd1f4UIeuKA9fyYkpyBnpyToOrD6hz Lbqw== X-Gm-Message-State: AOAM530Zc3pMR67BqyrnMVEAP0IaX1dCdVmV4PZC5iwpeHETeeWXYKEi 7CawGD7Mv/PQzt04Re3Etsc= X-Received: by 2002:a63:1a44:: with SMTP id a4mr4796308pgm.281.1594757769130; Tue, 14 Jul 2020 13:16:09 -0700 (PDT) Received: from Asurada-Nvidia (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id e28sm37314pfm.177.2020.07.14.13.16.08 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Jul 2020 13:16:08 -0700 (PDT) Date: Tue, 14 Jul 2020 13:15:45 -0700 From: Nicolin Chen To: Arnaud Ferraris 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 Subject: Re: [PATCH 0/4] ASoC: fsl_asrc: allow selecting arbitrary clocks Message-ID: <20200714201544.GA10501@Asurada-Nvidia> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3fea8912-63df-ff27-0c29-6284a85107ab@collabora.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 14, 2020 at 06:20:32PM +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 > 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. 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.