Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Apr 2011 19:50:02 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        multimedia@FreeBSD.org
Subject:   SNDCTL_DSP_GETIPTR implementation
Message-ID:  <4DB6F7BA.4070808@FreeBSD.org>

next in thread | raw e-mail | index | archive | help

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.

--- 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.
-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DB6F7BA.4070808>