Changeset 411
- Timestamp:
- 02/21/07 14:25:53 (17 years ago)
- Files:
-
- branches/streaming-rework/src/libfreebobavc/ieee1394service.cpp (modified) (7 diffs)
- branches/streaming-rework/src/libstreaming/AmdtpStreamProcessor.cpp (modified) (17 diffs)
- branches/streaming-rework/src/libstreaming/cycletimer.h (modified) (6 diffs)
- branches/streaming-rework/src/libstreaming/MotuStreamProcessor.cpp (modified) (7 diffs)
- branches/streaming-rework/src/libstreaming/StreamProcessor.cpp (modified) (2 diffs)
- branches/streaming-rework/src/libstreaming/StreamProcessor.h (modified) (3 diffs)
- branches/streaming-rework/src/libstreaming/StreamProcessorManager.cpp (modified) (8 diffs)
- branches/streaming-rework/src/libutil/TimestampedBuffer.cpp (modified) (2 diffs)
- branches/streaming-rework/tests/test-cycletimer.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/streaming-rework/src/libfreebobavc/ieee1394service.cpp
r408 r411 1 1 /* ieee1394service.cpp 2 2 * Copyright (C) 2005,07 by Daniel Wagner 3 * Copyright (C) 2007 by Pieter Palmers 3 4 * 4 5 * This file is part of FreeBoB. … … 32 33 #include <iomanip> 33 34 34 IMPL_DEBUG_MODULE( Ieee1394Service, Ieee1394Service, DEBUG_LEVEL_ NORMAL);35 IMPL_DEBUG_MODULE( Ieee1394Service, Ieee1394Service, DEBUG_LEVEL_VERBOSE ); 35 36 36 37 Ieee1394Service::Ieee1394Service() … … 379 380 */ 380 381 signed int Ieee1394Service::allocateIsoChannelGeneric(unsigned int bandwidth) { 382 debugOutput(DEBUG_LEVEL_VERBOSE, "Allocating ISO channel using generic method...\n" ); 383 381 384 struct ChannelInfo cinfo; 382 385 … … 433 436 ) { 434 437 438 debugOutput(DEBUG_LEVEL_VERBOSE, "Allocating ISO channel using IEC61883 CMP...\n" ); 439 435 440 struct ChannelInfo cinfo; 436 441 … … 482 487 */ 483 488 bool Ieee1394Service::freeIsoChannel(signed int c) { 489 debugOutput(DEBUG_LEVEL_VERBOSE, "Freeing ISO channel %d...\n", c ); 484 490 485 491 if (c < 0 || c > 63) { 486 debugWarning("Invalid channel number: %d ", c);492 debugWarning("Invalid channel number: %d\n", c); 487 493 return false; 488 494 } … … 490 496 switch (m_channels[c].alloctype) { 491 497 default: 492 debugError(" BUG: invalid allocation type!\n");498 debugError(" BUG: invalid allocation type!\n"); 493 499 return false; 494 500 495 501 case AllocFree: 496 debugWarning(" Channel %d not registered\n", c);502 debugWarning(" Channel %d not registered\n", c); 497 503 return false; 498 504 499 505 case AllocGeneric: 506 debugOutput(DEBUG_LEVEL_VERBOSE, " allocated using generic routine...\n" ); 500 507 if (unregisterIsoChannel(c)) { 501 508 return false; 502 509 } else { 510 debugOutput(DEBUG_LEVEL_VERBOSE, " freeing %d bandwidth units...\n", m_channels[c].bandwidth ); 503 511 if (raw1394_bandwidth_modify(m_handle, m_channels[c].bandwidth, RAW1394_MODIFY_FREE) !=0) { 504 512 debugWarning("Failed to deallocate bandwidth\n"); 505 513 } 514 debugOutput(DEBUG_LEVEL_VERBOSE, " freeing channel %d...\n", m_channels[c].channel ); 506 515 if (raw1394_channel_modify (m_handle, m_channels[c].channel, RAW1394_MODIFY_FREE) != 0) { 507 516 debugWarning("Failed to free channel\n"); … … 511 520 512 521 case AllocCMP: 522 debugOutput(DEBUG_LEVEL_VERBOSE, " allocated using IEC61883 CMP...\n" ); 513 523 if (unregisterIsoChannel(c)) { 514 524 return false; 515 525 } else { 526 debugOutput(DEBUG_LEVEL_VERBOSE, " performing IEC61883 CMP disconnect...\n" ); 516 527 if(iec61883_cmp_disconnect( 517 528 m_handle, branches/streaming-rework/src/libstreaming/AmdtpStreamProcessor.cpp
r407 r411 126 126 // the difference between the cycle this 127 127 // packet is intended for and 'now' 128 int cycle_diff = substractCycles(cycle, now_cycles);128 int cycle_diff = diffCycles(cycle, now_cycles); 129 129 130 130 #ifdef DEBUG … … 139 139 // to be 'running' 140 140 // NOTE: this works only at startup 141 if (!m_running && cycle_diff >= 0 && cycle != -1) {141 if (!m_running && cycle_diff >= 0 && cycle >= 0) { 142 142 debugOutput(DEBUG_LEVEL_VERBOSE, "Xmit StreamProcessor %p started running at cycle %d\n",this, cycle); 143 143 m_running=true; … … 157 157 // the number of cycles the sync source lags (> 0) 158 158 // or leads (< 0) 159 int sync_lag_cycles= substractCycles(cycle, m_SyncSource->getLastCycle());159 int sync_lag_cycles=diffCycles(cycle, m_SyncSource->getLastCycle()); 160 160 161 161 // account for the cycle lag between sync SP and this SP … … 167 167 // therefore sync_lag_cycles * TICKS_PER_CYCLE earlier than 168 168 // T1. 169 ts_head = addTicks(ts_head, sync_lag_cycles * TICKS_PER_CYCLE); 170 169 ts_head = addTicks(ts_head, (sync_lag_cycles) * TICKS_PER_CYCLE); 170 171 ts_head = substractTicks(ts_head, TICKS_PER_CYCLE); 172 173 // account for one extra packet of frames 174 ts_head = substractTicks(ts_head, 175 (uint32_t)((float)m_syt_interval * m_SyncSource->m_data_buffer->getRate())); 176 171 177 m_data_buffer->setBufferHeadTimestamp(ts_head); 172 178 173 179 #ifdef DEBUG 174 180 if ((unsigned int)m_data_buffer->getFrameCounter() != m_data_buffer->getBufferSize()) { … … 176 182 } 177 183 #endif 178 debugOutput(DEBUG_LEVEL_VERBOSE,"XMIT TS SET: TS=%10ll d, LAG=%03d, FC=%4d\n",184 debugOutput(DEBUG_LEVEL_VERBOSE,"XMIT TS SET: TS=%10llu, LAG=%03d, FC=%4d\n", 179 185 ts_head, sync_lag_cycles, m_data_buffer->getFrameCounter()); 180 186 } else { … … 202 208 // packet is sent, unless TRANSFER_DELAY > 3072. 203 209 // this means that we need at least one cycle of extra buffering. 204 uint 64_t ticks_to_advance = TICKS_PER_CYCLE * TRANSMIT_ADVANCE_CYCLES;210 uint32_t ticks_to_advance = TICKS_PER_CYCLE * TRANSMIT_ADVANCE_CYCLES; 205 211 206 212 // if cycle lies cycle_diff cycles in the future, we should … … 210 216 211 217 // determine the 'now' time in ticks 212 uint64_t cycle_timer=CYCLE_TIMER_TO_TICKS(ctr); 218 uint32_t cycle_timer=CYCLE_TIMER_TO_TICKS(ctr); 219 220 cycle_timer = addTicks(cycle_timer, ticks_to_advance); 213 221 214 222 // time until the packet is to be sent (if > 0: send packet) 215 int 64_t until_next=substractTicks(ts_head, cycle_timer + ticks_to_advance);223 int32_t until_next=diffTicks(ts_head, cycle_timer); 216 224 217 225 // if until_next < 0 we should send a filled packet … … 219 227 if((until_next<0) && (m_running)) { 220 228 // add the transmit transfer delay to construct the playout time (=SYT timestamp) 221 uint 64_t ts_packet=addTicks(ts_head, TRANSMIT_TRANSFER_DELAY);229 uint32_t ts_packet=addTicks(ts_head, TRANSMIT_TRANSFER_DELAY); 222 230 223 231 // if we are disabled, send a silent packet … … 228 236 m_dbc += fillDataPacketHeader(packet, length, ts_packet); 229 237 230 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "XMIT SYNC: CY=%04u TSH=%011llu TSP=%011l lu\n",238 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "XMIT SYNC: CY=%04u TSH=%011llu TSP=%011lu\n", 231 239 cycle, ts_head, ts_packet); 232 240 … … 252 260 } 253 261 254 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "XMIT : CY=%04u TSH=%011llu TSP=%011llu\n",262 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "XMIT DATA: CY=%04u TSH=%011llu TSP=%011lu\n", 255 263 cycle, ts_head, ts_packet); 256 264 … … 282 290 283 291 } else { // no packet due, send no-data packet 292 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "XMIT NONE: CY=%04u TSH=%011llu\n", 293 cycle, ts_head); 294 284 295 m_dbc += fillNoDataPacketHeader(packet, length); 285 296 return RAW1394_ISO_DEFER; … … 356 367 // lies in the future for every possible buffer fill case. 357 368 int offset=(int)(m_ringbuffer_size_frames*m_ticks_per_frame); 358 359 // we can substract the delay as it introduces360 // unnescessary delay361 offset -= m_SyncSource->getSyncDelay();362 369 363 370 m_data_buffer->setTickOffset(offset); … … 594 601 ts_head=addTicks(ts_head, TRANSMIT_ADVANCE_CYCLES*TICKS_PER_CYCLE); 595 602 603 // we want the SP to start sending silent packets somewhat earlier than the 604 // time it is enabled 605 ts_head=substractTicks(ts_head, 100*TICKS_PER_CYCLE); 606 596 607 m_data_buffer->setBufferTailTimestamp(ts_head); 597 608 … … 888 899 } 889 900 890 891 901 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"ch%2u: CY=%4u, SYT=%08X (%4ucy + %04uticks) (running=%d, disabled=%d,%d)\n", 892 902 channel, cycle,ntohs(packet->syt), … … 914 924 // because we're going to update the buffer again this loop 915 925 // using writeframes 916 m_data_buffer->setBufferTailTimestamp(m_last_timestamp 2);926 m_data_buffer->setBufferTailTimestamp(m_last_timestamp); 917 927 918 928 } else { … … 1037 1047 // ISO buffering 1038 1048 int AmdtpReceiveStreamProcessor::getMinimalSyncDelay() { 1039 return ((int)(m_handler->getWakeupInterval() * m_syt_interval * m_ticks_per_frame) +10000);1049 return ((int)(m_handler->getWakeupInterval() * m_syt_interval * m_ticks_per_frame)); 1040 1050 } 1041 1051 … … 1056 1066 m_PacketStat.reset(); 1057 1067 m_WakeupStat.reset(); 1058 1059 // this makes that the buffer lags a little compared to reality 1060 // the result is that we get some extra time before period boundaries 1061 // are signaled. 1062 // ISO buffering causes the packets to be received at max 1063 // m_handler->getWakeupInterval() later than the time they were received. 1064 // hence their payload is available this amount of time later. However, the 1065 // period boundary is predicted based upon earlier samples, and therefore can 1066 // pass before these packets are processed. Adding this extra term makes that 1067 // the period boundary is signalled later 1068 m_data_buffer->setTickOffset(m_SyncSource->getSyncDelay()); 1068 1069 m_data_buffer->setTickOffset(0); 1069 1070 1070 1071 // reset all non-device specific stuff branches/streaming-rework/src/libstreaming/cycletimer.h
r397 r411 98 98 99 99 /** 100 * @brief Wraps x to the minimum number of ticks 101 * 102 * The input value is wrapped to the minimum value of the cycle 103 * timer, in ticks (= 0). 104 * 105 * @param x time to wrap 106 * @return wrapped time 107 */ 108 static inline uint32_t wrapAtMinTicks(int64_t x) { 109 if (x < 0) { 110 x += TICKS_PER_SECOND * 128L; 111 } 112 113 #ifdef DEBUG 114 if (x < 0) { 115 debugWarning("insufficient wrapping: %lld\n",x); 116 117 debugWarning("correcting...\n"); 118 while (x < 0) { 119 x += TICKS_PER_SECOND * 128L; 120 121 if (x < 0) { 122 debugWarning(" insufficient wrapping: %lld\n",x); 123 } 124 } 125 } 126 127 #endif 128 129 return (uint32_t)x; 130 } 131 132 /** 100 133 * @brief Wraps both at minimum and maximum value for ticks 134 * 135 * The input value is wrapped to the maximum value of the cycle 136 * timer, in ticks (128sec * 24576000 ticks/sec), and 137 * to the minimum value of the cycle timer, in ticks (= 0). 138 * 101 139 * @param x value to wrap 102 140 * @return wrapped value … … 137 175 * @return the difference x-y, unwrapped 138 176 */ 139 static inline int32_t substractTicks(uint32_t x, uint32_t y) {177 static inline int32_t diffTicks(uint32_t x, uint32_t y) { 140 178 int64_t diff=(int64_t)x - (int64_t)y; 141 179 … … 165 203 * 166 204 * This function computes a sum of timestamps in ticks, 167 * wrapping the result if ne scessary.205 * wrapping the result if necessary. 168 206 * 169 207 * @param x First timestamp … … 175 213 176 214 return wrapAtMaxTicks(sum); 215 } 216 217 /** 218 * @brief Computes a substraction of timestamps 219 * 220 * This function computes a substraction of timestamps in ticks, 221 * wrapping the result if necessary. 222 * 223 * @param x First timestamp 224 * @param y Second timestamp 225 * @return the difference x-y, wrapped 226 */ 227 static inline uint32_t substractTicks(uint32_t x, uint32_t y) { 228 int64_t subs=x-y; 229 230 return wrapAtMinTicks(subs); 177 231 } 178 232 … … 351 405 * such that it respects wrapping (at 8000 cycles). 352 406 * 353 * See substractTicks407 * See diffTicks 354 408 * 355 409 * @param x First cycle value … … 357 411 * @return the difference x-y, unwrapped 358 412 */ 359 static inline int substractCycles(unsigned int x, unsigned int y) {413 static inline int diffCycles(unsigned int x, unsigned int y) { 360 414 int diff = x - y; 361 415 branches/streaming-rework/src/libstreaming/MotuStreamProcessor.cpp
r410 r411 109 109 // the difference between the cycle this 110 110 // packet is intended for and 'now' 111 int cycle_diff = substractCycles(cycle, now_cycles);111 int cycle_diff = diffCycles(cycle, now_cycles); 112 112 113 113 // Signal that streaming is still active … … 118 118 // to be 'running' 119 119 // NOTE: this works only at startup 120 if (!m_running && cycle_diff >= 0 && cycle != -1) {120 if (!m_running && cycle_diff >= 0 && cycle >= 0) { 121 121 debugOutput(DEBUG_LEVEL_VERBOSE, "Xmit StreamProcessor %p started running at cycle %d\n",this, cycle); 122 122 m_running=true; … … 135 135 // the number of cycles the sync source lags (> 0) 136 136 // or leads (< 0) 137 int sync_lag_cycles= substractCycles(cycle, m_SyncSource->getLastCycle());137 int sync_lag_cycles=diffCycles(cycle, m_SyncSource->getLastCycle()); 138 138 139 139 // account for the cycle lag between sync SP and this SP … … 199 199 200 200 // time until the packet is to be sent (if > 0: send packet) 201 int 64_t until_next=substractTicks(timestamp, cycle_timer + ticks_to_advance);201 int32_t until_next=diffTicks(timestamp, cycle_timer + ticks_to_advance); 202 202 203 203 // Size of a single data frame in quadlets … … 370 370 int offset=(int)(m_data_buffer->getBufferSize()*m_ticks_per_frame); 371 371 372 // we can substract the delay as it introduces373 // unnescessary delay374 offset -= m_SyncSource->getSyncDelay();375 376 372 m_data_buffer->setTickOffset(offset); 377 373 … … 591 587 592 588 m_data_buffer->setBufferTailTimestamp(ts_head); 593 594 589 595 590 if (!StreamProcessor::prepareForEnable(time_to_enable_at)) { … … 1046 1041 1047 1042 debugOutput( DEBUG_LEVEL_VERBOSE, "Resetting...\n"); 1048 1049 // this makes that the buffer lags a little compared to reality 1050 // the result is that we get some extra time before period boundaries 1051 // are signaled. 1052 // ISO buffering causes the packets to be received at max 1053 // m_handler->getWakeupInterval() later than the time they were received. 1054 // hence their payload is available this amount of time later. However, the 1055 // period boundary is predicted based upon earlier samples, and therefore can 1056 // pass before these packets are processed. Adding this extra term makes that 1057 // the period boundary is signalled later 1058 m_data_buffer->setTickOffset(m_SyncSource->getSyncDelay()); 1043 1044 m_data_buffer->setTickOffset(0); 1059 1045 1060 1046 // reset all non-device specific stuff branches/streaming-rework/src/libstreaming/StreamProcessor.cpp
r407 r411 232 232 } 233 233 234 int64_t StreamProcessor::getTimeUntilNextPeriod Usecs() {234 int64_t StreamProcessor::getTimeUntilNextPeriodSignalUsecs() { 235 235 uint64_t time_at_period=getTimeAtPeriod(); 236 236 237 // we delay the period signal with the sync delay 238 // this makes that the period signals lag a little compared to reality 239 // ISO buffering causes the packets to be received at max 240 // m_handler->getWakeupInterval() later than the time they were received. 241 // hence their payload is available this amount of time later. However, the 242 // period boundary is predicted based upon earlier samples, and therefore can 243 // pass before these packets are processed. Adding this extra term makes that 244 // the period boundary is signalled later 245 time_at_period = addTicks(time_at_period, m_SyncSource->getSyncDelay()); 246 237 247 uint64_t cycle_timer=m_handler->getCycleTimerTicks(); 238 248 239 249 // calculate the time until the next period 240 int 64_t until_next=substractTicks(time_at_period,cycle_timer);250 int32_t until_next=diffTicks(time_at_period,cycle_timer); 241 251 242 252 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "=> TAP=%11llu, CTR=%11llu, UTN=%11lld\n", … … 321 331 uint64_t TransmitStreamProcessor::getTimeAtPeriod() { 322 332 uint64_t next_period_boundary=m_data_buffer->getTimestampFromTail((m_nb_buffers-1) * m_period); 323 333 324 334 #ifdef DEBUG 325 335 uint64_t ts,fc; branches/streaming-rework/src/libstreaming/StreamProcessor.h
r401 r411 154 154 155 155 /** 156 * \brief return the time until the next period boundary (in microseconds)157 * 158 * Return the time until the next period boundary . If this StreamProcessor156 * \brief return the time until the next period boundary should be signaled (in microseconds) 157 * 158 * Return the time until the next period boundary signal. If this StreamProcessor 159 159 * is the current synchronization source, this function is called to 160 160 * determine when a buffer transfer can be made. When this value is … … 164 164 * \return the time in usecs 165 165 */ 166 int64_t getTimeUntilNextPeriod Usecs();166 int64_t getTimeUntilNextPeriodSignalUsecs(); 167 167 /** 168 168 * \brief return the time of the next period boundary (in microseconds) … … 181 181 * \brief return the time of the next period boundary (in internal units) 182 182 * 183 * The same as getTimeUntilNextPeriod Usecs() but in internal units.183 * The same as getTimeUntilNextPeriodSignalUsecs() but in internal units. 184 184 * 185 185 * @return the time in internal units branches/streaming-rework/src/libstreaming/StreamProcessorManager.cpp
r407 r411 40 40 #define PREPARE_TIMEOUT_MSEC 4000 41 41 #define ENABLE_TIMEOUT_MSEC 4000 42 43 #define ENABLE_DELAY_CYCLES 2000 42 44 43 45 namespace FreebobStreaming { … … 259 261 bool StreamProcessorManager::syncStartAll() { 260 262 261 debugOutput( DEBUG_LEVEL_VERBOSE, "Waiting for allStreamProcessor streams to start running...\n");263 debugOutput( DEBUG_LEVEL_VERBOSE, "Waiting for StreamProcessor streams to start running...\n"); 262 264 // we have to wait until all streamprocessors indicate that they are running 263 265 // i.e. that there is actually some data stream flowing … … 268 270 notRunning=false; 269 271 270 for ( StreamProcessorVectorIterator it = m_ReceiveProcessors.begin(); 271 it != m_ReceiveProcessors.end(); 272 ++it ) { 273 if(!(*it)->isRunning()) notRunning=true; 274 } 275 276 for ( StreamProcessorVectorIterator it = m_TransmitProcessors.begin(); 277 it != m_TransmitProcessors.end(); 278 ++it ) { 279 if(!(*it)->isRunning()) notRunning=true; 280 } 272 // for ( StreamProcessorVectorIterator it = m_ReceiveProcessors.begin(); 273 // it != m_ReceiveProcessors.end(); 274 // ++it ) { 275 // if(!(*it)->isRunning()) notRunning=true; 276 // } 277 // 278 // for ( StreamProcessorVectorIterator it = m_TransmitProcessors.begin(); 279 // it != m_TransmitProcessors.end(); 280 // ++it ) { 281 // if(!(*it)->isRunning()) notRunning=true; 282 // } 283 284 // EXPERIMENT: 285 // the only stream that should be running is the sync 286 // source stream, as this is the one that defines 287 // when to signal buffers. Maybe we get an xrun at startup, 288 // but that should be handled. 289 290 // the problem is that otherwise a setup with a device 291 // that waits for decent input before sending output 292 // will not start up (e.g. the bounce device), because 293 // all streams are required to be running. 294 295 // other streams still have at least ENABLE_DELAY_CYCLES cycles 296 // to start up 297 if(!m_SyncSource->isRunning()) notRunning=true; 298 281 299 usleep(1000); 282 300 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Running check: %d\n",notRunning); … … 285 303 if(!wait_cycles) { // timout has occurred 286 304 debugFatal("One or more streams are not starting up (timeout):\n"); 287 305 288 306 for ( StreamProcessorVectorIterator it = m_ReceiveProcessors.begin(); 289 307 it != m_ReceiveProcessors.end(); … … 305 323 } 306 324 } 307 308 325 return false; 309 326 } … … 356 373 357 374 // FIXME: this should not be in cycles, but in 'time' 358 unsigned int enable_at=TICKS_TO_CYCLES(now)+ 2000;375 unsigned int enable_at=TICKS_TO_CYCLES(now)+ENABLE_DELAY_CYCLES; 359 376 if (enable_at > 8000) enable_at -= 8000; 360 377 … … 746 763 assert(m_SyncSource); 747 764 748 time_till_next_period=m_SyncSource->getTimeUntilNextPeriod Usecs();765 time_till_next_period=m_SyncSource->getTimeUntilNextPeriodSignalUsecs(); 749 766 750 767 while(time_till_next_period > 0) { … … 770 787 771 788 // check if we were waked up too soon 772 time_till_next_period=m_SyncSource->getTimeUntilNextPeriod Usecs();789 time_till_next_period=m_SyncSource->getTimeUntilNextPeriodSignalUsecs(); 773 790 } 774 791 branches/streaming-rework/src/libutil/TimestampedBuffer.cpp
r407 r411 565 565 } 566 566 #endif 567 568 int64_t diff=m_buffer_next_tail_timestamp - m_buffer_tail_timestamp;569 if (diff < 0) diff += m_wrap_at;570 567 571 568 pthread_mutex_lock(&m_framecounter_lock); … … 605 602 int64_t ts=new_timestamp; 606 603 607 int64_t diff=m_buffer_next_tail_timestamp - m_buffer_tail_timestamp;608 if (diff < 0) diff += m_wrap_at;609 610 604 pthread_mutex_lock(&m_framecounter_lock); 611 605 branches/streaming-rework/tests/test-cycletimer.cpp
r394 r411 159 159 160 160 int32_t subs; 161 subs= substractTicks(10, 8);161 subs=diffTicks(10, 8); 162 162 if (subs != 2) { 163 debugOutput(DEBUG_LEVEL_NORMAL, " substractTicks(10, 8) != 2 : %ld\n",164 subs); 165 failures++; 166 } 167 168 subs= substractTicks(10, 12);163 debugOutput(DEBUG_LEVEL_NORMAL, " diffTicks(10, 8) != 2 : %ld\n", 164 subs); 165 failures++; 166 } 167 168 subs=diffTicks(10, 12); 169 169 if (subs != -2) { 170 debugOutput(DEBUG_LEVEL_NORMAL, " substractTicks(10, 12) != -2 : %ld\n",171 subs); 172 failures++; 173 } 174 175 subs= substractTicks(TICKS_PER_SECOND*128L + 10, 8);170 debugOutput(DEBUG_LEVEL_NORMAL, " diffTicks(10, 12) != -2 : %ld\n", 171 subs); 172 failures++; 173 } 174 175 subs=diffTicks(TICKS_PER_SECOND*128L + 10, 8); 176 176 if (subs != 2) { 177 debugOutput(DEBUG_LEVEL_NORMAL, " substractTicks(TICKS_PER_SECOND*128L + 10, 8) != 2 : %ld\n",178 subs); 179 failures++; 180 } 181 182 subs= substractTicks(TICKS_PER_SECOND*128L + 10, 12);177 debugOutput(DEBUG_LEVEL_NORMAL, " diffTicks(TICKS_PER_SECOND*128L + 10, 8) != 2 : %ld\n", 178 subs); 179 failures++; 180 } 181 182 subs=diffTicks(TICKS_PER_SECOND*128L + 10, 12); 183 183 if (subs != -2) { 184 debugOutput(DEBUG_LEVEL_NORMAL, " substractTicks(TICKS_PER_SECOND*128L + 10, 12) != -2 : %ld\n",185 subs); 186 failures++; 187 } 188 189 subs= substractTicks(10, TICKS_PER_SECOND*128L + 8);184 debugOutput(DEBUG_LEVEL_NORMAL, " diffTicks(TICKS_PER_SECOND*128L + 10, 12) != -2 : %ld\n", 185 subs); 186 failures++; 187 } 188 189 subs=diffTicks(10, TICKS_PER_SECOND*128L + 8); 190 190 if (subs != 2) { 191 debugOutput(DEBUG_LEVEL_NORMAL, " substractTicks(10, TICKS_PER_SECOND*128L + 8) != 2 : %ld\n",192 subs); 193 failures++; 194 } 195 196 subs= substractTicks(10, TICKS_PER_SECOND*128L + 12);191 debugOutput(DEBUG_LEVEL_NORMAL, " diffTicks(10, TICKS_PER_SECOND*128L + 8) != 2 : %ld\n", 192 subs); 193 failures++; 194 } 195 196 subs=diffTicks(10, TICKS_PER_SECOND*128L + 12); 197 197 if (subs != -2) { 198 debugOutput(DEBUG_LEVEL_NORMAL, " substractTicks(10, TICKS_PER_SECOND*128L + 12) != -2 : %l011llu\n",198 debugOutput(DEBUG_LEVEL_NORMAL, " diffTicks(10, TICKS_PER_SECOND*128L + 12) != -2 : %l011llu\n", 199 199 subs); 200 200 failures++;