From patchwork Mon Jun 1 09:16:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Enric Balletbo Serra X-Patchwork-Id: 6519811 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CF0DB9F326 for ; Mon, 1 Jun 2015 09:16:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E24E8205FF for ; Mon, 1 Jun 2015 09:16:54 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9637F205BD for ; Mon, 1 Jun 2015 09:16:53 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id A83A026070A; Mon, 1 Jun 2015 11:16:52 +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, 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 9E257260504; Mon, 1 Jun 2015 11:16:44 +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 85C5D26050C; Mon, 1 Jun 2015 11:16:43 +0200 (CEST) Received: from mail-ig0-f175.google.com (mail-ig0-f175.google.com [209.85.213.175]) by alsa0.perex.cz (Postfix) with ESMTP id 7600C2604F4 for ; Mon, 1 Jun 2015 11:16:36 +0200 (CEST) Received: by igbpi8 with SMTP id pi8so56343229igb.1 for ; Mon, 01 Jun 2015 02:16:35 -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=8E6ECsWMt3c2wuYdCbI63RT5sNFiCxFBhlK+eV3N710=; b=getAs6JpE1mNtsD6wONsYvAz9ZbgBNTOTX4fwQONQG3Q0IxfJlJjzZQmSaGiiTip54 h5NTXCyazGEHSgDmCMwGrf5LqZRkNS0Fh3Eof/hNVP/QyMvHcJ8qkeb1uW5yXdMhyCqc SwCWedm/vKB+TpkcufeVdO2maH/hwFmA8i7EaKpKj5thx1Ddz2BQi/fwnfV8PT1EsfFr Et2Xnd8ySosaGB2acNPwWdPaLZKVzMxKEKKcIT++NZ781ASnEFWmcOSS3vU7qwovXM+7 RalXcQlKh9aiEfPhGSdAR2NaEWUiZtnnb8mLuX62vTe0/6fhIbMbuPHxn7TckF4r4lr5 IysA== MIME-Version: 1.0 X-Received: by 10.107.7.195 with SMTP id g64mr25263643ioi.81.1433150195729; Mon, 01 Jun 2015 02:16:35 -0700 (PDT) Received: by 10.79.104.131 with HTTP; Mon, 1 Jun 2015 02:16:35 -0700 (PDT) In-Reply-To: <556858AD.1030609@ti.com> References: <5568133A.6010006@ti.com> <556858AD.1030609@ti.com> Date: Mon, 1 Jun 2015 11:16:35 +0200 Message-ID: From: Enric Balletbo Serra To: Peter Ujfalusi Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen , Takashi Iwai , Liam Girdwood , Jyri Sarha , Mark Brown Subject: Re: [alsa-devel] Audio play problem with tlv320aic3106 in mainline. 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, 2015-05-29 14:16 GMT+02:00 Peter Ujfalusi : > On 05/29/2015 12:24 PM, Enric Balletbo Serra wrote: >>> It might be really 24MHz. >>> If the MCLK in your board is wired like am335x-evmsk or how BeagleBone's audio >>> capes are wired (MCLK is coming from AM335x's EVENT_INTR0/1 pin as CLKOUT1/2) >>> then 24MHz is correct. On the am335x-evm there is a dedicated crystal >>> providing the 12MHz. >>> >> Well, in my board there is also a dedicated crystal providing the >> 12MHz, so I expect that the correct value for clock-frequency is 12MHz >> not 24MHz. > > I was wrong with the BBW audio cape.. At least the RevA which I have does have > 12MHz crystal connected to aic3106 MCLK, but there is a line to the SoC's > CLKOUT2. By default the codec runs using the 12MHz. > I have checked with a scope and yep, I have 12MHz for MCLK. > >> >> clocks { >> compatible = "simple-bus"; >> #address-cells = <1>; >> #size-cells = <0>; >> >> /* audio external oscillator */ >> tlv320aic3x_mclk: oscillator@0 { >> compatible = "fixed-clock"; >> #clock-cells = <0>; >> clock-frequency = <12000000>; /* 12MHz */ >> }; >> }; >> >> sound { >> compatible = "ti,da830-evm-audio"; >> ti,model = "AM335x-SL50"; >> ti,audio-codec = <&audio_codec>; >> ti,mcasp-controller = <&mcasp0>; >> >> clocks = <&tlv320aic3x_mclk>; >> clock-names = "mclk"; >> >> ti,audio-routing = >> "Headphone Jack", "HPLOUT", >> "Headphone Jack", "HPROUT", >> "LINE1R", "Line In", >> "LINE1L", "Line In"; >> }; > > If I use this with my BBW+Audio cape: audio is fine. > Tested with linux-next and same problem here, I also checked with a scope my clock and it's 12MHz but I need to apply this patch to make it work. Really odd, so we'll have something different, at the moment I don't know what could be the difference. >> >> For me it's really odd have to set the clock-frequency to 24MHz to make it work >> >> clock-frequency = <24000000>; > > If I change it to this, I will have slow motion playback, as expected. > >> For that reason I'm wondering if there is a bug in the driver, did >> anyone test with an am335x-evm board ? > > I'm using linux-next. > Not sure what could be the issue. > >> >>>> >>>> [1] https://patchwork.kernel.org/patch/6480071/ >>>> >>>> Thanks in advance, >>>> Enric >>>> >>> >>> -- >>> Péter >> >> Thanks, >> Enric >> > > > -- > Péter diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c index 731fb0d..8ce0d32 100644 --- a/sound/soc/davinci/davinci-evm.c +++ b/sound/soc/davinci/davinci-evm.c @@ -64,6 +64,11 @@ static int evm_hw_params(struct snd_pcm_substream *substream, unsigned sysclk = ((struct snd_soc_card_drvdata_davinci *) snd_soc_card_get_drvdata(soc_card))->sysclk; + ret = snd_soc_dai_set_clkdiv(cpu_dai, 0, 2); + if (ret < 0) + return ret; + /* set the codec system clock */ ret = snd_soc_dai_set_sysclk(codec_dai, 0, sysclk, SND_SOC_CLOCK_OUT); if (ret < 0)