From owner-freebsd-bugs Sun Mar 18 22: 0: 6 2001 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 9FAF037B719 for ; Sun, 18 Mar 2001 22:00:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f2J602U61599; Sun, 18 Mar 2001 22:00:02 -0800 (PST) (envelope-from gnats) Received: from daconcepts.dyndns.org (wks-166-129-114.kscable.com [24.166.129.114]) by hub.freebsd.org (Postfix) with ESMTP id E782037B718 for ; Sun, 18 Mar 2001 21:58:47 -0800 (PST) (envelope-from natedac@daconcepts.dyndns.org) Received: (from natedac@localhost) by daconcepts.dyndns.org (8.11.3/8.11.3) id f2J5rcE42369; Sun, 18 Mar 2001 23:53:38 -0600 (CST) (envelope-from natedac) Message-Id: <200103190553.f2J5rcE42369@daconcepts.dyndns.org> Date: Sun, 18 Mar 2001 23:53:38 -0600 (CST) From: natedac@kscable.com Reply-To: natedac@kscable.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: kern/25910: Kernel sound driver may die if a program crashes>> update Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 25910 >Category: kern >Synopsis: Kernel sound driver may die if a program crashes>> update >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Mar 18 22:00:02 PST 2001 >Closed-Date: >Last-Modified: >Originator: Nate Dannenberg >Release: FreeBSD 4.3-BETA i386 >Organization: n/a >Environment: System: FreeBSD piccolo 4.3-BETA FreeBSD 4.3-BETA #1: Fri Mar 16 16:32:20 CST 2001 natedac@piccolo.daconcepts.dyndns.org:/usr/src/sys/compile/PICCOLO i386 IBM Aptiva with ESS Solo-1 audio >Description: If a program crashes while it's using the sound device, the kernel fails to close the device so that other programs may use it. The device is left in an open, "busy" state. >How-To-Repeat: Run any program like mpg123, and find a way to cause it to crash. Now try to play something else with that or any other audio application. >Fix: Don't compile the sound driver into the kernel. Instead, use the loadable module. I got a chance to test this out, and sure enough, I can restore the sound after the driver dies, without rebooting the system (which is the case with the in-kernel driver)... Exit all audio applications, including those that may be using the mixer device (gqmpeg, aumix) or that are just acting as a server/daemon for other programs (esd). Unload the driver modules and reload them. These few lines will automate the process a little bit: #!/usr/local/bin/bash # or any other path-capable shell. killall esd killall mpg123 killall gqmpeg killall xmp killall aumix sleep 1 kldunload snd_pcm kldunload snd_solo sleep 1 kldload /modules/snd_pcm kldload /modules/snd_solo mixer line 0 mixer line1 0 mixer mic 0 mixer synth 0 mixer cd 100 mixer pcm 50 mixer vol 50 # end... If the sound drivers are compiled into the kernel, it is necessary to shut the computer down and re-start it to restore sound once the driver dies. With the modules, the above code seems to work, preserving what may be rather important uptime. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message