From mboxrd@z Thu Jan 1 00:00:00 1970 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.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 683FAC433E0 for ; Mon, 10 Aug 2020 15:03:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4155A20772 for ; Mon, 10 Aug 2020 15:03:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727768AbgHJPDL (ORCPT ); Mon, 10 Aug 2020 11:03:11 -0400 Received: from mga14.intel.com ([192.55.52.115]:38032 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726499AbgHJPDK (ORCPT ); Mon, 10 Aug 2020 11:03:10 -0400 IronPort-SDR: wWHoqf6ltRmFMz3QjQMdD1POQtu2tal+juHHNOJfckx7BgmxbCBEruqYTZJQXP9Bdc/PkIjjm6 Pp5FyHYZYilw== X-IronPort-AV: E=McAfee;i="6000,8403,9708"; a="152760447" X-IronPort-AV: E=Sophos;i="5.75,457,1589266800"; d="scan'208";a="152760447" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2020 08:03:09 -0700 IronPort-SDR: 12GPmA8BCeQKGz3X7oWrHdalm2jYaMpo7RLVvb4zhfL6Ek6UshgXWdDmlDGRZyMjLYfytOv4Ny v8l1ys7ZGACg== X-IronPort-AV: E=Sophos;i="5.75,457,1589266800"; d="scan'208";a="438722426" Received: from schen8-mobl.amr.corp.intel.com (HELO [10.212.235.58]) ([10.212.235.58]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2020 08:03:07 -0700 Subject: Re: [PATCH v3 2/2] ASoC: Intel: Add period size constraint on strago board To: "Lu, Brent" , Takashi Iwai Cc: Guennadi Liakhovetski , "alsa-devel@alsa-project.org" , Kai Vehmanen , Kuninori Morimoto , "Rojewski, Cezary" , Takashi Iwai , Jie Yang , "linux-kernel@vger.kernel.org" , "yuhsuan@google.com" , Liam Girdwood , Sam McNally , Mark Brown , Ranjani Sridharan , Daniel Stuart , Andy Shevchenko , Yu-Hsuan Hsu , Damian van Soelen References: <1596020585-11517-1-git-send-email-brent.lu@intel.com> <1596198365-10105-1-git-send-email-brent.lu@intel.com> <1596198365-10105-3-git-send-email-brent.lu@intel.com> <63bca214-3434-16c6-1b60-adf323aec554@linux.intel.com> <6466847a-8aae-24f7-d727-36ba75e95f98@linux.intel.com> From: Pierre-Louis Bossart Message-ID: <3f3baf5e-f73d-9cd6-cbfb-36746071e126@linux.intel.com> Date: Mon, 10 Aug 2020 10:03:06 -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: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/6/20 11:41 AM, Lu, Brent wrote: >> >> I don't get this. If the platform driver already stated 240 and 960 samples why >> would 432 be chosen? Doesn't this mean the constraint is not applied? > > Hi Pierre, > > Sorry for late reply. I used following constraints in V3 patch so any period which > aligns 1ms would be accepted. > > + /* > + * Make sure the period to be multiple of 1ms to align the > + * design of firmware. Apply same rule to buffer size to make > + * sure alsa could always find a value for period size > + * regardless the buffer size given by user space. > + */ > + snd_pcm_hw_constraint_step(substream->runtime, 0, > + SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 48); > + snd_pcm_hw_constraint_step(substream->runtime, 0, > + SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 48); 432 samples is 9ms, I don't have a clue why/how CRAS might ask for this value. It'd be a bit odd to add constraints just for the purpose of letting userspace select a sensible value.