On Sun, 2006-04-16 at 20:16 +0200, Julien Claassen wrote:
> Hi all!
>   Just recently this started. When ever I connect fluidsynth (1.0.6 or 1.0.7)
> to my soundcard it says once something like:
> WARNING: alsamidi sequencer buffer overflow!
>  When I switch on my synth, which has active sensing), this message repeats
> over and over again. The sound works fine, but I can't read what's on the
> screen and that annoys me and makes things dificult.
>   My system:
>   Kernel 2.6.16.2 (alsa 1.0.11rc3?)
>   With kernel 2.6.11.8 it ran perfectly well. But now my soundcard's switched
> from port 64 to port 16.
>   Can anyone help me? Anyone with the same problem and a fix? Suspicions?
>   Kindest regards
>         Julien
> 
> --------
> Music was my first love and it will be my last (John Miles)
> 
> ======== FIND MY WEB-PROJECT AT: ========
> http://ltsb.sourceforge.net - the Linux TextBased Studio guide
> 

Hi Julien! :)

I added that when trying to make the ALSA sequencer more robust, guess
it doesn't work quite right though.  Here is a patch against 1.0.7a.
Let me know if you have any problems with it.  It should be applied from
the top level FluidSynth source directory like so:
patch -p0 <fluid_alsa.patch

Sorry for the annoyance ;)  Cheers!
        Josh Green

--- src/fluid_alsa.c.orig	2006-04-17 13:04:22.000000000 -0700
+++ src/fluid_alsa.c	2006-04-17 13:03:48.000000000 -0700
@@ -390,6 +390,7 @@
 	|| (state == SND_PCM_STATE_PAUSED)) {
       snd_pcm_drop(dev->pcm);
     }
+    snd_pcm_close (dev->pcm);
   }
 
   FLUID_FREE(dev);
@@ -901,8 +902,8 @@
     id = id_pid;
   }
 
-  /* open the sequencer INPUT only, non-blocking */
-  err = snd_seq_open(&dev->seq_handle, device, SND_SEQ_OPEN_INPUT, SND_SEQ_NONBLOCK);
+  /* open the sequencer INPUT only */
+  err = snd_seq_open(&dev->seq_handle, device, SND_SEQ_OPEN_INPUT, 0);
   if (err < 0) {
     FLUID_LOG(FLUID_ERR, "Error opening ALSA sequencer");
     goto error_recovery;
@@ -1134,17 +1135,12 @@
 	}
     }
 
-    if (n < 0)		/* Negative value indicates an error */
+    /* Negative value indicates an error, ignore interrupted system call
+       (-EPERM) and input event buffer overrun (-ENOSPC) */
+    if (n < 0 && n != -EPERM && n != -ENOSPC)
     {
-      if (n == -EPERM)		/* interrupted system call? */
-	;
-      else if (n != -ENOSPC)	/* input event buffer overrun? */
-	FLUID_LOG(FLUID_WARN, "ALSA sequencer buffer overrun, lost events");
-      else
-      {
 	FLUID_LOG(FLUID_ERR, "Error occured while reading ALSA sequencer events (code=%d)", n);
 	dev->status = FLUID_MIDI_DONE;
-      }
     }
   }
   pthread_exit(NULL);

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
fluid-dev mailing list
fluid-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/fluid-dev

Reply via email to