From patchwork Thu Dec 14 13:54:29 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: 10112243 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 68763603FA for ; Thu, 14 Dec 2017 14:01:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58D1A2908F for ; Thu, 14 Dec 2017 14:01:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DA8729097; Thu, 14 Dec 2017 14:01:26 +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 B610D2908F for ; Thu, 14 Dec 2017 14:01:22 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 50BCD267AC4; Thu, 14 Dec 2017 14:54:34 +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 D6CB6267AC5; Thu, 14 Dec 2017 14:54:32 +0100 (CET) Received: from vps-vb.mhejs.net (vps-vb.mhejs.net [37.28.154.113]) by alsa0.perex.cz (Postfix) with ESMTP id 5A81726732A for ; Thu, 14 Dec 2017 14:54:31 +0100 (CET) Received: by vps-vb.mhejs.net with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) (envelope-from ) id 1ePTy2-00061x-60; Thu, 14 Dec 2017 14:54:30 +0100 From: "Maciej S. Szmigiero" References: To: Jaroslav Kysela , Takashi Iwai Message-ID: Date: Thu, 14 Dec 2017 14:54:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Cc: alsa-devel@alsa-project.org, Takashi Sakamoto Subject: [alsa-devel] [alsa-lib][PATCH v3 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,