Subject: Re: Multiple channels of audio?
To: Brian A. Seklecki <lavalamp@spiritual-machines.org>
From: Chris Wareham <chris.wareham@iosystems.co.uk>
List: current-users
Date: 06/11/2004 11:27:54
This is a multi-part message in MIME format.
--------------010504050509090800040201
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Brian A. Seklecki wrote:
>>(http://jackit.sf.net/) does on Linux. It would be great if someone
>>could port it to NetBSD, but it uses the horribly undocumented ALSA
> 
> 
> ALSA isn't so bad(R); it's the fact that GTK/Gnome apps use ESD and
> KDE/QT apps use ARTSD to add network transparency, which in-turn talk to
> ALSA.
> 

A quick poke around the mailing lists, and it appears that someone
(Jussi Laako) has ported Jack to FreeBSD. It looks like Jack was written
so that different audio layers could be supported in a modular fashion.
Jussi Laako wrote an OSS compatible module, which compiles on NetBSD.
The only change I needed to make was a one liner that deals with setting
thread attributes (see attached patch). I'll have a go at doing it the
"autotools" way(1) and submit it as a patch to the Jack developers.

(1) - detect whether to use pthread_attr_setschedpolicy or
pthread_attr_setchedparam at configure time and set a preprocessor flag.

> Eventually *BSD will require an ALSA compatibility layer, as the apps we
> emulate and cross-compile will use that API exclusively. 
> 

I'm looking forward to someone writing an ALSA compatibility layer.
Sadly, a lack of time (and possible lack of ability) means I'm not the
one that's going to do it. Having the compatability layer would bring
support for great applications like the new version of Rosegarden, which
is so good I dual boot Linux to use it.

Chris

--------------010504050509090800040201
Content-Type: text/plain;
 name="jack.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="jack.diff"

diff -Naur jack-audio-connection-kit-0.98.1/libjack/client.c jack-audio-connection-kit-scratch/libjack/client.c
--- jack-audio-connection-kit-0.98.1/libjack/client.c	2004-04-14 04:38:32.000000000 +0100
+++ jack-audio-connection-kit-scratch/libjack/client.c	2004-06-11 11:10:11.000000000 +0100
@@ -1342,7 +1342,11 @@
 
 		pthread_attr_init (attributes);
 
+#ifdef __NetBSD__
+		if (pthread_attr_setschedparam (attributes, SCHED_FIFO)) {
+#else
 		if (pthread_attr_setschedpolicy (attributes, SCHED_FIFO)) {
+#endif
 			jack_error ("cannot set FIFO scheduling class for RT "
 				    "thread");
 			return -1;

--------------010504050509090800040201--