Changeset 1972
- Timestamp:
- 04/05/11 05:48:58 (13 years ago)
- Files:
-
- trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp (modified) (5 diffs)
- trunk/libffado/src/libstreaming/generic/StreamProcessor.h (modified) (1 diff)
- trunk/libffado/src/libstreaming/rme/RmeReceiveStreamProcessor.cpp (modified) (3 diffs)
- trunk/libffado/src/libstreaming/rme/RmeTransmitStreamProcessor.cpp (modified) (1 diff)
- trunk/libffado/src/libstreaming/StreamProcessorManager.cpp (modified) (3 diffs)
- trunk/libffado/src/libstreaming/StreamProcessorManager.h (modified) (2 diffs)
- trunk/libffado/src/libutil/TimestampedBuffer.cpp (modified) (2 diffs)
- trunk/libffado/src/libutil/TimestampedBuffer.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp
r1965 r1972 76 76 , m_dll_bandwidth_hz ( STREAMPROCESSOR_DLL_BW_HZ ) 77 77 , m_extra_buffer_frames( 0 ) 78 , m_max_fs_diff_norm ( 0.01 ) 79 , m_max_diff_ticks ( 50 ) 78 80 , m_in_xrun( false ) 79 81 { … … 385 387 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "Nom fs: %12f, Instantanous fs: %12f, diff: %12f (%12f)\n", 386 388 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, 389 392 fs_nom, fs_syt, fs_diff, fs_diff_norm); 390 393 } … … 395 398 // values is more than 50 ticks. 1 sample at 48k is 512 ticks 396 399 // 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) { 398 401 debugOutput(DEBUG_LEVEL_VERBOSE, 399 402 "cy %04d rather large TSP difference TS=%011"PRIu64" => TS=%011"PRIu64" (%d, nom %d)\n", … … 703 706 // debugOutput(DEBUG_LEVEL_VERBOSE, "Diff fs: %12f, m_last_timestamp: %011"PRIu64", m_last_timestamp2: %011"PRIu64"\n", 704 707 // 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, 707 711 fs_nom, fs_syt, fs_diff, fs_diff_norm); 708 712 } … … 712 716 // values is more than 50 ticks. 1 sample at 48k is 512 ticks 713 717 // 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) { 715 719 debugOutput(DEBUG_LEVEL_VERBOSE, 716 720 "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 426 426 float m_dll_bandwidth_hz; 427 427 unsigned int m_extra_buffer_frames; 428 float m_max_fs_diff_norm; 429 signed int m_max_diff_ticks; 428 430 private: 429 431 bool m_in_xrun; trunk/libffado/src/libstreaming/rme/RmeReceiveStreamProcessor.cpp
r1967 r1972 136 136 // this value has been determined experimentally. 137 137 //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; 140 m_dll_bandwidth_hz = 0.25; 141 m_max_fs_diff_norm = 100.0; 142 m_max_diff_ticks = 30720; 143 m_data_buffer->setMaxAbsDiff(10000); 144 m_Parent.getDeviceManager().getStreamProcessorManager().setMaxDiffTicks(30720); 145 139 146 return true; 140 147 } … … 232 239 if (newts >= 128LL*TICKS_PER_SECOND) 233 240 newts -= 128LL*TICKS_PER_SECOND; 234 #if 1241 #if 0 235 242 // 3584 236 243 if (newts-m_last_timestamp > 4000) { … … 244 251 pkt_ctr_ticks, prevts, pkt_ctr_ticks-prevts); 245 252 #endif 246 m_last_timestamp = newts; 253 //m_last_timestamp = newts; 254 m_last_timestamp = pkt_ctr_ticks; 247 255 prevts = pkt_ctr_ticks; 248 256 trunk/libffado/src/libstreaming/rme/RmeTransmitStreamProcessor.cpp
r1966 r1972 563 563 { 564 564 debugOutput ( DEBUG_LEVEL_VERBOSE, "Preparing (%p)...\n", this ); 565 m_max_fs_diff_norm = 10.0; 566 m_max_diff_ticks = 30720; 567 565 568 // Unsure whether this helps yet. Testing continues. 566 569 m_dll_bandwidth_hz = 1.0; // 0.1; trunk/libffado/src/libstreaming/StreamProcessorManager.cpp
r1859 r1972 60 60 , m_nbperiods(0) 61 61 , m_WaitLock( new Util::PosixMutex("SPMWAIT") ) 62 , m_max_diff_ticks( 50 ) 62 63 { 63 64 addOption(Util::OptionContainer::Option("slaveMode",false)); … … 85 86 , m_nbperiods(0) 86 87 , m_WaitLock( new Util::PosixMutex("SPMWAIT") ) 88 , m_max_diff_ticks( 50 ) 87 89 { 88 90 addOption(Util::OptionContainer::Option("slaveMode",false)); … … 1270 1272 // values is more than 50 ticks. 1 sample at 48k is 512 ticks 1271 1273 // 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) { 1273 1275 debugOutput(DEBUG_LEVEL_VERBOSE, "rather large TSP difference TS=%011"PRIu64" => TS=%011"PRIu64" (%d, nom %d)\n", 1274 1276 m_time_of_transfer2, m_time_of_transfer, diff, ticks_per_period); trunk/libffado/src/libstreaming/StreamProcessorManager.h
r1763 r1972 100 100 {return m_nb_buffers;}; 101 101 102 void setMaxDiffTicks(signed int n) { m_max_diff_ticks = n; }; 103 102 104 // this is the amount of usecs we wait before an activity 103 105 // timeout occurs. … … 200 202 Util::Mutex *m_WaitLock; 201 203 204 signed int m_max_diff_ticks; 205 202 206 DECLARE_DEBUG_MODULE; 203 207 trunk/libffado/src/libutil/TimestampedBuffer.cpp
r1763 r1972 75 75 m_buffer_next_tail_timestamp(TIMESTAMP_MAX + 1.0), 76 76 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) 78 80 { 79 81 pthread_mutex_init(&m_framecounter_lock, NULL); … … 1036 1038 1037 1039 // 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; 1039 1041 1040 1042 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, trunk/libffado/src/libutil/TimestampedBuffer.h
r1763 r1972 93 93 virtual ~TimestampedBuffer(); 94 94 95 void setMaxAbsDiff ( unsigned int n ) { m_max_abs_diff = n; }; 96 95 97 bool writeDummyFrame(); 96 98 bool dropFrames ( unsigned int nbframes ); … … 205 207 float m_current_rate; 206 208 unsigned int m_update_period; 209 210 unsigned int m_max_abs_diff; 207 211 }; 208 212