From patchwork Wed Nov 29 22:17:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej S. Szmigiero" X-Patchwork-Id: 10083745 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7FEED60353 for ; Wed, 29 Nov 2017 22:24:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70FB729CD4 for ; Wed, 29 Nov 2017 22:24:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6512B29CDA; Wed, 29 Nov 2017 22:24:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA9C829CD4 for ; Wed, 29 Nov 2017 22:24:38 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 86361267A53; Wed, 29 Nov 2017 23:18:02 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E5D9F267A55; Wed, 29 Nov 2017 23:18:00 +0100 (CET) Received: from vps-vb.mhejs.net (vps-vb.mhejs.net [37.28.154.113]) by alsa0.perex.cz (Postfix) with ESMTP id DCF63267A53 for ; Wed, 29 Nov 2017 23:17:53 +0100 (CET) Received: by vps-vb.mhejs.net with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) (envelope-from ) id 1eKAfw-00041e-DD; Wed, 29 Nov 2017 23:17:52 +0100 From: "Maciej S. Szmigiero" To: tiwai@suse.de, perex@perex.cz Message-ID: <43cb4e59-50c3-436c-b7bb-c66bed1d9c7e@maciej.szmigiero.name> Date: Wed, 29 Nov 2017 23:17:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Language: en-US Cc: alsa-devel@alsa-project.org, Takashi Sakamoto Subject: [alsa-devel] [alsa-lib][PATCH 4/4] pcm: plug: add SND_PCM_FORMAT_{S, U}20 to linear_preferred_formats X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This commit adds the recently added formats SND_PCM_FORMAT_{S,U}20 to the linear_preferred_formats array in pcm_plug. Let's give them lower priority than more standard S24 formats but a higher priority than less typical 3-byte versions. Signed-off-by: Maciej S. Szmigiero --- src/pcm/pcm_plug.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/pcm/pcm_plug.c b/src/pcm/pcm_plug.c index f1d7792db709..abf6f1ab9751 100644 --- a/src/pcm/pcm_plug.c +++ b/src/pcm/pcm_plug.c @@ -138,6 +138,17 @@ static const snd_pcm_format_t linear_preferred_formats[] = { SND_PCM_FORMAT_S24_LE, SND_PCM_FORMAT_U24_LE, #endif +#ifdef SND_LITTLE_ENDIAN + SND_PCM_FORMAT_S20_LE, + SND_PCM_FORMAT_U20_LE, + SND_PCM_FORMAT_S20_BE, + SND_PCM_FORMAT_U20_BE, +#else + SND_PCM_FORMAT_S20_BE, + SND_PCM_FORMAT_U20_BE, + SND_PCM_FORMAT_S20_LE, + SND_PCM_FORMAT_U20_LE, +#endif #ifdef SND_LITTLE_ENDIAN SND_PCM_FORMAT_S24_3LE, SND_PCM_FORMAT_U24_3LE,