public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Arnaud Ferraris <arnaud.ferraris@collabora.com>
To: alsa-devel@alsa-project.org
Cc: Arnaud Ferraris <arnaud.ferraris@collabora.com>,
	Timur Tabi <timur@kernel.org>, Xiubo Li <Xiubo.Lee@gmail.com>,
	Fabio Estevam <festevam@gmail.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org,
	Nicolin Chen <nicoleotsuka@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	kernel@collabora.com, Shengjiu Wang <shengjiu.wang@gmail.com>
Subject: [PATCH 2/2] ASoC: fsl_asrc: always use internal ratio
Date: Thu, 16 Jul 2020 16:52:01 +0200	[thread overview]
Message-ID: <20200716145201.186270-3-arnaud.ferraris@collabora.com> (raw)
In-Reply-To: <20200716145201.186270-1-arnaud.ferraris@collabora.com>

Even though the current driver calculates the dividers to be used
depending on the clocks and sample rates, enabling the internal ratio
can lead to noticeable improvements in the audio quality, based on my
testing.

As stated in the documentation, "When USRx=1 and IDRx=0, ASRC internal
measured ratio will be used", so setting this bit even when not in
"Ideal Ratio" mode still makes sense.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
---
 sound/soc/fsl/fsl_asrc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index bfd35b9c0781..cc0f70c9140f 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -465,7 +465,7 @@ static int fsl_asrc_config_pair(struct fsl_asrc_pair *pair, bool use_ideal_rate)
 	regmap_update_bits(asrc->regmap, REG_ASRCTR,
 			   ASRCTR_ATSi_MASK(index), ASRCTR_ATS(index));
 	regmap_update_bits(asrc->regmap, REG_ASRCTR,
-			   ASRCTR_USRi_MASK(index), 0);
+			   ASRCTR_USRi_MASK(index), ASRCTR_USR(index));
 
 	/* Set the input and output clock sources */
 	regmap_update_bits(asrc->regmap, REG_ASRCSR,
@@ -507,8 +507,7 @@ static int fsl_asrc_config_pair(struct fsl_asrc_pair *pair, bool use_ideal_rate)
 
 	/* Enable Ideal Ratio mode */
 	regmap_update_bits(asrc->regmap, REG_ASRCTR,
-			   ASRCTR_IDRi_MASK(index) | ASRCTR_USRi_MASK(index),
-			   ASRCTR_IDR(index) | ASRCTR_USR(index));
+			   ASRCTR_IDRi_MASK(index), ASRCTR_IDR(index);
 
 	fsl_asrc_sel_proc(inrate, outrate, &pre_proc, &post_proc);
 
-- 
2.27.0


  parent reply	other threads:[~2020-07-16 14:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 14:51 [PATCH 0/2] ASoC: fsl_asrc: improve clock selection and quality Arnaud Ferraris
2020-07-16 14:52 ` [PATCH 1/2] ASoC: fsl_asrc: make sure the input and output clocks are different Arnaud Ferraris
2020-07-16 15:07   ` Arnaud Ferraris
2020-07-16 14:52 ` Arnaud Ferraris [this message]
2020-07-16 15:13 ` [PATCH v2 0/2] ASoC: fsl_asrc: improve clock selection and quality Arnaud Ferraris
2020-07-16 15:13   ` [PATCH v2 1/2] ASoC: fsl_asrc: make sure the input and output clocks are different Arnaud Ferraris
2020-07-16 23:20     ` Nicolin Chen
2020-07-17 10:38       ` [PATCH v3 0/1] ASoC: fsl_asrc: always select different clocks Arnaud Ferraris
2020-07-17 10:38         ` [PATCH v3 1/1] ASoC: fsl_asrc: make sure the input and output clocks are different Arnaud Ferraris
2020-07-17 23:05           ` Nicolin Chen
2020-07-20 10:34           ` Shengjiu Wang
2020-07-17 11:21         ` [PATCH v3 0/1] ASoC: fsl_asrc: always select different clocks Mark Brown
2020-07-17 11:34           ` Arnaud Ferraris
2020-07-17 11:45             ` Mark Brown
2020-07-16 15:13   ` [PATCH v2 2/2] ASoC: fsl_asrc: always use internal ratio Arnaud Ferraris
2020-07-16 23:37     ` Nicolin Chen
2020-07-17  9:58       ` Arnaud Ferraris
2020-07-20 10:20         ` Shengjiu Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200716145201.186270-3-arnaud.ferraris@collabora.com \
    --to=arnaud.ferraris@collabora.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@collabora.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicoleotsuka@gmail.com \
    --cc=shengjiu.wang@gmail.com \
    --cc=timur@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox