From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
To: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Mark Brown <broonie@kernel.org>,
linux-sound@vger.kernel.org, Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: Debugging CPU-side DAI hardware with a dummy codec
Date: Thu, 10 Apr 2025 13:23:21 +0200 [thread overview]
Message-ID: <5347100.LvFx2qVVIh@workhorse> (raw)
In-Reply-To: <CAEnQRZD4xw5wRR6exsXo9xjTmmQ1TQAn0jNVeXij66-veEESMw@mail.gmail.com>
On Thursday, 10 April 2025 12:54:16 Central European Summer Time Daniel Baluta wrote:
> > > I hope someone can shed some light on this, as it seems like something audio
> > > controller developers would be doing all the time.
> >
> > I suspect most people test with an actual system. A bunch of things get
> > easier if you can actually play and record sound.
>
> Mark, that's true in most of the cases. But for silicon IP
> pre-validation using emulation
> environments most of the SoC creators use a synthetic codec so things like being
> able to probe a dummy-codec does make some sense.
>
> Nicolas,
>
> Can you please paste your patches (dts and the rest)?
>
> thanks,
> Daniel.
>
Hi Daniel,
I'll send the test-component changes in a proper patch submission later.
The DTS in my case looks like this though. `sai0` here is the SoC-side
audio interface. Don't worry about the pinctrl/dma overriding, that's
me disabling capture.
---
diff --git a/arch/arm64/boot/dts/rockchip/rk3576-armsom-sige5.dts b/arch/arm64/boot/dts/rockchip/rk3576-armsom-sige5.dts
index de63b053a06c..6e78713b1a99 100644
--- a/arch/arm64/boot/dts/rockchip/rk3576-armsom-sige5.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3576-armsom-sige5.dts
@@ -84,6 +84,25 @@ simple-audio-card,codec {
};
};
+ dummy_codec: dummy-codec {
+ compatible = "test-codec-verbose";
+ dai-tdm-slot-num = <8>;
+ dai-tdm-slot-width = <16>;
+ #sound-dai-cells = <0>;
+
+ port {
+ codec_endpoint: endpoint {
+ remote-endpoint = <&sai0_endpoint>;
+ };
+ };
+ };
+
+ dummy_sound: dummy-sound {
+ compatible = "audio-graph-card";
+ label = "Dumdum";
+ dais = <&sai0_p0>;
+ };
+
vcc_12v0_dcin: regulator-vcc-12v0-dcin {
compatible = "regulator-fixed";
regulator-name = "vcc_12v0_dcin";
@@ -708,6 +727,26 @@ led_rgb_g: led-green-en {
};
};
+&sai0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&sai0m1_lrck
+ &sai0m1_sclk
+ &sai0m1_sdo0>;
+ dmas = <&dmac0 0>;
+ dma-names = "tx";
+ status = "okay";
+
+ sai0_p0: port {
+ sai0_endpoint: endpoint {
+ dai-format = "i2s";
+ dai-tdm-slot-num = <8>;
+ dai-tdm-slot-width = <16>;
+ mclk-fs = <256>;
+ remote-endpoint = <&codec_endpoint>;
+ };
+ };
+};
+
&sai1 {
pinctrl-names = "default";
pinctrl-0 = <&sai1m0_lrck
---
NB. that this is based on my local v2 of the RK3576 SAI series so trying
to apply this with any tooling makes no sense, the main takeaway should be
the audio-graph-card and how the nodes reference each other.
The dummy_codec and dummy_sound nodes are children of the root node
`/ { /* ... */ };` here, the sai0 reference comes from the SoC's dtsi.
Kernel needs to be compiled with CONFIG_SND_TEST_COMPONENT of course if you
want the test components.
Cheers,
Nicolas Frattaroli
next prev parent reply other threads:[~2025-04-10 11:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 19:58 Debugging CPU-side DAI hardware with a dummy codec Nicolas Frattaroli
2025-04-09 15:01 ` Mark Brown
2025-04-09 19:56 ` Nicolas Frattaroli
2025-04-09 20:06 ` Mark Brown
2025-04-10 10:54 ` Daniel Baluta
2025-04-10 11:23 ` Nicolas Frattaroli [this message]
2025-04-10 12:02 ` Nicolas Frattaroli
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=5347100.LvFx2qVVIh@workhorse \
--to=nicolas.frattaroli@collabora.com \
--cc=broonie@kernel.org \
--cc=daniel.baluta@gmail.com \
--cc=lgirdwood@gmail.com \
--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