lkml.org 
[lkml]   [1999]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subjectes1371 midi_read patch
    When doing a read() call on /dev/midi using the es1371 driver, the driver
    waits for the entire buffer you specify to be filled. Well, this basically
    defeats the purpose of realtime midi input unless you poll it with a
    one-byte buffer.

    Attached is a quick fix. I haven't even looked at the 1370 driver, but a
    similar patch might apply there.

    -Andy

    --- /usr/src/linux/drivers/sound/es1371.c Mon Apr 12 18:18:27 1999
    +++ es1371.c Thu Sep 2 12:35:09 1999
    @@ -2468,7 +2468,7 @@
    if (!access_ok(VERIFY_WRITE, buffer, count))
    return -EFAULT;
    ret = 0;
    - while (count > 0) {
    +read_more:
    spin_lock_irqsave(&s->lock, flags);
    ptr = s->midi.ird;
    cnt = MIDIINBUF - ptr;
    @@ -2483,7 +2483,7 @@
    interruptible_sleep_on(&s->midi.iwait);
    if (signal_pending(current))
    return ret ? ret : -ERESTARTSYS;
    - continue;
    + goto read_more;
    }
    if (copy_to_user(buffer, s->midi.ibuf + ptr, cnt))
    return ret ? ret : -EFAULT;
    @@ -2495,7 +2495,6 @@
    count -= cnt;
    buffer += cnt;
    ret += cnt;
    - }
    return ret;
    }
    \
     
     \ /
      Last update: 2005-03-22 13:53    [W:0.019 / U:29.348 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site