Hi everyone,
I'm working on an i.MX93-based board and I'm trying to use one of the SAI interfaces (specifically SAI3) in PCM mode to connect directly to a Quectel GSM module.
The module exposes PCM lines (DIN, DOUT, CLK, SYNC) and also an I2C interface to communicate with an external codec. According to Quectel's documentation, audio can be transmitted directly over PCM without the need for an external audio codec, the module already should have an internal codec.
My goal is to route call audio to/from the module directly via PCM.
I’d like to ask:
Is it possible to use the i.MX93 SAI interface in PCM mode without a codec?
Has anyone already done this kind of setup on i.MX93 (or similar NXP SoCs)?
What is the recommended Device Tree configuration for this kind of direct PCM connection (SAI <-> MODULE)?
Is an audio-card node still needed in the device tree even if there's no codec?
Any advice or pointers to examples would be greatly appreciated!
Thanks in advance,
Stefano
已解决! 转到解答。
Hello,
You can have a look at this thread from ALSA mailing list: https://www.spinics.net/linux/fedora/linux-sound/msg22016.html
Besides the discussion above you can try to use the dummy codec (not recommended, not accepted by the community, but you can have it a try for testing purposes).
Something like this:
DTS file:
+ codec_test: codec_test {
+ #sound-dai-cells = <0>;
+ compatible = "linux,snd-soc-dummy";
+ };
+
+ sound-test {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "sai-audio-card";
+ simple-audio-card,format = "left_j";
+ simple-audio-card,bitclock-master = <&sai_cpu>;
+ simple-audio-card,frame-master = <&sai_cpu>;
+ status = "disabled";
+ sai_cpu: simple-audio-card,cpu {
+ sound-dai = <&sai1>;
+ dai-tdm-slot-num = <2>;
+ dai-tdm-slot-width = <32>;
+ };
+ simple-audio-card,codec {
+ sound-dai = <&codec_test>;
+ };
+ };
+
--- a/sound/soc/soc-utils.c
+++ b/sound/soc/soc-utils.c+static const struct of_device_id soc_dummy_ids[] = {
+ { .compatible = "linux,snd-soc-dummy", },
+ { },
+};
+
static struct platform_driver soc_dummy_driver = {
.driver = {
.name = "snd-soc-dummy",
+ .of_match_table = of_match_ptr(soc_dummy_ids),
},
.probe = snd_soc_dummy_probe,
};
Hello,
You can have a look at this thread from ALSA mailing list: https://www.spinics.net/linux/fedora/linux-sound/msg22016.html
Besides the discussion above you can try to use the dummy codec (not recommended, not accepted by the community, but you can have it a try for testing purposes).
Something like this:
DTS file:
+ codec_test: codec_test {
+ #sound-dai-cells = <0>;
+ compatible = "linux,snd-soc-dummy";
+ };
+
+ sound-test {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "sai-audio-card";
+ simple-audio-card,format = "left_j";
+ simple-audio-card,bitclock-master = <&sai_cpu>;
+ simple-audio-card,frame-master = <&sai_cpu>;
+ status = "disabled";
+ sai_cpu: simple-audio-card,cpu {
+ sound-dai = <&sai1>;
+ dai-tdm-slot-num = <2>;
+ dai-tdm-slot-width = <32>;
+ };
+ simple-audio-card,codec {
+ sound-dai = <&codec_test>;
+ };
+ };
+
--- a/sound/soc/soc-utils.c
+++ b/sound/soc/soc-utils.c+static const struct of_device_id soc_dummy_ids[] = {
+ { .compatible = "linux,snd-soc-dummy", },
+ { },
+};
+
static struct platform_driver soc_dummy_driver = {
.driver = {
.name = "snd-soc-dummy",
+ .of_match_table = of_match_ptr(soc_dummy_ids),
},
.probe = snd_soc_dummy_probe,
};