From patchwork Thu Sep 18 13:30:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 4930861 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 240619F350 for ; Thu, 18 Sep 2014 13:30:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 73A1F20120 for ; Thu, 18 Sep 2014 13:30:55 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B9C93201EC for ; Thu, 18 Sep 2014 13:30:44 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 30D52265511; Thu, 18 Sep 2014 15:30:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id CE2C3261B36; Thu, 18 Sep 2014 15:30:32 +0200 (CEST) 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 86EF7262631; Thu, 18 Sep 2014 15:30:27 +0200 (CEST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by alsa0.perex.cz (Postfix) with ESMTP id 4C75E261B14 for ; Thu, 18 Sep 2014 15:30:19 +0200 (CEST) Received: by mail-la0-f53.google.com with SMTP id ge10so1115024lab.26 for ; Thu, 18 Sep 2014 06:30:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=ZaHQxvAqSdkGa3uJEi8dmt5dcljEN7Swy/xLcYb3kws=; b=URKhT7jiI29E5Yq8m+gNx1lixCv8ct1GsigqRdfQqX6L8rrLq9oIPoDSIBuKL+wZ8+ bkEJIvD56H2mtuGApu8rk/i5hnIW3a7oKxvljZ9dA20D56mD86x0DGi96JOHzAvLeqUl kS6iCe7cV5rOzCUhhraDUDJbQQ8FaJ2oW+PwytcIOTIhfgrJbyk9NkNcB/IYWW3S/A1E OgeYzfkgeOwsEB6DY6Q/EWgMU8Q88oaDPmoV2EgoEamuPAB9NnyGzcp5edRaP0zvNXpZ P4HY2lqXLfaig30gU4dcYtrUkPg7Gaf+q3JhkD3QkNmKL1LFFehsSKs8/OHhFW4/GERL Ck3g== MIME-Version: 1.0 X-Received: by 10.112.168.38 with SMTP id zt6mr3570357lbb.60.1411047018642; Thu, 18 Sep 2014 06:30:18 -0700 (PDT) Received: by 10.152.192.163 with HTTP; Thu, 18 Sep 2014 06:30:18 -0700 (PDT) In-Reply-To: References: Date: Thu, 18 Sep 2014 10:30:18 -0300 Message-ID: From: Fabio Estevam To: Jean-Michel Hautbois Cc: "alsa-devel@alsa-project.org" , Lars-Peter Clausen , Shengjiu Wang , Nicolin Chen , Markus Pargmann , Shawn Guo Subject: Re: [alsa-devel] =?utf-8?q?No_sound_captured_with_SGTL5000_on_i=2EMX6?= =?utf-8?q?_in_I=C2=B2S_master_mode?= 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 Hi Jean-Michel, On Thu, Sep 18, 2014 at 9:56 AM, Jean-Michel Hautbois wrote: > Hi, > > Sorry if double posting, I have not received confirmation on > subscription yesterday... So I try again :/. > > I have a custom i.MX6 board, and have a sgtl5000 connected on it. I > would like to have it used in master mode (it is used only for audio > capture) but I get a "pcm_read:2031: read error: Input/output error" > when using arecord. > I have checked my signals and I get something on I²S which seems to be good. > I launch : > $> arecord -f cd -Dhw:0,0 -v -V stereo > Receive Frame Sync is 44.1KHz > Receive Clock Signal is ~1MHz (I can be more precise if needed) > Data Receive is present, only when arecord is launched. It stops when > there is no capture asked. > Both clocks are still present even when no arecord is running. > > This suggests, for me, that master mode is working. > So, I don't know why I can't get any data to my arecord. Is this a > left/right justified master mode ? Anything else ? I am also trying to test fsl_ssi in master mode. I am running linux-next 20140912 with the following changes to get SSI in master mode: ,but when I do aplay I do not get any sound. > I am wondering if I forgot something in my DT or if I need to do > something else : > > sound { > compatible = "fsl,imx6q-vbx3-sgtl5000", > "fsl,imx-audio-sgtl5000"; > model = "imx6q-vbx3-sgtl5000"; > ssi-controller = <&ssi1>; > audio-codec = <&codec>; > audio-routing = > "LINE_IN", "Line In Jack"; > mux-int-port = <1>; > mux-ext-port = <5>; > }; > > &audmux { > pinctrl-names = "default"; > pinctrl-0 = <&pinctrl_audmux>; > status = "okay"; > }; > > &i2c2 { > clock-frequency = <100000>; > pinctrl-names = "default"; > pinctrl-0 = <&pinctrl_i2c2>; > status = "okay"; > > codec: sgtl5000@0a { > compatible = "fsl,sgtl5000"; > reg = <0x0a>; > clocks = <&clks 201>; > VDDA-supply = <&vgen6_reg>; > VDDIO-supply = <&vgen6_reg>; > sysclk = <24000000>; > }; > }; > > &iomuxc { > pinctrl-names = "default"; > pinctrl-0 = <&pinctrl_hog>; > > imx6qdl-vbx3 { > pinctrl_audmux: audmuxgrp { > fsl,pins = < > MX6QDLPAD_DISP0_DAT13__AUD5_RXFS 0x130b0 > MX6QDL_PAD_DISP0_DAT14__AUD5_RXC 0x130b0 > MX6QDL_PAD_DISP0_DAT19__AUD5_RXD 0x130b0 > >; > }; > }; > > &ssi1 { > status = "okay"; > codec-handle = <&codec>; I think this codec-handle is not needed here. > fsl,mode = "i2s-master"; > fsl,ssi-asynchronous; /* Not sure about it, but does not change anything */ > }; > > Here is the dmesg part : > [ 6.026803] sgtl5000 1-000a: sgtl5000 revision 0x11 > [ 6.129380] imx-sgtl5000 sound: snd_soc_register_card failed (-517) > [ 6.248849] platform sound: Driver imx-sgtl5000 requests probe deferral > [ 6.311643] sgtl5000 1-000a: Using internal LDO instead of VDDD > [ 6.393196] imx-sgtl5000 sound: sgtl5000 <-> 2028000.ssi mapping ok > > And the user space commands : > $> arecord -l > **** List of CAPTURE Hardware Devices **** > card 0: imx6qvbx3sgtl50 [imx6q-vbx3-sgtl5000], device 0: HiFi sgtl5000-0 [] > Subdevices: 1/1 > Subdevice #0: subdevice #0 > > $> arecord -v -V stereo -fdat -D hw:0,0 somefile.wav > Recording WAVE 'somefile.wav' : Signed 16 bit Little Endian, Rate > 48000 Hz, Stereo > Hardware PCM card 0 'imx6q-vbx3-sgtl5000' device 0 subdevice 0 > Its setup is: > stream : CAPTURE > access : RW_INTERLEAVED > format : S16_LE > subformat : STD > channels : 2 > rate : 48000 > exact rate : 48000 (48000/1) > msbits : 16 > buffer_size : 16384 > period_size : 4096 > period_time : 85333 > tstamp_mode : NONE > period_step : 1 > avail_min : 4096 > period_event : 0 > start_threshold : 1 > stop_threshold : 16384 > silence_threshold: 0 > silence_size : 0 > boundary : 1073741824 > appl_ptr : 0 > hw_ptr : 0 > arecord: pcm_read:2031: read error: Input/output error > > The kernel is 3.17-rc5. > > Thanks for reading all this, and for any advice :). I am adding some more folks in Cc in case they have some suggestions. Regards, Fabio Estevam --- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi @@ -532,6 +532,7 @@ }; &ssi2 { + fsl,mode = "i2s-master"; status = "okay"; }; diff --git a/sound/soc/fsl/imx-wm8962.c b/sound/soc/fsl/imx-wm8962.c index 3a3d17c..09ea6a5 100644 --- a/sound/soc/fsl/imx-wm8962.c +++ b/sound/soc/fsl/imx-wm8962.c @@ -247,7 +247,7 @@ static int imx_wm8962_probe(struct platform_device *pdev) data->dai.platform_of_node = ssi_np; data->dai.ops = &imx_hifi_ops; data->dai.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | - SND_SOC_DAIFMT_CBM_CFM; + SND_SOC_DAIFMT_CBS_CFS; data->card.dev = &pdev->dev; ret = snd_soc_of_parse_card_name(&data->card, "model");