Changeset 498
- Timestamp:
- 07/26/07 16:09:57 (16 years ago)
- Files:
-
- trunk/libffado/src/libstreaming/cycletimer.h (modified) (1 diff)
- trunk/libffado/src/libstreaming/MotuStreamProcessor.cpp (modified) (5 diffs)
- trunk/libffado/src/libutil/TimestampedBuffer.cpp (modified) (1 diff)
- trunk/libffado/src/libutil/TimestampedBuffer.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/libstreaming/cycletimer.h
r494 r498 194 194 if(diff > max || diff < -max) { 195 195 debugWarning("difference does not make any sense\n"); 196 debugWarning("diff=%lld max=%l dd\n", diff, max);196 debugWarning("diff=%lld max=%lld\n", diff, max); 197 197 198 198 } trunk/libffado/src/libstreaming/MotuStreamProcessor.cpp
r497 r498 125 125 // we can get this thing synchronised. For now this seems to work. 126 126 int fc; 127 ffado_timestamp_t ts_head; 127 int64_t ts_head; 128 ffado_timestamp_t ts_tmp; 128 129 quadlet_t *quadlet = (quadlet_t *)data; 129 130 signed int i; … … 175 176 176 177 // initialize the buffer head & tail 177 m_SyncSource->m_data_buffer->getBufferHeadTimestamp(&ts_head, &fc); // thread safe 178 m_SyncSource->m_data_buffer->getBufferHeadTimestamp(&ts_tmp, &fc); // thread safe 179 ts_head = (int64_t)ts_tmp; 178 180 179 181 // the number of cycles the sync source lags (> 0) … … 235 237 236 238 // the base timestamp is the one of the next sample in the buffer 237 m_data_buffer->getBufferHeadTimestamp(&ts_ head, &fc); // thread safe238 239 m_data_buffer->getBufferHeadTimestamp(&ts_tmp, &fc); // thread safe 240 ts_head = (int64_t)ts_tmp; 239 241 int64_t timestamp = ts_head; 240 242 … … 257 259 // packet is sent, unless TRANSFER_DELAY > 3072. 258 260 // this means that we need at least one cycle of extra buffering. 259 uint64_t ticks_to_advance = TICKS_PER_CYCLE * TRANSMIT_ADVANCE_CYCLES;261 int64_t ticks_to_advance = TICKS_PER_CYCLE * TRANSMIT_ADVANCE_CYCLES; 260 262 261 263 // if cycle lies cycle_diff cycles in the future, we should 262 264 // queue this packet cycle_diff * TICKS_PER_CYCLE earlier than 263 265 // we would if it were to be sent immediately. 264 ticks_to_advance += cycle_diff * TICKS_PER_CYCLE;266 ticks_to_advance += (int64_t)cycle_diff * TICKS_PER_CYCLE; 265 267 266 268 // determine the 'now' time in ticks … … 268 270 269 271 // time until the packet is to be sent (if > 0: send packet) 272 //debugOutput(DEBUG_LEVEL_VERBOSE,"pre: timestamp=%lld, cycle_timer=%lld, adv=%lld, cdiff=%d\n", 273 // timestamp, cycle_timer,ticks_to_advance,cycle_diff); 270 274 int32_t until_next=diffTicks(timestamp, cycle_timer + ticks_to_advance); 275 //debugOutput(DEBUG_LEVEL_VERBOSE,"post\n"); 271 276 272 277 until_next = (cycle >= TICKS_TO_CYCLES(timestamp))?-1:1; trunk/libffado/src/libutil/TimestampedBuffer.cpp
r496 r498 915 915 m_buffer_tail_timestamp=m_buffer_next_tail_timestamp; 916 916 m_buffer_next_tail_timestamp += (ffado_timestamp_t)(m_dll_b * err + m_dll_e2); 917 // 918 // 917 // m_buffer_tail_timestamp=ts; 918 // m_buffer_next_tail_timestamp += (ffado_timestamp_t)(m_dll_b * err + m_dll_e2); 919 919 920 920 m_dll_e2 += m_dll_c*err; trunk/libffado/src/libutil/TimestampedBuffer.h
r494 r498 32 32 #include "libutil/ringbuffer.h" 33 33 34 typedef float ffado_timestamp_t; 34 //typedef float ffado_timestamp_t; 35 //#define TIMESTAMP_FORMAT_SPEC "%14.3f" 36 typedef double ffado_timestamp_t; 35 37 #define TIMESTAMP_FORMAT_SPEC "%14.3f" 36 38 // typedef int64_t ffado_timestamp_t;