Date: Tue, 1 Aug 2000 04:55:29 -0700 (PDT) From: shirai@nintendo.co.jp To: freebsd-gnats-submit@FreeBSD.org Subject: kern/20340: SNDCTL_DSP_GETODELAY on pcm device is incorrectly implemented. Message-ID: <20000801115529.AC9CB37BCE1@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 20340 >Category: kern >Synopsis: SNDCTL_DSP_GETODELAY on pcm device is incorrectly implemented. >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Aug 01 05:00:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Takashi SHIRAI >Release: 4-STABLE >Organization: Nintendo, Co., Ltd. >Environment: FreeBSD 4-STABLE >Description: According to OSS Programmer's Guide (http://www.opensound.com/pguide/), SNDCTL_DSP_GETODELAY returns the number of unplayed bytes in the kernel buffer. It means the length of ready areas (rl). But, in the latest implement, this call returns the total bytes played already. It is certainly mis-implement. >How-To-Repeat: Use any audio applications which use SNDCTL_DSP_GETODELAY. e.g. TiMidity++ (>= 3.5.1) >Fix: The following patch will be effective: diff -u dsp.c.old dsp.c --- dsp.c.old Tue Aug 1 04:36:13 2000 +++ dsp.c Tue Aug 1 20:18:08 2000 @@ -587,12 +587,13 @@ case SNDCTL_DSP_GETODELAY: if (wrch) { snd_dbuf *b = &wrch->buffer; + snd_dbuf *bs = &wrch->buffer2nd; if (b->dl) { chn_checkunderflow(wrch); if (!(wrch->flags & CHN_F_MAPPED)) while (chn_wrfeed(wrch) > 0); } - *arg = b->total; + *((int *)arg) = bs->rl; } else ret = EINVAL; break; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000801115529.AC9CB37BCE1>