From: Takashi Iwai Subject: Re: snd_pcm_avail_update returns bogus values with the OSS PCM plugin Date: Fri, 17 Jul 2009 12:04:41 +0200 Message-ID: References: <20090710102955.eaqs4fpsows0swwg@webmail.ntnu.no> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 9EE291038C6 for ; Fri, 17 Jul 2009 12:04:41 +0200 (CEST) In-Reply-To: <20090710102955.eaqs4fpsows0swwg@webmail.ntnu.no> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Sindre =?ISO-8859-1?Q?Aam=E5s?= Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Fri, 10 Jul 2009 10:29:55 +0200, Sindre Aam=E5s wrote: > = > Hi. > = > For the attached test case snd_pcm_avail_update returns values higher = > than the buffer size when run with the OSS PCM plugin. Output of = > alsa-info.sh is at > http://www.alsa-project.org/db/?f=3D77a873e55d5d6ca50d67a035a9d6b7e10cca1= 79d . This is obviously a bug in OSS plugin (who thought of using this plugin seriously? :) The oneliner below should fix the problem. thanks, Takashi --- >From ae9a633d98988d072307284a260e985a4c660501 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 17 Jul 2009 12:00:18 +0200 Subject: [PATCH] oss - Add missing initialization of fragments The periods calculation was missing for initializing OSS fragments. Signed-off-by: Takashi Iwai --- oss/pcm_oss.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/oss/pcm_oss.c b/oss/pcm_oss.c index 8a2a672..d43b44c 100644 --- a/oss/pcm_oss.c +++ b/oss/pcm_oss.c @@ -181,6 +181,7 @@ static int oss_hw_params(snd_pcm_ioplug_t *io, fprintf(stderr, "*** OSS: invalid period size %d\n", (int)io->period_siz= e); return -EINVAL; } + oss->periods =3D io->buffer_size / io->period_size; = _retry: tmp =3D oss->period_shift | (oss->periods << 16); -- = 1.6.3.2