Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27B53C433B4 for ; Fri, 23 Apr 2021 11:23:21 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B2AF5613B2 for ; Fri, 23 Apr 2021 11:23:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B2AF5613B2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=users.sourceforge.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 34A5C169F; Fri, 23 Apr 2021 13:22:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 34A5C169F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1619176997; bh=J/Lx/io48Nfpmauknl6vY2OedoYBC+SR7rAMyGYEBSE=; h=Date:From:To:In-Reply-To:References:Subject:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Reply-To:From; b=CtEya+cQcUzy9aMobOsTULDxR54gzJvQHyB3wU7/KqdlQpPbaQLZmqpK8vfnsvpfw s+Js2ICwdEXL+sI1Z0gxReo73AcsctbtSj1M0QEDOOGa0sbc24NIXaAi28jhRcpqyG Vgg3lp2YXkt3sIQRrUf3+NLdJ4UW7wCsVPK121Ag= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 901B3F8019B; Fri, 23 Apr 2021 13:22:26 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 55EC1F80227; Fri, 23 Apr 2021 13:22:24 +0200 (CEST) Received: from sonic311-30.consmr.mail.ir2.yahoo.com (sonic311-30.consmr.mail.ir2.yahoo.com [77.238.176.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2644CF800E3 for ; Fri, 23 Apr 2021 13:22:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2644CF800E3 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b="Ol3QfAqQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1619176934; bh=Iro8ZN1A6S/J9xu8AypXENro6pWx36YeN6B30jgSX4w=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=Ol3QfAqQEBBFpl5G4kdJfYJmNzCijTud/TMlhLl8fAFIx3msrgzUVViJAgC7m/xIHoKcxzHPQehTWJ3n7MaCQQSUlMoiNSwE5+oSFDwePEky89qcUSTrrq55cA415RSdNHvN4sNIYt7zKeISDfYtNm76EXz6Pj+N80syeQAx8Q/9OxYhnCUnq70Jbr4e+fMORjZ4nuOHa6KV0TG15QgZHqwCvphvzeq//BpPvl/m5P5sW/K/K6B2XqvHKntjBsZBl6ELqlZXc/iMLcz0rcOEl3/0nWa3HlGJ8RfSngQgfvIkPNXFY1YWkvzR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9zS6_ZIhshJVDg6zxzb6GvmUz0YJajZofuoYfCV B1OFJv50EqoVedODZYxJ48LxNrfuaeAcQ5qKvynQV2ev5q9DYPDjKT9WbQjktyj3AN7Dxcz6547O k_fg0eJPR5SDwcmLjbADFQoq9pNbUTY5b1nKUtAx25k4POkE8Hs4Kkq5LQu.t9WvSsGuAFpH4kae g.mxWPgISLR8tmA-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ir2.yahoo.com with HTTP; Fri, 23 Apr 2021 11:22:14 +0000 Date: Fri, 23 Apr 2021 11:22:10 +0000 (UTC) From: Hin-Tak Leung To: Peter Ujfalusi , =?UTF-8?Q?P=C3=A9ter_Ujfalusi?= Message-ID: <1556414365.8666901.1619176930979@mail.yahoo.com> In-Reply-To: References: <148484793.4894421.1618654607945.ref@mail.yahoo.com> <148484793.4894421.1618654607945@mail.yahoo.com> <877dkz5hz1.wl-kuninori.morimoto.gx@renesas.com> <1772063602.5910217.1618841824599@mail.yahoo.com> <87h7k152du.wl-kuninori.morimoto.gx@renesas.com> <212419469.6653726.1618928398310@mail.yahoo.com> <425493399.6730534.1618934642983@mail.yahoo.com> Subject: Re: ASoc / PCM recording-related regression between v5.4 and v5.5 MIME-Version: 1.0 X-Mailer: WebService/1.1.18121 YMailNodin Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: alsa-devel@alsa-project.org, Mark Brown , Pierre-Louis Bossart , Kuninori Morimoto X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Reply-To: htl10@users.sourceforge.net Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Thursday, 22 April 2021, 15:01:02 BST, P=C3=A9ter Ujfalusi wrote: > If you start the DAI first and later the DMA then it works again? > I'm still behind of the patch which introduced different sequences for > start and stop. I am with you on your change too - I think your change makes sense; it is t= he vendor's driver that needs correcting. > From my commit the start sequence is: > dai_link, DMA, CPU DAI then the codec > Is it make any difference if you try: > dai_link, DMA, codec then the CPU DAI I'll give this a try soon. I am just the owner of one such device, and did = the porting from kernel 4.19 to v.5.4, and now troubleshooting to v5.10. Th= e vendor has been quite absent... and I feel I perhaps spend more time on t= his venture than I am happy with... Anyway -=20 > But the codec is usually not handled in trigger, it can not be atomic > most of the time. I suspect the vendor did something not quite right in the area to make it w= ork under the previous wrong trigger order too. More below about spinlock a= nd atomic context. > Can you point me to the out of tree driver and the related dts files? > Can it be reproduced with rpbi w/o any hat? I have one hifiberry but > that is playback only and if I'm not mistaken the 3.5 on the board also? For your purpose you can see my fork (which includes v5.4 -> v5.10 migratio= n change, unlike the vendor's), https://github.com/HinTak/seeed-voicecard .= =20 The dts concerned is: https://github.com/HinTak/seeed-voicecard/blob/v5.9/s= eeed-8mic-voicecard-overlay.dts The card trigger code is in: https://github.com/HinTak/seeed-voicecard/blob= /v5.9/seeed-voicecard.c while the codec trigger code is in https://github.com/HinTak/seeed-voicecard/blob/v5.9/ac108.c and also https://github.com/HinTak/seeed-voicecard/blob/v5.9/ac101.c !=20 Note that the routine ac101_trigger() is not used, although the ac101 codec= itself is involved. There is a spinlock in ac108_trigger(), which I have long suspected to be i= ncorrect, and has been known to cause the pi to kernel panic if built with = PREEMPT ; Now I think it is there to make it work under the previous wrong = sequence. There is another device of the same family - which records okay regardless = of the trigger sequence https://github.com/HinTak/seeed-voicecard/blob/v5.9= /seeed-4mic-voicecard-overlay.dts . The problematic device has 8 mics, using two ac108 for 2 x 4-ADC and the ac= 101 for DAC loopback (and as clock master?). The 4-mics record-okay device = has just one ac108 (and without a ac101) to record 4-channels. As I understand it, to record / playback for 8 channels on the pi, the I2S = on the pi transfer data as stereo at 4x the frequency, and the codecs try t= o start and stop in such a way to avoid channel shifts during the 8-channel= s to 4x stereo change. I can reboot between 5.4 and 5.10 quite easily (the pi does not have a boot= loader per se - you just overwrite the kernel image in the first fat32 par= titition...). At the moment I am thinking of inserting some pr_info() into = seeed-voicecard.c:seeed_voice_card_trigger() and ac108.c:ac108_trigger() an= d perhaps also in general in ac101.c to see how the driver behaves differen= tly under v5.4 and v5.10 . And while doing that, have some thoughts about g= etting rid of that problematic spinlock in ac108.c:ac108_trigger() when the= code get re-arranged. The problem is with trying to record, so I assume you cannot reproduce the = problem if you do not have the hardware. However, I could certainly benefit= from some suggestions and guidance on what to change and how to change the= current code. I am fairly okay with kernel development (in a few other different areas, f= ile systems and wireless mostly), but audio is new to me. Thanks a lot for any ideas / suggestions you might want to give on modfying= the two trigger functions and getting rid of that spinlock! Regards, Hin-Tak =20