diff options
author | Dugan Chen <dugan [underscore] c [at] fastmail [dot] fm> | 2010-05-14 23:31:50 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackware.com> | 2010-05-14 23:31:50 +0200 |
commit | b66a27946bea58639bb9d7c62ec6f916e1f5a5a3 (patch) | |
tree | 4e7c8d2953df4550ad4f642fce0dd0321296a495 | |
parent | fd27b599598e6dd5ff4050b3447b27cf3ac526e2 (diff) |
system/oss: Added. (an ALSA alternative)
The Open Sound System is a set of sound drivers that serve as
an alternative to the usual ALSA architecture.
-rw-r--r-- | system/oss/README | 11 | ||||
-rw-r--r-- | system/oss/README.SLACKWARE | 25 | ||||
-rw-r--r-- | system/oss/doinst.sh | 23 | ||||
-rw-r--r-- | system/oss/oss.SlackBuild | 83 | ||||
-rw-r--r-- | system/oss/oss.info | 10 | ||||
-rw-r--r-- | system/oss/ossxmix.desktop | 8 | ||||
-rw-r--r-- | system/oss/rc.oss | 39 | ||||
-rw-r--r-- | system/oss/slack-desc | 19 |
8 files changed, 218 insertions, 0 deletions
diff --git a/system/oss/README b/system/oss/README new file mode 100644 index 000000000000..e1c4a0fcdf2e --- /dev/null +++ b/system/oss/README @@ -0,0 +1,11 @@ +The Open Sound System is a set of sound drivers that serve as an alternative +to the usual ALSA architecture. + +Among the benefits are: +* volume levels being settable for each application individually +* better latency than ALSA in most cases +* software mixing working out of the box + +If your WM/DE supports tray icons, you will have one for the OSS mixer. + +See README.SLACKWARE for post-installation instructions and setup information. diff --git a/system/oss/README.SLACKWARE b/system/oss/README.SLACKWARE new file mode 100644 index 000000000000..309db29c9ffb --- /dev/null +++ b/system/oss/README.SLACKWARE @@ -0,0 +1,25 @@ +README.SLACKWARE for oss + +After installing the package, do the following: + +1. Blacklist the alsa modules for your sound card. + The output of "lsmod | grep snd" should give you a list of which modules + will need to be blacklisted. + +2. Make /etc/rc.d/rc.alsa non-executable: chmod 0644 /etc/rc.d/rc.alsa + +3. Make /etc/rc.d/rc.oss executable: chmod 0755 /etc/rc.d/rc.oss + +4. Add this snippet to /etc/rc.d/rc.local: + + if [ -x /etc/rc.d/rc.oss ]; then + /etc/rc.d/rc.oss start + fi + +5. Reboot. + +6. Test sound to ensure that it works - use "osstest" for this. + +7. Configure applications to use OSS instead of ALSA; typically, this will + involve setting the "Sound Command" or some such to use "ossplay" + diff --git a/system/oss/doinst.sh b/system/oss/doinst.sh new file mode 100644 index 000000000000..b9b1c208fa68 --- /dev/null +++ b/system/oss/doinst.sh @@ -0,0 +1,23 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +# Keep same perms on rc.oss.new: +if [ -e etc/rc.d/rc.oss ]; then + cp -a etc/rc.d/rc.oss etc/rc.d/rc.oss.new.incoming + cat etc/rc.d/rc.oss.new > etc/rc.d/rc.oss.new.incoming + mv etc/rc.d/rc.oss.new.incoming etc/rc.d/rc.oss.new +fi + +config etc/oss.conf.new +config etc/rc.d/rc.oss.new + diff --git a/system/oss/oss.SlackBuild b/system/oss/oss.SlackBuild new file mode 100644 index 000000000000..c4ffbcf8406c --- /dev/null +++ b/system/oss/oss.SlackBuild @@ -0,0 +1,83 @@ +#!/bin/sh + +# Slackware build script for OSS 4. + +# Written by Dugan Chen (dugan [underscore] c [at] fastmail [dot] fm). + +PRGNAM=oss +VERSION=${VERSION:-4.2} +SUBVERSION=${SUBVERSION:-2002} +ARCH=${ARCH:-i486} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +SRCVERSION=v${VERSION}-build${SUBVERSION}-src-gpl +PKGVERSION=${VERSION}.${SUBVERSION} + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2" # yes, -fPIC is left out on purpose here + LIBDIRSUFFIX="64" +fi + +set -e # Exit on most errors + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$SRCVERSION +tar xvf $CWD/$PRGNAM-$SRCVERSION.tar.bz2 +cd $PRGNAM-$SRCVERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +if [ $ARCH = "x86_64" ]; then + sed -i 's,OSSLIBDIR=\"/usr/lib/oss\",OSSLIBDIR=\"/usr/lib64/oss\",g' configure +fi + +mkdir build && cd build +../configure +CFLAGS="$SLKCFLAGS" make build +cp -a prototype/* $PKG + +chmod -R a+r $PKG +find $PKG -type d -exec chmod a+x '{}' \; + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +# Don't clobber the config file +mv $PKG/etc/oss.conf $PKG/etc/oss.conf.new + +mkdir -p $PKG/etc/rc.d +cat $CWD/rc.oss > $PKG/etc/rc.d/rc.oss.new + +# Fix location of manual pages +mv $PKG/usr/share/man $PKG/usr +rm -rf $PKG/usr/share + +mkdir -p $PKG/usr/doc/$PRGNAM-$PKGVERSION +cp -a COPYING Changelog RELNOTES.txt $PKG/usr/doc/$PRGNAM-$PKGVERSION +cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$PKGVERSION/README.SLACKWARE +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$PKGVERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKGVERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/system/oss/oss.info b/system/oss/oss.info new file mode 100644 index 000000000000..c9e903714a91 --- /dev/null +++ b/system/oss/oss.info @@ -0,0 +1,10 @@ +PRGNAM="oss" +VERSION="4.2.2002" +HOMEPAGE="http://www.opensound.com" +DOWNLOAD="http://www.4front-tech.com/developer/sources/stable/gpl/oss-v4.2-build2002-src-gpl.tar.bz2" +MD5SUM="246bb461f61fb8a2b496f03608839488" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +MAINTAINER="Dugan Chen" +EMAIL="dugan [underscore] c [at] fastmail [dot] fm" +APPROVED="rworkman" diff --git a/system/oss/ossxmix.desktop b/system/oss/ossxmix.desktop new file mode 100644 index 000000000000..af6185bed392 --- /dev/null +++ b/system/oss/ossxmix.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Open Sound System Mixer +GenericName=Audio Mixer +Exec=ossxmix -b +Icon=audio-card +Categories=GTK;AudioVideo;Player; +Terminal=false +Type=Application diff --git a/system/oss/rc.oss b/system/oss/rc.oss new file mode 100644 index 000000000000..a8084594fa30 --- /dev/null +++ b/system/oss/rc.oss @@ -0,0 +1,39 @@ +#!/bin/sh +# Start/stop/restart OSS: + +# Credit to Tsomi, on the 4Front Technologies forum: +# http://www.opensound.com/board2006/viewtopic.php?p=8174 + +oss_start() { + echo "Starting OSS..." + if [ -x /usr/sbin/soundon ]; then + /usr/sbin/soundon + else + echo "No /usr/sbin/soundon script found." + exit 1 + fi +} + +oss_stop() { + echo "Stopping OSS..." + /usr/sbin/soundoff +} + +# See how we were called. +case "$1" in + start) + oss_start + ;; + stop) + oss_stop + ;; + restart) + oss_stop + sleep 1 + oss_start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + ;; +esac + diff --git a/system/oss/slack-desc b/system/oss/slack-desc new file mode 100644 index 000000000000..be80183e3d27 --- /dev/null +++ b/system/oss/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' on +# the right side marks the last column you can put a character in. You must make +# exactly 11 lines for the formatting to be correct. It's also customary to +# leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +oss: oss (The Open Sound System) +oss: +oss: The Open Sound System (OSS) is a standard interface for making and +oss: capturing sound in Unix operating systems. The goal of OSS is to +oss: allow one to write a sound-based application program that works with +oss: any sound controller hardware, even though the hardware interface +oss: varies greatly from one type to another. OSS is free software, +oss: distributed (here) under the GPL license. +oss: +oss: Learn more at: http://www.opensound.com/ +oss: |