Changeset 709

Show
Ignore:
Timestamp:
11/04/07 10:47:05 (13 years ago)
Author:
ppalmers
Message:

some more streaming system updates.
this works with the saffire up till -n2 -p256

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/ppalmers-streaming/src/libstreaming/amdtp/AmdtpStreamProcessor.cpp

    r707 r709  
    386386} 
    387387 
    388 int AmdtpTransmitStreamProcessor::getMinimalSyncDelay() { 
    389     return 0; 
    390 } 
    391  
    392388bool AmdtpTransmitStreamProcessor::prefill() { 
    393389 
     
    10361032} 
    10371033 
    1038 // returns the delay between the actual (real) time of a timestamp as received, 
    1039 // and the timestamp that is passed on for the same event. This is to cope with 
    1040 // ISO buffering 
    1041 int AmdtpReceiveStreamProcessor::getMinimalSyncDelay() { 
    1042     return ((int)(m_handler->getWakeupInterval() * m_syt_interval * getTicksPerFrame())); 
    1043 } 
    1044  
    10451034void AmdtpReceiveStreamProcessor::dumpInfo() { 
    10461035    StreamProcessor::dumpInfo(); 
  • branches/ppalmers-streaming/src/libstreaming/amdtp/AmdtpStreamProcessor.h

    r707 r709  
    109109    unsigned int getMaxPacketSize() {return 4 * (2 + m_syt_interval * m_dimension);}; 
    110110 
    111     int getMinimalSyncDelay(); 
    112  
    113111protected: 
    114112    bool processWriteBlock(char *data, unsigned int nevents, unsigned int offset); 
     
    197195 
    198196    void dumpInfo(); 
    199  
    200     int getMinimalSyncDelay(); 
    201  
    202197protected: 
    203198 
  • branches/ppalmers-streaming/src/libstreaming/generic/StreamProcessor.cpp

    r707 r709  
    179179 
    180180 
     181int StreamProcessor::getMaxFrameLatency() { 
     182    if (getType() == E_Receive) { 
     183        return (int)(m_handler->getWakeupInterval() * TICKS_PER_CYCLE); 
     184    } else { 
     185        return (int)(m_handler->getWakeupInterval() * TICKS_PER_CYCLE); 
     186    } 
     187} 
     188 
    181189bool StreamProcessor::isRunning() { 
    182190    return m_running; 
  • branches/ppalmers-streaming/src/libstreaming/generic/StreamProcessor.h

    r707 r709  
    214214 
    215215        /** 
    216          * Returns the minimal sync delay a SP needs 
    217          * @return minimal sync delay 
    218          */ 
    219         virtual int getMinimalSyncDelay() = 0; 
     216         * @brief get the maximal frame latency 
     217         * 
     218         * The maximum frame latency is the maximum time that will elapse 
     219         * between the frame being received by the 1394 stack, and the moment this 
     220         * frame is presented to the StreamProcessor.  
     221         * 
     222         * For transmit SP's this is the maximum time that a frame is requested by 
     223         * the handler ahead of the time the frame is intended to be transmitted. 
     224         * 
     225         * This is useful to figure out how longer than the actual reception time 
     226         * we have to wait before trying to read the frame from the SP. 
     227         * 
     228         * @return maximal frame latency 
     229         */ 
     230        virtual int getMaxFrameLatency(); 
    220231 
    221232        bool setSyncSource(StreamProcessor *s); 
  • branches/ppalmers-streaming/src/libstreaming/StreamProcessorManager.cpp

    r708 r709  
    320320    } 
    321321 
    322     // we want to make sure that everything is running well, 
    323     // so wait for a while 
    324 //     usleep(USECS_PER_CYCLE * CYCLES_TO_SLEEP_AFTER_RUN_SIGNAL); 
    325  
    326322    debugOutput( DEBUG_LEVEL_VERBOSE, " StreamProcessor streams running...\n"); 
    327323 
     324    // now find out how long we have to delay the wait operation such that 
     325    // the received frames will all be presented to the SP 
    328326    debugOutput( DEBUG_LEVEL_VERBOSE, "Finding minimal sync delay...\n"); 
    329  
    330327    int max_of_min_delay=0; 
    331328    int min_delay=0; 
     
    333330            it != m_ReceiveProcessors.end(); 
    334331            ++it ) { 
    335         min_delay=(*it)->getMinimalSyncDelay(); 
     332        min_delay=(*it)->getMaxFrameLatency(); 
    336333        if(min_delay>max_of_min_delay) max_of_min_delay=min_delay; 
    337334    } 
    338335 
    339     for ( StreamProcessorVectorIterator it = m_TransmitProcessors.begin(); 
    340             it != m_TransmitProcessors.end(); 
    341             ++it ) { 
    342         min_delay=(*it)->getMinimalSyncDelay(); 
    343         if(min_delay>max_of_min_delay) max_of_min_delay=min_delay; 
    344     } 
    345  
    346     debugOutput( DEBUG_LEVEL_VERBOSE, "  %d ticks\n", max_of_min_delay); 
     336    debugOutput( DEBUG_LEVEL_VERBOSE, "  %d ticks (%03us %04uc %04ut)...\n",  
     337        max_of_min_delay, 
     338        (unsigned int)TICKS_TO_SECS(max_of_min_delay), 
     339        (unsigned int)TICKS_TO_CYCLES(max_of_min_delay), 
     340        (unsigned int)TICKS_TO_OFFSET(max_of_min_delay)); 
    347341    m_SyncSource->setSyncDelay(max_of_min_delay); 
    348342