From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Andrejs Cainikovs <andrejs.cainikovs@gmail.com>
Cc: <patches@opensource.cirrus.com>, <linux-sound@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Subject: Re: [RFC PATCH v1] ASoC: wm8904: enable fll with fixed mclk
Date: Mon, 11 Mar 2024 11:35:53 +0000 [thread overview]
Message-ID: <Ze7smWSeoCVIcxIo@ediswmail9.ad.cirrus.com> (raw)
In-Reply-To: <20240308155831.141229-1-andrejs.cainikovs@gmail.com>
On Fri, Mar 08, 2024 at 04:58:31PM +0100, Andrejs Cainikovs wrote:
> From: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
>
> Dear all,
>
> This is an attempt to change wm8904 for a scenario when reference clock
> supposed to be fixed to a particular frequency, but is not configured as
> a fixed-clock. While this change is working fine, I'm struggling to
> finalize it, not being able to find a proper solution of adding a check
> whether we want to use fixed MCLK with codec's FLL or not. I could, of
> course, introduce a new device tree property, but do not feel this would
> be a proper way forward. Hence, I'm sending out this RFC patch to gather
> your valuable feedback.
>
> DUT: Dahlia carrier board with Verdin TI AM62 SOM.
> Audio card configuration can be found in ti/k3-am62-verdin-dahlia.dtsi.
At some point one really starts to question if this is really a
"simple card" any more.
> On systems with a fixed reference clock output rate it
> is impossible to use this clock for all audio frequencies.
>
> Following is an example of playing a 44100Hz audio on a system
> with a fixed 25MHz reference clock applied to wm8904 codec,
> in combination with simple-audio-card without mclk-fs:
>
> [ 27.013564] wm8904 1-001a: Target BCLK is 1411200Hz
> [ 27.013601] wm8904 1-001a: Using 25000000Hz MCLK
> [ 27.013611] wm8904 1-001a: CLK_SYS is 12500000Hz
> [ 27.013654] wm8904 1-001a: Selected CLK_SYS_RATIO of 256
> [ 27.013663] wm8904 1-001a: Selected SAMPLE_RATE of 44100Hz
> [ 27.013671] wm8904 1-001a: Selected BCLK_DIV of 80 for 1562500Hz BCLK
> [ 27.013680] wm8904 1-001a: LRCLK_RATE is 35
>
> This leads to a distorted sound and this configuration is unusable.
>
> On the other hand, configuring simple-audio-card with mclk-fs will
> force the system to change MCLK frequency, which supposed to be fixed.
>
> This change forces to use wm8904 FLL while keeping SoC's MCLK
> frequency intact:
>
> [ 234.108149] wm8904 1-001a: Target BCLK is 1411200Hz
> [ 234.108304] wm8904 1-001a: Using 0Hz FLL clock
> [ 234.108722] wm8904 1-001a: FLL configured for 25000000Hz->1411200Hz
> [ 234.108794] wm8904 1-001a: CLK_SYS is 1411200Hz
> [ 234.108835] wm8904 1-001a: Selected CLK_SYS_RATIO of 64
> [ 234.108875] wm8904 1-001a: Selected SAMPLE_RATE of 44100Hz
> [ 234.108913] wm8904 1-001a: Selected BCLK_DIV of 10 for 1411200Hz BCLK
> [ 234.108955] wm8904 1-001a: LRCLK_RATE is 32
>
Hmm... the driver already provides an option to automatically
configure the clock. Is the issue here that in your fail case the
machine driver never calls wm8904_set_sysclk? Or if it does call
it, when and what parameters is it passing?
Thanks,
Charles
next prev parent reply other threads:[~2024-03-11 11:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-08 15:58 Andrejs Cainikovs
2024-03-11 11:35 ` Charles Keepax [this message]
2024-03-12 12:13 ` Andrejs Cainikovs
2024-03-12 13:51 ` Charles Keepax
2024-03-15 10:32 ` Andrejs Cainikovs
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=Ze7smWSeoCVIcxIo@ediswmail9.ad.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=andrejs.cainikovs@gmail.com \
--cc=andrejs.cainikovs@toradex.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/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
all inboxes | Powered by JetHome®