Changeset 425

Show
Ignore:
Timestamp:
02/27/07 19:15:25 (14 years ago)
Author:
jwoithe
Message:

MOTU: more fixes to the new streaming code for MOTU. Rx shows promise but TX is still broken.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/streaming-rework/config.h.in

    r412 r425  
    8484#undef const 
    8585 
    86 /* Define to `unsigned' if <sys/types.h> does not define. */ 
     86/* Define to `unsigned int' if <sys/types.h> does not define. */ 
    8787#undef size_t 
    8888 
  • branches/streaming-rework/src/libstreaming/MotuStreamProcessor.cpp

    r419 r425  
    409409 
    410410    // allocate the internal buffer 
    411     float ticks_per_frame = (TICKS_PER_SECOND*1.0) / ((float)m_framerate); 
     411    m_ticks_per_frame = (TICKS_PER_SECOND*1.0) / ((float)m_framerate); 
    412412        unsigned int events_per_frame = m_framerate<=48000?8:(m_framerate<=96000?16:32); 
    413413 
    414414    assert(m_data_buffer);     
    415415    m_data_buffer->setBufferSize(ringbuffer_size_frames); 
    416     m_data_buffer->setEventSize(m_event_size/events_per_frame); 
    417     m_data_buffer->setEventsPerFrame(events_per_frame); 
     416    m_data_buffer->setEventSize(m_event_size); 
     417    m_data_buffer->setEventsPerFrame(1); 
    418418     
    419419    m_data_buffer->setUpdatePeriod(m_period); 
    420     m_data_buffer->setNominalRate(ticks_per_frame); 
     420    m_data_buffer->setNominalRate(m_ticks_per_frame); 
    421421     
    422422    // FIXME: check if the timestamp wraps at one second 
     
    919919            m_data_buffer->setBufferTailTimestamp(m_last_timestamp2); 
    920920 
     921debugOutput(DEBUG_LEVEL_VERBOSE,"On enable: last ts2=%lld\n",m_last_timestamp2); 
    921922        } else { 
    922923            debugOutput(DEBUG_LEVEL_VERY_VERBOSE, 
     
    989990            // set the timestamp as if there will be a sample put into 
    990991            // the buffer by the next packet. 
     992if (ts > TICKS_PER_SECOND) 
     993  ts -= TICKS_PER_SECOND; 
    991994            m_data_buffer->setBufferTailTimestamp(ts); 
     995debugOutput(DEBUG_LEVEL_VERBOSE,"%p, last ts=%lld, ts=%lld, lts2=%lld\n", m_data_buffer, m_last_timestamp, ts, m_last_timestamp2); 
    992996             
    993997            return RAW1394_ISO_DEFER; 
     
    995999 
    9961000                debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "put packet...\n"); 
     1001debugOutput(DEBUG_LEVEL_VERBOSE,"enabled: %p, last ts=%lld, ts2=%lld\n",m_data_buffer, m_last_timestamp, m_last_timestamp2); 
    9971002 
    9981003        //=> process the packet 
     
    10741079     
    10751080    // prepare the framerate estimate 
    1076     float ticks_per_frame = (TICKS_PER_SECOND*1.0) / ((float)m_framerate); 
     1081    m_ticks_per_frame = (TICKS_PER_SECOND*1.0) / ((float)m_framerate); 
    10771082         
    10781083        // initialize internal buffer 
     
    10831088    assert(m_data_buffer);     
    10841089    m_data_buffer->setBufferSize(ringbuffer_size_frames); 
    1085     m_data_buffer->setEventSize(m_event_size/events_per_frame); 
    1086     m_data_buffer->setEventsPerFrame(events_per_frame);  
    1087      
    1088     m_data_buffer->setUpdatePeriod(m_period); 
    1089     m_data_buffer->setNominalRate(ticks_per_frame); 
     1090    m_data_buffer->setEventSize(m_event_size); 
     1091    m_data_buffer->setEventsPerFrame(1);         
     1092     
     1093// JMW: The rx buffer receives a new timestamp once per received frame so I think the 
     1094// buffer update period is events_per_frame, not events per period. 
     1095//    m_data_buffer->setUpdatePeriod(m_period); 
     1096    m_data_buffer->setUpdatePeriod(events_per_frame); 
     1097    m_data_buffer->setNominalRate(m_ticks_per_frame); 
    10901098     
    10911099    m_data_buffer->setWrapValue(TICKS_PER_SECOND);