Changeset 495

Show
Ignore:
Timestamp:
07/24/07 17:29:22 (15 years ago)
Author:
jwoithe
Message:

MOTU: more debugging aids.
TimestampedBuffer?: update internal DLL state when changing the tick offset to maintain consistency. Helps for MOTU, other interfaces need testing.

Files:

Legend:

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

    r494 r495  
    239239    int64_t timestamp = ts_head; 
    240240 
     241//debugOutput(DEBUG_LEVEL_VERBOSE,"tx cycle %d, base timestamp %lld\n",cycle, ts_head); 
    241242#if 0 
    242243if (cycle<10000) { 
     
    11561157            // to stop these warnings most of the time and allow for a 
    11571158            // smoother startup. 
    1158             m_data_buffer->setBufferTailTimestamp(ts); 
    1159 //            m_data_buffer->setBufferTailTimestamp(m_last_timestamp); 
     1159            // On second thoughts, perhaps it doesn't help much after all. 
     1160//            m_data_buffer->setBufferTailTimestamp(ts); 
     1161            m_data_buffer->setBufferTailTimestamp(m_last_timestamp); 
    11601162//debugOutput(DEBUG_LEVEL_VERBOSE,"%p, last ts=%lld, ts=%lld, lts2=%lld\n", m_data_buffer, m_last_timestamp, ts, m_last_timestamp2); 
    11611163 
     
    11641166 
    11651167        debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "put packet...\n"); 
    1166 //debugOutput(DEBUG_LEVEL_VERBOSE,"cycle=%d, mp=%d, last ts=%lld, ts2=%lld\n",cycle,m_period, m_last_timestamp, m_last_timestamp2); 
     1168//debugOutput(DEBUG_LEVEL_VERBOSE,"rx cycle=%d, last ts=%lld\n",cycle, m_last_timestamp); 
    11671169 
    11681170        //=> process the packet 
  • trunk/libffado/src/libutil/TimestampedBuffer.cpp

    r494 r495  
    204204bool TimestampedBuffer::setTickOffset(ffado_timestamp_t nticks) { 
    205205    debugOutput(DEBUG_LEVEL_VERBOSE,"Setting ticks offset to "TIMESTAMP_FORMAT_SPEC"\n",nticks); 
     206 
     207    // JMW: I think we need to update the internal DLL state to take account 
     208    // of the new offset.  Doing so certainly makes for a smoother MOTU 
     209    // startup. 
     210    pthread_mutex_lock(&m_framecounter_lock); 
     211    m_buffer_tail_timestamp = m_buffer_tail_timestamp - m_tick_offset + nticks; 
     212    m_buffer_next_tail_timestamp = (ffado_timestamp_t)((float)m_buffer_tail_timestamp + m_dll_e2); 
    206213    m_tick_offset=nticks; 
     214    pthread_mutex_unlock(&m_framecounter_lock); 
     215 
    207216    return true; 
    208217}