[linux-audio-dev] buffering, latency, cut-outs

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

Subject: [linux-audio-dev] buffering, latency, cut-outs
From: Jake Donham (jake_AT_crankshaft.bitmechanic.com)
Date: to tammi  13 2000 - 12:58:12 EST


Hi,

I am one of the authors of Freebirth, a softsynth/step sequencer which
runs on Linux (see <http://www.bitmechanic.com/projects/freebirth/>).

The current version sometimes cuts out (during heavy UI activity,
while top is running, etc.), even on a fast machine, and I'm trying to
understand why it happens and what can be done about it.

Freebirth uses OSS, and we're calling

  frag = 0x0004000C;
  result = ioctl(fd,SNDCTL_DSP_SETFRAGMENT, &frag);

to set a buffer of 4 fragments of 4K each. One question I have is
whether these two parameters matter much, or whether it's just the
total buffer size that matters; if I set it to 0x00200009, for
example, for 32 fragments of 512 bytes each, I get the same 16K
buffer. Another question is whether this is an adequate buffer
size. We'd like to keep the buffer small for good interactive response
(Freebirth's major appeal is knob-twiddling).

The code is not multi-threaded; we're using GTK+'s polling mechanism
to watch the /dev/dsp file descriptor. I guess this means that GTK+
could delay things arbitrarily if it doesn't come back and poll the
file descriptors often enough. But that doesn't really explain the
problem with top. The alternative would be to have the synth processs
in one thread and the UI in another.

Are there any other issues I should investigate with this?

Thanks,

Jake


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

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:23:26 EST