Date: 10 May 2002 16:50:53 -0000 From: Martin Kaeske <Martin.Kaeske@Stud.TU-Ilmenau.DE> To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/37932: [PATCH] bug in ad1816.c stops sound playback Message-ID: <20020510165053.16595.qmail@walnut.hh59.local>
index | next in thread | raw e-mail
>Number: 37932
>Category: kern
>Synopsis: [PATCH] bug in ad1816.c stops sound playback
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri May 10 10:00:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Martin Kaeske
>Release: FreeBSD 4.6-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD walnut.hh59.local 4.6-PRERELEASE FreeBSD 4.6-PRERELEASE #5: Fri May 10 16:51:12 CEST 2002 martin@walnut.hh59.local:/usr/obj/usr/src/sys/BSD4_5 i386
>Description:
There is a problem inside ad1816.c that prevents any access to
/dev/dsp and /dev/audio. During opening of /dev/dsp the function
chn_reset is called that itself calls chn_setformat. That results
in ad1816chan_setformat to be called. ad1816chan_setformat returns
one of its parameters (u_int32_t format) but chn_setformat expects
to get "0" if everything went okay (actually its chn_tryformat
that calls ad1816chan_setformat). Since format is not "0"
chn_setformat comes to the conclusion that there was an error
and as a result dsp_open returns ENODEV. I've looked at the
other drivers inside sys/dev/sound/isa and they return "0" as
the result of a setformat call so i think its a good idea
to change ad1816.c to also return "0". Furthermore returning
format doesn't make much sense, because it is not changed and
is no error indicator.
Another interesting thing i saw was that only the very first
attempt to open /dev/dsp results in ENODEV any subsequent tries
gave me EBUSY, maybe this is related to kern/35004.
>How-To-Repeat:
any read/write access to /dev/dsp (/dev/audio as well) fails
>Fix:
apply attached patch
--- ad1816.patch begins here ---
--- ad1816.c.orig Fri May 10 18:26:58 2002
+++ ad1816.c Fri May 10 18:28:29 2002
@@ -368,7 +368,7 @@
if (format & AFMT_STEREO) fmt |= AD1816_STEREO;
io_wr(ad1816, reg, fmt);
ad1816_unlock(ad1816);
- return format;
+ return 0;
}
static int
--- ad1816.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020510165053.16595.qmail>
