Changeset 989

Show
Ignore:
Timestamp:
03/27/08 22:48:53 (16 years ago)
Author:
jwoithe
Message:

MOTU: yet more MIDI treaks. Thanks to Francois Ernoult for the extensive testing of the 828MkII in this regard.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libstreaming/motu/MotuReceiveStreamProcessor.cpp

    r988 r989  
    327327    // Get MIDI bytes if present in any frames within the packet.  MOTU MIDI 
    328328    // data is sent using a 3-byte sequence starting at the port's position.  
    329     // On no occasion has more than one MIDI data byte been observed in a 
    330     // single packet coming from a MOTU device.  This is fortunate given 
    331     // the alignment requirement imposed by the FFADO MIDI layer. 
     329    // Some MOTUs (eg: the 868MkII send more than one MIDI byte in some 
     330    // packets, so allow for this.  Because of the requirement by the FFADO 
     331    // MIDI layer to align MIDI data in multiples of 8 samples the buffer 
     332    // must be incremented by 8 samples after every byte.  This seems to 
     333    // work in some cases but is probably wrong in the case where there is 
     334    // more than one MIDI byte per packet since we have no guarantee that 
     335    // the buffer is larger than nevents samples.  This will need to be fixed, 
     336    // probably by using some of our own buffering. 
    332337    src = (unsigned char *)data + p->getPosition(); 
    333338    // We assume that the buffer has been set up in such a way that the first 
     
    339344            sample |= 0x01000000; // Flag MIDI byte as being present 
    340345            *buffer = sample; 
    341             // This packet's MIDI byte has been found so there's nothing 
    342             // more to do. 
    343             break; 
     346            buffer += 8; 
    344347        } 
    345348        j++;