From owner-freebsd-stable@FreeBSD.ORG Fri Apr 29 06:10:56 2011 Return-Path: Delivered-To: stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08D7D106566B for ; Fri, 29 Apr 2011 06:10:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 51A8E8FC12 for ; Fri, 29 Apr 2011 06:10:55 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id IAA13752; Fri, 29 Apr 2011 08:59:40 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QFgjr-000F70-Ss; Fri, 29 Apr 2011 08:59:39 +0300 Message-ID: <4DBA53CB.4090403@FreeBSD.org> Date: Fri, 29 Apr 2011 08:59:39 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110308 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: current@FreeBSD.org, stable@FreeBSD.org X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Fwd: SNDCTL_DSP_GETIPTR implementation X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2011 06:10:56 -0000 I intend to commit the following change soon and MFC it after a short period of time. Please test it if you use multimedia applications, both native and Linux, especially if they deal with audio recording/capture. Thank you. -------- Original Message -------- Message-ID: <4DB6F7BA.4070808@FreeBSD.org> Date: Tue, 26 Apr 2011 19:50:02 +0300 From: Andriy Gapon To: multimedia@freebsd.org Subject: SNDCTL_DSP_GETIPTR implementation 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