# OSS sound driver problem



## Seeker (Aug 20, 2010)

*Sys: 8.1 RELEASE*

```
# ossdetect -v
Detected Sound Blaster Audigy LS / Live7.1
```
This worked on 8.0

```
# soundon
kldload: can't load /usr/local/lib/oss/modules/oss_audigyls.ko: No such file or directory
Loading module oss_audigyls failed - ignored
No /dev/mixer device available in your system.
Perhaps Open Sound System is not installed or running.
No /dev/mixer device available in your system.
Perhaps Open Sound System is not installed or running.
```
Kernel outputs:

```
link_elf: symbol audio_engines undefined
```
Module does exist:

```
# ll /usr/local/lib/oss/modules/oss_audigyls.ko
-r-xr-xr-x  1 root  wheel  -   23K Aug 20 11:12:08 2010 /usr/local/lib/oss/modules/oss_audigyls.ko
```
Direct load:

```
# kldload  /usr/local/lib/oss/modules/oss_audigyls.ko
kldload: can't load /usr/local/lib/oss/modules/oss_audigyls.ko: No such file or directory
```
Kernel outputs:

```
link_elf: symbol audio_engines undefined
```


----------



## SirDice (Aug 20, 2010)

Looks like your oss install got screwed up somewhere. Try reinstalling audio/oss. Watch for any errors during the install.


----------



## Seeker (Aug 20, 2010)

I've deinstalled and installed second time:

```
# /usr/local/etc/rc.d/oss onestart
Starting Open Sound System
kldload: can't load /usr/local/lib/oss/modules/oss_audigyls.ko: No such file or directory
Loading module oss_audigyls failed - ignored
No /dev/mixer device available in your system.
Perhaps Open Sound System is not installed or running.
No /dev/mixer device available in your system.
Perhaps Open Sound System is not installed or running.
```
Kernel said:

```
kernel: link_elf: symbol audio_engines undefined
```
# kldstat, shows only osscore.ko, loaded successfully from oss port.


----------



## adamk (Aug 20, 2010)

Is your kernel source tree for the same version as your running kernel?

Adam


----------



## Seeker (Aug 20, 2010)

Yes it is.
Sources are complete and up to date for 8.1 RELEASE
Everything(world and kernel) have been compiled from source, with CPUTYPE?=athlon-xp


----------



## SirDice (Aug 20, 2010)

Did you use a prebuild package or did you build using the port?

Mine has the file (I built my own package from the port):

```
root@williscorto:~#pkg_info -Lx oss | grep audigy
/usr/local/man/man7/oss_audigyls.7.gz
/usr/local/lib/oss/conf/oss_audigyls.conf.sample
/usr/local/lib/oss/modules/oss_audigyls.ko
root@williscorto:~#ll //usr/local/lib/oss/modules/oss_audigyls.ko
-r-xr-xr-x  1 root  wheel  24488 Aug 10 20:06 //usr/local/lib/oss/modules/oss_audigyls.ko
```

I don't have an audigy though but my x-fi is detected and loaded correctly:

```
root@williscorto:~#ossinfo 
Version info: OSS 4.2 (b 2003/201008101805) (0x00040100) BSD
Platform: FreeBSD/i386 8.1-STABLE FreeBSD 8.1-STABLE #0: Tue Aug  3 19:48:17 CEST 2010     root@molly.dicelan.home:/usr/obj/usr/src/sys/CORTO8 (williscorto.dicelan.home)

Number of audio devices:	2
Number of audio engines:	6
Number of MIDI devices:		0
Number of mixer devices:	1


Device objects
 0: oss_sbxfi0 Sound Blaster X-Fi (SB073x) interrupts=85470345 (85470345)
    PCI device 1102:0005, subdevice 1102:0031

MIDI devices (/dev/midi*)

Mixer devices
 0: Sound Blaster X-Fi (SB073x) (Mixer 0 of device object 0)

Audio devices
Sound Blaster X-Fi (SB073x) output  /dev/oss/oss_sbxfi0/pcm0  (device index 0)
Sound Blaster X-Fi (SB073x) input  /dev/oss/oss_sbxfi0/pcmin0  (device index 1)

Nodes
  /dev/dsp -> /dev/oss/oss_sbxfi0/pcm0
  /dev/dsp_in -> /dev/oss/oss_sbxfi0/pcm0
  /dev/dsp_out -> /dev/oss/oss_sbxfi0/pcm0
  /dev/dsp_mmap -> /dev/oss/oss_sbxfi0/pcm0
```

