Changeset 1528

Show
Ignore:
Timestamp:
03/29/09 08:09:27 (15 years ago)
Author:
ppalmers
Message:

cosmetic changes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libffado-2.0/src/libieee1394/cycletimer.h

    r1247 r1528  
    119119        if (x < 0) { 
    120120            debugWarning("insufficient wrapping: %lld\n",x); 
    121  
    122             debugWarning("correcting...\n"); 
    123             while (x < 0) { 
    124                 x += TICKS_PER_SECOND * 128L; 
    125  
    126                 if (x < 0) { 
    127                     debugWarning(" insufficient wrapping: %lld\n",x); 
    128                 } 
    129             } 
    130         } 
    131  
     121        } 
    132122#endif 
    133123 
  • branches/libffado-2.0/src/libieee1394/IsoHandler.cpp

    r1526 r1528  
    523523        #ifdef DEBUG 
    524524        if(skipped) { 
    525             debugOutput(DEBUG_LEVEL_VERBOSE, 
     525            debugOutput(DEBUG_LEVEL_VERY_VERBOSE, 
    526526                        "(%p) skipped %d cycles, cycle: %d, last_cycle: %d, dropped: %d\n",  
    527527                        this, skipped, cycle, m_last_cycle, dropped); 
  • branches/libffado-2.0/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp

    r1525 r1528  
    4545    , m_nb_audio_ports( 0 ) 
    4646    , m_nb_midi_ports( 0 ) 
    47  
    4847{} 
    4948 
  • branches/libffado-2.0/src/libstreaming/generic/StreamProcessor.cpp

    r1526 r1528  
    737737                           fs_nom, fs_syt, fs_diff, fs_diff_norm); 
    738738                } 
    739             } 
    740  
    741             int ticks_per_packet = (int)(getTicksPerFrame() * getNominalFramesPerPacket()); 
    742             int diff = diffTicks(m_last_timestamp, m_last_timestamp2); 
    743             // display message if the difference between two successive tick 
    744             // values is more than 50 ticks. 1 sample at 48k is 512 ticks 
    745             // so 50 ticks = 10%, which is a rather large jitter value. 
    746             if(diff-ticks_per_packet > 50 || diff-ticks_per_packet < -50) { 
    747                 debugOutput(DEBUG_LEVEL_VERBOSE, 
    748                             "cy %04d, rather large TSP difference TS=%011llu => TS=%011llu (%d, nom %d)\n", 
    749                             CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp2, 
    750                             m_last_timestamp, diff, ticks_per_packet); 
    751             } 
    752             debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    753                                "%04d %011llu %011llu %d %d\n", 
    754                                CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp2, 
    755                                m_last_timestamp, diff, ticks_per_packet); 
     739                int ticks_per_packet = (int)(getTicksPerFrame() * getNominalFramesPerPacket()); 
     740                int diff = diffTicks(m_last_timestamp, m_last_timestamp2); 
     741                // display message if the difference between two successive tick 
     742                // values is more than 50 ticks. 1 sample at 48k is 512 ticks 
     743                // so 50 ticks = 10%, which is a rather large jitter value. 
     744                if(diff-ticks_per_packet > 50 || diff-ticks_per_packet < -50) { 
     745                    debugOutput(DEBUG_LEVEL_VERBOSE, 
     746                                "cy %04d, rather large TSP difference TS=%011llu => TS=%011llu (%d, nom %d)\n", 
     747                                CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp2, 
     748                                m_last_timestamp, diff, ticks_per_packet); 
     749                } 
     750                debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
     751                                "%04d %011llu %011llu %d %d\n", 
     752                                CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp2, 
     753                                m_last_timestamp, diff, ticks_per_packet); 
     754            } 
    756755            #endif 
    757756 
     
    16071606            m_local_node_id = m_1394service.getLocalNodeId() & 0x3f; 
    16081607            m_data_buffer->setTransparent(false); 
     1608            m_last_timestamp2 = 0; // NOTE: no use in checking if we just started running 
    16091609            break; 
    16101610        default: 
  • branches/libffado-2.0/src/libstreaming/StreamProcessorManager.cpp

    r1452 r1528  
    4141 
    4242StreamProcessorManager::StreamProcessorManager(DeviceManager &p) 
    43     : m_is_slave( false ) 
     43    : m_time_of_transfer ( 0 ) 
     44    #ifdef DEBUG 
     45    , m_time_of_transfer2 ( 0 ) 
     46    #endif 
     47    , m_is_slave( false ) 
    4448    , m_SyncSource(NULL) 
    4549    , m_parent( p ) 
     
    6165StreamProcessorManager::StreamProcessorManager(DeviceManager &p, unsigned int period, 
    6266                                               unsigned int framerate, unsigned int nb_buffers) 
    63     : m_is_slave( false ) 
     67    : m_time_of_transfer ( 0 ) 
     68    #ifdef DEBUG 
     69    , m_time_of_transfer2 ( 0 ) 
     70    #endif 
     71    , m_is_slave( false ) 
    6472    , m_SyncSource(NULL) 
    6573    , m_parent( p ) 
     
    533541    //        1394 time 
    534542 
     543    float syncrate = 0.0; 
     544    float tpf = m_SyncSource->getTicksPerFrame(); 
     545    if (tpf > 0.0) { 
     546        syncrate = 24576000.0/tpf; 
     547    } else { 
     548        debugWarning("tpf <= 0? %f\n", tpf); 
     549    } 
     550    debugOutput( DEBUG_LEVEL_VERBOSE, " sync source frame rate: %f fps (%f tpf)\n", syncrate, tpf); 
     551 
    535552    // we now should have decent sync info on the sync source 
    536553    // determine a point in time where the system should start 
     
    555572        (unsigned int)TICKS_TO_OFFSET(time_of_first_sample)); 
    556573 
     574    #ifdef DEBUG 
     575    // the time at which the previous period would have passed is the 
     576    // time of the first sample received, minus one frame. 
     577    //m_time_of_transfer2 = substractTicks(time_of_first_sample, (uint64_t)m_SyncSource->getTicksPerFrame()); 
     578    m_time_of_transfer2 = time_of_first_sample; 
     579    #endif 
     580 
    557581    // we should start wet-running the transmit SP's some cycles in advance 
    558582    // such that we know it is wet-running when it should output its first sample 
    559     uint64_t time_to_start_xmit = substractTicks(time_of_first_sample,  
     583    uint64_t time_to_start_xmit = substractTicks(time_of_first_sample, 
    560584                                                 prestart_cycles_for_xmit * TICKS_PER_CYCLE); 
    561585 
     
    620644    // note: the SP's are scheduled to start in STREAMPROCESSORMANAGER_CYCLES_FOR_STARTUP cycles, 
    621645    // so a 20 times this value should be a good timeout 
    622     int cnt = cycles_for_startup * 20; // by then it should have started 
     646    //int cnt = cycles_for_startup * 20; // by then it should have started 
     647    // or maybe we just have to use 1 second, as this wraps the cycle counter 
     648    int cnt = 8000; 
    623649    while (!m_SyncSource->isRunning() && cnt) { 
    624650        SleepRelativeUsec(125); 
     
    635661    // and a (still very rough) approximation of the rate 
    636662    float rate = m_SyncSource->getTicksPerFrame(); 
    637     int64_t delay_in_ticks=(int64_t)(((float)((m_nb_buffers-1) * m_period)) * rate); 
     663    int64_t delay_in_ticks = (int64_t)(((float)((m_nb_buffers-1) * m_period)) * rate); 
    638664    // also add the sync delay 
    639     delay_in_ticks += m_SyncSource->getSyncDelay(); 
     665    delay_in_ticks = addTicks(delay_in_ticks, m_SyncSource->getSyncDelay()); 
    640666    debugOutput( DEBUG_LEVEL_VERBOSE, "  initial time of transfer %010lld, rate %f...\n", 
    641667                m_time_of_transfer, rate); 
     668 
    642669 
    643670    // then use this information to initialize the xmit handlers 
     
    10901117     
    10911118    #ifdef DEBUG 
    1092     static uint64_t m_time_of_transfer2 = m_time_of_transfer
     1119    int ticks_per_period = (int)(m_SyncSource->getTicksPerFrame() * m_period)
    10931120     
    1094     int ticks_per_period = (int)(m_SyncSource->getTicksPerFrame() * m_period); 
    1095     int diff=diffTicks(m_time_of_transfer, m_time_of_transfer2); 
     1121    int diff = diffTicks(m_time_of_transfer, m_time_of_transfer2); 
    10961122    // display message if the difference between two successive tick 
    10971123    // values is more than 50 ticks. 1 sample at 48k is 512 ticks 
  • branches/libffado-2.0/src/libstreaming/StreamProcessorManager.h

    r1452 r1528  
    141141    // for the transmit SP's 
    142142    uint64_t m_time_of_transfer; 
     143    #ifdef DEBUG 
     144    uint64_t m_time_of_transfer2; 
     145    #endif 
    143146 
    144147public: 
  • branches/libffado-2.0/src/libutil/Configuration.cpp

    r1525 r1528  
    6464                return false; 
    6565            } catch (ParseException& e) { 
    66                 debugOutput(DEBUG_LEVEL_VERBOSE, "Could not parse file: %s\n", filename.c_str()); 
     66                debugWarning("Could not parse file: %s\n", filename.c_str()); 
    6767                delete c; 
    6868                return false; 
    6969            } catch (...) { 
    70                 debugOutput(DEBUG_LEVEL_VERBOSE, "Unknown exception when opening file: %s\n", filename.c_str()); 
     70                debugWarning("Unknown exception when opening file: %s\n", filename.c_str()); 
    7171                delete c; 
    7272                return false;