HOWTO: OSS4 on Debian (squeeze/sid only)

Share your own howto's etc. Not for support questions!
Message
Author
User avatar
Parsifal
Posts: 48
Joined: 2010-04-10 09:30
Location: Sydney, Australia

HOWTO: OSS4 on Debian (squeeze/sid only)

#1 Post by Parsifal »

I've recently had the urge to set up OSS4 on Debian to see how it compares with ALSA after reading this article, and I must say that it does indeed sound much better than ALSA did. However, when trying to set it up I found a distinct lack of any simple tutorial on how to do it, so I've decided to document what I did here for other people to follow.

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
Step 2 - Build OSS4 kernel modules

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
The prepare command installs any packages necessary for module-assistant to build packages. The auto-install command runs both the build and install commands, so it will build a .deb package from the sources and then install it for you.


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
Then select OSS instead of ALSA in the menu presented. Optionally, you can also remove ALSA from your system:

Code: Select all

/etc/init.d/alsa-utils stop
aptitude remove alsa-base alsa-utils
The above commands come from https://help.ubuntu.com/community/OpenSound, with minor changes to suit Debian.


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
Last edited by Parsifal on 2010-06-19 11:26, edited 1 time in total.
Email: steven@steven-mcdonald.id.au
IRC: Parsifal on Freenode and OFTC
XMPP (Jabber): steven-mcdonald@jabber.org.au

User avatar
Hadret
Posts: 354
Joined: 2007-07-19 13:04
Location: Berlin

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#2 Post by Hadret »

Many thanks for this HOWTO! I was considering changing ALSA to PulseAudio, but it was so unstable and had some irritating bugs (like mute on GNOME launch etc.). I was wondering how hard OSS4 installation can be, but thanks to you, it's pretty easy now. Like almost everything in Debian (:

User avatar
Hadret
Posts: 354
Joined: 2007-07-19 13:04
Location: Berlin

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#3 Post by Hadret »

Only one thing here. There's section about Adobe Flash:
installing libflashsupport

If you used a distro package to install libflashsupport, there's no need for the instruction below. Otherwise, follow this:

1. sudo install -s libflashsupport.so /usr/lib/oss/lib
2. sudo install -s libflashsupport.so /usr/lib
3. sudo ldconfig
4. Restart browser
It's mostly true and working fine, but firstly you must create /usr/lib/oss/lib directory, for example like that:

Code: Select all

