Changeset 928

Show
Ignore:
Timestamp:
03/10/08 15:21:26 (16 years ago)
Author:
jwoithe
Message:

Fixed generation of silent headers for MOTU. Seems to improve shutdown reliability. Although this fix makes a slightly incorrect assumption (that every iso packet has audio data) it seems to be sufficient for correct operation.

Files:

Legend:

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

    r873 r928  
    141141        uint32_t last_sph = ntohl(*(quadlet_t *)(data+8+(n_events-1)*event_length)); 
    142142        m_last_timestamp = sphRecvToFullTicks(last_sph, m_Parent.get1394Service().getCycleTimer()); 
     143 
    143144        return eCRV_OK; 
    144145    } else { 
  • trunk/libffado/src/libstreaming/motu/MotuTransmitStreamProcessor.cpp

    r905 r928  
    337337 
    338338    // A "silent" packet is identical to a regular data packet except 
    339     // all audio data is set to zero.  Therefore we can just use 
    340     // generatePacketHeader() to do the work here. 
    341     return generatePacketHeader(data, length, tag, sy, cycle, dropped, max_length); 
     339    // all audio data is set to zero. 
     340 
     341    // The number of events per packet expected by the MOTU is solely 
     342    // dependent on the current sample rate.  An 'event' is one sample from 
     343    // all channels plus possibly other midi and control data. 
     344    signed n_events = getNominalFramesPerPacket(); 
     345 
     346    // Do housekeeping expected for all packets sent to the MOTU, even 
     347    // for packets containing no audio data. 
     348    *sy = 0x00; 
     349    *tag = 1;      // All MOTU packets have a CIP-like header 
     350 
     351    /* Assume the packet will have audio data.  This is not strictly valid 
     352     * but seems to work most of the time.  The MOTU data packets have 
     353     * either 8, 16 or 32 samples in them.  This is more than would normally 
     354     * be required in each cycle period and so every so often an empty 
     355     * packet must be sent to allow things to "catch up". 
     356     */ 
     357    *length = n_events*m_event_size + 8; 
     358 
     359    return eCRV_Packet; 
     360    //generatePacketHeader(data, length, tag, sy, cycle, dropped, max_length); 
    342361} 
    343362