Changeset 1972

Show
Ignore:
Timestamp:
04/05/11 05:48:58 (13 years ago)
Author:
jwoithe
Message:

- Parameterise selected low-level error detection thresholds. The default values are those which have been used up to now, so no functional changes should result from this.
- RME: attempt to use the main DLL without a smoothing DLL in front of it since this may track the current timestamp better. Broaden various lower level error thresholds of RME objects accordingly. Testing continues.

Files:

Legend:

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

    r1965 r1972  
    7676    , m_dll_bandwidth_hz ( STREAMPROCESSOR_DLL_BW_HZ ) 
    7777    , m_extra_buffer_frames( 0 ) 
     78    , m_max_fs_diff_norm ( 0.01 ) 
     79    , m_max_diff_ticks ( 50 ) 
    7880    , m_in_xrun( false ) 
    7981{ 
     
    385387            debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "Nom fs: %12f, Instantanous fs: %12f, diff: %12f (%12f)\n", 
    386388                        fs_nom, fs_syt, fs_diff, fs_diff_norm); 
    387             if (fs_diff_norm > 0.01 || fs_diff_norm < -0.01) { 
    388                 debugWarning( "Instantanous samplerate more than 1%% off nominal. [Nom fs: %12f, Instantanous fs: %12f, diff: %12f (%12f)]\n", 
     389            if (fs_diff_norm > m_max_fs_diff_norm || fs_diff_norm < -m_max_fs_diff_norm) { 
     390                debugWarning( "Instantanous samplerate more than %0.0f%% off nominal. [Nom fs: %12f, Instantanous fs: %12f, diff: %12f (%12f)]\n", 
     391                        m_max_fs_diff_norm*100, 
    389392                        fs_nom, fs_syt, fs_diff, fs_diff_norm); 
    390393            } 
     
    395398                // values is more than 50 ticks. 1 sample at 48k is 512 ticks 
    396399                // so 50 ticks = 10%, which is a rather large jitter value. 
    397                 if(diff-ticks_per_packet > 50 || diff-ticks_per_packet < -50) { 
     400                if(diff-ticks_per_packet > m_max_diff_ticks || diff-ticks_per_packet < -m_max_diff_ticks) { 
    398401                    debugOutput(DEBUG_LEVEL_VERBOSE, 
    399402                                "cy %04d rather large TSP difference TS=%011"PRIu64" => TS=%011"PRIu64" (%d, nom %d)\n", 
     
    703706//                 debugOutput(DEBUG_LEVEL_VERBOSE, "Diff fs: %12f, m_last_timestamp: %011"PRIu64", m_last_timestamp2: %011"PRIu64"\n", 
    704707//                            fs_diff, m_last_timestamp, m_last_timestamp2); 
    705                 if (fs_diff_norm > 0.01 || fs_diff_norm < -0.01) { 
    706                     debugWarning( "Instantanous samplerate more than 1%% off nominal. [Nom fs: %12f, Instantanous fs: %12f, diff: %12f (%12f)]\n", 
     708                if (fs_diff_norm > m_max_fs_diff_norm || fs_diff_norm < -m_max_fs_diff_norm) { 
     709                    debugWarning( "Instantanous samplerate more than %0.0f%% off nominal. [Nom fs: %12f, Instantanous fs: %12f, diff: %12f (%12f)]\n", 
     710                           m_max_fs_diff_norm*100, 
    707711                           fs_nom, fs_syt, fs_diff, fs_diff_norm); 
    708712                } 
     
    712716                // values is more than 50 ticks. 1 sample at 48k is 512 ticks 
    713717                // so 50 ticks = 10%, which is a rather large jitter value. 
    714                 if(diff-ticks_per_packet > 50 || diff-ticks_per_packet < -50) { 
     718                if(diff-ticks_per_packet > m_max_diff_ticks || diff-ticks_per_packet < -m_max_diff_ticks) { 
    715719                    debugOutput(DEBUG_LEVEL_VERBOSE, 
    716720                                "cy %04d, rather large TSP difference TS=%011"PRIu64" => TS=%011"PRIu64" (%d, nom %d)\n", 
  • trunk/libffado/src/libstreaming/generic/StreamProcessor.h

    r1947 r1972  
    426426        float m_dll_bandwidth_hz; 
    427427        unsigned int m_extra_buffer_frames; 
     428        float m_max_fs_diff_norm; 
     429        signed int m_max_diff_ticks; 
    428430    private: 
    429431        bool m_in_xrun; 
  • trunk/libffado/src/libstreaming/rme/RmeReceiveStreamProcessor.cpp

    r1967 r1972  
    136136// this value has been determined experimentally. 
    137137//m_dll_bandwidth_hz = 10.0; 
    138 m_dll_bandwidth_hz = 3.0; 
     138//m_dll_bandwidth_hz = 3.0; 
     139////m_dll_bandwidth_hz = 1.0; 
     140m_dll_bandwidth_hz = 0.25; 
     141m_max_fs_diff_norm = 100.0; 
     142m_max_diff_ticks = 30720; 
     143m_data_buffer->setMaxAbsDiff(10000); 
     144m_Parent.getDeviceManager().getStreamProcessorManager().setMaxDiffTicks(30720); 
     145 
    139146    return true; 
    140147} 
     
    232239if (newts >= 128LL*TICKS_PER_SECOND) 
    233240  newts -= 128LL*TICKS_PER_SECOND; 
    234 #if 1 
     241#if 0 
    235242// 3584 
    236243if (newts-m_last_timestamp > 4000) { 
     
    244251  pkt_ctr_ticks, prevts, pkt_ctr_ticks-prevts); 
    245252#endif 
    246 m_last_timestamp = newts; 
     253//m_last_timestamp = newts; 
     254m_last_timestamp = pkt_ctr_ticks; 
    247255prevts = pkt_ctr_ticks; 
    248256 
  • trunk/libffado/src/libstreaming/rme/RmeTransmitStreamProcessor.cpp

    r1966 r1972  
    563563{ 
    564564    debugOutput ( DEBUG_LEVEL_VERBOSE, "Preparing (%p)...\n", this ); 
     565    m_max_fs_diff_norm = 10.0; 
     566    m_max_diff_ticks = 30720; 
     567 
    565568// Unsure whether this helps yet.  Testing continues. 
    566569m_dll_bandwidth_hz = 1.0; // 0.1; 
  • trunk/libffado/src/libstreaming/StreamProcessorManager.cpp

    r1859 r1972  
    6060    , m_nbperiods(0) 
    6161    , m_WaitLock( new Util::PosixMutex("SPMWAIT") ) 
     62    , m_max_diff_ticks( 50 )  
    6263{ 
    6364    addOption(Util::OptionContainer::Option("slaveMode",false)); 
     
    8586    , m_nbperiods(0) 
    8687    , m_WaitLock( new Util::PosixMutex("SPMWAIT") ) 
     88    , m_max_diff_ticks( 50 ) 
    8789{ 
    8890    addOption(Util::OptionContainer::Option("slaveMode",false)); 
     
    12701272    // values is more than 50 ticks. 1 sample at 48k is 512 ticks 
    12711273    // so 50 ticks = 10%, which is a rather large jitter value. 
    1272     if(diff-ticks_per_period > 50 || diff-ticks_per_period < -50) { 
     1274    if(diff-ticks_per_period > m_max_diff_ticks || diff-ticks_per_period < -m_max_diff_ticks) { 
    12731275        debugOutput(DEBUG_LEVEL_VERBOSE, "rather large TSP difference TS=%011"PRIu64" => TS=%011"PRIu64" (%d, nom %d)\n", 
    12741276                                            m_time_of_transfer2, m_time_of_transfer, diff, ticks_per_period); 
  • trunk/libffado/src/libstreaming/StreamProcessorManager.h

    r1763 r1972  
    100100            {return m_nb_buffers;}; 
    101101 
     102    void setMaxDiffTicks(signed int n) { m_max_diff_ticks = n; }; 
     103 
    102104    // this is the amount of usecs we wait before an activity 
    103105    // timeout occurs. 
     
    200202    Util::Mutex *m_WaitLock; 
    201203 
     204    signed int m_max_diff_ticks; 
     205 
    202206    DECLARE_DEBUG_MODULE; 
    203207 
  • trunk/libffado/src/libutil/TimestampedBuffer.cpp

    r1763 r1972  
    7575      m_buffer_next_tail_timestamp(TIMESTAMP_MAX + 1.0), 
    7676      m_dll_e2(0.0), m_dll_b(DLL_COEFF_B), m_dll_c(DLL_COEFF_C), 
    77       m_nominal_rate(0.0), m_current_rate(0.0), m_update_period(0) 
     77      m_nominal_rate(0.0), m_current_rate(0.0), m_update_period(0), 
     78      // half a cycle is what we consider 'normal' 
     79      m_max_abs_diff(3072/2) 
    7880{ 
    7981    pthread_mutex_init(&m_framecounter_lock, NULL); 
     
    10361038 
    10371039    // check whether the update is within the allowed bounds 
    1038     ffado_timestamp_t max_abs_diff = 3072/2; // half a cycle is what we consider 'normal' 
     1040    ffado_timestamp_t max_abs_diff = m_max_abs_diff; 
    10391041 
    10401042    debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
  • trunk/libffado/src/libutil/TimestampedBuffer.h

    r1763 r1972  
    9393        virtual ~TimestampedBuffer(); 
    9494 
     95        void setMaxAbsDiff ( unsigned int n ) { m_max_abs_diff = n; }; 
     96 
    9597        bool writeDummyFrame(); 
    9698        bool dropFrames ( unsigned int nbframes ); 
     
    205207        float m_current_rate; 
    206208        unsigned int m_update_period; 
     209 
     210        unsigned int m_max_abs_diff; 
    207211}; 
    208212