Changeset 918

Show
Ignore:
Timestamp:
03/08/08 08:08:13 (13 years ago)
Author:
ppalmers
Message:

fix bogus startup timestamp issue

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/config.h.in

    r916 r918  
    7373 
    7474#define STREAMPROCESSORMANAGER_CYCLES_FOR_DRYRUN            40000 
    75 #define STREAMPROCESSORMANAGER_CYCLES_FOR_STARTUP           2000 
     75#define STREAMPROCESSORMANAGER_CYCLES_FOR_STARTUP           200 
    7676#define STREAMPROCESSORMANAGER_PRESTART_CYCLES_FOR_XMIT     20 
    7777#define STREAMPROCESSORMANAGER_PRESTART_CYCLES_FOR_RECV     0 
  • trunk/libffado/src/libieee1394/CycleTimerHelper.cpp

    r915 r918  
    285285 
    286286        #ifdef DEBUG 
    287         if(usecs_late > 200) { 
     287        // makes no sense if not running realtime 
     288        if(m_realtime && usecs_late > 200) { 
    288289            debugOutput(DEBUG_LEVEL_VERBOSE, "Rather late wakeup: %lld usecs\n", usecs_late); 
    289290        } 
  • trunk/libffado/src/libieee1394/IsoHandlerManager.cpp

    r913 r918  
    110110IsoTask::Execute() 
    111111{ 
    112     debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Execute\n"); 
     112    debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
     113                       "(%p, %s) Execute\n", 
     114                       this, m_type==eTT_Transmit?"Transmit":"Receive"); 
    113115    int err; 
    114116    unsigned int i; 
     
    123125    // bypass if no handlers are registered 
    124126    if (m_poll_nfds_shadow == 0) { 
    125         debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "bypass iterate since no handlers to poll\n"); 
     127        debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
     128                           "(%p, %s) bypass iterate since no handlers to poll\n", 
     129                           this, m_type==eTT_Transmit?"Transmit":"Receive"); 
    126130        usleep(m_poll_timeout * 1000); 
    127131        return true; 
    128132    } 
     133 
     134    // FIXME: what can happen is that poll() returns, but not all clients are 
     135    // ready. there might be some busy waiting behavior that still has to be solved. 
    129136 
    130137    // setup the poll here 
  • trunk/libffado/src/libstreaming/StreamProcessorManager.cpp

    r907 r918  
    471471                } 
    472472            } 
     473 
     474            // we now set the buffer tail timestamp of the transmit buffer 
     475            // to the period transfer time instant plus what's nb_buffers - 1 
     476            // in ticks. This due to the fact that we (should) have received one period 
     477            // worth of ticks at t=m_time_of_transfer 
     478            // hence one period of frames should also have been transmitted, which means 
     479            // that there should be (nb_buffers - 1) * periodsize of frames in the xmit buffer 
     480            // that allows us to calculate the tail timestamp for the buffer. 
     481            float rate = m_SyncSource->getTicksPerFrame(); 
     482            int64_t delay_in_ticks=(int64_t)(((float)((m_nb_buffers-1) * m_period)) * rate); 
     483            int64_t transmit_tail_timestamp = addTicks(m_time_of_transfer, delay_in_ticks); 
     484 
     485            for ( StreamProcessorVectorIterator it = m_TransmitProcessors.begin(); 
     486                  it != m_TransmitProcessors.end(); 
     487                  ++it ) { 
     488                // m_time_of_transfer is set by waitForPeriod() 
     489                (*it)->setBufferTailTimestamp(transmit_tail_timestamp); 
     490            } 
     491 
    473492            if(!transferSilence()) { 
    474493                debugError("Could not transfer silence\n"); 
  • trunk/libffado/src/libutil/TimestampedBuffer.cpp

    r911 r918  
    751751    EXIT_CRITICAL_SECTION; 
    752752 
    753     debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE,  
     753    debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    754754                       "for (%p) to "TIMESTAMP_FORMAT_SPEC" => "TIMESTAMP_FORMAT_SPEC", " 
    755755                       "NTS="TIMESTAMP_FORMAT_SPEC", DLL2=%f, RATE=%f\n", 
    756756                       this, new_timestamp, ts, m_buffer_next_tail_timestamp, m_dll_e2, getRate()); 
    757  
    758757} 
    759758 
     
    933932    ffado_timestamp_t max_abs_diff = one_update_step * (1.0 + max_deviation);*/ 
    934933    ffado_timestamp_t max_abs_diff = 200; 
    935      
     934 
    936935    debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    937936                       " nbframes: %d, m_update_period: %d \n", 
     
    941940                       m_buffer_tail_timestamp, m_buffer_next_tail_timestamp); 
    942941    debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    943                        " new TS: "TIMESTAMP_FORMAT_SPEC", wrapped new TS: "TIMESTAMP_FORMAT_SPEC"\n",  
    944                        new_timestamp, new_timestamp); 
     942                       " new TS: "TIMESTAMP_FORMAT_SPEC", diff: "TIMESTAMP_FORMAT_SPEC"\n",  
     943                       new_timestamp, diff); 
    945944 
    946945    if (diff > max_abs_diff) {