You are not logged in.

#1 2010-08-10 18:38:37

Anonymo
Member
Registered: 2005-04-07
Posts: 427
Website

libsalsa PKGBUILD

We had the libsalsa PKGBUILD in AUR http://aur.archlinux.org/packages.php?ID=22093
I updated the links and md5 sum to latest stable builld

It won't build because it says it's missing the patch.diff, which is there.

2010-08-10 13:22:26 (419 KB/s) - "oss-v4.2-build2003-src-gpl.tar.bz2.part" saved [1743674/1743674]

==> Validating source files with md5sums...
    oss-v4.2-build2003-src-gpl.tar.bz2 ... Passed
==> Extracting Sources...
  -> Extracting oss-v4.2-build2003-src-gpl.tar.bz2 with bsdtar
==> Entering fakeroot environment...
==> Starting build()...
patch: **** Can't open patch file patch.diff : No such file or directory
    Aborting...

I want to try to get Skype sound working... I don't really NEED it but it bothers me that it does not work with OSS4.

I was reading this:
http://insanecoding.blogspot.com/2009/0 … ion-4.html

Here in case site ever goes down:

Perfect sound with OSS version 4

So I just happened to be keeping my eye on some packages being upgraded in Debian on dist-upgrade, and something caught my eye, the package "libasound2-plugins". I wondered what kind of plugins it provided, so I asked APT to show me what it was. Here's what came up:


    Package: libasound2-plugins
    Priority: optional
    Section: libs
    Installed-Size: 488
    Maintainer: Debian ALSA Maintainers
    Architecture: amd64
    Source: alsa-plugins
    Version: 1.0.19-2
    Depends: libasound2 (>> 1.0.18), libc6 (>= 2.2.5), libjack0 (>= 0.116.1), libpulse0 (>= 0.9.14), libsamplerate0
    Filename: pool/main/a/alsa-plugins/libasound2-plugins_1.0.19-2_amd64.deb
    Size: 119566
    MD5sum: 89efb281a3695d8c0f0d3c153ff8041a
    SHA1: fdd93b68ec0b8e6de0b67b3437b9f8c86c04b449
    SHA256: 7eb5b023373db00ca1b65765720a99654a0b63be741a5f5db2516a8881048aa6
    Description: ALSA library additional plugins
    This package contains plugins for the ALSA library that are
    not included in the main libasound2 package.
    .
    The following plugins are included, among other:
    - a52: S16 to A52 stream converter
    - jack: play or capture via JACK
    - oss: run native ALSA apps on OSS drivers
    - pulse: play or capture via Pulse Audio
    - lavcrate, samplerate and speexrate: rate converters
    - upmix and vdownmix: convert from/to 2 and 4/6 channel streams
    .
    ALSA is the Advanced Linux Sound Architecture.
    Enhances: libasound2
    Homepage: [url]http://www.alsa-project.org[/url]/
    Tag: devel::library, role::plugin, works-with::audio



Now something jumped out at me, run native ALSA apps on OSS drivers?
If you read my sound article, you know I'm an advocate of OSSv4, since it seems superior where it matters.

So I looked into the documentation for the Debian (as well as Ubuntu) package "libasound2-plugins" on how this ALSA over OSS works exactly.

I edited /etc/asound.conf, and changed it to the following:


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

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


And presto, every ALSA application now started properly outputting sound for me. No more need to always have to fiddle with configurations for each sound layer to use OSS, because the distros don't allow auto config of them.

I could never get flash on 64 bit with sound before, even though each new OSS release says they "fixed it". Now it does work for me.

I tested the following with ALSA:
MPlayer (-ao alsa)
Firefox, flashplugin-nonfree, Homestar Runner
ZSNES (-ad alsa)
bsnes (defaults)

Oh and in case you're wondering, mixing is working perfectly. I tried running four instances of MPlayer, two set to use ALSA, the other two set to output using OSS, and I was able to hear all four at once.

Now it's great to setup each application and sound layer individually to use OSS, so there's less overhead. But just making this one simple change means you don't have to for each application where the distro defaulted to ALSA, or have to suffer incompatibility when a particular application is ALSA only.


Note that depending how you installed OSS and which version, it may have tried forcing ALSA programs to use a buggy ALSA emulation library, which is incomplete, and not bug for bug compatible with the real ALSA. If that happened to you, here's how to use the real ALSA libraries, which are 100% ALSA compatible, as it's 100% the real ALSA.

