# SB Live - Nothing but Buzzing



## Ruler2112 (Nov 8, 2011)

I have a system with FreeBSD 8.2/amd64 loaded on with a PCI SB Live sound card.  It uses the EMU10Kx sound module which is configured to load automatically in /boot/loader.conf using 
	
	



```
snd_emu10kx_load="YES"
```

/dev/sndstat has the following in it:


```
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <EMU10Kx DSP front PCM interface> (play/rec) default
pcm1: <EMU10Kx DSP rear PCM interface> (play)
```

The sound card shows up in the system:


```
vendor     = 'Creative Technology LTD.'
    device     = 'Sound Blaster Live! (Also Live! 5.1) - OEM from DELL - CT4780 (CT5880DCQ)'
    class      = multimedia
    subclass   = audio
none3@pci0:5:1:1:       class=0x098000 card=0x00201102 chip=0x70021102 rev=0x08 hdr=0x00
```

I initially set up the system, kldloaded the module manually, started kde as a user, and everything was great - this is when I added the line above to /boot/loader.conf so it'd happen at boot time.  I compiled/installed a bunch of ports (LibreOffice, TightVNC, Firefox 3.6, Flash, GIMP, etc).

When I rebooted, the sound.ko and snd_emu10kx.ko modules loaded at boot just as they should.  However, when I started KDE, a buzzing noise started coming from my speakers.  As long as the sound system is active, the buzzing noise persists.  The buzz fluctuates when KDE would ordinarily play a sound.

The only thing I can think of is that one of the ports I installed somehow conflicts with the KDE sound system, resulting in this behavior.

Any ideas of what I could try in the way of troubleshooting?  Frankly, I'm at a loss of what to try next.  (Other than to unplug my speakers so it doesn't drive me insane...  )


----------



## Ruler2112 (Nov 8, 2011)

I made a discovery - it's not confined to within KDE.  Using sndfile-play from the console to play a wave also results in static/buzz/crap.  Now I'm really confused as to what's going on...


----------



## Ruler2112 (Nov 8, 2011)

Very odd.... if I remove the line loading the snd_emu10kx module from /boot/loader.conf, reboot, and then load the module manually with kldload, it works perfectly.  Booting with the module loaded automatically results in nothing but crap coming from the speakers.

I have a workaround (logging in as root and loading the module manually after every boot), but would like to not have to do this if possible.  Advice appreciated.


----------



## adamk (Nov 8, 2011)

I've noticed that when snd_emu10kx is loaded via loader.conf, it gives the pcm devices a different order than when the driver is loaded after the system boots.  You could try adjusting the hw.snd.default_unit sysctl and see if that resolves the problem.


----------



## Ruler2112 (Nov 11, 2011)

Good thought Adam.  I tried it and found that no matter if I load snd_emu10kx from /boot/loader.conf or via kldload after the system is up, the sysctl entries are the same.


```
# When loaded via loader.conf - sound is static/garbled
sysctl -qa |grep dev.pcm > snd.boot
sysctl -qa |grep hw.snd >> snd.boot

# Rebooted, loaded via kldload - sound is good
sysctl -qa |grep dev.pcm > snd.kld
sysctl -qa |grep hw.snd >> snd.kld
```

Both output files are the same.  I'm at a loss to explain how or why it's happening.  Since I have a workaround, it's a low priority for me, even though having to log in as root every time I reboot is a PITA.


----------



## adamk (Nov 11, 2011)

You can always just edit /etc/rc.local to load the module.  Then you won't have to do it manually each time.

Adam


----------



## Ruler2112 (Nov 14, 2011)

Good call Adam, though /etc/rc.local is in Linux. :\    I created a script in /usr/local/etc/rc.d to do what is needed and the sound is now loaded automatically after everything else is done.


----------



## adamk (Nov 14, 2011)

Ruler2112 said:
			
		

> Good call Adam, though /etc/rc.local is in Linux.



Ummm, no, no it's not.

But, yes, your way can work, too.


----------

