This how-to is intended to illustrate the process of setting up OSS4 on Debian. I run sid, but the packages I used are also in squeeze; they are not, however, in lenny, so this method won't work if you're a lenny user. The method is surprisingly simple, but for such a simple method it is also surprisingly undocumented. This how-to won't cover configuring applications to work with OSS; it is only intended to get you to the point where you have a working, running OSS4 installation.
Note: Unless otherwise specified, all commands listed here should be run as root.
This is also my first how-to, so constructive criticism is appreciated.
Step 1 - Install OSS4 packages
I prefer using aptitude to install packages, but as always you can use apt-get if you prefer. The packages you'll need are oss4-base and oss4-source; I also installed oss4-gtk which installs a GTK+ OSS mixer.
Code: Select all
aptitude install oss4-base oss4-source oss4-gtk
The oss4-base package will install OSS4 itself, but not the kernel modules needed to interface with your sound card; these are found in source form in oss4-source. You need to use module-assistant program to build these modules (oss4-source depends on it, so it was installed in step 1):
Code: Select all
module-assistant prepare
module-assistant auto-install oss4
Step 3 - Configure OSS as your default sound engine
By default, ALSA will still be configured as the default sound engine. To set this as OSS instead, perform the following command:
Code: Select all
dpkg-reconfigure linux-sound-base
Code: Select all
/etc/init.d/alsa-utils stop
aptitude remove alsa-base alsa-utils
Step 4 - Reboot
Now, in theory you could load the kernel modules using modprobe, and I'd appreciate it if anyone knows the exact commands that need to be run, but using "modprobe osscore" didn't work for me - it got OSS to start, but no programs would use it, returning the error that /dev/dsp did not exist.
So I rebooted, OSS started up during boot and I am listening to music using OSS4 as I write this tutorial. You can run the OSS4 mixer by issuing the command "ossxmix"; it's not a particularly intuitive interface, but by clicking things and seeing what happens you can figure it out pretty easily. My onboard speaker was still producing sound when I plugged my headphones in at first, but playing around with the mixer for half a minute fixed that.
Further reading
The Sorry State of Sound in Linux
Configuring Applications for OSS4
Tips and Tricks
Troubleshooting