First check where everything is pointing with the following command ls -la /usr/lib/libasound.*
I get the following:


    -rw-r--r-- 1 root root 1858002 2009-03-04 11:09 /usr/lib/libasound.a
    -rw-r--r-- 1 root root 840 2009-03-04 11:09 /usr/lib/libasound.la
    lrwxrwxrwx 1 root root 18 2009-03-06 03:35 /usr/lib/libasound.so -> libasound.so.2.0.0
    lrwxrwxrwx 1 root root 18 2009-03-06 03:35 /usr/lib/libasound.so.2 -> libasound.so.2.0.0
    -rw-r--r-- 1 root root 935272 2009-03-04 11:09 /usr/lib/libasound.so.2.0.0


Now as you can see libasound.so and libasound.so.2 both point to libasound.so.2.0.0. The bad emulation is called libsalsa. So if instead of seeing "-> libasound..." you see "-> libsalsa..." there, you'll want to correct the links.

You can correct with the following commands as root:


    cd /usr/lib/
    rm libasound.so libasound.so.2
    ln -s libasound.so.2.0.0 libasound.so
    ln -s libasound.so.2.0.0 libasound.so.2


If you're using Ubuntu and don't know how to switch to root, try sudo su prior to the steps above.

If you'd like to try to configure as many applications as possible to use OSS directly to avoid any unneeded overhead, see the documentation here and here which provide a lot of useful information. However if you're happy with your current setup, the hassle to configure each additional application isn't needed as long as you setup ALSA to use OSS.

Enjoy your sound! 

and was hoping someone knew how to get it working...

Last edited by Anonymo (2010-08-10 18:39:11)

Offline

#2 2010-08-10 19:11:19

saline
Member
Registered: 2010-02-20
Posts: 86

Re: libsalsa PKGBUILD

Under files on the AUR page, you can download that file.  It should have been included in the tarball.  Possibly you only grabbed the PKGBUILD file?

Offline

#3 2010-08-10 21:12:33

Anonymo
Member
Registered: 2005-04-07
Posts: 427
Website

Re: libsalsa PKGBUILD

saline wrote:

Under files on the AUR page, you can download that file.  It should have been included in the tarball.  Possibly you only grabbed the PKGBUILD file?

No I downloaded the TARBALL.  Thanks for the suggestion though.

Offline

#4 2010-08-10 21:18:37

saline
Member
Registered: 2010-02-20
Posts: 86

Re: libsalsa PKGBUILD

Try adding patch.diff to the files array and update the md5s.  Then, change the line in PKGBUILD to:

patch $srcdir/oss-v4.2-build2003-src-gpl/lib/libsalsa/Makefile $srcdir/patch.diff

Offline

#5 2010-08-10 21:34:58

Anonymo
Member
Registered: 2005-04-07
Posts: 427
Website

Re: libsalsa PKGBUILD

saline wrote:

Try adding patch.diff to the files array and update the md5s.  Then, change the line in PKGBUILD to:

patch $srcdir/oss-v4.2-build2003-src-gpl/lib/libsalsa/Makefile $srcdir/patch.diff

Thanks, I think that worked

  -> Found patch.diff
==> Validating source files with md5sums...
    oss-v4.2-build2003-src-gpl.tar.bz2 ... Passed
    patch.diff ... Passed
==> Extracting Sources...
  -> Extracting oss-v4.2-build2003-src-gpl.tar.bz2 with bsdtar