Are there _any_ drivers installed in /usr/local/lib/oss/modules/?


----------



## Seeker (Aug 20, 2010)

I've did my install, directly from ports tree.
There were no errors.

```
# pkg_info -Lx oss | grep audigy
/usr/local/man/man7/oss_audigyls.7.gz
/usr/local/lib/oss/conf/oss_audigyls.conf.sample
/usr/local/lib/oss/modules/oss_audigyls.ko
```
This one misses _/dev/mixer_

```
# ossinfo
No /dev/mixer device available in your system.
Perhaps Open Sound System is not installed or running.
```
Drivers:

```
# ll /usr/local/lib/oss/modules
total 1552
-r-xr-xr-x  1 root  wheel  -   17K Aug 20 17:59:54 2010 oss_ali5455.ko
-r-xr-xr-x  1 root  wheel  -   18K Aug 20 17:59:54 2010 oss_atiaudio.ko
-r-xr-xr-x  1 root  wheel  -   23K Aug 20 17:59:54 2010 oss_audigyls.ko
-r-xr-xr-x  1 root  wheel  -   15K Aug 20 17:59:54 2010 oss_audioloop.ko
-r-xr-xr-x  1 root  wheel  -   22K Aug 20 17:59:54 2010 oss_audiopci.ko
-r-xr-xr-x  1 root  wheel  -   29K Aug 20 17:59:54 2010 oss_cmi878x.ko
-r-xr-xr-x  1 root  wheel  -   26K Aug 20 17:59:54 2010 oss_cmpci.ko
-r-xr-xr-x  1 root  wheel  -   18K Aug 20 17:59:54 2010 oss_cs4281.ko
-r-xr-xr-x  1 root  wheel  -   76K Aug 20 17:59:54 2010 oss_cs461x.ko
-r-xr-xr-x  1 root  wheel  -   18K Aug 20 17:59:54 2010 oss_digi96.ko
-r-xr-xr-x  1 root  wheel  -   19K Aug 20 17:59:54 2010 oss_emu10k1x.ko
-r-xr-xr-x  1 root  wheel  -  149K Aug 20 17:59:54 2010 oss_envy24.ko
-r-xr-xr-x  1 root  wheel  -   64K Aug 20 17:59:54 2010 oss_envy24ht.ko
-r-xr-xr-x  1 root  wheel  -   17K Aug 20 17:59:54 2010 oss_fmedia.ko
-r-xr-xr-x  1 root  wheel  -   16K Aug 20 17:59:54 2010 oss_geode.ko
-r-xr-xr-x  1 root  wheel  -  130K Aug 20 17:59:54 2010 oss_hdaudio.ko
-r-xr-xr-x  1 root  wheel  -   23K Aug 20 17:59:54 2010 oss_ich.ko
-r-xr-xr-x  1 root  wheel  -   17K Aug 20 17:59:54 2010 oss_imux.ko
-r-xr-xr-x  1 root  wheel  -   22K Aug 20 17:59:54 2010 oss_madi.ko
-r-xr-xr-x  1 root  wheel  -   12K Aug 20 17:59:54 2010 oss_midiloop.ko
-r-xr-xr-x  1 root  wheel  -  9.1K Aug 20 17:59:54 2010 oss_midimix.ko
-r-xr-xr-x  1 root  wheel  -   84K Aug 20 17:59:54 2010 oss_sblive.ko
-r-xr-xr-x  1 root  wheel  -   19K Aug 20 17:59:54 2010 oss_sbpci.ko
-r-xr-xr-x  1 root  wheel  -   29K Aug 20 17:59:54 2010 oss_sbxfi.ko
-r-xr-xr-x  1 root  wheel  -   18K Aug 20 17:59:54 2010 oss_solo.ko
-r-xr-xr-x  1 root  wheel  -   20K Aug 20 17:59:54 2010 oss_trident.ko
-r-xr-xr-x  1 root  wheel  -   20K Aug 20 17:59:54 2010 oss_userdev.ko
-r-xr-xr-x  1 root  wheel  -   17K Aug 20 17:59:54 2010 oss_via823x.ko
-r-xr-xr-x  1 root  wheel  -   16K Aug 20 17:59:54 2010 oss_via97.ko
-r-xr-xr-x  1 root  wheel  -   45K Aug 20 17:59:54 2010 oss_ymf7xx.ko
-r-xr-xr-x  1 root  wheel  -  483K Aug 20 17:59:54 2010 osscore.ko
```


