* [PATCH][2.2.x,2.4.x] OSS MIDI output loses data
@ 2002-11-28 12:10 Clemens Ladisch
0 siblings, 0 replies; only message in thread
From: Clemens Ladisch @ 2002-11-28 12:10 UTC (permalink / raw)
To: linux-sound
In the 2.1.6 kernel, the output loop in midi_poll() was changed to enable
interrupts during the outputc() call. Unfortunately, the check whether the
device has accepted the current byte ("ok") was moved behind the code
which removes the byte from the output queue, so one byte would be lost
every time the hardware FIFO is full.
--
Clemens
--- linux-2.4.19/drivers/sound/midibuf.c Wed Nov 27 12:34:56 2002
+++ linux/drivers/sound/midibuf.c Wed Nov 27 16:32:31 2002
@@ -129,15 +129,16 @@
for (dev = 0; dev < num_midis; dev++)
if (midi_devs[dev] != NULL && midi_out_buf[dev] != NULL)
{
- int ok = 1;
-
- while (DATA_AVAIL(midi_out_buf[dev]) && ok)
+ while (DATA_AVAIL(midi_out_buf[dev]))
{
+ int ok;
int c = midi_out_buf[dev]->queue[midi_out_buf[dev]->head];
restore_flags(flags); /* Give some time to others */
ok = midi_devs[dev]->outputc(dev, c);
cli();
+ if (!ok)
+ break;
midi_out_buf[dev]->head = (midi_out_buf[dev]->head + 1) % MAX_QUEUE_SIZE;
midi_out_buf[dev]->len--;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-11-28 12:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-28 12:10 [PATCH][2.2.x,2.4.x] OSS MIDI output loses data Clemens Ladisch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox