Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Hsieh Hung-En <hungen3108@gmail.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Hsieh Hung-En <hungen3108@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Shengjiu Wang <shengjiu.wang@gmail.com>,
	Fabio Estevam <festevam@gmail.com>,
	Nicolin Chen <nicoleotsuka@gmail.com>,
	Xiubo Li <Xiubo.Lee@gmail.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 02/21] ASoC: fsl: use .auto_selectable_formats
Date: Tue, 22 Sep 2026 16:35:05 +0800	[thread overview]
Message-ID: <20260922083512.2256991-1-hungen3108@gmail.com> (raw)
In-Reply-To: <87wlt3yw5b.wl-kuninori.morimoto.gx@renesas.com>

Hi,

I tested this on an i.MX95 board with an SAI3 <-> TLV320AIC3101 link,
on top of broonie/sound.git for-7.4 (f42fbd560cd8), which already has
cb125dde4b5d ("ASoC: codecs: tlv320*: use .auto_selectable_formats"),
so both ends of the link advertise their formats.

Two device trees, differing in one property:

  - control:       simple-audio-card,format = "i2s";
  - auto-selected: that property deleted, so the FORMAT bits are left
                   for soc_dai_auto_select_format() to fill in.

bitclock-master and frame-master are present in both, so the
clock-provider relationship stays fixed while format/polarity selection
is exercised.

The card registers and plays in both cases, and the hardware ends up
configured identically (read during a stream):

              control       auto-selected
  SAI TCR4    0x10010F3B    0x10010F3B    FSE|FSP -> I2S, FSD_MSTR,
  SAI RCR4    0x10010F3B    0x10010F3B    SYWD=0x0f, FRSZ=1
  SAI TCR2    0x43000000    0x43000000
  SAI RCR2    0x07000003    0x07000003
  AIC3101 r8  0x00          0x00          codec is clock consumer
  AIC3101 r9  0x00          0x00          bits 7:6 = 00 -> I2S

So auto-selection lands on I2S + NB_NF, matching the effective DAI
format of the control case.

That the card came up at all is informative here, because a wrong pick
is not silent on this codec: aic3x_set_dai_fmt() validates format and
inversion together, and the codec's low-priority entry is
DSP_A|DSP_B|IB_NF while fsl_sai advertises DSP_A, DSP_B and all four
inversion combinations. I checked this with a third device tree using

    simple-audio-card,format = "dsp_a";

which gives DSP_A + NB_NF, a combination the codec refuses:

    tlv320aic3x 3-0018: ASoC error (-22): at snd_soc_dai_set_fmt() on tlv320aic3x-hifi
    asoc-simple-card sound-aic3101: error -EINVAL: parse error
    asoc-simple-card sound-aic3101: probe with driver asoc-simple-card failed with error -22
    No soundcards found.

In other words, an unsupported format/inversion combination fails the
machine driver's probe outright; there is no fallback to another
format.

I also ran an analogue loopback, headphone output cabled back into
LINE1, so the capture path and fsl_sai_pcm_dai_rx_ops are exercised as
well. alsabat plays 1 kHz and FFTs the capture: three runs per device
tree, all six reporting "PASS: Peak detected at target frequency" at
999.76 Hz. alsabat's overall return is non-zero (-1003, "more than one
signal") in every run because the analogue loop also shows a few
spurious peaks, but those are not consistent between runs of the same
device tree, so this is a functional round-trip check and not an
analogue quality measurement.

What this does not cover is the case you asked about, Mark: this board
has no DPCM link, so the dummy DAI is never the far end of the
negotiation here.

Tested-by: Hsieh Hung-En <hungen3108@gmail.com>

  parent reply	other threads:[~2026-09-22  8:35 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03  1:13 [PATCH 00/21] ASoC: use .auto_selectable_formats Kuninori Morimoto
2026-09-03  1:13 ` [PATCH 01/21] ASoC: dwc: " Kuninori Morimoto
2026-09-03  1:13 ` [PATCH 02/21] ASoC: fsl: " Kuninori Morimoto
2026-09-03  7:43   ` Vladimir Zapolskiy
2026-09-11 20:10   ` Mark Brown
2026-09-13 23:55     ` Kuninori Morimoto
2026-09-22  8:35   ` Hsieh Hung-En [this message]
2026-09-03  1:13 ` [PATCH 03/21] ASoC: hisilicon: " Kuninori Morimoto
2026-09-03  1:13 ` [PATCH 04/21] ASoC: img: " Kuninori Morimoto
2026-09-03  1:13 ` [PATCH 05/21] ASoC: jz4740: " Kuninori Morimoto
2026-09-03  1:13 ` [PATCH 06/21] ASoC: kirkwood: " Kuninori Morimoto
2026-09-03  1:13 ` [PATCH 07/21] ASoC: loongson: " Kuninori Morimoto
2026-09-03  1:13 ` [PATCH 08/21] ASoC: mediatek: " Kuninori Morimoto
2026-09-03  1:14 ` [PATCH 09/21] ASoC: mxs: " Kuninori Morimoto
2026-09-03  1:14 ` [PATCH 10/21] ASoC: pxa: " Kuninori Morimoto
2026-09-03  1:14 ` [PATCH 11/21] ASoC: renesas: " Kuninori Morimoto
2026-09-03  1:14 ` [PATCH 12/21] ASoC: rockchip: " Kuninori Morimoto
2026-09-03  1:14 ` [PATCH 13/21] ASoC: samsung: " Kuninori Morimoto
2026-09-03  1:14 ` [PATCH 14/21] ASoC: sti: " Kuninori Morimoto
2026-09-03  1:14 ` [PATCH 15/21] ASoC: stm: " Kuninori Morimoto
2026-09-03  1:14 ` [PATCH 16/21] ASoC: sunxi: " Kuninori Morimoto
2026-09-03  1:14 ` [PATCH 17/21] ASoC: tegra: " Kuninori Morimoto
2026-09-04  8:53   ` Jon Hunter
2026-09-03  1:14 ` [PATCH 18/21] ASoC: ti: " Kuninori Morimoto
2026-09-03  1:14 ` [PATCH 19/21] ASoC: uniphier: " Kuninori Morimoto
2026-09-03  1:14 ` [PATCH 20/21] ASoC: ux500: " Kuninori Morimoto
2026-09-03  1:14 ` [PATCH 21/21] ASoC: xtensa: " Kuninori Morimoto
2026-09-11 20:12 ` (subset) [PATCH 00/21] ASoC: " Mark Brown

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=20260922083512.2256991-1-hungen3108@gmail.com \
    --to=hungen3108@gmail.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=broonie@kernel.org \
    --cc=festevam@gmail.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=nicoleotsuka@gmail.com \
    --cc=perex@perex.cz \
    --cc=shengjiu.wang@gmail.com \
    --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