Re: [linux-audio-dev] oss2jack 0.13: A kernel-based approach to using OSS applications with jackd

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] oss2jack 0.13: A kernel-based approach to using OSS applications with jackd
From: Florian Schmidt (mista.tapas_AT_gmx.net)
Date: Tue Feb 24 2004 - 12:27:26 EET


On Mon, 23 Feb 2004 19:30:13 -0700
Kor Nielsen <korn-ml_AT_xdas.com> wrote:

> Hi,
>
> I have been quite frustrated with the difficulty of getting multiple
> OSS applications using my sound hardware simultaneously. The
> LD_PRELOAD hacks that I have tried leave much to be desired in terms
> of usability, especially when dealing with arts and mozilla plugins.

Are you talking about alsa-oss and aoss [the script which basiocally
only LD_PRELOAD's libalsa-oss.so]? These tools only support those apps
that use libc's open(). As soon as fopen() and friends are used, it
doesn't work anymore [libc uses internal version of open() which is not
publically interceptable because it has been resolved at libc link
time]].. I was looking into other means of intercepting all open() calls
[modifying the libc image in memory to jump to the replacement function,
using ptrace, using a kernel module].

I was thinking about the problem of how to map system calls from a
kernel module back to user space with little overhead. It seems that
this fusd has already tackled this..

>
> oss2jack uses Jeremy Elson's useful fusd library
> (http://www.circlemud.org/~jelson/software/fusd/) to create a
> userspace character device, which is also a jackd client. It supports
> mono and stereo streams, with virtually any sample rate thanks to
> libsamplerate(http://www.mega-nerd.com/SRC/). Only the commonly-used
> OSS ioctls are currently supported.

THis sounds good.

>
> I have tested oss2jack with the following applications, and they
> behave fairly well:
>
> - mplayer
> - artsd (and thus all the kde applications)
> - xmms
> - Macromedia Flash

Please test with Teamspeak [dunno, if it uses mmap though. i don't think
so]. This is one of the killer apps for linux gaming [when i hang out in
#alsa, this is one of the most frequently asked questions: "my soundcard
#doesn't dupport hw mixing: how do i get teamspeak and quake3 running
#simultaneously?".. my answer was [until today]: "you're screwed"]

>
> TODO:
>
> - support mmap for quake and other games
> (requires support in fusd)
>
> - detect jackd period for audio sync (currently assumes 64 samples).
> Should not be too noticeable unless you get above a 256 sample
> period)

Soundcards have a wide range of available periodsizes. My soundcard for
example cannot go above 512 for full duple jack operation. Some other
cards have fixed period sizes of 1024 or above.. So this can become a
serious problem..

>
> - lower CPU usage with artsd by blocking until the minimum fragment
> size is available (rather than the jackd period)
>
> - support for the OSS mixer.

Hmm, can't the OSS mixer stil be provided by kernel level oss emu
[snd-mixer-oss]?

>
> Available at:
>
> http://fort.xdas.com/~kor/oss2jack/
>
> WARNING: I have not yet tested oss2jack on the 2.4 series kernel..
> Currently I am using a self-created 2.6 patch for fusd available at
> the site above. It has been stable for the past 3 weeks on my machine,
> but no guarantees about stability or safety... :)
>
> fusd currently requires that devfs be enabled in the kernel.

Another problem: devfs is marked deprecated.. I would guess that only
about 1/4 [max] of the linux users nowadays use devfs [i'm not one of
them], so this can become a problem, too..

>
> Any comments are appreciated.

HTH :)

BTW: thanks for the effort. This can become very useful, as many people
are yearning for mixing playback streams and sharing capture streams in
OSS apps.. I'm not a kernel hacker, but i would be glad to help if i
can..

-- 
signature :)


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Tue Feb 24 2004 - 12:23:48 EET