SNDCTL_DSP_GETIPTR implementation

Andriy Gapon avg at
Tue Apr 26 16:50:05 UTC 2011


I reading this
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);
 	    		} else

P.S. leading (indenting) whitespace in this file is a mess.
Andriy Gapon

More information about the freebsd-multimedia mailing list