Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1303454pxa; Thu, 13 Aug 2020 05:58:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCGzW7e0CoLCxP9q59N92QqqhzFHuLFcd4fyYkfEpS6dfpt5yAqA6CctI/Q0HV4b435HrK X-Received: by 2002:a17:906:2506:: with SMTP id i6mr4569364ejb.72.1597323523322; Thu, 13 Aug 2020 05:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597323523; cv=none; d=google.com; s=arc-20160816; b=viXaaVKk/W21fyyYRIdZoMxfy96xow4IyEhw6SEH3Y1wMD82NoQmJ4RnA1Exp3ieK5 q69Qny0jV1x7xCrYd8/aw7fJGf6LH14PxeVk1NVwdlEygeAgaI99IZnJXU+F7jF4n4dT jch75/ZEwHAJLRm0zadFM+eSaxoBI7uUcDAftiSwcA1zhSDGhlzZ9gptNmyAHBc1ol4b qS0O9KIFwVMoNjAAgXRGYCKujRQgaV4QXUpJP1vXhsURvbrpwICUH3AVblwNsSjL+KlN +3Uiy2a9X65aITnyGurZc8JN48jNCJA0dQTm3RWx1bgA/tnU4BCDscxXCxnaCdRtNNFP R6sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=2GohYqsN4VZSiILwH+iqbFrgc0o902QSe3pzaaC1RFE=; b=RBfaGlsxnwe35en0XwRXZSGUp+s4/dYFxqhaHD+JEit71kS1zfWFEi3bvnx+bJ0VL6 IJuTmY1S98eZIsfog7XR5Zv5pVfZcjsWGE96GrVLQ/j560NLN4hluLsQOIAM4Rz4H1oQ HnE384HRUMm8eXCbNGfKjCWS11LiI1pCTD05GyafaeevMhWGiGk5d1Y1qk0TkagGC/gi r5Hest3k6W4LENAf9nbdxe5DQNakCGAiw/PdpFqdezjtqeqZx7BZThptCdVz1VUEWSv+ /ROQ7TpKp0cKnspNkZlv0sqPKw+bX1UyCBVRMT341X0c6IBsXV5F0aes6+lt3mWlOT9O 9dBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i20si3014329ejh.394.2020.08.13.05.58.20; Thu, 13 Aug 2020 05:58:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726486AbgHMM5j (ORCPT + 99 others); Thu, 13 Aug 2020 08:57:39 -0400 Received: from mga17.intel.com ([192.55.52.151]:30638 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726192AbgHMM5i (ORCPT ); Thu, 13 Aug 2020 08:57:38 -0400 IronPort-SDR: XMbXD5wOjMy9ylOIT79c5GULY32En/0TbSGuDlH2t3NjxCfD0ZjSbEkYXIkyifrbEQuuicv/L2 1KQmnGV6YK0g== X-IronPort-AV: E=McAfee;i="6000,8403,9711"; a="134262895" X-IronPort-AV: E=Sophos;i="5.76,308,1592895600"; d="scan'208";a="134262895" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2020 05:57:38 -0700 IronPort-SDR: 4TbxNK5/QPQDHXXHIJNqMc9bTYRc/awbplus0DHvOH1EX6V8zHMPTO2JPHWk16GPlh3qi1OJok zcLByXumFfhA== X-IronPort-AV: E=Sophos;i="5.76,308,1592895600"; d="scan'208";a="333100702" Received: from jsdraege-mobl1.amr.corp.intel.com (HELO [10.209.128.166]) ([10.209.128.166]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2020 05:57:36 -0700 Subject: Re: [PATCH v3 2/2] ASoC: Intel: Add period size constraint on strago board To: Takashi Iwai , Yu-Hsuan Hsu Cc: "Lu, Brent" , Guennadi Liakhovetski , "alsa-devel@alsa-project.org" , Andy Shevchenko , Kuninori Morimoto , Kai Vehmanen , "linux-kernel@vger.kernel.org" , "Rojewski, Cezary" , Jie Yang , Takashi Iwai , Liam Girdwood , Sam McNally , Mark Brown , Ranjani Sridharan , Daniel Stuart , "yuhsuan@google.com" , Damian van Soelen References: <3f3baf5e-f73d-9cd6-cbfb-36746071e126@linux.intel.com> <20200811172209.GM6967@sirena.org.uk> <0714b222-d3fc-5744-1147-bfac7df2651e@linux.intel.com> From: Pierre-Louis Bossart Message-ID: Date: Thu, 13 Aug 2020 07:57:35 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/13/20 3:45 AM, Takashi Iwai wrote: > On Thu, 13 Aug 2020 10:36:57 +0200, > Yu-Hsuan Hsu wrote: >> >> Lu, Brent 於 2020年8月13日 週四 下午3:55寫道: >>> >>>>>> >>>>>> CRAS calls snd_pcm_hw_params_set_buffer_size_max() to use as large >>>>>> buffer as possible. So the period size is an arbitrary number in >>>>>> different platforms. Atom SST platform happens to be 256, and CML >>>>>> SOF platform is 1056 for example. >>>>> >>>>> ok, but earlier in this thread it was mentioned that values such as >>>>> 432 are not suitable. the statement above seems to mean the period >>>>> actual value is a "don't care", so I don't quite see why this specific >>>>> patch2 restricting the value to 240 is necessary. Patch1 is needed for >>>>> sure, >>>>> Patch2 is where Takashi and I are not convinced. >>>> >>>> I have downloaded the patch1 but it does not work. After applying patch1, >>>> the default period size changes to 320. However, it also has the same issue >>>> with period size 320. (It can be verified by aplay.) >>> >>> The period_size is related to the audio latency so it's decided by application >>> according to the use case it's running. That's why there are concerns about >>> patch 2 and also you cannot find similar constraints in other machine driver. >> You're right. However, the problem here is the provided period size >> does not work. Like 256, setting the period size to 320 also makes >> users have big latency in the DSP ring buffer. >> >> localhost ~ # aplay -Dhw:1,0 --period-size=320 --buffer-size=640 >> /dev/zero -d 1 -f dat --test-position >> Playing raw data '/dev/zero' : Signed 16 bit Little Endian, Rate 48000 >> Hz, Stereo >> Suspicious buffer position (1 total): avail = 0, delay = 2640, buffer = 640 >> Suspicious buffer position (2 total): avail = 0, delay = 2640, buffer = 640 >> Suspicious buffer position (3 total): avail = 0, delay = 2720, buffer = 640 >> ... > > It means that the delay value returned from the driver is bogus. > I suppose it comes pcm_delay value calculated in sst_calc_tstamp(), > but haven't followed the code closely yet. Maybe checking the debug > outputs can help to trace what's going wrong. the problem is really that we add a constraint that the period size be a multiple of 1ms, and it's not respected. 320 samples is not a valid choice, I don't get how it ends-up being selected? there's a glitch in the matrix here.