Changeset 1981

Show
Ignore:
Timestamp:
04/16/11 07:41:26 (13 years ago)
Author:
jwoithe
Message:

When calculating the difference signal in the receive DLL, allow the actual and predicted timestamps to wrap at slightly different times. For most interfaces, the chances of hitting a problem without this allowance is extremely small since the DLL tracks the incoming timestamp tightly. However for RME devices the difference is grossly miscalculated at every wraparound without this fix due to the way the timestamp is synthesised for these devices.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libutil/TimestampedBuffer.cpp

    r1972 r1981  
    10351035    ffado_timestamp_t diff = new_timestamp - m_buffer_next_tail_timestamp; 
    10361036 
     1037    // correct for when new_timestamp doesn't wrap at the same time as 
     1038    // m_buffer_next_tail_timestamp 
     1039    if (diff > m_wrap_at/2) 
     1040      diff = m_wrap_at - diff; 
     1041    else 
     1042    if (diff < -m_wrap_at/2) 
     1043      diff = m_wrap_at + diff; 
    10371044#ifdef DEBUG 
    10381045