From patchwork Wed Jul 16 15:54:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 4568261 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 33C19C0514 for ; Wed, 16 Jul 2014 15:55:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 70216201C0 for ; Wed, 16 Jul 2014 15:55:38 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 4097320145 for ; Wed, 16 Jul 2014 15:55:37 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4FCB826548F; Wed, 16 Jul 2014 17:55:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 6EB23265487; Wed, 16 Jul 2014 17:55:12 +0200 (CEST) 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 4C1A3265357; Wed, 16 Jul 2014 17:55:09 +0200 (CEST) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 4F80B265488 for ; Wed, 16 Jul 2014 17:54:43 +0200 (CEST) Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 30978AB5D for ; Wed, 16 Jul 2014 15:54:43 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Wed, 16 Jul 2014 17:54:43 +0200 Message-Id: <1405526083-18484-1-git-send-email-tiwai@suse.de> X-Mailer: git-send-email 2.0.1 Subject: [alsa-devel] [PATCH] alsa-lib: pcm: Fill sw_params proto field 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Fill the new proto field introduced to sw_params with the current PCM protocol version. This makes tstamp_type evaluated properly in the kernel. Signed-off-by: Takashi Iwai --- include/sound/asound.h | 4 ++-- src/pcm/pcm.c | 1 + src/pcm/pcm_params.c | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/sound/asound.h b/include/sound/asound.h index 552f41bd1ca9..98708c60c320 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h @@ -386,8 +386,8 @@ struct snd_pcm_sw_params { snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */ snd_pcm_uframes_t silence_size; /* silence block size */ snd_pcm_uframes_t boundary; /* pointers wrap point */ - unsigned int tstamp_type; /* timestamp type */ - int pads; /* alignment, reserved */ + unsigned int tstamp_type; /* timestamp type (req. proto >= 2.0.12) */ + unsigned int proto; /* protocol version */ unsigned char reserved[56]; /* reserved for future */ }; diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c index 89844430bf35..1399a5b2e671 100644 --- a/src/pcm/pcm.c +++ b/src/pcm/pcm.c @@ -5610,6 +5610,7 @@ int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params) SNDMSG("PCM not set up"); return -EIO; } + params->proto = SNDRV_PCM_VERSION; params->tstamp_mode = pcm->tstamp_mode; params->tstamp_type = pcm->tstamp_type; params->period_step = pcm->period_step; diff --git a/src/pcm/pcm_params.c b/src/pcm/pcm_params.c index 4adbefae0530..6e57904e445b 100644 --- a/src/pcm/pcm_params.c +++ b/src/pcm/pcm_params.c @@ -2257,6 +2257,7 @@ static int snd_pcm_sw_params_default(snd_pcm_t *pcm, snd_pcm_sw_params_t *params { assert(pcm && params); assert(pcm->setup); + params->proto = SNDRV_PCM_VERSION; params->tstamp_mode = SND_PCM_TSTAMP_NONE; params->tstamp_type = pcm->tstamp_type; params->period_step = 1;