Date: Sun, 18 Mar 2001 23:53:38 -0600 (CST) From: natedac@kscable.com To: FreeBSD-gnats-submit@freebsd.org Subject: kern/25910: Kernel sound driver may die if a program crashes>> update Message-ID: <200103190553.f2J5rcE42369@daconcepts.dyndns.org>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103190553.f2J5rcE42369>