From owner-freebsd-bugs Fri May 10 10: 0:37 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 466DE37B40B for ; Fri, 10 May 2002 10:00:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g4AH02652880; Fri, 10 May 2002 10:00:02 -0700 (PDT) (envelope-from gnats) Received: from piggy.rz.tu-ilmenau.de (piggy.rz.tu-ilmenau.de [141.24.4.8]) by hub.freebsd.org (Postfix) with ESMTP id A431837B400 for ; Fri, 10 May 2002 09:51:02 -0700 (PDT) Received: from gtw.hh59.local (pD9508BBA.dip.t-dialin.net [217.80.139.186]) (authenticated (0 bits)) by piggy.rz.tu-ilmenau.de (8.11.1/8.11.1) with ESMTP id g4AGoxv13493 (using TLSv1/SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168 bits) verified NO) ; Fri, 10 May 2002 18:51:01 +0200 (MET DST) Received: from walnut.hh59.local (walnut.hh59.local [192.168.2.10]) by gtw.hh59.local (8.11.3/8.11.3) with ESMTP id g4AHMQK10990 (using TLSv1/SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168 bits) verified FAIL) for ; Fri, 10 May 2002 19:22:30 +0200 (CEST) Received: (qmail 16596 invoked by uid 1000); 10 May 2002 16:50:53 -0000 Message-Id: <20020510165053.16595.qmail@walnut.hh59.local> Date: 10 May 2002 16:50:53 -0000 From: Martin Kaeske Reply-To: Martin Kaeske To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/37932: [PATCH] bug in ad1816.c stops sound playback Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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