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=-5.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 02A1EC43331 for ; Mon, 30 Mar 2020 20:09:43 +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 82E6020786 for ; Mon, 30 Mar 2020 20:09:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="pd51reCc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 82E6020786 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com 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 D20591616; Mon, 30 Mar 2020 22:08:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D20591616 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1585598980; bh=TDrx4vLSl2+txCh0mH6vNAiFpiWZKGjMWjGFhFuO0yo=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=pd51reCcSTjQgBlsOpVWtko5nBFyGvTenpFmOtvPnaovHZfN7XEMUxk5diblm2CoM wRb9g7bmhF49DSl5I+2EvPMuxriDBgDXEmHMhKycIbUXlZv6entpnboq86zOrzZKSu GGHI8sH+naSJ/uUAY7o1OhazDvBwaWm6DUnsnTDs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4D81EF80254; Mon, 30 Mar 2020 22:07:14 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 92E47F8014A; Mon, 30 Mar 2020 22:07:10 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (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 78CB6F80148 for ; Mon, 30 Mar 2020 22:07:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 78CB6F80148 IronPort-SDR: 2NbMc8qoAf3c7h/0UgHczUnKYtjR5c8X5f3AKcfmxxYuUmeTKPjfa0KF9TRpB512v+T/KCI+3G Avn0vwqBtD1Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2020 13:07:01 -0700 IronPort-SDR: FBmhe8AthXB0+KVrywlHCmh18zmuctcn0kZClWFnFfO1lPsQnKs30eiDaLc9PW5F6bGIFcySY2 oygEEr5izKkw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,325,1580803200"; d="scan'208";a="248816622" Received: from unknown (HELO [10.134.63.32]) ([10.134.63.32]) by orsmga003.jf.intel.com with ESMTP; 30 Mar 2020 13:07:00 -0700 Subject: Re: [PATCH] ASoC: qcom: q6asm-dai: Add SNDRV_PCM_INFO_BATCH flag To: Lars-Peter Clausen , Stephan Gerhold , Mark Brown References: <20200330175210.47518-1-stephan@gerhold.net> From: Pierre-Louis Bossart Message-ID: <3ac5fe32-8292-ce3a-f586-32d556efc98c@linux.intel.com> Date: Mon, 30 Mar 2020 13:52:55 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Cc: alsa-devel@alsa-project.org, Banajit Goswami , Patrick Lai , Liam Girdwood , Takashi Iwai , Srinivas Kandagatla , ~postmarketos/upstreaming@lists.sr.ht 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" On 3/30/20 1:15 PM, Lars-Peter Clausen wrote: > On 3/30/20 7:52 PM, Stephan Gerhold wrote: >> At the moment, playing audio with PulseAudio with the qdsp6 driver >> results in distorted sound. It seems like its timer-based scheduling >> does not work properly with qdsp6 since setting tsched=0 in >> the PulseAudio configuration avoids the issue. >> >> Apparently this happens when the pointer() callback is not accurate >> enough. There is a SNDRV_PCM_INFO_BATCH flag that can be used to stop >> PulseAudio from using timer-based scheduling by default. >> >> According to >> https://www.alsa-project.org/pipermail/alsa-devel/2014-March/073816.html: >> >>      The flag is being used in the sense explained in the previous audio >>      meeting -- the data transfer granularity isn't fine enough but >> aligned >>      to the period size (or less). >> >> q6asm-dai reports the position as multiple of >> >>      prtd->pcm_count = snd_pcm_lib_period_bytes(substream) >> >> so it indeed just a multiple of the period size. >> >> Therefore adding the flag here seems appropriate and makes audio >> work out of the box. >> >> Fixes: 2a9e92d371db ("ASoC: qdsp6: q6asm: Add q6asm dai driver") >> Cc: Srinivas Kandagatla >> Signed-off-by: Stephan Gerhold >> --- >> I'm still quite confused about the true meaning of SNDRV_PCM_INFO_BATCH, >> so please correct me if I'm wrong :) > > The meaning might have changed over the years, but the way it is used > right now is that it means that the position pointer has limited > granularity. With 'limited' being a bit fuzzy, but typically means that > the granularity is worse than a few samples. > > This driver definitely falls into the limited category as the > granularity seems to be period size. Agree, we added this INFO_BATCH flag for SOF Broadwell and Baytrail platforms as well for the same reason of large granularity.