From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: Brian Sune <briansune@gmail.com>,
Charles Keepax <ckeepax@opensource.cirrus.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] ASoC: wm8978: add missing BCLK divider setup
Date: Wed, 8 Oct 2025 17:27:12 +0100 [thread overview]
Message-ID: <53ba5ea7-ab5f-41dd-853e-2e39efac1321@opensource.cirrus.com> (raw)
In-Reply-To: <20251008160452.1741-1-briansune@gmail.com>
On 08/10/2025 5:04 pm, Brian Sune wrote:
> In previous WM8978 codec driver versions, wm8978_set_dai_clkdiv
> might not have been called for BCLK, leaving the bit clock
> divider unconfigured. This could cause incorrect or unstable audio
> clocks depending on sample rate and word length.
>
> This patch adds a check in wm8978_hw_params: if the BCLK divider
> has not been set via wm8978_set_dai_clkdiv, it is dynamically
> calculated and configured at runtime.
> This ensures that BCLK is always correctly set, whether the
> machine driver configures it explicitly or not.
>
> Apart from this core patch, due to request from Mark Brown and
> Charles Keepax. Overclock BCLK setup is applied, and dropped the
> possible lowest error BCLK result.
Selecting a lowest-error rate is not valid I2S.
You must have enough BCLK cycles to send all the data. If number
of BCLK cycles < number of sample bits you cannot send all the
sample bits. So that would be an incorrect setup.
> On top of the overclocking,
Using a higher BCLK is valid I2S. In fact, it is exactly defined in the
I2S specification that there can be more BCLK cycles than data bits
and the RX end should ignore extra cycles.
> warning message is given to user as a reminding.
Warning the user that you selected the correct BCLK is strange.
> This patch author do not agree with this design nor
> concept from first place!
For example if you are sending stereo 16-bit samples at 48 kHz you must
have a BCLK at least 48000 * 16 * 2 = 1536000 Hz.
If the _nearest_ BCLK is < 1536000 you don't have enough clock
cycles to send all the sample bits.
next prev parent reply other threads:[~2025-10-08 16:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-08 16:04 Brian Sune
2025-10-08 16:27 ` Richard Fitzgerald [this message]
2025-10-08 16:37 ` Sune Brian
2025-10-08 16:58 ` Sune Brian
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=53ba5ea7-ab5f-41dd-853e-2e39efac1321@opensource.cirrus.com \
--to=rf@opensource.cirrus.com \
--cc=briansune@gmail.com \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.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
all inboxes | Powered by JetHome®