==> Entering fakeroot environment...
==> Starting build()...
patching file /home/raul/libsalsa/src/oss-v4.2-build2003-src-gpl/lib/libsalsa/Makefile
Hunk #1 succeeded at 49 with fuzz 1.
libtool --tag=CC --mode=compile cc -O -I../../include -I../libOSSlib -c main.c
libtool: compile:  cc -O -I../../include -I../libOSSlib -c main.c  -fPIC -DPIC -o .libs/main.o
libtool: compile:  cc -O -I../../include -I../libOSSlib -c main.c -o main.o >/dev/null 2>&1
libtool --tag=CC --mode=compile cc -O -I../../include -I../libOSSlib -c output.c
libtool: compile:  cc -O -I../../include -I../libOSSlib -c output.c  -fPIC -DPIC -o .libs/output.o
libtool: compile:  cc -O -I../../include -I../libOSSlib -c output.c -o output.o >/dev/null 2>&1
libtool --tag=CC --mode=compile cc -O -I../../include -I../libOSSlib -c misc.c
libtool: compile:  cc -O -I../../include -I../libOSSlib -c misc.c  -fPIC -DPIC -o .libs/misc.o
libtool: compile:  cc -O -I../../include -I../libOSSlib -c misc.c -o misc.o >/dev/null 2>&1
libtool --tag=CC --mode=compile cc -O -I../../include -I../libOSSlib -c pcm.c 
libtool: compile:  cc -O -I../../include -I../libOSSlib -c pcm.c  -fPIC -DPIC -o .libs/pcm.o
libtool: compile:  cc -O -I../../include -I../libOSSlib -c pcm.c -o pcm.o >/dev/null 2>&1
libtool --tag=CC --mode=compile cc -O -I../../include -I../libOSSlib -c mix.c
libtool: compile:  cc -O -I../../include -I../libOSSlib -c mix.c  -fPIC -DPIC -o .libs/mix.o
libtool: compile:  cc -O -I../../include -I../libOSSlib -c mix.c -o mix.o >/dev/null 2>&1
libtool --tag=CC --mode=compile cc -O -I../../include -I../libOSSlib -c seq.c 
libtool: compile:  cc -O -I../../include -I../libOSSlib -c seq.c  -fPIC -DPIC -o .libs/seq.o
libtool: compile:  cc -O -I../../include -I../libOSSlib -c seq.c -o seq.o >/dev/null 2>&1
libtool --tag=CC --mode=compile cc -O -I../../include -I../libOSSlib -c seqmid.c 
libtool: compile:  cc -O -I../../include -I../libOSSlib -c seqmid.c  -fPIC -DPIC -o .libs/seqmid.o
libtool: compile:  cc -O -I../../include -I../libOSSlib -c seqmid.c -o seqmid.o >/dev/null 2>&1
libtool --tag=CC --mode=compile cc -O -I../../include -I../libOSSlib -c rawmidi.c 
libtool: compile:  cc -O -I../../include -I../libOSSlib -c rawmidi.c  -fPIC -DPIC -o .libs/rawmidi.o
libtool: compile:  cc -O -I../../include -I../libOSSlib -c rawmidi.c -o rawmidi.o >/dev/null 2>&1
libtool --tag=CC --mode=compile cc -O -I../../include -I../libOSSlib -c seq_output.c 
libtool: compile:  cc -O -I../../include -I../libOSSlib -c seq_output.c  -fPIC -DPIC -o .libs/seq_output.o
libtool: compile:  cc -O -I../../include -I../libOSSlib -c seq_output.c -o seq_output.o >/dev/null 2>&1
libtool --tag=CC --mode=compile cc -O -I../../include -I../libOSSlib -c timer.c 
libtool: compile:  cc -O -I../../include -I../libOSSlib -c timer.c  -fPIC -DPIC -o .libs/timer.o
libtool: compile:  cc -O -I../../include -I../libOSSlib -c timer.c -o timer.o >/dev/null 2>&1
libtool --tag=CC --mode=compile cc -O -I../../include -I../libOSSlib -c stubs.c
libtool: compile:  cc -O -I../../include -I../libOSSlib -c stubs.c  -fPIC -DPIC -o .libs/stubs.o
libtool: compile:  cc -O -I../../include -I../libOSSlib -c stubs.c -o stubs.o >/dev/null 2>&1
libtool --tag=CC --mode=compile cc -O -I../../include -I../libOSSlib -c seq_input.c 
libtool: compile:  cc -O -I../../include -I../libOSSlib -c seq_input.c  -fPIC -DPIC -o .libs/seq_input.o
libtool: compile:  cc -O -I../../include -I../libOSSlib -c seq_input.c -o seq_input.o >/dev/null 2>&1
libtool --tag=CC --mode=link cc -rpath /usr/lib -Wl,--version-script=Versions -version-info 2:0:0 -o libsalsa.la main.lo output.lo misc.lo pcm.lo mix.lo seq.lo seqmid.lo rawmidi.lo seq_output.lo timer.lo stubs.lo seq_input.lo -L../libOSSlib -lOSSlib
libtool: link: gcc -shared  .libs/main.o .libs/output.o .libs/misc.o .libs/pcm.o .libs/mix.o .libs/seq.o .libs/seqmid.o .libs/rawmidi.o .libs/seq_output.o .libs/timer.o .libs/stubs.o .libs/seq_input.o   -L/home/raul/libsalsa/src/oss-v4.2-build2003-src-gpl/lib/libOSSlib -lOSSlib  -Wl,--version-script=Versions   -Wl,-soname -Wl,libsalsa.so.2 -o .libs/libsalsa.so.2.0.0
libtool: link: (cd ".libs" && rm -f "libsalsa.so.2" && ln -s "libsalsa.so.2.0.0" "libsalsa.so.2")
libtool: link: (cd ".libs" && rm -f "libsalsa.so" && ln -s "libsalsa.so.2.0.0" "libsalsa.so")
libtool: link: ar cru .libs/libsalsa.a  main.o output.o misc.o pcm.o mix.o seq.o seqmid.o rawmidi.o seq_output.o timer.o stubs.o seq_input.o
libtool: link: ranlib .libs/libsalsa.a
libtool: link: ( cd ".libs" && rm -f "libsalsa.la" && ln -s "../libsalsa.la" "libsalsa.la" )
mkdir -p /home/raul/libsalsa/pkg/usr/lib
libtool --tag=CC --mode=install cp libsalsa.la /home/raul/libsalsa/pkg/usr/lib
libtool: install: cp .libs/libsalsa.so.2.0.0 /home/raul/libsalsa/pkg/usr/lib/libsalsa.so.2.0.0
libtool: install: (cd /home/raul/libsalsa/pkg/usr/lib && { ln -s -f libsalsa.so.2.0.0 libsalsa.so.2 || { rm -f libsalsa.so.2 && ln -s libsalsa.so.2.0.0 libsalsa.so.2; }; })
libtool: install: (cd /home/raul/libsalsa/pkg/usr/lib && { ln -s -f libsalsa.so.2.0.0 libsalsa.so || { rm -f libsalsa.so && ln -s libsalsa.so.2.0.0 libsalsa.so; }; })
libtool: install: cp .libs/libsalsa.lai /home/raul/libsalsa/pkg/usr/lib/libsalsa.la
libtool: install: cp .libs/libsalsa.a /home/raul/libsalsa/pkg/usr/lib/libsalsa.a
libtool: install: chmod 644 /home/raul/libsalsa/pkg/usr/lib/libsalsa.a
libtool: install: ranlib /home/raul/libsalsa/pkg/usr/lib/libsalsa.a
libtool: install: warning: remember to run `libtool --finish /usr/lib'
(cd /home/raul/libsalsa/pkg/usr/lib;ln -sf libsalsa.so.2.0.0 libasound.so)
(cd /home/raul/libsalsa/pkg/usr/lib;ln -sf libsalsa.so.2.0.0 libasound.so.2)
==> Tidying install...
  -> Purging other files...
  -> Compressing man and info pages...
  -> Stripping unneeded symbols from binaries and libraries...
==> WARNING: Package contains reference to $srcdir
==> Creating package...
  -> Generating .PKGINFO file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: libsalsa 4.2-1 (Tue Aug 10 16:32:56 CDT 2010)
==> Cleaning up...

Offline

#6 2010-08-10 22:15:23

Anonymo
Member
Registered: 2005-04-07
Posts: 427
Website

Re: libsalsa PKGBUILD

Not to stay that this was for nothing, but I got a file conflict at install, which I'm guessing means libsalsa is already included with OSS package?

Offline

#7 2010-08-10 23:48:19

saline
Member
Registered: 2010-02-20
Posts: 86

Re: libsalsa PKGBUILD

The PKGBUILD says it conflicts with alsa-libs, in case that's what it's saying.  It also says it is a libasound replacerment.

Offline

#8 2010-08-11 13:55:21

Anonymo
Member
Registered: 2005-04-07
Posts: 427
Website

Re: libsalsa PKGBUILD

saline wrote:

The PKGBUILD says it conflicts with alsa-libs, in case that's what it's saying.  It also says it is a libasound replacerment.

I removed alsa-lib (pacman -Rd alsa-lib) and then libsalsa installed fine

Offline

Board footer

Powered by FluxBB