From owner-freebsd-bugs Sun Feb 16 11: 0: 7 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 54A5137B401 for ; Sun, 16 Feb 2003 11:00:05 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5406F43FAF for ; Sun, 16 Feb 2003 11:00:04 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h1GJ04NS095669 for ; Sun, 16 Feb 2003 11:00:04 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h1GJ04wC095668; Sun, 16 Feb 2003 11:00:04 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 623FC37B401 for ; Sun, 16 Feb 2003 10:51:21 -0800 (PST) Received: from gateway.lefort.net (213.189.162.78.brutele.be [213.189.162.78]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0EEC543F75 for ; Sun, 16 Feb 2003 10:51:20 -0800 (PST) (envelope-from jylefort@brutele.be) Received: from jsite.lefort.net (jsite.lefort.net [192.168.1.2]) by gateway.lefort.net (Postfix) with ESMTP id 768C754E5 for ; Sun, 16 Feb 2003 19:51:17 +0100 (CET) Received: by jsite.lefort.net (Postfix, from userid 1000) id 47EE922E35; Sun, 16 Feb 2003 19:51:17 +0100 (CET) Message-Id: <20030216185117.47EE922E35@jsite.lefort.net> Date: Sun, 16 Feb 2003 19:51:17 +0100 (CET) From: Jean-Yves Lefort Reply-To: Jean-Yves Lefort To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/48338: pcm audio driver hogs /dev/dsp?.? 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: 48338 >Category: kern >Synopsis: pcm audio driver hogs /dev/dsp?.? >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Feb 16 11:00:03 PST 2003 >Closed-Date: >Last-Modified: >Originator: Jean-Yves Lefort >Release: FreeBSD 4.7-RELEASE-p3 i386 >Organization: >Environment: The problem has been experienced on: $ uname -a FreeBSD jsite.lefort.net 4.7-RELEASE-p3 FreeBSD 4.7-RELEASE-p3 #0: Tue Jan 7 23:46:56 CET 2003 jylefort@jsite.lefort.net:/usr/obj/usr/src/sys/JSITE i386 $ cat /dev/sndstat FreeBSD Audio Driver (newpcm) Installed devices: pcm0: at io 0x9000 irq 11 (1p/1r/4v channels duplex) $ and: $ uname -a FreeBSD noname 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Sat Feb 1 00:57:38 EST 2003 refugee@noname:/usr/obj/usr/src/sys/NONAME i386 $ cat /dev/sndstat FreeBSD Audio Driver (newpcm) Installed devices: pcm0: at io 0xd800 irq 10 (1p/1r/0v channels duplex default) $ >Description: Under certain conditions, the pcm audio device driver hogs /dev/dsp?.? ("Device Busy"). It seems that the problem happens when a process tries to open a dsp device shortly after the same device has been opened by another process. This might be related to the vchan code, as the hw.snd.pcm0.vchans sysctl knob was set to 4 during my tests. "fstat | grep dsp" gives nothing. >How-To-Repeat: $ while :; do play somesoundfile & done This will quickly lock /dev/dsp0.0. Of course, be prepared to hit ^C, since the & is not a typo. :) >Fix: If multiple virtual channels are in use when the problem first appears, setting sysctl hw.snd.pcm0.vchans to locked_dsp_# - 1 and then back to the original number unlocks the dsp device. However, after locking the dsp device a second time, reducing hw.snd.pcm0.vchans gives "Invalid argument" and the device is locked for good: then, only a reboot helps. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message