From: "arnaud.mouiche@invoxia.com" <arnaud.mouiche@invoxia.com>
To: Caleb Crome <caleb@crome.org>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: Simple-card without codec for testing purpose
Date: Mon, 23 Nov 2015 10:58:32 +0100 [thread overview]
Message-ID: <5652E348.8080002@invoxia.com> (raw)
In-Reply-To: <CAG5mAdw7_bLC9cFzAyUiPwC+UgQ6pgGHQA7D8z9PPDomUSR6FA@mail.gmail.com>
To answer to myself:
- there are some "virtual" codecs available : "bt-sco",
"linux,spdif-dit" and "linux,spdif-dir". but none of them is fully generic.
- a "snd-soc-dummy-dai" codec is implemented in soc-utils.c. yet, no
device-tree bindings are available, except if a patch like the following
one is applied
--- a/sound/soc/soc-utils.c
+++ b/sound/soc/soc-utils.c
@@ -19,6 +19,7 @@
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
+#include <linux/module.h>
int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots)
{
@@ -151,9 +152,18 @@ static int snd_soc_dummy_remove(struct
platform_device *pdev)
return 0;
}
+#ifdef CONFIG_OF
+static const struct of_device_id soc_dummy_ids[] = {
+ { .compatible = "linux,snd-soc-dummy", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, soc_dummy_ids);
+#endif
+
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,
.remove = snd_soc_dummy_remove,
Once done, here is a DTS example for imx6sl:
&audmux {
ssi3 {
fsl,audmux-port = <6>;
fsl,port-config = <
#ifdef SSI_TEST_MASTER
0x00000000
#else
(IMX_AUDMUX_V2_PTCR_TFSDIR |
IMX_AUDMUX_V2_PTCR_TFSEL(4) |
IMX_AUDMUX_V2_PTCR_TCLKDIR |
IMX_AUDMUX_V2_PTCR_TCSEL(4))
#endif
IMX_AUDMUX_V2_PDCR_RXDSEL(4)
>;
};
port5 {
fsl,audmux-port = <4>;
fsl,port-config = <
#ifdef SSI_TEST_MASTER
(IMX_AUDMUX_V2_PTCR_TFSDIR |
IMX_AUDMUX_V2_PTCR_TFSEL(6) |
IMX_AUDMUX_V2_PTCR_TCLKDIR |
IMX_AUDMUX_V2_PTCR_TCSEL(6))
#else
0x00000000
#endif
IMX_AUDMUX_V2_PDCR_RXDSEL(6)
>;
};
};
&ssi3 {
status = "okay";
// select the a clock parent suitable for 48000 Hz sampling rate
assigned-clocks = <&clks IMX6SL_CLK_SSI3_SEL>, <&clks IMX6SL_CLK_SSI3>;
assigned-clock-parents = <&clks IMX6SL_CLK_PLL4_AUDIO_DIV>;
assigned-clock-rates = <0>, <49152000>;
};
/ {
codec_test: codec_test {
compatible = "linux,snd-soc-dummy";
#sound-dai-cells = <0>;
};
sound@2 {
compatible = "simple-audio-card";
simple-audio-card,name = "test";
simple-audio-card,format="dsp_a";
#ifdef SSI_TEST_MASTER
simple-audio-card,frame-master = <&sound2_ssi>;
simple-audio-card,bitclock-master = <&sound2_ssi>;
#else
simple-audio-card,frame-master = <&codec_test>;
simple-audio-card,bitclock-master = <&codec_test>;
#endif
sound2_ssi: simple-audio-card,cpu {
sound-dai = <&ssi3>;
system-clock-frequency = <1536000>;
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <16>;
};
sound2codec: simple-audio-card,codec {
sound-dai = <&codec_test>;
};
};
};
Le 20/11/2015 02:24, Caleb Crome a écrit :
> I've been wondering about that too. I don't know how to do it easily.
>
> -Caleb
>
>
> On Thu, Nov 19, 2015 at 9:26 AM, arnaud.mouiche@invoxia.com
> <arnaud.mouiche@invoxia.com> wrote:
>> Hello,
>>
>> I'm starting debugging / testing all the fsl_ssi issues (see Caleb's
>> previous post).
>>
>> First step I just need to setup a DTS entry for "simple-card" + fake codec
>> to generate arbitrary PCM bus output (1 to 16 channels, various TDM, various
>> sampling rate and format and master/slave role)
>> I will then plug my logical analyser, or do some loopback, or plug a FPGA to
>> generate/check some patterns.
>>
>> Is there such "fake codec" somewhere. Indeed, something that look like the
>> bt-sco codec, but without rate/format/channel limitations ?
>> Or does the "simple-card" even needs one ?
>>
>> Regards,
>> Arnaud
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2015-11-23 9:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-19 17:26 Simple-card without codec for testing purpose arnaud.mouiche
2015-11-20 1:24 ` Caleb Crome
2015-11-23 9:58 ` arnaud.mouiche [this message]
2015-11-24 15:38 ` Caleb Crome
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=5652E348.8080002@invoxia.com \
--to=arnaud.mouiche@invoxia.com \
--cc=alsa-devel@alsa-project.org \
--cc=caleb@crome.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.