# ALC888 oss-Audio setup (wav, ogg) (dmesg only showed HDA at pci0)



## jb_fvwm2 (Mar 7, 2011)

Posting this because various snd_hda attempts so far failed, this may be easier:

```
cd /usr/ports/audio/oss && make install
kldload /usr/local/lib/oss/modules/osscore.ko
kldload /usr/local/lib/oss/modules/oss_hdaudio.ko
```
Other modules available besides oss_hdaudio. The following then should work with wav, ogg files at least:

```
ossplay -d /dev/oss/oss_hdaudio0/pcm0 [file]
```

(More information to include, however, IANAE and this post should just relate what I know for certain...)

..........
edit 1...
........

```
mpg123 -v -a /dev/oss/oss_hdaudio0/pcm0 [mp3 file]
```
........
edit 2...  Seems to  play Ogg GOOD
........

```
cd /usr/ports/audio/vorbis-tools
/bin/rm -rf work
make install
rehash
ogg123 -v -d oss -o dsp:/dev/oss/oss_hdaudio0/pvcm0 [ogg file]
```


----------



## SirDice (Mar 7, 2011)

jb_fvwm2 said:
			
		

> ```
> kldload /usr/local/lib/oss/modules/osscore.ko
> kldload /usr/local/lib/oss/modules/oss_hdaudio.ko
> ```




```
echo oss_enable="YES" >> /etc/rc.conf
/usr/local/etc/rc.d/oss start
```


----------



## carlton_draught (Jun 21, 2011)

I'm adding this here in case it helps someone.

I also was having trouble getting emulators/virtualbox-ose to have sound, and OSS was the only driver that was supported that I could see). Some things I needed to do:

Install audio/oss
`# portmaster audio/oss`
Enable OSS in rc.conf.
`# vim /etc/rc.conf`
Add the following:

```
oss_enable="YES"
```

Check dmesg output to see which dsp your soundcard outputs to.
`# dmesg | grep pcm`

```
pcm0: <HDA NVidia (Unknown) PCM #0 DisplayPort> at cad 0 nid 1 on hdac0
pcm1: <HDA NVidia (Unknown) PCM #0 DisplayPort> at cad 1 nid 1 on hdac0
pcm2: <HDA NVidia (Unknown) PCM #0 DisplayPort> at cad 2 nid 1 on hdac0
pcm3: <HDA NVidia (Unknown) PCM #0 DisplayPort> at cad 3 nid 1 on hdac0
pcm4: <HDA NVidia (Unknown) PCM #0 DisplayPort> at cad 0 nid 1 on hdac1
pcm5: <HDA NVidia (Unknown) PCM #0 DisplayPort> at cad 1 nid 1 on hdac1
pcm6: <HDA NVidia (Unknown) PCM #0 DisplayPort> at cad 2 nid 1 on hdac1
pcm7: <HDA NVidia (Unknown) PCM #0 DisplayPort> at cad 3 nid 1 on hdac1
pcm8: <HDA Realtek ALC888 PCM #0 Analog> at cad 0 nid 1 on hdac2
pcm9: <HDA Realtek ALC888 PCM #1 Analog> at cad 0 nid 1 on hdac2
pcm10: <HDA Realtek ALC888 PCM #2 Digital> at cad 0 nid 1 on hdac2
```
Note that pcm8 is the one where the output goes. (See this thread for more info on testing.)
Edit /etc/sysctl.conf so that the right dsp link is created (I think this is what it does).
`# vim /etc/sysctl.conf`
Add the following (note that the 8 comes from pcm8 above):

```
hw.snd.default_unit=8
```

Reboot.
Get oss_detect to work.
`# ossdetect -v`
See that it worked.
`# cat /usr/local/lib/oss/etc/installed_drivers`

```
oss_hdaudio #Intel High Definition Audio (PCH)
```

Reboot

Now provided that you have "OSS Audio Driver" and "ICH AC97" selected in VirtualBox Audio settings, your VMs should have sound.


----------



## adamk (Jun 21, 2011)

Why are you telling folks to load both the OSSv4 driver from ports and the OSSv3 driver from the base system?  They will be very lucky if that doesn't lead to a kernel panic.

Adam


----------



## carlton_draught (Jun 21, 2011)

adamk said:
			
		

> Why are you telling folks to load both the OSSv4 driver from ports and the OSSv3 driver from the base system?  They will be very lucky if that doesn't lead to a kernel panic.
> 
> Adam


Could you elaborate? Not sure which post and which part of the post you are referring to.


----------



## adamk (Jun 21, 2011)

In step 1 you have users loading snd_hda, which is from the FreeBSD base system.  In steps 2, 3, 7 and 8 you have users installing and configuring OSSv4.  You're having users load two separate drivers, from different vendors, to drive the same hardware.  That's bad and can often lead to kernel panics.

Adam


----------



## carlton_draught (Jun 21, 2011)

adamk said:
			
		

> In step 1 you have users loading snd_hda, which is from the FreeBSD base system.  In steps 2, 3, 7 and 8 you have users installing and configuring OSSv4.  You're having users load two separate drivers, from different vendors, to drive the same hardware.  That's bad and can often lead to kernel panics.
> 
> Adam


Ok, thanks for that, I'll try and then amend it.

Edit: Amended.


----------



## jb_fvwm2 (Oct 7, 2011)

Updating current (5-24-2011) to RELENG_9 (as of yesterday) seems to panic the box used in the original post, removing either the sound drivers (i.e. snd_hda, sound) in the GENERIC new kernel, and/or the debugging options (debug, WITNESS etc...) may make it not panic.  No time to test as of yet, since the snd_hda works "out of the box" for playing mp3's at least, and the machine is not the one I use primarily.   (Several reboots to fix it since I had the oss drivers loaded via a .login file, serving as a crafted (alias) audio/yell.


----------

