From patchwork Mon Nov 23 09:58:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnaud Mouiche X-Patchwork-Id: 7679391 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 88469BF90C for ; Mon, 23 Nov 2015 09:58:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A56A42061B for ; Mon, 23 Nov 2015 09:58:56 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 30D872043C for ; Mon, 23 Nov 2015 09:58:55 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id AAB3E2652F5; Mon, 23 Nov 2015 10:58:53 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, NO_DNS_FOR_FROM,RCVD_IN_DNSWL_LOW,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 149472651FD; Mon, 23 Nov 2015 10:58:45 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id ECF85265205; Mon, 23 Nov 2015 10:58:43 +0100 (CET) Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by alsa0.perex.cz (Postfix) with ESMTP id 666152651ED for ; Mon, 23 Nov 2015 10:58:38 +0100 (CET) Received: by wmec201 with SMTP id c201so97336372wme.1 for ; Mon, 23 Nov 2015 01:58:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=invoxia-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=SYOfTxXPVbtVtFXXlbJRiVwI6AVW0B6YtmuDSz6LPrs=; b=ZfYEOvGEg1Y1OWQaATtUPQohai7kcOHJJREgw5Qxh8lnJdHYiKKQmIi1fPhNANKxBx pXiyCNbCasxKDJ3aUEBk5owPu8Fp8RVQQebv+47Hg6XY+PKVVQF/L4VNfNja0dwQPSEX JjucFjnPW26gRv/c4yN1zv/zoyamsJYbpRpRvh8c1K32w7G145EbsD0ACEqSoY5EoY3o dgrzGTFDTY+phE/pva+g4Hpcbw7wJNP/SOt378LSjqqQjnrUrsGmtuEiXYDkGAU2CPMk ysN72FBH88THnI4hAQTHd9otcgzg/NOiLjCSdMfekXoQHdqo0NsS3AMPrIUidp0BW+P4 lnVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=SYOfTxXPVbtVtFXXlbJRiVwI6AVW0B6YtmuDSz6LPrs=; b=Djlth8VFj+aRdk21Cqedr7sdcL3IXvynD9Fc7VUp3gj4GWttDSHxYwWnDF8ujG7VCE OYFxqDRQmqXypUCcirTrlbU/pv2mzJs4XCn4g6CRkit8BViFPsB7kx6iz5UsWoutWQgq YLkOkSqwXzX5LBMa7MO4CMEwG8+vacaWW7vzxwJKb6xTnFsi95CfyrNPaoNy9VnrLMkg HMpQzG7Y6/kfpPO6yjS7/v08mwuLXJQw5o18Gds25lKLS6QOeIX5tfxlHJ97BhSz/Hgx eYxXR++Ir+f8XIYOcuZpcK7y90ncJaIZjWKKFnqlzhKnR1qgkJFZuZYuvSbxtLm/YI/J c3nA== X-Gm-Message-State: ALoCoQnSfKZLdKnBqVB9GK434dMci5E8TJFser0LEqjhqNjnOXXnlFHkQLoslNkkadE2fdiJBYGc X-Received: by 10.28.186.138 with SMTP id k132mr18684092wmf.75.1448272715003; Mon, 23 Nov 2015 01:58:35 -0800 (PST) Received: from [192.168.65.141] (AAnnecy-653-1-168-46.w86-200.abo.wanadoo.fr. [86.200.99.46]) by smtp.googlemail.com with ESMTPSA id v4sm12436764wjx.18.2015.11.23.01.58.33 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 Nov 2015 01:58:33 -0800 (PST) To: Caleb Crome References: <564E0656.9000709@invoxia.com> From: "arnaud.mouiche@invoxia.com" Message-ID: <5652E348.8080002@invoxia.com> Date: Mon, 23 Nov 2015 10:58:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Cc: "alsa-devel@alsa-project.org" Subject: Re: [alsa-devel] Simple-card without codec for testing purpose X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 .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 > 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 --- a/sound/soc/soc-utils.c +++ b/sound/soc/soc-utils.c @@ -19,6 +19,7 @@ #include #include #include +#include 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,