# CA0106 Soundblaster: no sound.



## Woodman (Jun 1, 2013)

Hi everyone,

I've installed FreeBSD (GNOME 2) and am very pleased with it.  I'd very much appreciate some help with this. I've spent hours trying to get sound from a PCI Soundblaster card, but without luck so far. The main problem appears to be that its place is being hogged by the NVIDIA HDMI audio, so I wish to set the Soundblaster as the default.

I've installed FreeBSD 9.1-RELEASE-p3.

I'm trying to get 5.1 (surround sound) working. I got no sound from the default audio setup when I had practically the same result as I have now with OSS4 having compiled the kernel exactly as detailed at www.4front-tech.com/freebsd.html. I installed OSS4 with `# pkg_install -r -v oss`


```
# ossdetect -v
Detected Sound Blaster Audigy LS / Live7.1
```

There's no problem with hardware; I know the card works perfectly.However,only NVIDIA HDMI audio is shown by 
	
	



```
# cat /dev/sndstat 
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <NVIDIA GT21x (HDMI/DP 8ch)> (play) default
pcm1: <NVIDIA GT21x (HDMI/DP 8ch)> (play)
pcm2: <NVIDIA GT21x (HDMI/DP 8ch)> (play)
pcm3: <NVIDIA GT21x (HDMI/DP 8ch)> (play)
```
dmesg only shows:

```
# dmesg | grep 'pcm[0-9]'
pcm0: <NVIDIA GT21x (HDMI/DP 8ch)> at nid 5 on hdaa0
pcm1: <NVIDIA GT21x (HDMI/DP 8ch)> at nid 5 on hdaa1
pcm2: <NVIDIA GT21x (HDMI/DP 8ch)> at nid 5 on hdaa2
pcm3: <NVIDIA GT21x (HDMI/DP 8ch)> at nid 5 on hdaa3
pcm0: <NVIDIA GT21x (HDMI/DP 8ch)> at nid 5 on hdaa0
pcm1: <NVIDIA GT21x (HDMI/DP 8ch)> at nid 5 on hdaa1
pcm2: <NVIDIA GT21x (HDMI/DP 8ch)> at nid 5 on hdaa2
pcm3: <NVIDIA GT21x (HDMI/DP 8ch)> at nid 5 on hdaa3
```
But

```
$ pciconf -lv
    vendor     = 'nVidia Corporation'
    device     = 'High Definition Audio Controller'
    class      = multimedia
    subclass   = HDA
re0@pci0:3:0:0:	class=0x020000 card=0xe0001458 chip=0x816810ec rev=0x02 hdr=0x00
    vendor     = 'Creative Labs'
    device     = 'CA0106 Soundblaster'
    class      = multimedia
    subclass   = audio
```
There's another onboard audio card but that's disabled in the BIOS. So I'm at a bit of a loss as to how to enable OSS4. Neither ossmix nor ossxmix work:


```
$ ossmix
No such file or directory
$ ossxmix
SNDCTL_MIX_NRMIX: Invalid argument
Error: OSS version 4.0 or later is required
```
.
There seems to be no way at the moment I can do anything with a command like:

```
# sysctl hw.snd.default_unit=0
hw.snd.default_unit: 1 -> 0
```

Short of removing the NCIDIA graphics/audio card, is there some way I can disable the NVIDIA audio? Finally, which do you recommend? The default audio setup for this card or would it be preferable to use the OSS4 driver for 5.1 surround sound? 

Thank you for reading.


----------



## adamk (Jun 2, 2013)

To use OSSv4, you need to build a kernel that doesn't include any of native FreeBSD sound drivers.


----------



## Woodman (Jun 2, 2013)

Thank you @adamk for your reply; you are right but I understood that the steps for rebuilding the kernel which I referenced here would result in a kernel without any of the native FreeBSD sound drivers having commented out all the lines under Sound as follows:

```
$ cd /usr/src/sys/amd64/conf && tail GENERIC
# Sound support
#device		sound		# Generic sound driver (required)
#device		snd_cmi		# CMedia CMI8338/CMI8738
#device		snd_csa		# Crystal Semiconductor CS461x/428x
#device		snd_emu10kx	# Creative SoundBlaster Live! and Audigy
#device		snd_es137x	# Ensoniq AudioPCI ES137x
#device		snd_hda		# Intel High Definition Audio
#device		snd_ich		# Intel, NVidia and other ICH AC'97 Audio
#device		snd_uaudio	# USB Audio
#device		snd_via8233	# VIA VT8233x Audio
```
I did that before proceeding with:

```
config GENERIC 
cd ../compile/GENERIC 
make cleandepend && make depend 
make; make install 
reboot
```
After rebooting I grep'd `dmesg` only to find:

```
$ dmesg |grep -i "Open Sound System" && dmesg |grep osscore
osscore: Open Sound System conflicts with FreeBSD driver
osscore: Please remove sound(4) from kernel or unload it
module_register_init: MOD_LOAD (osscore, 0xffffffff824464e0, 0) error 16
```
I've tried creating

```
# cat /boot/loader.conf
sound_enable="NO"
```
And also unloading it without success:

```
# kldunload sound
kldunload: can't find file sound
```
Finally,

```
# /usr/local/etc/rc.d/oss start
Starting Open Sound System
kldload: can't load /usr/local/lib/oss/modules/osscore.ko: Exec format error
Loading the osscore module failed
```
I followed the www.4front-tech.com/freebsd steps for rebuilding the kernel exactly but they are evidently incomplete because the sound module still gets loaded and cannot apparently be unloaded using kldunload(8).


----------



## SirDice (Jun 2, 2013)

Woodman said:
			
		

> I did that before proceeding with:
> 
> ```
> config GENERIC
> ...


This is a very old way of doing things. It may not work as intended. 


```
cd /usr/src
make buildkernel
make installkernel
```

And please, don't change GENERIC. We expect it to be standard. If you're going to make changes make a copy of the GENERIC file and name it MYKERNEL (or something else). Also don't forget to change the ident line.


```
make buildkernel KERNCONF=MYKERNEL
make installkernel KERNCONF=MYKERNEL
```
Or simply add to /etc/make.conf:

```
KERNCONF=MYKERNEL
```


----------



## Woodman (Jun 2, 2013)

Thank you @SirDice for your detailed reply which has solved the problem ; I now have sound. ossmix, ossxmix and osstest, etc., all work and I can play videos in Epiphany, although Firefox crashes so I'll try Lightspark or maybe Flash.

To recapitulate:

```
# cd /usr/src/sys/amd64/conf
```
I first edited GENERIC to remove the # comments to restore it to the default. I then copied it, renaming it MYKERNEL thus:

```
root@localhost:/usr/src/sys/amd64/conf # cp GENERIC MYKERNEL
```
I also changed the ident as you said:

```
ident		MYKERNEL
```
and commented out the sound drivers as before:

```
$ cd /usr/src/sys/amd64/conf && tail MYKERNEL
```


```
# Sound support
#device		sound		# Generic sound driver (required)
#device		snd_cmi		# CMedia CMI8338/CMI8738
#device		snd_csa		# Crystal Semiconductor CS461x/428x
#device		snd_emu10kx	# Creative SoundBlaster Live! and Audigy
#device		snd_es137x	# Ensoniq AudioPCI ES137x
#device		snd_hda		# Intel High Definition Audio
#device		snd_ich		# Intel, NVidia and other ICH AC'97 Audio
#device		snd_uaudio	# USB Audio
#device		snd_via8233	# VIA VT8233x Audio
```
I don't know if it was necessary but, just in case, I also edited /etc/make.conf, having also consulted the /handbook/kernelconfig-building.html to include:

```
WITHOUT_MODULES = sound
```
.
before continuing with:

```
root@localhost:/root # cd /usr/src
root@localhost:/usr/src # make buildkernel KERNCONF=MYKERNEL
```
followed by:

```
# make installkernel KERNCONF=MYKERNEL
```
And rebooted the new kernel with no problems. There are one or two minor details but I'm very pleased with the result, so thanks again to you and @adamk for your helpful replies. I'll mark this topic solved.


----------



## SirDice (Jun 3, 2013)

Woodman said:
			
		

> I don't know if it was necessary but, just in case, I also edited /etc/make.conf, having also consulted the /handbook/kernelconfig-building.html to include:
> 
> ```
> WITHOUT_MODULES = sound
> ```


Don't put spaces around the equal sign.

```
WITHOUT_MODULES=sound
```


----------



## Woodman (Jun 3, 2013)

```
$ cat /etc/make.conf
# added by use.perl 2013-06-01 18:37:54
PERL_VERSION=5.14.2
# added by user 2013-06-01 1:21:45
#WITHOUT_MODULES = sound 
#changed to
WITHOUT_MODULES=sound
QT4_OPTIONS= CUPS QGTKSTYLE
WITHOUT_NOUVEAU=yes
```
Thanks for drawing attention to that inaccuracy; everything works fine even though the spaces were inadvertently inserted but next time I rebuild I'll remember that. Must have been a bit drowsy at the time!


----------



## graudeejs (Jun 3, 2013)

Offtopic: Does surround sound work on this card?


----------



## Woodman (Jun 3, 2013)

Yes, I obtain surround sound with the CA0106 Soundblaster with a "Creative Inspire Speaker 5.1" System A500. I get sound from all speakers using ossmix.


----------

