Changeset 498

Show
Ignore:
Timestamp:
07/26/07 16:09:57 (16 years ago)
Author:
jwoithe
Message:

MOTU: more debugging and tweaks.
TimestampedBuffer?: ffado_timestamp_t changed to double for now - MOTU needs the extra precision.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libstreaming/cycletimer.h

    r494 r498  
    194194    if(diff > max || diff < -max) { 
    195195        debugWarning("difference does not make any sense\n"); 
    196         debugWarning("diff=%lld max=%ldd\n", diff, max); 
     196        debugWarning("diff=%lld max=%lld\n", diff, max); 
    197197         
    198198    } 
  • trunk/libffado/src/libstreaming/MotuStreamProcessor.cpp

    r497 r498  
    125125// we can get this thing synchronised.  For now this seems to work. 
    126126    int fc; 
    127     ffado_timestamp_t ts_head; 
     127    int64_t ts_head; 
     128    ffado_timestamp_t ts_tmp; 
    128129    quadlet_t *quadlet = (quadlet_t *)data; 
    129130    signed int i; 
     
    175176 
    176177            // initialize the buffer head & tail 
    177             m_SyncSource->m_data_buffer->getBufferHeadTimestamp(&ts_head, &fc); // thread safe 
     178            m_SyncSource->m_data_buffer->getBufferHeadTimestamp(&ts_tmp, &fc); // thread safe 
     179            ts_head = (int64_t)ts_tmp; 
    178180 
    179181            // the number of cycles the sync source lags (> 0) 
     
    235237 
    236238    // the base timestamp is the one of the next sample in the buffer 
    237     m_data_buffer->getBufferHeadTimestamp(&ts_head, &fc); // thread safe 
    238  
     239    m_data_buffer->getBufferHeadTimestamp(&ts_tmp, &fc); // thread safe 
     240    ts_head = (int64_t)ts_tmp; 
    239241    int64_t timestamp = ts_head; 
    240242 
     
    257259    // packet is sent, unless TRANSFER_DELAY > 3072. 
    258260    // this means that we need at least one cycle of extra buffering. 
    259     uint64_t ticks_to_advance = TICKS_PER_CYCLE * TRANSMIT_ADVANCE_CYCLES; 
     261    int64_t ticks_to_advance = TICKS_PER_CYCLE * TRANSMIT_ADVANCE_CYCLES; 
    260262 
    261263    // if cycle lies cycle_diff cycles in the future, we should 
    262264    // queue this packet cycle_diff * TICKS_PER_CYCLE earlier than 
    263265    // we would if it were to be sent immediately. 
    264     ticks_to_advance += cycle_diff * TICKS_PER_CYCLE; 
     266    ticks_to_advance += (int64_t)cycle_diff * TICKS_PER_CYCLE; 
    265267 
    266268    // determine the 'now' time in ticks 
     
    268270 
    269271    // time until the packet is to be sent (if > 0: send packet) 
     272//debugOutput(DEBUG_LEVEL_VERBOSE,"pre: timestamp=%lld, cycle_timer=%lld, adv=%lld, cdiff=%d\n", 
     273// timestamp, cycle_timer,ticks_to_advance,cycle_diff); 
    270274    int32_t until_next=diffTicks(timestamp, cycle_timer + ticks_to_advance); 
     275//debugOutput(DEBUG_LEVEL_VERBOSE,"post\n"); 
    271276 
    272277until_next = (cycle >= TICKS_TO_CYCLES(timestamp))?-1:1; 
  • trunk/libffado/src/libutil/TimestampedBuffer.cpp

    r496 r498  
    915915    m_buffer_tail_timestamp=m_buffer_next_tail_timestamp; 
    916916    m_buffer_next_tail_timestamp += (ffado_timestamp_t)(m_dll_b * err + m_dll_e2); 
    917 //    m_buffer_tail_timestamp=ts; 
    918 //    m_buffer_next_tail_timestamp += (ffado_timestamp_t)(m_dll_b * err + m_dll_e2); 
     917//    m_buffer_tail_timestamp=ts; 
     918//    m_buffer_next_tail_timestamp += (ffado_timestamp_t)(m_dll_b * err + m_dll_e2); 
    919919     
    920920    m_dll_e2 += m_dll_c*err; 
  • trunk/libffado/src/libutil/TimestampedBuffer.h

    r494 r498  
    3232#include "libutil/ringbuffer.h" 
    3333 
    34 typedef float ffado_timestamp_t; 
     34//typedef float ffado_timestamp_t; 
     35//#define TIMESTAMP_FORMAT_SPEC "%14.3f" 
     36typedef double ffado_timestamp_t; 
    3537#define TIMESTAMP_FORMAT_SPEC "%14.3f" 
    3638// typedef int64_t ffado_timestamp_t;