--- 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);