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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 0EA17C4338F for ; Thu, 19 Aug 2021 15:12:34 +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 C0A2A60E93 for ; Thu, 19 Aug 2021 15:12:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C0A2A60E93 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 21B85167E; Thu, 19 Aug 2021 17:11:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 21B85167E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629385951; bh=7gNJge1B1O8IP1CqH2yhR7h1b+6mqwlq4VMnM7YuSoQ=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=U9TOSUzWe+eSEBInlCV71gxLa6mMHZMtd28R+5Tgod3X1jKwXNrk1f311GstiQs91 kXnU5MtYcEV2GsMB6V3x9pEdL1jmWq/b044qqIgWNjBkf7GqTzmfsfsmC8UXeeGOiO A5iGEPcCAww5bNNL48ildo2wYbGhFM6Ei7iu6j1g= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id ACD87F800F8; Thu, 19 Aug 2021 17:11:40 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4EA43F8026D; Thu, 19 Aug 2021 17:11:39 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D2500F800F8 for ; Thu, 19 Aug 2021 17:11:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D2500F800F8 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hGNY3mAv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629385889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BZNUNlu8wVsisChveZvNcZgPBdKsWQpxQI2cw/eBXTE=; b=hGNY3mAvV7sKDGe6Bu1VyRUzg0kOJo67/9YDbGK9wc63xRi/exbAxm5V9ra31njmiYqgv2 GSdqDBdpFUhkynFY4vWnPhCjCV0ZcmnJh+7qX6dFsvcsJRSeQJEPvkgd9o4AOGVQIN5pmk bFDLSpePzPFplXzxKo/mgSxTMb3Ltkk= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-345-6Hvg29oZOLq-2QHDd40pjA-1; Thu, 19 Aug 2021 11:11:28 -0400 X-MC-Unique: 6Hvg29oZOLq-2QHDd40pjA-1 Received: by mail-ed1-f72.google.com with SMTP id p2-20020a50c9420000b02903a12bbba1ebso2964651edh.6 for ; Thu, 19 Aug 2021 08:11:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BZNUNlu8wVsisChveZvNcZgPBdKsWQpxQI2cw/eBXTE=; b=pBtSEKjsuS2N9+6xT2Y+aV9W5HmQAR1iz7jY3oxUOi3xi3anZqeqEJaP8LEftuo8Ic EmUiiUv4a1HlnjXWwS5fM5MIb8MRTrQQB0F/VJOiGh0i0GqWem55nSgKqk6Xp1G2hjOQ XfUyHA+6GuvdgJJyf7j+7GpMF8fL3P9TYU6Hc4905+PY8BOmD4WGosRNwdKa7GSA2zmY OFCJqf3CIdc+V93oCxgNQhViDjPI+azaOp43hvVh4FZLuoQfjRXKcwh3WgPdlAFE5uKb DQGROPrVAImY5v3SbF1+FUMNas65xA8ffcGFW/DIzDzpQ4Ak8kKRJ6brQdjiIUumER0Q 49wQ== X-Gm-Message-State: AOAM532KeS7vC6NGFwFzO3dsKeDT8TQ4XOUtlRUsejX0RM4DumLYKyxe qbwAAOfokLaFUYJf7TBzLBvM1cGGiY4fGXSLargtN3vbJswfPs83EdpGuDR/LZoUwOhizWhCv9J QSmsiT+033DTZhmoWWbQxBwLgN13D8e5oN17q2SmFSmeefwucp/XmGX9q3JJr12KLN0ZBFPcXUX s= X-Received: by 2002:a17:906:405:: with SMTP id d5mr16104529eja.189.1629385886937; Thu, 19 Aug 2021 08:11:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylKeG7fzvO0RwBuLilXK7QofYfUiC/JIogh/5IsESQT8nKptUQqjEtpXbrBoKnNQ9NTqbjOg== X-Received: by 2002:a17:906:405:: with SMTP id d5mr16104500eja.189.1629385886661; Thu, 19 Aug 2021 08:11:26 -0700 (PDT) Received: from x1.localdomain (2001-1c00-0c1e-bf00-1054-9d19-e0f0-8214.cable.dynamic.v6.ziggo.nl. [2001:1c00:c1e:bf00:1054:9d19:e0f0:8214]) by smtp.gmail.com with ESMTPSA id g16sm1410587ejw.74.2021.08.19.08.11.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Aug 2021 08:11:26 -0700 (PDT) Subject: Re: [5.14 regression] "ASoC: intel: atom: Fix reference to PCM buffer address" breaks Intel SST audio To: Takashi Iwai References: <2048c6aa-2187-46bd-6772-36a4fb3c5aeb@redhat.com> From: Hans de Goede Message-ID: Date: Thu, 19 Aug 2021 17:11:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hdegoede@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Cc: "alsa-devel@alsa-project.org" , Mark Brown , Pierre-Louis Bossart 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Hi, On 8/19/21 4:52 PM, Takashi Iwai wrote: > On Thu, 19 Aug 2021 16:45:19 +0200, > Hans de Goede wrote: >> >> Hi, >> >> On 8/19/21 4:42 PM, Hans de Goede wrote: >>> Hi All, >>> >>> After rebasing a set of bytcr_rt5640 patches, on top of asoc/for-next >>> I noticed that playing back audio would only generate random-noise / buzzing >>> (I did not try recording any audio). >>> >>> After poking at this for a while I've found the culprit: >>> >>> 2e6b836312a4 ("ASoC: intel: atom: Fix reference to PCM buffer address") >>> >>> If I revert that single commit then audio on Intel Bay Trail and >>> Cherry Trail devices works fine again with 5.14. >>> >>> This is with a Fedora 34 userspace using pipewire as audiodaemon >>> >>> I'm not sure what is going on here, but since the old code >>> changed by the broken commit has worked fine for ages and >>> given where we are in the devel-cycle I think it might be best >>> to just revert 2e6b836312a4 again. >> >> p.s. to be clear I noticed this after rebasing on top of asoc/for-next >> but the troublesome commit is actually in Linus tree now and thus >> will hit end users once 5.14 is released. >> >> (the troublesome commit landed in 5.14-rc6 and my previous tests >> were with 5.14-rc5) > > Ah, the commit might be problematic on 5.14 where dma_addr isn't set > yet for the CONTINUOUS buffer type (which was fixed in sound.git > for-next branch). > > Could you try the patch below? I can confirm that this fixes things. Note though that I'm running 5.14-rc6 with asoc/for-next merged in, so this suggest that the "dma_addr isn't set yet for the CONTINUOUS buffer type" problem also exists in asoc/for-next which means that asoc/for-next as a standalone tree also has broken Intel SST audio atm (I did not verify this). Either way I guess that even with the dma_addr being set doing virt_to_phys(substream->runtime->dma_area) will still be fine, so this probably is the right thing to do for now regardless. Regards, Hans > > > thanks, > > Takashi > > --- > --- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c > +++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c > @@ -127,7 +127,7 @@ static void sst_fill_alloc_params(struct snd_pcm_substream *substream, > snd_pcm_uframes_t period_size; > ssize_t periodbytes; > ssize_t buffer_bytes = snd_pcm_lib_buffer_bytes(substream); > - u32 buffer_addr = substream->runtime->dma_addr; > + u32 buffer_addr = virt_to_phys(substream->runtime->dma_area); > > channels = substream->runtime->channels; > period_size = substream->runtime->period_size; >