From owner-freebsd-multimedia@FreeBSD.ORG Tue Apr 26 17:47:59 2011 Return-Path: Delivered-To: multimedia@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52CCE1065673; Tue, 26 Apr 2011 17:47:59 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 11FBC8FC17; Tue, 26 Apr 2011 17:47:58 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 2C1121E000C9; Tue, 26 Apr 2011 19:47:58 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.4/8.14.3) with ESMTP id p3QHin4U005403; Tue, 26 Apr 2011 19:44:49 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.4/8.14.3/Submit) id p3QHinpH005402; Tue, 26 Apr 2011 19:44:49 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Tue, 26 Apr 2011 19:44:49 +0200 To: Andriy Gapon Message-ID: <20110426174449.GA4437@triton8.kn-bremen.de> References: <4DB6F7BA.4070808@FreeBSD.org> <4DB701C4.30802@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DB701C4.30802@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Juergen Lock , multimedia@FreeBSD.org Subject: Re: SNDCTL_DSP_GETIPTR implementation X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 17:47:59 -0000 On Tue, Apr 26, 2011 at 08:32:52PM +0300, Andriy Gapon wrote: > on 26/04/2011 19:50 Andriy Gapon said the following: > > > > Guys, > > > > I reading this http://manuals.opensound.com/developer/SNDCTL_DSP_GETOPTR.html > > It says: "In mmap mode (only) the ptr field tells the location where the next > > sample will be recorded." > > In my opinion that means that we have a mistake in our code and the following > > patch should be applied. But I am not sufficiently familiar with this code. > > It seems that with this change linux alsa lib with oss plugin works for audio > recording now. E.g. in skype. > Hope I wasn't sloppy with my testing again, so I will re-test. > > Juergen, > will you be able to test this too? > > > --- a/sys/dev/sound/pcm/dsp.c > > +++ b/sys/dev/sound/pcm/dsp.c > > @@ -1655,7 +1655,7 @@ dsp_ioctl > > /* XXX abusive DMA update: chn_rdupdate(rdch); */ > > a->bytes = sndbuf_gettotal(bs); > > a->blocks = sndbuf_getblocks(bs) - rdch->blocks; > > - a->ptr = sndbuf_getreadyptr(bs); > > + a->ptr = sndbuf_getfreeptr(bs); > > rdch->blocks = sndbuf_getblocks(bs); > > CHN_UNLOCK(rdch); > > } else > > > > P.S. leading (indenting) whitespace in this file is a mess. Nice, I'll have a go. Thanx! Juergen