Changeset 492

Show
Ignore:
Timestamp:
07/15/07 17:04:05 (16 years ago)
Author:
jwoithe
Message:

MOTU: more debugging. There's nothing really profound in these changes.

Files:

Legend:

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

    r491 r492  
    193193// These are just copied from AmdtpStreamProcessor.  At some point we should 
    194194// verify that they make sense for the MOTU. 
    195             ts_head = substractTicks(ts_head, TICKS_PER_CYCLE); 
     195//            ts_head = substractTicks(ts_head, TICKS_PER_CYCLE); 
    196196            // account for the number of cycles we are too late to enable 
    197197            ts_head = addTicks(ts_head, cycles_past_enable * TICKS_PER_CYCLE); 
    198198            // account for one extra packet of frames 
    199             ts_head = substractTicks(ts_head, 
    200               (uint32_t)((float)n_events * m_SyncSource->m_data_buffer->getRate()));  
     199//            ts_head = substractTicks(ts_head, 
     200//              (uint32_t)((float)n_events * m_SyncSource->m_data_buffer->getRate()));  
    201201 
    202202            m_data_buffer->setBufferTailTimestamp(ts_head); 
     
    269269    int32_t until_next=diffTicks(timestamp, cycle_timer + ticks_to_advance); 
    270270 
    271 until_next = (cycle >= TICKS_TO_CYCLES((uint32_t)timestamp))?-1:1; 
     271until_next = (cycle >= TICKS_TO_CYCLES(timestamp))?-1:1; 
    272272 
    273273    // Size of a single data frame in quadlets 
     
    335335 
    336336        *length = n_events*m_event_size + 8; 
    337  
    338         // convert the timestamp to Motu format 
    339         // I assume that it is in ticks, and wraps as the cycle timer 
    340         #warning syt conversion to be done 
    341337 
    342338        // FIXME: if we choose to read the buffer even during closedown, 
     
    511507    // allocate the internal buffer 
    512508    m_ticks_per_frame = (TICKS_PER_SECOND*1.0) / ((float)m_framerate); 
    513     unsigned int events_per_frame = m_framerate<=48000?8:(m_framerate<=96000?16:32); 
    514509 
    515510    assert(m_data_buffer); 
     511    // Note: terminology is slightly confused here.  From the point of view 
     512    // of the buffer the event size is the size of a single complete "event" 
     513    // in the MOTU datastream, which consists of one sample from each audio 
     514    // channel plus a timestamp and other control data.  Almost by 
     515    // definition then, the buffer's "events per frame" must be 1.  With 
     516    // these values, data copies to/from the MOTU data stream can be handled 
     517    // by the generic copying functions. 
    516518    m_data_buffer->setBufferSize(ringbuffer_size_frames); 
    517519    m_data_buffer->setEventSize(m_event_size);