# mkdir -p /usr/lib/oss/lib
Secondly, if you are using 64-bit like I am, you can use provided, precompiled 64-bit library but before you will make install -s commands, you must change the name of file from libflashsupport_64.so to libflashsupport.so. Simple as that. From now one, flash videos will have working audio once again (:

User avatar
craigevil
Posts: 5250
Joined: 2006-09-17 03:17
Location: Oz
Has thanked: 2 times
Been thanked: 2 times

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#4 Post by craigevil »

Configuring Applications for OSSv4 - Open Sound System - http://www.opensound.com/wiki/index.php ... _for_OSSv4

Tips And Tricks - Open Sound System - http://www.opensound.com/wiki/index.php/Tips_And_Tricks

Troubleshooting - Open Sound System - http://www.opensound.com/wiki/index.php/Troubleshooting
Raspberry PI 400 Distro: Raspberry Pi OS (Unstable) Kernel: 5.10.52-v8+ aarch64 DE: MATE Ram 4GB
Debian - "If you can't apt install something, it isn't useful or doesn't exist"

User avatar
Parsifal
Posts: 48
Joined: 2010-04-10 09:30
Location: Sydney, Australia

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#5 Post by Parsifal »

craigevil wrote:Configuring Applications for OSSv4 - Open Sound System - http://www.opensound.com/wiki/index.php ... _for_OSSv4

Tips And Tricks - Open Sound System - http://www.opensound.com/wiki/index.php/Tips_And_Tricks

Troubleshooting - Open Sound System - http://www.opensound.com/wiki/index.php/Troubleshooting
Thanks for these links, I'll add them to the bottom of the howto. I'm not going to add what Hadret said because it's outside the scope of the Howto.
Email: steven@steven-mcdonald.id.au
IRC: Parsifal on Freenode and OFTC
XMPP (Jabber): steven-mcdonald@jabber.org.au

shmerl
Posts: 302
Joined: 2009-07-30 21:41

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#6 Post by shmerl »

Debian testing at present has no package oss4-source.

User avatar
Hadret
Posts: 354
Joined: 2007-07-19 13:04
Location: Berlin

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#7 Post by Hadret »

AFAICS, it's not available in Debian Sid either:

Code: Select all

~$ apt-cache policy oss4-source
N: Nie udało się odnaleźć pakietu oss4-source

User avatar
julian67
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#8 Post by julian67 »

Wisdom from my inbox: "do not mock at your pottenocy"

shmerl
Posts: 302
Joined: 2009-07-30 21:41

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#9 Post by shmerl »

Yes, actually oss4-dkms installs kernel module, so the HOWTO needs to be updated. I tried it, but didn't manage to get Flash to work, even with flashplugin-nonfree-extrasound, so I reverted back to ALSA until I'll figure out how to do it. Probably need to compile the alternative version of extra plugin from 4front.

mundigranja
Posts: 1
Joined: 2010-10-23 14:59

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#10 Post by mundigranja »

How can I configure my external USB sound card like default card ?

ossinfo out is:

Code: Select all

root@portatil:/etc# ossinfo 
Version info: OSS 4.2 (b 2003/201007150434) (0x00040100) GPL
Platform: Linux/i686 2.6.32-5-686 #1 SMP Thu Oct 14 17:15:16 UTC 2010 (portatil)

Number of audio devices:	3
Number of audio engines:	8
Number of MIDI devices:		0
Number of mixer devices:	2


Device objects
 0: osscore0 OSS core services
 1: oss_ich0 Intel ICH6 (266E) interrupts=9488 (40896)
 2: oss_usb0 USB audio core services
 3: usb08bb2902-0 USB sound device
 4: usb08bb2902-1 USB sound device
 5: usb08bb2902-2 USB sound device

MIDI devices (/dev/midi*)

Mixer devices
 0: ICH AC97 Mixer (0x43585430) (Mixer 0 of device object 1)
 1: USB sound device (Mixer 0 of device object 3)

Audio devices
Intel ICH6 (266E)                 /dev/oss/oss_ich0/pcm0  (device index 0)
USB sound device play             /dev/oss/usb08bb2902-1/pcm0  (device index 1)
USB sound device rec              /dev/oss/usb08bb2902-2/pcmin0  (device index 2)

Nodes
  /dev/dsp -> /dev/oss/oss_ich0/pcm0
  /dev/dsp_in -> /dev/oss/oss_ich0/pcm0
  /dev/dsp_out -> /dev/oss/oss_ich0/pcm0
  /dev/dsp_ac3 -> /dev/oss/oss_ich0/pcm0
  /dev/dsp_mmap -> /dev/oss/oss_ich0/pcm0
  /dev/dsp_multich -> /dev/oss/oss_ich0/pcm0
root@portatil:/etc# 
Thanks

User avatar
ManilaTux
Posts: 113
Joined: 2010-12-19 12:10
Location: In your mom's bedroom

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#11 Post by ManilaTux »

Wow, I can't believe how awesome OSS4 is compared to ALSA. :shock: Thanks a lot for the howto. This is my dumbed down version:

1. Install OSS4
aptitude install oss4-base oss4-dkms oss4-gtk

2. Make OSS the default sound
dpkg-reconfigure linux-sound-base

3. Flash plugin fix
aptitude install flashplugin-nonfree-extrasound
mkdir -p /usr/lib/oss/lib
cd /usr/lib/flashplugin-nonfree-extrasound
install -s libflashsupport.so /usr/lib/oss/lib
install -s libflashsupport.so /usr/lib
ldconfig

4. Optionally remove ALSA
/etc/init.d/alsa-utils stop
aptitude remove alsa-base alsa-utils

5. Reboot


BTW, I'm using SMPlayer, GNOME Mplayer, VLC, Guayadeque, cmus. All working just fine. :mrgreen:
I use Debian, therefore I am.

shmerl
Posts: 302
Joined: 2009-07-30 21:41

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#12 Post by shmerl »

Did anyone manage to make Google Talk browser plugin to work with OSS4? I had no luck with that.

hypnotic
Posts: 6
Joined: 2008-01-05 12:22

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#13 Post by hypnotic »

shmerl wrote:Did anyone manage to make Google Talk browser plugin to work with OSS4? I had no luck with that.
I don't use this particular application but you could try ALSA->OSS4 emulation. I managed to get gnash working with this:

Code: Select all

aptitude install libasound2-plugins
Edit /etc/asound.conf as follows:

Code: Select all

pcm.oss {
   type oss
    device /dev/dsp
}

pcm.!default {
    type oss
    device /dev/dsp
}

ctl.oss {
    type oss
    device /dev/mixer
}

ctl.!default {
    type oss
    device /dev/mixer
}
All ALSA outputs will now be emulated to OSS4.


source:
https://wiki.archlinux.org/index.php/Op ... _emulation

shmerl
Posts: 302
Joined: 2009-07-30 21:41

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#14 Post by shmerl »

I already tried that, thanks. While it helps for some cases, in this one it doesn't work for some reason.

User avatar
MrFrood
Posts: 480
Joined: 2008-04-22 12:08
Location: London UK
Contact:

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#15 Post by MrFrood »

Sorry for coming late to this discussion but I've recently been musing over how to improve the quality of the audio produced by my Debian box.

I thought I had an OK sound using ALSA & JACK(2) with MOC and Shell-fm (utilising MPlayer as a backend) but I wondered if it could be improved....

I install OSS4, this was like a sonic curtain being lifted but could I do better? How would OSS4 and JACK sound?

Here I hit some issues in that the Debian version of JACK(2) does not support OSS reading the Debian bug pages and upstream mailing lists did not exactly make it clear if this is a Debian thing or upstream issues but given that JACK(2) definitely has support for OSS on Solaris it is annoying however all was not lost as JACK(1) is also available in the repositories (both versions are still under active development) ... so uninstall JACK(2) and install JACK(1)...

More issues, despite starting the jack daemon with the -d oss it stll seemed to trying to use ALSA - I tracked this down to the ~/.jackdrc file left by JACK(2) wich seemed to override any command line switched - I updated the file to use OSS, I also had to edit the /etc/oss4/conf/osscore.conf file to read

Code: Select all

# By default the O_EXCL open() flag can be used to bypass the virtual mixer.
# Setting excl_policy to 1 or 2 makes OSS ignore O_EXCL. A setting of 1
# ignores O_EXCL from all but root processes, while a setting of 2 always
# ignores O_EXCL. 
# 
excl_policy=2
To ensure that JACK(1) did not hog OSS.

MPlayer (via Shell-fm) worked fine with JACK(1) & OSS but moc required some changes in the config

Code: Select all

# Jack output settings.
JackOutLeft                            = "system:playback_1"
JackOutRight                           = "system:playback_2"
did the trick for me.

The result an even better sonic experience than just pure OSS4 :D
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.

http://happy.sdf-eul.org/

GaryR
Posts: 5
Joined: 2011-08-02 18:42

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#16 Post by GaryR »

While an old thread this seems to be the place to post my problem.

I just tried to install oss4 on my Debian Squeeze kernel-2.6.32, Intel DP55KG board. I get the following when I run oss4-dkms:

DKMS: install Completed.
Module build for the currently running kernel was skipped since the
kernel source for this kernel does not seem to be installed.
Unloading Open Sound System kernel modules: done.
Starting Open Sound System: done.

I then ran Aptitude install linux-source-2.6.32 successfully and reinstalled oss4-dkms.
I got the same results.

If I try to configure oss4 it wants to remove all of the board sound drivers as being unused. No sound

GaryR

Revenger
Posts: 383
Joined: 2010-11-16 11:47

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#17 Post by Revenger »

GaryR wrote: I then ran Aptitude install linux-source-2.6.32 successfully and reinstalled oss4-dkms.
I got the same results.

If I try to configure oss4 it wants to remove all of the board sound drivers as being unused. No sound

GaryR
You want the linux-headers package for your kernel.

Code: Select all

apt-get install linux-headers-$(uname -r)
Next time someone says 'Go to hell' to me, I come right here.

Do you need bad help?

GaryR
Posts: 5
Joined: 2011-08-02 18:42

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#18 Post by GaryR »

Sorry I didn't include that little tidbit. I also loaded the header file in the process of trouble shooting. It didn't work either.

Gary R

User avatar
kedaha
Posts: 3186
Joined: 2008-05-24 12:26

Re: HOWTO: OSS4 on Debian Squeeze from source

#19 Post by kedaha »

For an update on how to enable OSS4 using Squeeze's main repositories, please see this post also. OSS4 can be installed easily in Squeeze (with the default kernel) from Debian's main repository as posted in the linked topic. The prebuilt trial deb package from here licensed under the 4Front Commercial License with a limited one-year license key works fine but the option of using the source code from the Mercurial repository seems inadvisable according to this note:
Please note that this Mercurial (hg) repository should only be used by developers who would like to contribute to OSS. The OSS version contained in it is usually in the middle of intensive hacking and potentially dangerous. It must not be installed to any kind of production system or to a computer that contains important files.
I recommend anyone who's interested in trying OSS4 to install it from Debian's repositories but one can also compile a more up-to-date build if one wishes using the official GPLv2 OSS4 source code from the download site: either the stable version -which is suitable for production use - (I used the stable oss-v4.2-build2005-src-gpl.tar.bz2) version, or the testing version - for developers. I compiled and made, as an example, an oss-linux-4.2-2005_amd64.deb on Squeeze + 2.6.38-bpo.2-amd64 which can also be easily installed in Wheezy/Sid with the 3.0.0-1-amd64 and no doubt other kernels but please see how to enable OSS4 below. The deb was made using this procedure:

Here's an example of how to compile OSS4 from the gpl'd source code:
Note: Compilation of this source code will work in Stable but I have not tried it in Wheezy.
The following should take care of most, if not all the dependencies (Remember it's a good idea to simulate the command before installing by appending an -s, i.e., aptitude install -s first). As root:

Code: Select all

# aptitude install binutils build-essential gawk gcc gstreamer0.10-plugins-bad libasound2-plugins libc6 libesd0 libtool libgtk2.0-0 libgtk2.0-dev libsdl1.2debian-all libsdl1.2debian-oss libsox-fmt-oss libwine-oss sed linux-headers-$(uname -r) mpg123 sed
The entire process is done as normal user:

Code: Select all

$ wget http://www.4front-tech.com/developer/sources/stable/gpl/oss-v4.2-build2005-src-gpl.tar.bz2
$ tar -xjf oss-v4.2-build2005-src-gpl.tar.bz2
$ mkdir oss && cd oss
$ ../oss-v4.2-build2005-src-gpl/configure --enable-libsalsa=NO
$ make build
$ make deb
Note I had to use --enable-libsalsa=NO to avoid the regparm error.
This makes an oss-linux-4.2-2005_amd64.deb which will be found in /home/oss/.

To install:
The deb can be installed easily with # dpkg -i or preferably with the gdebi package manager (just right-click on the package and open with gdebi) which will find any missing dependencies.

How to enable your system to use OSS4:
To enable OSS4 it is further necessary to do:

Code: Select all

$ su -
Password:
# gksu gedit /etc/asound.conf
Cut & paste the code below

Code: Select all

pcm.oss {
   type oss
    device /dev/dsp
}

pcm.!default {
    type oss
    device /dev/dsp
}

ctl.oss {
    type oss
    device /dev/mixer
}

ctl.!default {
    type oss
    device /dev/mixer
}
Save and now remove ALSA and reconfigure the system to use OSS4:

Code: Select all

# /etc/init.d/alsa-utils stop
# aptitude remove alsa-base alsa-utils
# dpkg-reconfigure linux-sound-base
Final note: it seems preferable to purge PulseAudio if previously installed.
Last edited by kedaha on 2011-09-27 15:55, edited 1 time in total.

phatsoundz
Posts: 3
Joined: 2011-09-26 16:54

Re: HOWTO: OSS4 on Debian (squeeze/sid only)

#20 Post by phatsoundz »

I just want to link up my howto on compiling the GPL'ed source of OSS4: Roll your own GPL'ed OSS4 (stable/testing/unstable)

Thanks for this wonderful howto Parsi.

Post Reply