HOWTO: OSS4 on Debian (squeeze/sid only)

Share your own howto's etc. Not for support questions!

HOWTO: OSS4 on Debian (squeeze/sid only)

Postby Parsifal » 2010-06-16 03:12

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
Parsifal
 
Posts: 48
Joined: 2010-04-10 09:30
Location: Sydney, Australia

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

Postby Hadret » 2010-06-16 07:02

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 (:
#404378
User avatar
Hadret
 
Posts: 354
Joined: 2007-07-19 13:04
Location: Wroclaw, Poland

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

Postby Hadret » 2010-06-17 16:53



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 (:
#404378
User avatar
Hadret
 
Posts: 354
Joined: 2007-07-19 13:04
Location: Wroclaw, Poland

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

Postby craigevil » 2010-06-19 03:44

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
Debian Sid KDE 4.8 Kernel 3.7 Thinkpad R40 Intel M 1.3 CPU 2GB RAM Radeon Mobility 7500
Debian - "If you can't apt-get something, it isn't useful or doesn't exist"
Giant Debian sources.list | Debian upgrade script smxi | sysinfo script inxi
User avatar
craigevil
 
Posts: 5149
Joined: 2006-09-17 03:17
Location: down the rabbit hole

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

Postby Parsifal » 2010-06-19 11:25

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
User avatar
Parsifal
 
Posts: 48
Joined: 2010-04-10 09:30
Location: Sydney, Australia

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

Postby shmerl » 2010-10-10 08:47

Debian testing at present has no package oss4-source.
shmerl
 
Posts: 259
Joined: 2009-07-30 21:41

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

Postby Hadret » 2010-10-10 10:01

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
#404378
User avatar
Hadret
 
Posts: 354
Joined: 2007-07-19 13:04
Location: Wroclaw, Poland

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

Postby julian67 » 2010-10-10 10:53

Wisdom from my inbox: "do not mock at your pottenocy"
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

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

Postby shmerl » 2010-10-11 03:41

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.
shmerl
 
Posts: 259
Joined: 2009-07-30 21:41

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

Postby mundigranja » 2010-10-23 15:11

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
mundigranja
 
Posts: 1
Joined: 2010-10-23 14:59

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

Postby ManilaTux » 2010-12-19 12:32

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.
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)

Postby shmerl » 2010-12-20 22:41

Did anyone manage to make Google Talk browser plugin to work with OSS4? I had no luck with that.
shmerl
 
Posts: 259
Joined: 2009-07-30 21:41

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

Postby hypnotic » 2011-01-06 01:49

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
hypnotic
 
Posts: 6
Joined: 2008-01-05 12:22

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

Postby shmerl » 2011-01-06 05:48

I already tried that, thanks. While it helps for some cases, in this one it doesn't work for some reason.
shmerl
 
Posts: 259
Joined: 2009-07-30 21:41

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

Postby MrFrood » 2011-03-11 09:39

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/
User avatar
MrFrood
 
Posts: 479
Joined: 2008-04-22 12:08
Location: London UK

Next

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 10 guests

fashionable