Changeset 1529
- Timestamp:
- 03/29/09 09:39:37 (14 years ago)
- Files:
-
- branches/libffado-2.0/config.h.in (modified) (1 diff)
- branches/libffado-2.0/src/libstreaming/generic/StreamProcessor.cpp (modified) (3 diffs)
- branches/libffado-2.0/src/libutil/TimestampedBuffer.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/libffado-2.0/config.h.in
r1525 r1529 206 206 #define STREAMPROCESSORMANAGER_DYNAMIC_SYNC_DELAY 0 207 207 208 // the default bandwidth of the stream processor timestamp DLL 208 // the default bandwidth of the stream processor timestamp DLL when synchronizing (should be fast) 209 #define STREAMPROCESSOR_DLL_FAST_BW_HZ 5.0 210 // the default bandwidth of the stream processor timestamp DLL when streaming 209 211 #define STREAMPROCESSOR_DLL_BW_HZ 0.1 210 212 branches/libffado-2.0/src/libstreaming/generic/StreamProcessor.cpp
r1528 r1529 529 529 return RAW1394_ISO_DEFER; 530 530 } else if(result2 == eCRV_OK) { 531 // no problem here532 // FIXME: cache the period size?533 unsigned int periodsize = m_StreamProcessorManager.getPeriodSize();534 unsigned int bufferfill = m_data_buffer->getBufferFill();535 if(bufferfill >= periodsize) {536 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "signal activity, %d>%d\n",537 bufferfill, periodsize);538 //SIGNAL_ACTIVITY_SPM;539 return RAW1394_ISO_DEFER; // FIXME: might not be needed540 }541 531 return RAW1394_ISO_OK; 542 532 } else { … … 1408 1398 result &= m_data_buffer->setNominalRate(ticks_per_frame); 1409 1399 result &= m_data_buffer->setWrapValue(128L*TICKS_PER_SECOND); 1410 result &= m_data_buffer->setBandwidth( m_dll_bandwidth_hz/ (double)TICKS_PER_SECOND);1400 result &= m_data_buffer->setBandwidth(STREAMPROCESSOR_DLL_FAST_BW_HZ / (double)TICKS_PER_SECOND); 1411 1401 result &= m_data_buffer->prepare(); // FIXME: the name 1412 1402 … … 1605 1595 m_in_xrun = false; 1606 1596 m_local_node_id = m_1394service.getLocalNodeId() & 0x3f; 1597 // reduce the DLL bandwidth to what we require 1598 result &= m_data_buffer->setBandwidth(m_dll_bandwidth_hz / (double)TICKS_PER_SECOND); 1599 // enable the data buffer 1607 1600 m_data_buffer->setTransparent(false); 1608 1601 m_last_timestamp2 = 0; // NOTE: no use in checking if we just started running branches/libffado-2.0/src/libutil/TimestampedBuffer.cpp
r1525 r1529 101 101 double bw_rel = bw * tupdate; 102 102 if(bw_rel >= 0.5) { 103 debugError("Requested bandwidth out of range: %f > %f\n", bw, 0.5 *tupdate);103 debugError("Requested bandwidth out of range: %f > %f\n", bw, 0.5 / tupdate); 104 104 return false; 105 105 } 106 ENTER_CRITICAL_SECTION; 106 107 m_dll_b = bw_rel * (DLL_SQRT2 * DLL_2PI); 107 108 m_dll_c = bw_rel * bw_rel * DLL_2PI * DLL_2PI; 109 EXIT_CRITICAL_SECTION; 108 110 return true; 109 111 } … … 460 462 // while disabled, we don't update the DLL, nor do we write frames 461 463 // we just set the correct timestamp for the frames 464 incrementFrameCounter(nframes, ts); 465 decrementFrameCounter(nframes); 462 466 setBufferTailTimestamp(ts); 463 467 } else { … … 793 797 794 798 // add the offsets 795 ffado_timestamp_t ts =new_timestamp;799 ffado_timestamp_t ts = new_timestamp; 796 800 797 801 if (ts >= m_wrap_at) { … … 814 818 m_buffer_tail_timestamp = ts; 815 819 816 m_dll_e2 =m_update_period * (double)m_nominal_rate;820 m_dll_e2 = m_update_period * (double)m_current_rate; 817 821 m_buffer_next_tail_timestamp = (ffado_timestamp_t)((double)m_buffer_tail_timestamp + m_dll_e2); 818 822 … … 1101 1105 debugOutputShort( DEBUG_LEVEL_NORMAL, " Head - Tail : "TIMESTAMP_FORMAT_SPEC"\n", diff); 1102 1106 debugOutputShort( DEBUG_LEVEL_NORMAL, " DLL Rate : %f (%f)\n", m_dll_e2, m_dll_e2/m_update_period); 1107 debugOutputShort( DEBUG_LEVEL_NORMAL, " DLL Bandwidth : %10e 1/ticks (%f Hz)\n", getBandwidth(), getBandwidth() * TICKS_PER_SECOND); 1103 1108 } 1104 1109