Re: [LAD] [PATCH] oss2jack 0.25 for jack2

From: James Warden <warjamy@email-addr-hidden>
Date: Tue May 19 2009 - 17:31:30 EEST

Following the kfusd patch, here is a small patch to make oss2jack work fine against jack2.
It works against jack1 already because jack1's version of jack_set_samplerate_callback() actually executes the callback function, while jack2 does not do it right away. So I followed Stephane Letz's advice and call jack_get_sample_rate() in oss2jack in jack_init() instead.

Please be aware that you may get a reject by applying due to screwed spacing. I had some funny issues with this lately (and I use emacs for source code ... weird).

------ PATCH start ------------------
--- oss2jack-0.25.orig/src/oss2jack/oss2jack.c 2009-05-18 19:57:17.757704457 +0200
+++ oss2jack-0.25/src/oss2jack/oss2jack.c 2009-05-18 20:05:04.397724051 +0200
@@ -633,7 +633,7 @@

        jack_set_error_function(jack_error);

- info->client = jack_client_new("oss-dsp");
+ info->client = jack_client_open("oss-dsp", JackNullOption, NULL);

        if(info->client == NULL)
        {
@@ -652,6 +652,9 @@
        jack_set_sample_rate_callback(info->client, jack_srate, info);
        jack_set_buffer_size_callback(info->client, jack_buffer_size, info);

+ /* initialize current sample rate for jack2 at startup */
+ (void)jack_srate(jack_get_sample_rate(info->client), info);
+
        jack_on_shutdown(info->client, jack_shutdown, info);

        info->last_frame_size = 64;
------- PATCH end ------------------------------

Cheers!
J.

> --- On Fri, 5/15/09, Lennart Poettering <mzynq@email-addr-hidden>
> wrote:
>
> > From: Lennart Poettering <mzynq@email-addr-hidden>
> > Subject: Re: [LAD] [PATCH] kfusd against 2.6.29
> kernel
> > To: linux-audio-dev@email-addr-hidden
> > Date: Friday, May 15, 2009, 8:29 AM
> > On Fri, 15.05.09 05:21, James Warden
> > (warjamy@email-addr-hidden)
> > wrote:
> >
> > > Hi,
> > >
> > > I created a patch for kfusd (fusd-kor kernel
> module)
> > because I
> > > needed oss2jack to work again against kernel
> 2.6.29.x
> > >
> > > I need to clean up the patch as it bulldozes the
> old
> > kernel API. If
> > > anyone is interested, I can post it here when I
> clean
> > it up (some
> > > time tonight or tomorrow). I already contacted
> the
> > author of fusd
> > > but I've got no reply so far.
> > >
> > > Note that I am no kernel guru, I got inspired by
> the
> > update to
> > > module source drm_mm.c and tested oss2jack in a
> > 2.6.29.2-rt10
> > > environment against jack1_svn (latest). I need to
> fix
> > something to
> > > make it work with jack2 (some problem linked to
> > libsamplerate -
> > > which is used in oss2jack - specifically in
> > src_process, the
> > > src_ratio field of the passed data is out of
> range).
> >
> > Please note that cuse (which does mostly the same as
> fusd)
> > is on its
> > way into the kernel:
> >
> > http://lwn.net/Articles/296388/
> >
> > Lennart
> >
> > --
> > Lennart Poettering           
> >             Red Hat, Inc.
> > lennart [at] poettering [dot] net
> > http://0pointer.net/lennart/       
> >    GnuPG 0x1A015CC4
> > _______________________________________________
> > Linux-audio-dev mailing list
> > Linux-audio-dev@email-addr-hidden
> > http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
> >
>
>
>
>

      
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Tue May 19 20:15:05 2009

This archive was generated by hypermail 2.1.8 : Tue May 19 2009 - 20:15:05 EEST