Bug 25600

Summary: Loading/unloading sound modules (snd_sb16) more than once makes errors
Product: Base System Reporter: darkwalker <darkwalker>
Component: kernAssignee: cg
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-STABLE   
Hardware: Any   
OS: Any   

Description darkwalker 2001-03-08 05:30:00 UTC
Loading a sound kld (snd_sb16 for instance), unloading it,
then loading and unloading it again causes a few errors
from the kernel. Every subsequent load/unload causes another error
on top of the ones that have already shown to appear again.
It seems to not release DMAs after acquiring them,
and not destroy children devices of the SB16 properly
on module unload

I have a K6-2 500 with an SB AWE64 Value, FreeBSD installed
about 2 days ago and upgraded to -STABLE w/ cvsup

dmesg output after load/unloading snd_sb16 3 times:
---
c0: <Creative SB AWE64> at port 0x220-0x22f,0x330-0x331,0x388-0x38b irq 5 drq 
1,5 on isa0
pcm0: <SB16 DSP 4.16> on sbc0
pcm0: detached
sbc0: detached
sbc0: <Creative SB AWE64> at port 0x220-0x22f,0x330-0x331,0x388-0x38b irq 5 drq 1,5 on isa0
pcm0: <SB16 DSP 4.16> on sbc0
isa_dma_acquire: channel 1 already in use
isa_dma_acquire: channel 5 already in use
pcm1: <SB16 DSP 4.16> on sbc0
device_probe_and_attach: pcm1 attach returned 6
pcm0: detached
sbc0: detached
sbc0: <Creative SB AWE64> at port 0x220-0x22f,0x330-0x331,0x388-0x38b irq 5 drq 1,5 on isa0
pcm0: <SB16 DSP 4.16> on sbc0
isa_dma_acquire: channel 1 already in use
isa_dma_acquire: channel 5 already in use
pcm1: <SB16 DSP 4.16> on sbc0
device_probe_and_attach: pcm1 attach returned 6
pcm2: <SB16 DSP 4.16> on sbc0
device_probe_and_attach: pcm2 attach returned 6
pcm0: detached
sbc0: detached
---

Fix: 

This diff will get rid of the errors and fix what looks like
a typo in /sys/dev/sound/isa/sb16.c, but I'm not sure if they're
the right way to fix it (only been using freebsd 2 days :))

http://sync.dyndns.org/~walker/files/sbfix.diff
How-To-Repeat: execute `kldload snd_sb16; kldunload snd_sb16` three times with a
sound blaster in the system (may work with other modules too)
Comment 1 Kris Kennaway freebsd_committer freebsd_triage 2001-03-13 02:22:17 UTC
State Changed
From-To: open->feedback

Problem may already be resolved 


Comment 2 Kris Kennaway freebsd_committer freebsd_triage 2001-03-13 02:22:17 UTC
Responsible Changed
From-To: freebsd-bugs->cg

cg is Mr Sound
Comment 3 Kris Kennaway 2001-03-13 02:23:01 UTC
On Wed, Mar 07, 2001 at 09:24:40PM -0800, darkwalker@bigfoot.com wrote:

> Loading a sound kld (snd_sb16 for instance), unloading it,
> then loading and unloading it again causes a few errors
> from the kernel. Every subsequent load/unload causes another error
> on top of the ones that have already shown to appear again.
> It seems to not release DMAs after acquiring them,
> and not destroy children devices of the SB16 properly
> on module unload

PCM wasn't supported as modules in 4.x until very recently -- you may
be predating that change. Can you update to the latest -stable
(actually called 4.3-BETA) and try again?

Kris
Comment 4 greid freebsd_committer freebsd_triage 2001-04-08 22:27:46 UTC
State Changed
From-To: feedback->closed

Fixed