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=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 1D286C43464 for ; Mon, 21 Sep 2020 10:02:19 +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 7E97621BE5 for ; Mon, 21 Sep 2020 10:02:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="MNKCXbk/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E97621BE5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de 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 D3F1416E0; Mon, 21 Sep 2020 12:01:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D3F1416E0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1600682535; bh=ss9WbADD/n/A/0Cp2CdXIt8+p4BeZipgzQUsRF5kIh4=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=MNKCXbk/kXZPrBX/WCxcMCS8YBmNOsJvPU18lI/NGCvmHq4Or6voCdz3WDgG6+Fx8 JFmXjBqEI1crXFIyjFLm3tGUMKNstjauiPATuclK5z4fG1jPfTfSl9Tgjcrw0wWM6F SuwkoIPEWyeazjL5gIr49F8+VQdekatBSL7oO7Is= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 69FADF80161; Mon, 21 Sep 2020 12:01:25 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A9AB8F80162; Mon, 21 Sep 2020 12:01:23 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 96CC8F8010A; Mon, 21 Sep 2020 12:01:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 96CC8F8010A X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C092AAF83; Mon, 21 Sep 2020 10:01:51 +0000 (UTC) Date: Mon, 21 Sep 2020 12:01:15 +0200 Message-ID: From: Takashi Iwai To: Pawel Harlozinski Subject: Re: [PATCH v2 1/1] ALSA: hda: Refactor calculating SDnFMT according to specification In-Reply-To: <20200921094200.10126-1-pawel.harlozinski@linux.intel.com> References: <20200921094200.10126-1-pawel.harlozinski@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: cezary.rojewski@intel.com, patch@alsa-project.org, kai.vehmanen@linux.intel.com, alsa-devel@alsa-project.org, pierre-louis.bossart@linux.intel.com, lgirdwood@gmail.com, broonie@kernel.org, amadeuszx.slawinski@linux.intel.com 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 Mon, 21 Sep 2020 11:42:00 +0200, Pawel Harlozinski wrote: > > Fix setting SDnFMT based on High Definition Audio Specification Rev. 1.0a page 48. > > Bits per Sample (BITS): > 000 = 8 bits. The data will be packed in memory in 8-bit containers on 16-bit boundaries. > 001 = 16 bits. The data will be packed in memory in 16-bit containers on 16-bit boundaries. > 010 = 20 bits. The data will be packed in memory in 32-bit containers on 32-bit boundaries. > 011 = 24 bits. The data will be packed in memory in 32-bit containers on 32-bit boundaries. > 100 = 32 bits. The data will be packed in memory in 32-bit containers on 32-bit boundaries. > 101-111 = Reserved > > Set SDnFMT depending on which format was given. > Henceforth split cases for formats 20, 24, 32 bits, > but leave constraints to maxbps. As mentioned in the previous thread, practically seen, case 20 and 24 are never met, since HD-audio doesn't accept the SNDRV_PCM_FORMAT_20* or _24* due to the 32bit container. So this change is superfluous. I can take the change, but it has to be clarified that it won't affect the behavior on the real hardware but pure theoretical. > Change-Id: I97771b16da14e85b7f35372f5dfc87bb13bb5ce0 Please drop change-id. It's not useful for others. thanks, Takashi > Signed-off-by: Pawel Harlozinski > --- > sound/hda/hdac_device.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c > index 3e9e9ac804f6..ccc47a10ba63 100644 > --- a/sound/hda/hdac_device.c > +++ b/sound/hda/hdac_device.c > @@ -764,7 +764,14 @@ unsigned int snd_hdac_calc_stream_format(unsigned int rate, > val |= AC_FMT_BITS_16; > break; > case 20: > + val |= AC_FMT_BITS_20; > + break; > case 24: > + if (maxbps >= 24) > + val |= AC_FMT_BITS_24; > + else > + val |= AC_FMT_BITS_20; > + break; > case 32: > if (maxbps >= 32 || format == SNDRV_PCM_FORMAT_FLOAT_LE) > val |= AC_FMT_BITS_32; > -- > 2.17.1 >