All of lore.kernel.org
 help / color / mirror / Atom feed
* how to handle buffer underrun in a softsynth
@ 2011-11-28 16:06 Henning Thielemann
  2011-11-28 20:16 ` Clemens Ladisch
  0 siblings, 1 reply; 4+ messages in thread
From: Henning Thielemann @ 2011-11-28 16:06 UTC (permalink / raw)
  To: alsa-devel


I have written a software synthesizer in Haskell that fetches MIDI events 
from ALSA sequencer and plays the rendered signal via ALSA pcm. However it 
cannot cope correctly with buffer underruns.

I tried to learn the correct way from the miniFMsynth example of
    http://alsamodular.sourceforge.net/alsa_programming_howto.html
   however this program floods my terminal with buffer underrun messages 
without even being connected to any MIDI event source. This is independent 
from how large I choose the BUFSIZE constant.

I use:

$ pkg-config --modversion alsa
1.0.14

  Also, as far as I understand, that program allows to start notes only at 
block boundaries. This way it can ignore the timestamps of the incoming 
events. But this is crucial for me: I want to allow large blocksizes 
and thus I must allow notes to start anywhere inside a block.
  Now when I detect a buffer underrun on writing a block to an ALSA pcm 
sink, I like to know the time gap in order to adjust the timestamps of the 
incoming MIDI events.

My question in short is: Is there an example software synthesizer as 
simple as miniFMsynth, that works (on my machine), supports note start 
within a block and copes with buffer underruns in a reasonable way? If no 
working example, is there some documentation on how this is intended to 
work?


Thank you for your help
Henning

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-29 10:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-28 16:06 how to handle buffer underrun in a softsynth Henning Thielemann
2011-11-28 20:16 ` Clemens Ladisch
2011-11-29  8:39   ` Henning Thielemann
2011-11-29 10:46     ` Clemens Ladisch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.