[CM] [OT] jack and common lisp

Kjetil S. Matheussen k.s.matheussen at notam02.no
Wed Oct 15 13:33:10 PDT 2008

On Wed, 15 Oct 2008, Luke Crook wrote:

> On Wed, 15 Oct 2008 08:57:52 -0700, Vytautas Jancauskas
> <unaudio at gmail.com> wrote:
>> hat is the best
>> way to have audio playback from SBCL? I have written a set of jack
>> bindings
>> with cffi and they sorta work except that sbcl spazzes out all the time
>> (to
>> many callbacks? garbage collector?). The way i did it is to define a
>> callback that simply generates a single tone and then register that wih
>> jack. Does anyone has experience with this? How would you do something
>> like
>> that. I'm using linux btw. Thanks in advance.
> I maintain a set of CFFI bindings to the SDL_mixer library. SDL_mixer also
> uses a callback mechanism into a Lisp process (SBCL on Linux in my case)
> to fill the audio buffers. Seems to work on Linux just fine. It is a
> little flakey on win32, but I think this is due to the SBCL/win32 port not
> supporting threads 100%. The bindings work fine in Lispworks and CLISP
> though. How often is the callback called?

It's a little bit harder with jack than SDL, I would think, since
jack enjoys very much to throw out clients that doesn't
supply data fast enough.

Running jack in "soft mode" might
help the situation a little bit. At least earlier "soft mode"
made alsa "handle" xruns much much faster (by ignoring them).

Another thing could be not to lock down memory.
Some programs requiring large amounts
of memory, like vmware, and sometimes also Snd,
fails completely if memory is locked, but I don't
know if that is the reason here.

But frankly, since Sbcl's garbage collector most
likely was never designed to work very well in
hard realtime, the best solution is probably
to send data from sbcl to jack via a lockless

More information about the Cmdist mailing list