From patchwork Fri Jun 19 08:42:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Venturi X-Patchwork-Id: 6643521 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 15A969F358 for ; Fri, 19 Jun 2015 08:43:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1D52E205DD for ; Fri, 19 Jun 2015 08:43:16 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id BC36A20414 for ; Fri, 19 Jun 2015 08:43:12 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 05D142608BC; Fri, 19 Jun 2015 10:43:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org 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 0C1AE260663; Fri, 19 Jun 2015 10:43:02 +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 D3BC12606E3; Fri, 19 Jun 2015 10:43:00 +0200 (CEST) Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by alsa0.perex.cz (Postfix) with ESMTP id 5407426065F for ; Fri, 19 Jun 2015 10:42:56 +0200 (CEST) Received: by wicnd19 with SMTP id nd19so12146110wic.1 for ; Fri, 19 Jun 2015 01:42:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=XIMAH4p5XQI3SHTmlu3PH+TgIqeQzu4oy6DBEd7ypbA=; b=h1rQWJny2dA+w9SSQsvPne7ptXhSouTwyP4U62Xo+weeBgKA1HeRF2Pc59AcZiPZhy Swqux2umf1AUyQk5DKKhlGXOROXj6BxWk7d3QDKKj/Tc04q1R2m473SQpom1HTTCfHIv 0UiY4I3l6+Cm3v8XoIe6oTs8e2WDXbvk0jz8PXJ5Ocgb0lXIk0+E3bCDpC/57XcFLw6b kViGYwr1gSOx5DvF8yg9hTRajxJqi1WzNZfj8JXjQrUrwOKUdKfp1eLdV3k8CzmOKmhi BaAR3GUZM6AlsJjQ7T2XNhd1kOWEnvBQiQPGhkv3HFzLOImBcdedrRkbCosDL4/1Qo8i wUCA== X-Received: by 10.180.36.193 with SMTP id s1mr4381540wij.62.1434703376326; Fri, 19 Jun 2015 01:42:56 -0700 (PDT) Received: from [10.0.0.5] ([31.177.43.87]) by mx.google.com with ESMTPSA id ma15sm2625758wic.20.2015.06.19.01.42.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jun 2015 01:42:55 -0700 (PDT) Message-ID: <5583D603.8050905@gmail.com> Date: Fri, 19 Jun 2015 10:42:43 +0200 From: Andrea Venturi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: alsa-devel@alsa-project.org X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Subject: [alsa-devel] question about dapm-routes and uda1380.c 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 hello, i'm working on integrating on an Allwinner A20 based SBC an external codec based on NXP UDA1380 through I2S DAI; the SBC is Olime Olinuxino Lime2, the codec board is this one, as it's pretty cheap on usual china sites: http://www.wvshare.com/product/UDA1380-Board.htm i'm using mainline kernel, 4.0.x from here: https://github.com/jwrdegoede/linux-sunxi/tree/sunxi-wip i'm planning to just port the I2S DAI from the legacy allwinner linux-sunxi 3.4 and use a "simple-audio-card" approach. i have more or less the setup in place with my 3 modules and DTS someway hacked to work out the connection between SOC/CPU + DAI + CODEC. now i load the three modules in the kernel this way (i'm wondering if there's a way for autoloading, i'll look for when it's stable..): # insert the platform/DAI driver modprobe snd-soc-sunxi-i2s sleep 1 modprobe snd-soc-simple-card sleep 1 modprobe snd-soc-uda1380 sleep 1 then , i've a number of warning and error (it's normal as i'm in early debugging now..). the one for which i'm posting is related to "dapm routes" in the .../codecs/uda1380.c, these are errors in the log: [ 33.876179] uda1380-codec 1-0018: Control not supported for path Right PGA -> [Mic + Line R] -> Right ADC [ 33.885756] uda1380-codec 1-0018: ASoC: no dapm match for Right PGA --> Mic + Line R --> Right ADC [ 33.894719] uda1380-codec 1-0018: ASoC: Failed to add route Right PGA -> Mic + Line R -> Right ADC [ 33.903669] uda1380-codec 1-0018: Control not supported for path Right PGA -> [Line] -> Right ADC [ 33.912542] uda1380-codec 1-0018: ASoC: no dapm match for Right PGA --> Line --> Right ADC [ 33.920807] uda1380-codec 1-0018: ASoC: Failed to add route Right PGA -> Line -> Right ADC to clear them out, i had to patch the dapm_route structure of uda1380.c with: i added the same "Input Mux" DAPM widget as it's done on the left input of the codec, that's already bound to this "dapm widget" and is managing the couple of codec register bits at 0x22, SEL_LNA and SEL_MIC, that select one of the many input path (see the PDF to better understand.. i could add a shot but i don't know if it's policy permitted ) http://www.nxp.com/documents/data_sheet/UDA1380.pdf as far as i can see, it should be an issue independent by my "development" setup, but should happening, at module load time, to all the devices having such a codec and using a fairly recent mainline kernel in an ASOC environment; is that right? could you confirm this feeling? let me sincerely tell you that there's not that much documentation about Alsa ASoC, simple-audio-card, codec, DAIs, dapm, dts, up to date, or at least is scattered here and there. so it takes a bit of time to read, understand (maybe), code, test and debug this kind of drivers, really! i can understand there's lot's ongoing here, and API are on flux, for example i had to put together stuff from different card drivers as i'm willing to use also Dmaengine and regmap and don't remember whatever else, but many drivers are still frozen on previous API (i understand it would take lot's of janitoring effort and testing on regression cases..) of course, i still can't say this patch is good for something until i've worked out all the other issues and finally listened some good music out of this combo SOC+codec! :-) hope to post more about this setup when it's working.. bests --- sound/soc/codecs/uda1380-orig.c 2015-05-26 12:41:58.650111434 +0200 +++ sound/soc/codecs/uda1380.c 2015-06-18 22:38:51.845892195 +0200 @@ -403,8 +403,11 @@ {"Input Mux", "Line", "Left PGA"}, /* right input */ - {"Right ADC", "Mic + Line R", "Right PGA"}, - {"Right ADC", "Line", "Right PGA"}, + {"Right ADC", NULL, "Input Mux"}, + {"Input Mux", "Mic", "Mic LNA"}, + {"Input Mux", "Mic + Line R", "Right PGA"}, + {"Input Mux", "Line L", "Left PGA"}, + {"Input Mux", "Line", "Right PGA"}, /* inputs */ {"Mic LNA", NULL, "VINM"},