----------



## Seeker (Aug 23, 2010)

I've tried recompiling kernel and nada!
What now?


----------



## Seeker (Aug 24, 2010)

Now I've tried recompiling world and kernel and nada!
I am sick and tired of this.

Lastly, just out of curiosity, I did a (what I never do):

```
pkg_add -vr oss
```

Now, with binary package(ver: oss-4.2.b2003) it works!


So, what would be a solution, to make a port version work?


----------



## richardpl (Aug 29, 2010)

Are you using some extra flags for compiler?
Missing symbol points to some compiler vs linker limbo...


----------



## Seeker (Aug 29, 2010)

I've build world and kernel with appended '-march=native'.
I haven't touched a default optimizations.

It affects only that port.
Just for it, I removed all flags and left only default ones and still nothing.


----------



## richardpl (Aug 29, 2010)

Maybe you have some old source files for OSS causing linker error.
Are you sure you are building all OSS kernel modules in same way like kernel?


----------



## Seeker (Aug 29, 2010)

richardpl said:
			
		

> Maybe you have some old source files for OSS causing linker error.


How would I detect that?

In /usr/src I also did a cleanup and finally did a:
[CMD=]make check-old[/CMD]
It didn't found anything.



			
				richardpl said:
			
		

> Are you sure you are building all OSS kernel modules in same way like kernel?


Yes and /usr/src is complete.


----------



## richardpl (Aug 29, 2010)

You have problem with third-party vendor not FreeBSD so ignore /usr/src for now.
You did `# make clean` in OSS port directory?


----------



## Seeker (Aug 29, 2010)

Yup!
[CMD="make"]install clean[/CMD]
[CMD="make"]deinstall reinstall clean[/CMD]


----------



## Seeker (Aug 31, 2010)

Ok, it seems that I have a serious problem here, which is not *port*(those that also build kernel modules) related.

ANY port which also *builds kernel modules* will pass without errors, BUT, *kernel module will be unusable*!

When I installed 8.1, I also installed many port and all worked.

Now in this example I've *rebuilt working port*, after which it isn't working anymore!

What should I do, to isolate issue, as this will affect *any port*, from now on, that also builds it's onw kernel modules?


----------



## adamk (Aug 31, 2010)

I've only seen this when the modules were built against a different version of the kernel source than the actual running kernel or when the modules were built with a different version of gcc from the running kernel.

Since this problem started, have you rebuilt the kernel from your current source tree just to make sure the source and running kernel are the same version?

Adam


----------



## Seeker (Aug 31, 2010)

I've rebuilt kernel from my current source tree, 2 times already.
Now I am doing it for a third time, with removed all entries from make.conf execpt _CPUTYPE?=athlon-xp_


----------



## acheron (Sep 1, 2010)

try to delete your src tree and fetch a fresh one, delete also /usr/obj/*


----------



## Seeker (Sep 1, 2010)

Absolutely!
Both done.

Now I'm recompiling world and kernel, even without CPUTYPE and reverted to GENERIC.
Also got rid of ccache

If this doesn't do the trick then I really don't know what to do else. There is for a last 3 rebuilds no any CFLAGS...

PS: All builds of kernel and world, up to now always passed, but any port which is having it's own kern module built passes, but with unusable module


----------



## Seeker (Sep 2, 2010)

It didn't do a trick! No make.conf and all compiled with defaults values, no '-j' flag to 'make' and still NOTHING!
Then I saw a residue in ports, which isn't used by any port, nor do I personally use it: devel/binutils
After I've deinstalled ...

*Now everything works!!!*

Recompiled audios/oss
`# soundon`
And voila!


----------

