[HOWTO] Replace ALSA with OSS4

Post tutorials, HOWTO's and other useful resources here.
ashkenazi
White ninja
White ninja
Posts: 16
Joined: 27 Jan 2015, 08:40
Distribution: Porteus, BSD
Location: Backstage

[HOWTO] Replace ALSA with OSS4

Post#1 by ashkenazi » 01 Feb 2015, 17:48

Since ALSA has bad sound quality, you might want to replace it with OSS4. Download OSS4 from here:
http://slackonly.com/pub/packages/14.1- ... _slack.txz
then, convert it into an .xzm module and add it to your porteus/modules directory.

Activate the module. Run in the terminal as root:

Code: Select all

soundon
It will complain that

Code: Select all

sound_pcm
and similar ones are in use. Make a list of those modules as we need to blacklist them.
Create a file named:

Code: Select all

/etc/modprobe.d/alsa_blacklist.conf
and add a few lines by prepending

Code: Select all

blacklist
to module names you got in the previous step. Save the file and exit.
Add:

Code: Select all

/usr/sbin/soundon
to your

Code: Select all

/etc/rc.d/rc.local
Now we will fix the remaining issues with OSS4. In order to have Flash player working without crackling noise, add to your

Code: Select all

/usr/lib/oss/soundon.user
this:

Code: Select all

vmixctl attach /dev/oss/oss_envy240/pcm0 /dev/oss/oss_envy240/pcmin0
REPLACE oss_envy24 above with YOUR sound card module! (e. g. oss_hdaudio for integrated Intel HDA)
Now we need to make more apps aware of OSS4. Create a file

Code: Select all

/etc/asound.conf
which should contain this:

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
}
Add the sound mixer to your startup applications:

Code: Select all

ossxmix -b
Enjoy your high quality audio!

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: [HOWTO] Replace ALSA with OSS4

Post#2 by Bogomips » 01 Feb 2015, 18:47

Before going overboard and immersing oneself in the intricacies of it all, it may pay to check that there is an i486 version available somewhere, if one is a 32-biter.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

ashkenazi
White ninja
White ninja
Posts: 16
Joined: 27 Jan 2015, 08:40
Distribution: Porteus, BSD
Location: Backstage

Re: [HOWTO] Replace ALSA with OSS4

Post#3 by ashkenazi » 01 Feb 2015, 19:51

You can install it using the generic TAR:
http://www.opensound.com/release/oss-li ... 86.tar.bz2

As root:

Code: Select all

tar jxvf  oss-linux-v4.2-2011-i386.tar.bz2 -C /
sh /usr/lib/oss/build/install.sh
How to create a module from source:
http://www.porteus.org/component/conten ... ource.html

Slackbuild for OSS:
http://slackbuilds.org/repository/14.1/audio/oss/

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: [HOWTO] Replace ALSA with OSS4

Post#4 by Bogomips » 01 Feb 2015, 20:07

Thanks. So next on agenda: how to get OSS kernel module for my NVIDIA card, or is it already supplied in tar ball?
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

ashkenazi
White ninja
White ninja
Posts: 16
Joined: 27 Jan 2015, 08:40
Distribution: Porteus, BSD
Location: Backstage

Re: [HOWTO] Replace ALSA with OSS4

Post#5 by ashkenazi » 01 Feb 2015, 21:38

What's the exact model of your sound card? If unsure, please post the output of this command:

Code: Select all

lspci | grep Audio
The install.sh script compiles all OSS modules.

This is a list of all supported sound cards:
http://manuals.opensound.com/devlists/Linux.html

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: [HOWTO] Replace ALSA with OSS4

Post#6 by Bogomips » 02 Feb 2015, 01:02

Thanks for info. Now have more or less complete picture. :beer:
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

ashkenazi
White ninja
White ninja
Posts: 16
Joined: 27 Jan 2015, 08:40
Distribution: Porteus, BSD
Location: Backstage

Re: [HOWTO] Replace ALSA with OSS4

Post#7 by ashkenazi » 02 Feb 2015, 10:22

The best music player to use with OSS4 is Deadbeef with Petrov's plugin (exact scientific resampler):
http://www.opensound.com/forum/viewtopi ... =90#p19477

Another tip: use lossless audio codecs (FLAC is better than MP3)
SMTube combined with SMPlayer is better than Flash for YouTube (by avoiding Flash you can remove the "vmixctl attach" line from "soundon.user").
SMPlayer allows you to watch videos on ancient hardware (YouTube on 600MHz Celeron PIII-era laptop with no Xorg video driver? It's possible.)
Use Greasemonkey or Scriptish for Firefox with iSebaro's ViewTube plugin to watch videos on many popular websites:

Code: Select all

http://isebaro.com/viewtube/?ln=en
Use the "Get" option and copy the link you want to watch to your SMPlayer.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: [HOWTO] Replace ALSA with OSS4

Post#8 by Bogomips » 02 Feb 2015, 12:50

SMplayer sometimes doesn't play subtitles or age-restricted, in which case youtube-dl comes to the rescue, for which (usm -g)python needs to be activated. Python seems to be quite ubiquitous, so always have it at hand.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

ashkenazi
White ninja
White ninja
Posts: 16
Joined: 27 Jan 2015, 08:40
Distribution: Porteus, BSD
Location: Backstage

Re: [HOWTO] Replace ALSA with OSS4

Post#9 by ashkenazi » 02 Feb 2015, 14:36

This one has more features than youtube-dl and it's Python-based as well:
https://github.com/np1/mps-youtube

There's also Minitube:
http://flavio.tordini.org/minitube

SMPlayer can seek videos while they are still being downloaded, and that's the one advantage it offers.

rara
Black ninja
Black ninja
Posts: 36
Joined: 25 Jul 2015, 01:29
Distribution: Porteus
Location: India

Re: [HOWTO] Replace ALSA with OSS4

Post#10 by rara » 13 Aug 2015, 06:14

ashkenazi,

Forgive me if it sounds too naive a question, but I am really curious.

What are the advantages of OSS4 over ALSA, in what ways is it superior?

What hardware have you been using the evaluate the sound to reach your conclusion about ALSA and OSS4 sound quality?

Post Reply