Changeset 1965

Show
Ignore:
Timestamp:
03/11/11 07:32:51 (10 years ago)
Author:
jwoithe
Message:

- RME: further tweaks to the streaming system to make it more reliable (finally some progress is being made).
- Generic: reset timestamps in StreamProcessor::doDryRunning() in case the stream processor has previously been running (eg: before an xrun). Timestamps acquired during a previous run won't apply once the processor starts again. This change makes sense to me and helps xrun recovery on RME devices but there may be subtleties I don't see - so please double check the reasoning and behaviour with other interfaces.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp

    r1859 r1965  
    14861486            result &= m_data_buffer->clearBuffer(); 
    14871487            m_data_buffer->setTransparent(true); 
     1488            // If the stream has been running, clear the previous timestamps 
     1489            // as they won't be relevant after a restart 
     1490            m_last_timestamp = m_last_timestamp2 = 0; 
    14881491            break; 
    14891492        default: 
  • trunk/libffado/src/libstreaming/rme/RmeReceiveStreamProcessor.cpp

    r1953 r1965  
    192192            rxdll_e2 *= n_frames; 
    193193            rxdll_t1 = pkt_ctr_ticks + rxdll_e2; 
     194newts = pkt_ctr_ticks - rxdll_e2 - (0*3072); 
     195if (newts < 0) 
     196  newts += 128LL*TICKS_PER_SECOND; 
     197m_data_buffer->setBufferTailTimestamp(newts); 
    194198            newts = pkt_ctr_ticks; 
    195199//debugOutput(DEBUG_LEVEL_VERBOSE, "  INIT\n"); 
     
    203207 
    204208//newts += (6.0/7.00)*rxdll_e2; 
    205 newts -= (2*3072);  // Make there be some sort of latency 
     209newts -= (0*3072);  // Make there be some sort of latency 
    206210if (newts < 0) 
    207211  newts += 128LL*TICKS_PER_SECOND; 
     
    209213if (newts >= 128LL*TICKS_PER_SECOND) 
    210214  newts -= 128LL*TICKS_PER_SECOND; 
    211 #if 0 
     215#if 1 
    212216// 3584 
    213217if (newts-m_last_timestamp > 4000) { 
  • trunk/libffado/src/libstreaming/rme/RmeTransmitStreamProcessor.cpp

    r1943 r1965  
    408408//  if (cx < 255+64+10) { 
    409409//  if (cx < 255+(128+12)*n_events) { 
    410   if (cx < (128+12)*n_events) { 
     410  if (cx < (1)*n_events) { 
    411411    cx += n_events; 
    412412    *length = n_events * m_event_size; 
    413 m_last_timestamp = CYCLE_TIMER_TO_TICKS(pkt_ctr); 
     413//m_last_timestamp = CYCLE_TIMER_TO_TICKS(pkt_ctr); 
    414414//debugOutput(DEBUG_LEVEL_VERBOSE, "empty tx: %lld, ct=%08x (%03ld,%04ld,%04ld) len=%d\n", 
    415415//  m_last_timestamp, pkt_ctr, CYCLE_TIMER_GET_SECS(pkt_ctr), CYCLE_TIMER_GET_CYCLES(pkt_ctr), CYCLE_TIMER_GET_OFFSET(pkt_ctr), 
    416416//  *length); 
    417417  } 
     418//m_last_timestamp = -1; 
    418419} 
    419420//} else 
     
    421422#endif 
    422423//debugOutput(DEBUG_LEVEL_VERBOSE, "  txsize=%d\n", *length); 
     424//m_last_timestamp = CYCLE_TIMER_TO_TICKS(pkt_ctr); 
    423425    } 
    424426