Changeset 1722
- Timestamp:
- 11/22/09 09:05:16 (13 years ago)
- Files:
-
- branches/libffado-2.0/src/bebob/bebob_avdevice.cpp (modified) (2 diffs)
- branches/libffado-2.0/src/bebob/bebob_avplug.cpp (modified) (1 diff)
- branches/libffado-2.0/src/bebob/bebob_dl_bcd.cpp (modified) (4 diffs)
- branches/libffado-2.0/src/bebob/focusrite/focusrite_generic.cpp (modified) (6 diffs)
- branches/libffado-2.0/src/bebob/focusrite/focusrite_saffire.cpp (modified) (1 diff)
- branches/libffado-2.0/src/debugmodule/debugmodule.cpp (modified) (1 diff)
- branches/libffado-2.0/src/DeviceStringParser.cpp (modified) (2 diffs)
- branches/libffado-2.0/src/fbtypes.h (modified) (2 diffs)
- branches/libffado-2.0/src/fireworks/efc/efc_cmds_hardware.cpp (modified) (1 diff)
- branches/libffado-2.0/src/fireworks/fireworks_session_block.cpp (modified) (1 diff)
- branches/libffado-2.0/src/libavc/descriptors/avc_descriptor.cpp (modified) (1 diff)
- branches/libffado-2.0/src/libavc/general/avc_plug.cpp (modified) (1 diff)
- branches/libffado-2.0/src/libcontrol/Element.cpp (modified) (1 diff)
- branches/libffado-2.0/src/libieee1394/configrom.cpp (modified) (7 diffs)
- branches/libffado-2.0/src/libieee1394/cycletimer.h (modified) (14 diffs)
- branches/libffado-2.0/src/libieee1394/CycleTimerHelper.cpp (modified) (15 diffs)
- branches/libffado-2.0/src/libieee1394/ieee1394service.cpp (modified) (8 diffs)
- branches/libffado-2.0/src/libieee1394/IsoHandler.cpp (modified) (2 diffs)
- branches/libffado-2.0/src/libieee1394/IsoHandlerManager.cpp (modified) (3 diffs)
- branches/libffado-2.0/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp (modified) (1 diff)
- branches/libffado-2.0/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp (modified) (10 diffs)
- branches/libffado-2.0/src/libstreaming/generic/StreamProcessor.cpp (modified) (27 diffs)
- branches/libffado-2.0/src/libstreaming/motu/MotuReceiveStreamProcessor.cpp (modified) (1 diff)
- branches/libffado-2.0/src/libstreaming/motu/MotuTransmitStreamProcessor.cpp (modified) (5 diffs)
- branches/libffado-2.0/src/libstreaming/StreamProcessorManager.cpp (modified) (28 diffs)
- branches/libffado-2.0/src/libutil/Configuration.cpp (modified) (2 diffs)
- branches/libffado-2.0/src/libutil/serialize_expat.cpp (modified) (1 diff)
- branches/libffado-2.0/src/libutil/StreamStatistics.cpp (modified) (1 diff)
- branches/libffado-2.0/src/libutil/SystemTimeSource.cpp (modified) (1 diff)
- branches/libffado-2.0/src/libutil/Time.h (modified) (2 diffs)
- branches/libffado-2.0/src/libutil/TimestampedBuffer.cpp (modified) (3 diffs)
- branches/libffado-2.0/support/firmware/fireworks-downloader.cpp (modified) (2 diffs)
- branches/libffado-2.0/tests/streaming/teststreaming3.cpp (modified) (1 diff)
- branches/libffado-2.0/tests/systemtests/test-isorecv-1.cpp (modified) (2 diffs)
- branches/libffado-2.0/tests/systemtests/test-isoxmit-1.cpp (modified) (3 diffs)
- branches/libffado-2.0/tests/test-ffado.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/libffado-2.0/src/bebob/bebob_avdevice.cpp
r1720 r1722 724 724 725 725 char* configId; 726 asprintf(&configId, "%016 lx", getConfigurationId() );726 asprintf(&configId, "%016"PRIx64"", getConfigurationId() ); 727 727 if ( !configId ) { 728 728 debugError( "could not create id string\n" ); … … 800 800 // come up with an unique file name for the current settings 801 801 char* configId; 802 asprintf(&configId, "%016 lx", BeBoB::AvDevice::getConfigurationId() );802 asprintf(&configId, "%016"PRIx64"", BeBoB::AvDevice::getConfigurationId() ); 803 803 if ( !configId ) { 804 804 debugError( "Could not create id string\n" ); branches/libffado-2.0/src/bebob/bebob_avplug.cpp
r1720 r1722 583 583 { 584 584 debugError( "number of output plugs (%d) disagree with " 585 "number of elements in plug address vector (% lu)\n",585 "number of elements in plug address vector (%zd)\n", 586 586 infoType->m_plugOutput->m_nrOfOutputPlugs, 587 587 infoType->m_plugOutput->m_outputPlugAddresses.size()); branches/libffado-2.0/src/bebob/bebob_dl_bcd.cpp
r1720 r1722 154 154 bytes_read = fread( &m_bcd_version, 1, sizeof( fb_quadlet_t ), m_file ); 155 155 if ( bytes_read != sizeof( fb_quadlet_t ) ) { 156 debugError( "parse: % lubytes read at position %d failed\n",156 debugError( "parse: %zd bytes read at position %d failed\n", 157 157 sizeof( fb_quadlet_t ), 158 158 BCDFileVersionOffset ); … … 245 245 size_t bytes_read = std::fread( q, 1, sizeof( *q ), m_file ); 246 246 if ( bytes_read != sizeof( *q ) ) { 247 debugError( "read: % lubyte read failed at position 0x%08x\n",247 debugError( "read: %zd byte read failed at position 0x%08x\n", 248 248 sizeof( *q ), addr ); 249 249 return false; … … 263 263 size_t bytes_read = std::fread( o, 1, sizeof( *o ), m_file ); 264 264 if ( bytes_read != sizeof( *o ) ) { 265 debugError( "read: % lubyte read failed at position 0x%08x\n",265 debugError( "read: %zd byte read failed at position 0x%08x\n", 266 266 sizeof( *o ), addr ); 267 267 return false; … … 281 281 size_t bytes_read = std::fread( b, 1, len, m_file ); 282 282 if ( bytes_read != len ) { 283 debugError( "read: % lubyte read failed at position 0x%08x\n",283 debugError( "read: %zd byte read failed at position 0x%08x\n", 284 284 len, addr ); 285 285 return false; branches/libffado-2.0/src/bebob/focusrite/focusrite_generic.cpp
r1720 r1722 69 69 if(m_cmd_time_interval && (m_earliest_next_cmd_time > now)) { 70 70 ffado_microsecs_t wait = m_earliest_next_cmd_time - now; 71 debugOutput( DEBUG_LEVEL_VERBOSE, "Rate control... % lu\n", wait );71 debugOutput( DEBUG_LEVEL_VERBOSE, "Rate control... %"PRIu64"\n", wait ); 72 72 Util::SystemTimeSource::SleepUsecRelative(wait); 73 73 } … … 94 94 if(m_cmd_time_interval && (m_earliest_next_cmd_time > now)) { 95 95 ffado_microsecs_t wait = m_earliest_next_cmd_time - now; 96 debugOutput( DEBUG_LEVEL_VERBOSE, "Rate control... % lu\n", wait );96 debugOutput( DEBUG_LEVEL_VERBOSE, "Rate control... %"PRIu64"\n", wait ); 97 97 Util::SystemTimeSource::SleepUsecRelative(wait); 98 98 } … … 169 169 170 170 if(!get1394Service().write_quadlet( nodeId, addr, CondSwapToBus32(data) ) ) { 171 debugError("Could not write to node 0x%04X addr 0x%012 lX\n", nodeId, addr);171 debugError("Could not write to node 0x%04X addr 0x%012"PRIX64"\n", nodeId, addr); 172 172 return false; 173 173 } … … 185 185 186 186 if(!get1394Service().read_quadlet( nodeId, addr, &result ) ) { 187 debugError("Could not read from node 0x%04X addr 0x%012 lX\n", nodeId, addr);187 debugError("Could not read from node 0x%04X addr 0x%012"PRIX64"\n", nodeId, addr); 188 188 return false; 189 189 } … … 385 385 RegisterControl::setValue(uint64_t addr, uint64_t v) 386 386 { 387 debugOutput(DEBUG_LEVEL_VERBOSE, "setValue for addr % lu to %lu\n",387 debugOutput(DEBUG_LEVEL_VERBOSE, "setValue for addr %"PRIu64" to %"PRIu64"\n", 388 388 addr, v); 389 389 … … 403 403 return 0; 404 404 } else { 405 debugOutput(DEBUG_LEVEL_VERBOSE, "getValue for % lu= %u\n",405 debugOutput(DEBUG_LEVEL_VERBOSE, "getValue for %"PRIu64" = %u\n", 406 406 addr, val); 407 407 return val; branches/libffado-2.0/src/bebob/focusrite/focusrite_saffire.cpp
r1720 r1722 48 48 if(config.getValueForDeviceSetting(getConfigRom().getNodeVendorId(), getConfigRom().getModelId(), "cmd_interval_time", delaytime)) { 49 49 m_cmd_time_interval = delaytime; 50 debugOutput( DEBUG_LEVEL_VERBOSE, "Setting command interval time to % lu\n",50 debugOutput( DEBUG_LEVEL_VERBOSE, "Setting command interval time to %"PRIu64"\n", 51 51 m_cmd_time_interval ); 52 52 } else { 53 53 m_cmd_time_interval = 10000; 54 debugOutput( DEBUG_LEVEL_VERBOSE, "No command interval time setting found, defaulting to % lu\n",54 debugOutput( DEBUG_LEVEL_VERBOSE, "No command interval time setting found, defaulting to %"PRIu64"\n", 55 55 m_cmd_time_interval ); 56 56 } branches/libffado-2.0/src/debugmodule/debugmodule.cpp
r1721 r1722 186 186 int chars_written=0; 187 187 int retval=0; 188 retval = snprintf(msg, MB_BUFFERSIZE, "%011 lu: %s (%s)[%4u] %s: ",188 retval = snprintf(msg, MB_BUFFERSIZE, "%011"PRIu64": %s (%s)[%4u] %s: ", 189 189 ts_usec, getPreSequence( level ), 190 190 fname, line, function ); branches/libffado-2.0/src/DeviceStringParser.cpp
r1720 r1722 203 203 case eGUID: 204 204 retval = m_guid && (m_guid == x.m_guid); 205 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "eGUID 0x%016 lX == 0x%016lX? %d\n",205 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "eGUID 0x%016"PRIX64" == 0x%016"PRIX64"? %d\n", 206 206 m_guid, x.m_guid, retval); 207 207 return retval; … … 225 225 case eGUID: 226 226 debugOutput(DEBUG_LEVEL_INFO, "type: eGUID\n"); 227 debugOutput(DEBUG_LEVEL_INFO, " GUID: %016 lX\n", m_guid);227 debugOutput(DEBUG_LEVEL_INFO, " GUID: %016"PRIX64"\n", m_guid); 228 228 break; 229 229 case eInvalid: branches/libffado-2.0/src/fbtypes.h
r1292 r1722 25 25 #define FBTYPES_H 26 26 27 #define __STDC_FORMAT_MACROS 28 #include <inttypes.h> 29 27 30 #include <libraw1394/raw1394.h> 28 31 … … 35 38 typedef nodeaddr_t fb_nodeaddr_t; 36 39 40 #define FORMAT_FB_OCTLET_T "0x%016" PRIX64 41 #define FORMAT_FB_NODEID_T "0x%016" PRIX64 42 #define FORMAT_FB_NODEADDR_T "0x%016" PRIX64 43 37 44 class DeviceManager; 38 45 branches/libffado-2.0/src/fireworks/efc/efc_cmds_hardware.cpp
r1720 r1722 127 127 debugOutput(DEBUG_LEVEL_NORMAL, "EFC HW CAPS info:\n"); 128 128 debugOutput(DEBUG_LEVEL_NORMAL, " Flags : 0x%08X\n", m_flags); 129 debugOutput(DEBUG_LEVEL_NORMAL, " GUID : %016 lX\n", m_guid);129 debugOutput(DEBUG_LEVEL_NORMAL, " GUID : %016"PRIX64"\n", m_guid); 130 130 debugOutput(DEBUG_LEVEL_NORMAL, " HwType : 0x%08X\n", m_type); 131 131 debugOutput(DEBUG_LEVEL_NORMAL, " Version : %u\n", m_version); branches/libffado-2.0/src/fireworks/fireworks_session_block.cpp
r1720 r1722 255 255 256 256 if (len != h.size_quads*4) { 257 debugWarning("size not correct: got % lu, should be %d according to data\n", len, h.size_quads*4);257 debugWarning("size not correct: got %zd, should be %d according to data\n", len, h.size_quads*4); 258 258 } 259 259 branches/libffado-2.0/src/libavc/descriptors/avc_descriptor.cpp
r1721 r1722 255 255 256 256 debugOutput(DEBUG_LEVEL_VERBOSE, 257 " copying %u bytes to internal buffer offset % lu\n",257 " copying %u bytes to internal buffer offset %zd\n", 258 258 readDescCmd.m_data_length, bytes_read); 259 259 branches/libffado-2.0/src/libavc/general/avc_plug.cpp
r1566 r1722 1344 1344 return string("Output"); 1345 1345 default: 1346 case eAPT_Unknown:1347 1346 return string("Unknown"); 1348 1347 } branches/libffado-2.0/src/libcontrol/Element.cpp
r1720 r1722 302 302 { 303 303 Util::MutexLockHelper lock(getLock()); 304 debugOutput( DEBUG_LEVEL_NORMAL, "Container %s (% luElements)\n",304 debugOutput( DEBUG_LEVEL_NORMAL, "Container %s (%zd Elements)\n", 305 305 getName().c_str(), m_Children.size()); 306 306 branches/libffado-2.0/src/libieee1394/configrom.cpp
r1720 r1722 484 484 { 485 485 debugOutput( DEBUG_LEVEL_VERBOSE, 486 "Checking for updated node id for device with GUID 0x%016 lX...\n",486 "Checking for updated node id for device with GUID 0x%016"PRIX64"...\n", 487 487 getGuid()); 488 488 … … 515 515 516 516 debugOutput( DEBUG_LEVEL_VERBOSE, 517 " Node has GUID 0x%016 lX\n",517 " Node has GUID 0x%016"PRIX64"\n", 518 518 guid); 519 519 … … 522 522 if ( nodeId != getNodeId() ) { 523 523 debugOutput( DEBUG_LEVEL_VERBOSE, 524 "Device with GUID 0x%016 lXchanged node id "524 "Device with GUID 0x%016"PRIX64" changed node id " 525 525 "from %d to %d\n", 526 526 getGuid(), … … 530 530 } else { 531 531 debugOutput( DEBUG_LEVEL_VERBOSE, 532 "Device with GUID 0x%016 lXkept node id %d\n",532 "Device with GUID 0x%016"PRIX64" kept node id %d\n", 533 533 getGuid(), 534 534 getNodeId()); … … 547 547 548 548 debugOutput( DEBUG_LEVEL_VERBOSE, 549 "Device with GUID 0x%016 lXcould not be found on "549 "Device with GUID 0x%016"PRIX64" could not be found on " 550 550 "the bus anymore (removed?)\n", 551 551 getGuid() ); … … 560 560 debugOutput(DEBUG_LEVEL_NORMAL, "Config ROM\n" ); 561 561 debugOutput(DEBUG_LEVEL_NORMAL, "\tCurrent Node Id:\t%d\n", getNodeId() ); 562 debugOutput(DEBUG_LEVEL_NORMAL, "\tGUID:\t\t\t0x%016 lX\n", getGuid());562 debugOutput(DEBUG_LEVEL_NORMAL, "\tGUID:\t\t\t0x%016"PRIX64"\n", getGuid()); 563 563 debugOutput(DEBUG_LEVEL_NORMAL, "\tVendor Name:\t\t%s\n", getVendorName().c_str() ); 564 564 debugOutput(DEBUG_LEVEL_NORMAL, "\tModel Name:\t\t%s\n", getModelName().c_str() ); … … 581 581 printMessage("Config ROM\n" ); 582 582 printMessage("\tCurrent Node Id:\t%d\n", getNodeId() ); 583 printMessage("\tGUID:\t\t\t0x%016 lX\n", getGuid());583 printMessage("\tGUID:\t\t\t0x%016"PRIX64"\n", getGuid()); 584 584 printMessage("\tVendor Name:\t\t%s\n", getVendorName().c_str() ); 585 585 printMessage("\tModel Name:\t\t%s\n", getModelName().c_str() ); branches/libffado-2.0/src/libieee1394/cycletimer.h
r1720 r1722 95 95 #ifdef DEBUG 96 96 if (x >= TICKS_PER_SECOND * 128L) { 97 debugWarning("insufficient wrapping: % lu\n",x);97 debugWarning("insufficient wrapping: %"PRIu64"\n",x); 98 98 } 99 99 #endif … … 118 118 #ifdef DEBUG 119 119 if (x < 0) { 120 debugWarning("insufficient wrapping: % ld\n",x);120 debugWarning("insufficient wrapping: %"PRId64"\n",x); 121 121 } 122 122 #endif … … 145 145 #ifdef DEBUG 146 146 if (x >= (int64_t)(TICKS_PER_SECOND * 128L)) { 147 debugWarning("insufficient wrapping (max): % lu\n",x);147 debugWarning("insufficient wrapping (max): %"PRIu64"\n",x); 148 148 } 149 149 if (x < 0) { 150 debugWarning("insufficient wrapping (min): % ld\n",x);150 debugWarning("insufficient wrapping (min): %"PRId64"\n",x); 151 151 } 152 152 #endif … … 249 249 if(diff > max || diff < -max) { 250 250 debugWarning("difference does not make any sense\n"); 251 debugWarning("diff=% ld max=%ld\n", diff, max);251 debugWarning("diff=%"PRId64" max=%"PRId64"\n", diff, max); 252 252 253 253 } … … 302 302 uint64_t timestamp; 303 303 304 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, "SYT=% 04llX CY=%u CTR=%08llX\n",304 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, "SYT=%"PRIX64" CY=%u CTR=%08"PRIX64"\n", 305 305 syt_timestamp, rcv_cycle, ctr_now); 306 306 … … 313 313 int diff_cycles = diffCycles(cc_cycles, rcv_cycle); 314 314 if (diff_cycles<0) { 315 debugWarning("current cycle timer not ahead of receive cycle: rcv: %u / cc: % lu(%d)\n",315 debugWarning("current cycle timer not ahead of receive cycle: rcv: %u / cc: %"PRIu64" (%d)\n", 316 316 rcv_cycle, cc_cycles, diff_cycles); 317 317 } … … 351 351 } else { 352 352 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 353 "Detected wraparound: % d + %d = %d\n",353 "Detected wraparound: %u + %"PRId64" = %"PRId64"\n", 354 354 rcv_cycle, delta_cycles, new_cycles); 355 355 … … 372 372 if(( TICKS_TO_CYCLE_TIMER(timestamp) & 0xFFFF) != syt_timestamp) { 373 373 debugWarning("back-converted timestamp not equal to SYT\n"); 374 debugWarning("TS=%011 lu TSC=%08lX SYT=%04lX\n",374 debugWarning("TS=%011"PRIu64" TSC=%08"PRIX64" SYT=%04"PRIX64"\n", 375 375 timestamp, TICKS_TO_CYCLE_TIMER(timestamp), syt_timestamp); 376 376 } … … 391 391 uint64_t timestamp; 392 392 393 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, "SYT=%04 llXRCV_CTR=%08X\n",393 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, "SYT=%04"PRIX64" RCV_CTR=%08X\n", 394 394 syt_timestamp, rcv_ctr); 395 395 … … 433 433 if(( TICKS_TO_CYCLE_TIMER(timestamp) & 0xFFFF) != syt_timestamp) { 434 434 debugWarning("back-converted timestamp not equal to SYT\n"); 435 debugWarning("TS=%011 lu TSC=%08lX SYT=%04lX\n",435 debugWarning("TS=%011"PRIu64" TSC=%08"PRIX64" SYT=%04"PRIX64"\n", 436 436 timestamp, TICKS_TO_CYCLE_TIMER(timestamp), syt_timestamp); 437 437 } … … 457 457 uint64_t timestamp; 458 458 459 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, "SYT=%08 llX CY=%04X CTR=%08llX\n",459 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, "SYT=%08"PRIX64" CY=%04X CTR=%08"PRIX64"\n", 460 460 syt_timestamp, xmt_cycle, ctr_now); 461 461 … … 467 467 int diff_cycles = diffCycles(xmt_cycle, cc_cycles); 468 468 if (diff_cycles<0) { 469 debugWarning("xmit cycle not ahead of current cycle: xmt: %u / cc: % lu(%d)\n",469 debugWarning("xmit cycle not ahead of current cycle: xmt: %u / cc: %"PRIu64" (%d)\n", 470 470 xmt_cycle, cc_cycles, diff_cycles); 471 471 } … … 505 505 } else { 506 506 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 507 "Detected wraparound: % d + %d = %d\n",507 "Detected wraparound: %u + %"PRId64" = %"PRId64"\n", 508 508 xmt_cycle, delta_cycles, new_cycles); 509 509 … … 526 526 if(( TICKS_TO_CYCLE_TIMER(timestamp) & 0xFFFF) != syt_timestamp) { 527 527 debugWarning("back-converted timestamp not equal to SYT\n"); 528 debugWarning("TS=%011 lu TSC=%08lX SYT=%04lX\n",528 debugWarning("TS=%011"PRIu64" TSC=%08"PRIX64" SYT=%04"PRIX64"\n", 529 529 timestamp, TICKS_TO_CYCLE_TIMER(timestamp), syt_timestamp); 530 530 } branches/libffado-2.0/src/libieee1394/CycleTimerHelper.cpp
r1721 r1722 164 164 m_cycle_timer_prev, maxtries2); 165 165 } 166 debugOutput( DEBUG_LEVEL_VERBOSE, " read : CTR: %11u, local: %17 lu\n",166 debugOutput( DEBUG_LEVEL_VERBOSE, " read : CTR: %11u, local: %17"PRIu64"\n", 167 167 m_cycle_timer_prev, local_time); 168 168 debugOutput(DEBUG_LEVEL_VERBOSE, 169 " ctr : 0x%08X %11 lu(%03us %04ucy %04uticks)\n",169 " ctr : 0x%08X %11"PRIu64" (%03us %04ucy %04uticks)\n", 170 170 (uint32_t)m_cycle_timer_prev, (uint64_t)CYCLE_TIMER_TO_TICKS(m_cycle_timer_prev), 171 171 (unsigned int)CYCLE_TIMER_GET_SECS( m_cycle_timer_prev ), … … 291 291 cycle_timer_ticks = CYCLE_TIMER_TO_TICKS(cycle_timer); 292 292 293 debugOutputExtreme( DEBUG_LEVEL_VERY_VERBOSE, " read : CTR: %11u, local: %17 lu\n",293 debugOutputExtreme( DEBUG_LEVEL_VERY_VERBOSE, " read : CTR: %11u, local: %17"PRIu64"\n", 294 294 cycle_timer, local_time); 295 295 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 296 " ctr : 0x%08X %11 lu(%03us %04ucy %04uticks)\n",296 " ctr : 0x%08X %11"PRIu64" (%03us %04ucy %04uticks)\n", 297 297 (uint32_t)cycle_timer, (uint64_t)cycle_timer_ticks, 298 298 (unsigned int)TICKS_TO_SECS( (uint64_t)cycle_timer_ticks ), … … 351 351 ffado_microsecs_t now = Util::SystemTimeSource::getCurrentTimeAsUsecs(); 352 352 int sleep_time = m_sleep_until - now; 353 debugOutput( DEBUG_LEVEL_ULTRA_VERBOSE, "(%p) Sleep until % ld/%f (now: %ld, diff=%d) ...\n",353 debugOutput( DEBUG_LEVEL_ULTRA_VERBOSE, "(%p) Sleep until %"PRId64"/%f (now: %"PRId64", diff=%d) ...\n", 354 354 this, m_sleep_until, m_next_time_usecs, now, sleep_time); 355 355 #endif … … 390 390 if(not_good) { 391 391 debugOutput(DEBUG_LEVEL_VERBOSE, 392 "(%p) have to retry CTR read, diff unrealistic: diff: % ld, max: +/- %u (try: %d) %ld\n",392 "(%p) have to retry CTR read, diff unrealistic: diff: %"PRId64", max: +/- %u (try: %d) %"PRId64"\n", 393 393 this, err_ticks, 1*TICKS_PER_CYCLE, ntries, expected_ticks); 394 394 // sleep half a cycle to make sure the hardware moved on … … 419 419 } 420 420 421 debugOutputExtreme( DEBUG_LEVEL_ULTRA_VERBOSE, " read : CTR: %11u, local: %17 lu\n",421 debugOutputExtreme( DEBUG_LEVEL_ULTRA_VERBOSE, " read : CTR: %11u, local: %17"PRIu64"\n", 422 422 cycle_timer, local_time); 423 423 debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 424 " ctr : 0x%08X %11 lu(%03us %04ucy %04uticks)\n",424 " ctr : 0x%08X %11"PRIu64" (%03us %04ucy %04uticks)\n", 425 425 (uint32_t)cycle_timer, (uint64_t)cycle_timer_ticks, 426 426 (unsigned int)TICKS_TO_SECS( (uint64_t)cycle_timer_ticks ), … … 436 436 } else if (diff_ticks > m_ticks_per_update * 20) { 437 437 debugOutput(DEBUG_LEVEL_VERBOSE, 438 "re-init dll due to too large tick diff: % ld>> %f\n",438 "re-init dll due to too large tick diff: %"PRId64" >> %f\n", 439 439 diff_ticks, (float)(m_ticks_per_update * 20)); 440 440 if(!initDLL()) { … … 462 462 diff_ticks_corr = diff_ticks - ticks_late; 463 463 debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 464 "diff_ticks_corr=% d, diff_ticks = %ld, ticks_late = %ld\n",464 "diff_ticks_corr=%"PRId64", diff_ticks = %"PRId64", ticks_late = %"PRId64"\n", 465 465 diff_ticks_corr, diff_ticks, ticks_late); 466 466 } else { … … 473 473 // makes no sense if not running realtime 474 474 if(m_realtime && usecs_late > 1000) { 475 debugOutput(DEBUG_LEVEL_VERBOSE, "Rather late wakeup: % ldusecs\n", usecs_late);475 debugOutput(DEBUG_LEVEL_VERBOSE, "Rather late wakeup: %"PRId64" usecs\n", usecs_late); 476 476 } 477 477 #endif … … 526 526 527 527 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 528 " usecs: current: %f next: %f usecs_late=% d ticks_late=%ld\n",528 " usecs: current: %f next: %f usecs_late=%"PRId64" ticks_late=%"PRId64"\n", 529 529 m_current_time_usecs, m_next_time_usecs, usecs_late, ticks_late); 530 530 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 531 " ticks: current: %f next: %f diff=% d\n",531 " ticks: current: %f next: %f diff=%"PRId64"\n", 532 532 m_current_time_ticks, m_next_time_ticks, diff_ticks); 533 533 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 534 " ticks: current: %011 lu(%03us %04ucy %04uticks)\n",534 " ticks: current: %011"PRIu64" (%03us %04ucy %04uticks)\n", 535 535 (uint64_t)m_current_time_ticks, 536 536 (unsigned int)TICKS_TO_SECS( (uint64_t)m_current_time_ticks ), … … 538 538 (unsigned int)TICKS_TO_OFFSET( (uint64_t)m_current_time_ticks ) ); 539 539 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 540 " ticks: next : %011 lu(%03us %04ucy %04uticks)\n",540 " ticks: next : %011"PRIu64" (%03us %04ucy %04uticks)\n", 541 541 (uint64_t)m_next_time_ticks, 542 542 (unsigned int)TICKS_TO_SECS( (uint64_t)m_next_time_ticks ), … … 545 545 546 546 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 547 " state: local: %11 lu, dll_e2: %f, rate: %f\n",547 " state: local: %11"PRIu64", dll_e2: %f, rate: %f\n", 548 548 local_time, m_dll_e2, getRate()); 549 549 } … … 589 589 } 590 590 int32_t ctr_diff = cycle_timer_ticks-dll_time; 591 debugOutput(DEBUG_LEVEL_ULTRA_VERBOSE, "(%p) CTR DIFF: HW %010 lu- DLL %010u = %010d (%s)\n",591 debugOutput(DEBUG_LEVEL_ULTRA_VERBOSE, "(%p) CTR DIFF: HW %010"PRIu64" - DLL %010u = %010d (%s)\n", 592 592 this, cycle_timer_ticks, dll_time, ctr_diff, (ctr_diff>0?"lag":"lead")); 593 593 #endif … … 792 792 if (diffTicks(cycle_timer_ticks, m_cycle_timer_ticks_prev) < 0) { 793 793 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, 794 "non-monotonic CTR (try %02d): % lu -> %lu\n",794 "non-monotonic CTR (try %02d): %"PRIu64" -> %"PRIu64"\n", 795 795 maxtries, m_cycle_timer_ticks_prev, cycle_timer_ticks); 796 796 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, … … 798 798 m_cycle_timer_prev, *cycle_timer); 799 799 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, 800 " current: %011 lu(%03us %04ucy %04uticks)\n",800 " current: %011"PRIu64" (%03us %04ucy %04uticks)\n", 801 801 cycle_timer_ticks, 802 802 (unsigned int)TICKS_TO_SECS( cycle_timer_ticks ), … … 804 804 (unsigned int)TICKS_TO_OFFSET( cycle_timer_ticks ) ); 805 805 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, 806 " prev : %011 lu(%03us %04ucy %04uticks)\n",806 " prev : %011"PRIu64" (%03us %04ucy %04uticks)\n", 807 807 m_cycle_timer_ticks_prev, 808 808 (unsigned int)TICKS_TO_SECS( m_cycle_timer_ticks_prev ), branches/libffado-2.0/src/libieee1394/ieee1394service.cpp
r1721 r1722 509 509 #ifdef DEBUG 510 510 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, 511 "read: node 0x%hX, addr = 0x%016 lX, length = %lu\n",511 "read: node 0x%hX, addr = 0x%016"PRIX64", length = %zd\n", 512 512 nodeId, addr, length); 513 513 printBuffer( DEBUG_LEVEL_VERY_VERBOSE, length, buffer ); … … 518 518 #ifdef DEBUG 519 519 debugOutput(DEBUG_LEVEL_NORMAL, 520 "raw1394_read failed: node 0x%hX, addr = 0x%016 lX, length = %lu\n",520 "raw1394_read failed: node 0x%hX, addr = 0x%016"PRIX64", length = %zd\n", 521 521 nodeId, addr, length); 522 522 #endif … … 564 564 565 565 #ifdef DEBUG 566 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"write: node 0x%hX, addr = 0x%016 lX, length = %lu\n",566 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"write: node 0x%hX, addr = 0x%016"PRIX64", length = %zd\n", 567 567 nodeId, addr, length); 568 568 printBuffer( DEBUG_LEVEL_VERY_VERBOSE, length, data ); … … 601 601 } 602 602 #ifdef DEBUG 603 debugOutput(DEBUG_LEVEL_VERBOSE,"lockCompareSwap64: node 0x%X, addr = 0x%016 lX\n",603 debugOutput(DEBUG_LEVEL_VERBOSE,"lockCompareSwap64: node 0x%X, addr = 0x%016"PRIX64"\n", 604 604 nodeId, addr); 605 debugOutput(DEBUG_LEVEL_VERBOSE," if (*(addr)==0x%016 lX) *(addr)=0x%016lX\n",605 debugOutput(DEBUG_LEVEL_VERBOSE," if (*(addr)==0x%016"PRIX64") *(addr)=0x%016"PRIX64"\n", 606 606 compare_value, swap_value); 607 607 fb_octlet_t buffer; … … 609 609 debugWarning("Could not read register\n"); 610 610 } else { 611 debugOutput(DEBUG_LEVEL_VERBOSE,"before = 0x%016 lX\n", buffer);611 debugOutput(DEBUG_LEVEL_VERBOSE,"before = 0x%016"PRIX64"\n", buffer); 612 612 } 613 613 #endif … … 633 633 debugWarning("Could not read register\n"); 634 634 } else { 635 debugOutput(DEBUG_LEVEL_VERBOSE,"after = 0x%016 lX\n", buffer);635 debugOutput(DEBUG_LEVEL_VERBOSE,"after = 0x%016"PRIX64"\n", buffer); 636 636 } 637 637 #endif … … 827 827 fb_quadlet_t *data_quads = (fb_quadlet_t *)data; 828 828 #ifdef DEBUG 829 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"fcp response: node 0x%hX, response = %d, length = % lubytes\n",829 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"fcp response: node 0x%hX, response = %d, length = %zd bytes\n", 830 830 nodeid, response, length); 831 831 printBuffer(DEBUG_LEVEL_VERY_VERBOSE, (length+3)/4, data_quads ); … … 1381 1381 debugOutput( DEBUG_LEVEL_VERBOSE, " CycleTimerHelper: %p, IsoManager: %p, WatchDog: %p\n", 1382 1382 m_pCTRHelper, m_pIsoManager, m_pWatchdog ); 1383 debugOutput( DEBUG_LEVEL_VERBOSE, " Time: %011 lu(%03us %04ucy %04uticks)\n",1383 debugOutput( DEBUG_LEVEL_VERBOSE, " Time: %011"PRIu64" (%03us %04ucy %04uticks)\n", 1384 1384 ctr, 1385 1385 (unsigned int)TICKS_TO_SECS( ctr ), branches/libffado-2.0/src/libieee1394/IsoHandler.cpp
r1721 r1722 397 397 if((pkt_ctr & ~0x0FFFL) != pkt_ctr_ref) { 398 398 debugWarning("reconstructed CTR counter discrepancy\n"); 399 debugWarning(" ingredients: %X, %X, %X, %X, %X, %d, %ld, %ld, %ld\n", 400 cycle, pkt_ctr_ref, pkt_ctr, now, m_last_now, now_secs_ref, CYCLE_TIMER_GET_SECS(now), CYCLE_TIMER_GET_SECS(m_last_now), tmp); 401 debugWarning(" diffcy = %ld \n", diff_cycles); 399 debugWarning(" ingredients: %X, %X, %X, %X, %X, %d, %ld, %ld, %"PRId64"\n", 400 cycle, pkt_ctr_ref, pkt_ctr, 401 now, m_last_now, now_secs_ref, 402 (long int)CYCLE_TIMER_GET_SECS(now), 403 (long int)CYCLE_TIMER_GET_SECS(m_last_now), 404 tmp); 405 debugWarning(" diffcy = %"PRId64" \n", diff_cycles); 402 406 } 403 407 #endif … … 490 494 if(((pkt_ctr & ~0x0FFFL) != pkt_ctr_ref) && (m_packets > m_buf_packets)) { 491 495 debugWarning("reconstructed CTR counter discrepancy\n"); 492 debugWarning(" ingredients: %X, %X, %X, %X, %X, %d, %ld, %ld, %ld\n", 493 cycle, pkt_ctr_ref, pkt_ctr, now, m_last_now, now_secs_ref, CYCLE_TIMER_GET_SECS(now), CYCLE_TIMER_GET_SECS(m_last_now), tmp); 494 debugWarning(" diffcy = %ld \n", diff_cycles); 496 debugWarning(" ingredients: %X, %X, %X, %X, %X, %d, %ld, %ld, %"PRId64"\n", 497 cycle, pkt_ctr_ref, pkt_ctr, 498 now, m_last_now, now_secs_ref, 499 (long int)CYCLE_TIMER_GET_SECS(now), 500 (long int)CYCLE_TIMER_GET_SECS(m_last_now), 501 tmp); 502 debugWarning(" diffcy = %"PRId64" \n", diff_cycles); 495 503 } 496 504 #endif branches/libffado-2.0/src/libieee1394/IsoHandlerManager.cpp
r1721 r1722 331 331 332 332 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 333 "(%p, %s) check handler %d: diff = % ld, max = %lld, now: %08lX, last: %08lX\n",333 "(%p, %s) check handler %d: diff = %"PRId64", max = %"PRId64", now: %08X, last: %08X\n", 334 334 this, (m_handlerType == IsoHandler::eHT_Transmit? "Transmit": "Receive"), 335 335 i, measured_diff_ticks, max_diff_ticks, ctr_at_poll_return, last_packet_seen); 336 336 if(measured_diff_ticks > max_diff_ticks) { 337 debugFatal("(%p, %s) Handler died: now: %08X, last: %08X, diff: % ld (max: %ld)\n",337 debugFatal("(%p, %s) Handler died: now: %08X, last: %08X, diff: %"PRId64" (max: %"PRId64")\n", 338 338 this, (m_handlerType == IsoHandler::eHT_Transmit? "Transmit": "Receive"), 339 339 ctr_at_poll_return, last_packet_seen, measured_diff_ticks, max_diff_ticks); … … 416 416 debugError("(%p) sem_timedwait error (result=%d errno=EINVAL)\n", 417 417 this, result); 418 debugError("(%p) timeout_nsec=%lld ts.sec=%ld ts.nsec=%ld\n", 419 this, m_activity_wait_timeout_nsec, ts.tv_sec, ts.tv_nsec); 418 debugError("(%p) timeout_nsec=%lld ts.sec=%"PRId64" ts.nsec=%"PRId64"\n", 419 this, m_activity_wait_timeout_nsec, 420 (int64_t)ts.tv_sec, (int64_t)ts.tv_nsec); 420 421 return eAR_Error; 421 422 } else { 422 423 debugError("(%p) sem_timedwait error (result=%d errno=%d)\n", 423 424 this, result, errno); 424 debugError("(%p) timeout_nsec=%lld ts.sec=%ld ts.nsec=%ld\n", 425 this, m_activity_wait_timeout_nsec, ts.tv_sec, ts.tv_nsec); 425 debugError("(%p) timeout_nsec=%lld ts.sec=%"PRId64" ts.nsec=%"PRId64"\n", 426 this, m_activity_wait_timeout_nsec, 427 (int64_t)ts.tv_sec, (int64_t)ts.tv_nsec); 426 428 return eAR_Error; 427 429 } … … 888 890 889 891 m_StreamProcessors.push_back(stream); 890 debugOutput( DEBUG_LEVEL_VERBOSE, " % lu streams, %luhandlers registered\n",892 debugOutput( DEBUG_LEVEL_VERBOSE, " %zd streams, %zd handlers registered\n", 891 893 m_StreamProcessors.size(), m_IsoHandlers.size()); 892 894 return true; branches/libffado-2.0/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp
r1721 r1722 148 148 if(isRunning()) { 149 149 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 150 "STMP: % luticks | syt_interval=%d, tpf=%f\n",150 "STMP: %"PRIu64"ticks | syt_interval=%d, tpf=%f\n", 151 151 m_last_timestamp, m_syt_interval, getTicksPerFrame()); 152 152 /* debugOutput(DEBUG_LEVEL_NORMAL, 153 "STMP: %12 lu ticks | delta_t: %5ld| bufferfill: %5d\n",153 "STMP: %12"PRIu64" ticks | delta_t: %5"PRId64" | bufferfill: %5d\n", 154 154 m_last_timestamp, now_t-last_t, m_data_buffer->getBufferFill());*/ 155 155 } branches/libffado-2.0/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp
r1721 r1722 95 95 96 96 debugOutputExtreme( DEBUG_LEVEL_ULTRA_VERBOSE, 97 "Try for cycle %d\n", CYCLE_TIMER_GET_CYCLES(pkt_ctr) );97 "Try for cycle %d\n", (int) CYCLE_TIMER_GET_CYCLES(pkt_ctr) ); 98 98 // check whether the packet buffer has packets for us to send. 99 99 // the base timestamp is the one of the next sample in the buffer … … 141 141 { 142 142 debugOutput( DEBUG_LEVEL_NORMAL, 143 "Insufficient frames (P): N=%02d, CY=%04 lu, TC=%04u, CUT=%04d\n",144 fc, CYCLE_TIMER_GET_CYCLES(pkt_ctr),143 "Insufficient frames (P): N=%02d, CY=%04d, TC=%04u, CUT=%04d\n", 144 fc, (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), 145 145 transmit_at_cycle, cycles_until_transmit ); 146 146 // we are too late … … 153 153 154 154 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 155 "Insufficient frames (NP): N=%02d, CY=%04 u, TC=%04u, CUT=%04d, NOW=%04d\n",156 fc, CYCLE_TIMER_GET_CYCLES(pkt_ctr),155 "Insufficient frames (NP): N=%02d, CY=%04d, TC=%04u, CUT=%04d, NOW=%04d\n", 156 fc, (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), 157 157 transmit_at_cycle, cycles_until_transmit, now_cycle ); 158 158 #endif … … 200 200 // we are too late 201 201 debugOutput(DEBUG_LEVEL_VERBOSE, 202 "Too late: CY=%04 lu, TC=%04u, CUT=%04d, TSP=%011lu(%04u)\n",203 CYCLE_TIMER_GET_CYCLES(pkt_ctr),202 "Too late: CY=%04d, TC=%04u, CUT=%04d, TSP=%011"PRIu64" (%04u)\n", 203 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), 204 204 transmit_at_cycle, cycles_until_transmit, 205 205 presentation_time, (unsigned int)TICKS_TO_CYCLES(presentation_time) ); … … 229 229 // for timestamp tracing 230 230 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 231 "XMIT PKT: TSP= %011 lu(%04u) (%04u) (%04u)\n",231 "XMIT PKT: TSP= %011"PRIu64" (%04u) (%04u) (%04u)\n", 232 232 presentation_time, 233 233 (unsigned int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), … … 239 239 { 240 240 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 241 "Too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011 lu (%04u), TSP=%011llu(%04u)\n",242 CYCLE_TIMER_GET_CYCLES(pkt_ctr),241 "Too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011"PRIu64" (%04u), TSP=%011"PRId64" (%04u)\n", 242 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), 243 243 transmit_at_cycle, cycles_until_transmit, 244 244 transmit_at_time, (unsigned int)TICKS_TO_CYCLES(transmit_at_time), … … 248 248 { 249 249 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 250 "Way too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011 lu (%04u), TSP=%011llu(%04u)\n",251 CYCLE_TIMER_GET_CYCLES(pkt_ctr),250 "Way too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011"PRIu64" (%04u), TSP=%011"PRId64"(%04u)\n", 251 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), 252 252 transmit_at_cycle, cycles_until_transmit, 253 253 transmit_at_time, (unsigned int)TICKS_TO_CYCLES(transmit_at_time), … … 269 269 { 270 270 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 271 "XMIT DATA: TSP= %011 lu(%04u)\n",271 "XMIT DATA: TSP= %011"PRIu64" (%04u)\n", 272 272 m_last_timestamp, 273 273 (unsigned int)TICKS_TO_CYCLES(m_last_timestamp)); … … 301 301 struct iec61883_packet *packet = ( struct iec61883_packet * ) data; 302 302 debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 303 "XMIT SILENT (cy %04d): CY=%04u, TSP=%011lu(%04u)\n",304 CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp,303 "XMIT SILENT (cy %04d): TSP=%011"PRIu64" (%04u)\n", 304 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp, 305 305 (unsigned int)TICKS_TO_CYCLES(m_last_timestamp)); 306 306 … … 338 338 struct iec61883_packet *packet = ( struct iec61883_packet * ) data; 339 339 debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 340 "XMIT EMPTY (cy %04d): CY=%04u, TSP=%011lu(%04u)\n",341 CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp,340 "XMIT EMPTY (cy %04d): TSP=%011"PRIu64" (%04u)\n", 341 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp, 342 342 (unsigned int)TICKS_TO_CYCLES(m_last_timestamp) ); 343 343 packet->sid = m_local_node_id; branches/libffado-2.0/src/libstreaming/generic/StreamProcessor.cpp
r1721 r1722 378 378 if (m_last_timestamp > 0 && m_last_timestamp2 > 0) { 379 379 int64_t tsp_diff = diffTicks(m_last_timestamp, m_last_timestamp2); 380 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "TSP diff: % ld\n", tsp_diff);380 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "TSP diff: %"PRId64"\n", tsp_diff); 381 381 double tsp_diff_d = tsp_diff; 382 382 double fs_syt = 1.0/tsp_diff_d; … … 399 399 if(diff-ticks_per_packet > 50 || diff-ticks_per_packet < -50) { 400 400 debugOutput(DEBUG_LEVEL_VERBOSE, 401 "cy %04 lu rather large TSP difference TS=%011lu => TS=%011lu(%d, nom %d)\n",402 CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp2,401 "cy %04d rather large TSP difference TS=%011"PRIu64" => TS=%011"PRIu64" (%d, nom %d)\n", 402 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp2, 403 403 m_last_timestamp, diff, ticks_per_packet); 404 404 // !!!HACK!!! FIXME: this is the result of a failure in wrapping/unwrapping somewhere … … 410 410 diff = diffTicks(last_timestamp_fixed, m_last_timestamp2); 411 411 if(diff-ticks_per_packet < 50 && diff-ticks_per_packet > -50) { 412 debugWarning("cy %04 lu rather large TSP difference TS=%011lu => TS=%011lu(%d, nom %d)\n",413 CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp2,412 debugWarning("cy %04d rather large TSP difference TS=%011"PRIu64" => TS=%011"PRIu64" (%d, nom %d)\n", 413 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp2, 414 414 m_last_timestamp, diff, ticks_per_packet); 415 415 debugWarning("HACK: fixed by adding one second of ticks. This is a bug being run-time fixed.\n"); … … 420 420 diff = diffTicks(last_timestamp_fixed, m_last_timestamp2); 421 421 if(diff-ticks_per_packet < 50 && diff-ticks_per_packet > -50) { 422 debugWarning("cy %04 lu rather large TSP difference TS=%011lu => TS=%011lu(%d, nom %d)\n",423 CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp2,422 debugWarning("cy %04d rather large TSP difference TS=%011"PRIu64" => TS=%011"PRIu64" (%d, nom %d)\n", 423 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp2, 424 424 m_last_timestamp, diff, ticks_per_packet); 425 425 debugWarning("HACK: fixed by subtracing one second of ticks. This is a bug being run-time fixed.\n"); … … 429 429 } 430 430 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 431 "%04u %011 lu %011lu%d %d\n",432 CYCLE_TIMER_GET_CYCLES(pkt_ctr),431 "%04u %011"PRIu64" %011"PRIu64" %d %d\n", 432 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), 433 433 m_last_timestamp2, m_last_timestamp, 434 434 diff, ticks_per_packet); … … 437 437 438 438 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 439 "RECV: CY=%04u TS=%011 lu\n",440 CYCLE_TIMER_GET_CYCLES(pkt_ctr),439 "RECV: CY=%04u TS=%011"PRIu64"\n", 440 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), 441 441 m_last_timestamp); 442 442 … … 606 606 if (result == eCRV_Packet) { 607 607 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 608 "XMIT SILENT: CY=%04u TS=%011 lu\n",609 CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp);608 "XMIT SILENT: CY=%04u TS=%011"PRIu64"\n", 609 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp); 610 610 611 611 // assumed not to xrun … … 657 657 if (result == eCRV_Packet || result == eCRV_Defer) { 658 658 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 659 "XMIT: CY=%04u TS=%011 lu\n",660 CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp);659 "XMIT: CY=%04u TS=%011"PRIu64"\n", 660 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp); 661 661 662 662 // valid packet timestamp … … 694 694 if (m_last_timestamp > 0 && m_last_timestamp2 > 0) { 695 695 int64_t tsp_diff = diffTicks(m_last_timestamp, m_last_timestamp2); 696 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "TSP diff: % ld\n", tsp_diff);696 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "TSP diff: %"PRId64"\n", tsp_diff); 697 697 double tsp_diff_d = tsp_diff; 698 698 double fs_syt = 1.0/tsp_diff_d; … … 703 703 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "Nom fs: %12f, Instantanous fs: %12f, diff: %12f (%12f)\n", 704 704 fs_nom, fs_syt, fs_diff, fs_diff_norm); 705 // debugOutput(DEBUG_LEVEL_VERBOSE, "Diff fs: %12f, m_last_timestamp: %011 lu, m_last_timestamp2: %011lu\n",705 // debugOutput(DEBUG_LEVEL_VERBOSE, "Diff fs: %12f, m_last_timestamp: %011"PRIu64", m_last_timestamp2: %011"PRIu64"\n", 706 706 // fs_diff, m_last_timestamp, m_last_timestamp2); 707 707 if (fs_diff_norm > 0.01 || fs_diff_norm < -0.01) { … … 716 716 if(diff-ticks_per_packet > 50 || diff-ticks_per_packet < -50) { 717 717 debugOutput(DEBUG_LEVEL_VERBOSE, 718 "cy %04 ld, rather large TSP difference TS=%011lu => TS=%011lu(%d, nom %d)\n",719 CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp2,718 "cy %04d, rather large TSP difference TS=%011"PRIu64" => TS=%011"PRIu64" (%d, nom %d)\n", 719 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp2, 720 720 m_last_timestamp, diff, ticks_per_packet); 721 721 } 722 722 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 723 "%04 ld %011lu %011lu%d %d\n",724 CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp2,723 "%04d %011"PRIu64" %011"PRIu64" %d %d\n", 724 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp2, 725 725 m_last_timestamp, diff, ticks_per_packet); 726 726 } … … 757 757 goto send_empty_packet; 758 758 } else if (result == eCRV_Again) { 759 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "have to retry cycle % ld\n",CYCLE_TIMER_GET_CYCLES(pkt_ctr));759 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "have to retry cycle %d\n", (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr)); 760 760 if(m_state != m_next_state) { 761 761 debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state from %s to %s\n", … … 792 792 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 793 793 "XMIT EMPTY: CY=%04u\n", 794 CYCLE_TIMER_GET_CYCLES(pkt_ctr));794 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr)); 795 795 796 796 generateEmptyPacketHeader(data, length, tag, sy, pkt_ctr); … … 809 809 bool result; 810 810 debugOutputExtreme( DEBUG_LEVEL_VERBOSE, 811 "(%p, %s) getFrames(%d, %11 lu)\n",811 "(%p, %s) getFrames(%d, %11"PRIu64")\n", 812 812 this, getTypeString(), nbframes, ts); 813 813 assert( getType() == ePT_Receive ); … … 840 840 lag_frames = (((float)lag_ticks) / srate); 841 841 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 842 "stream (%p): drifts %6d ticks = %10.5f frames (rate=%10.5f), % ld, %lu, %d\n",842 "stream (%p): drifts %6d ticks = %10.5f frames (rate=%10.5f), %"PRId64", %"PRIu64", %d\n", 843 843 this, lag_ticks, lag_frames, srate, ts, ts_expected, fc); 844 844 if (lag_frames >= 1.0) { 845 845 // the stream lags 846 debugOutput(DEBUG_LEVEL_VERBOSE, "stream (%p): lags with %6d ticks = %10.5f frames (rate=%10.5f), % ld, %lu, %d\n",846 debugOutput(DEBUG_LEVEL_VERBOSE, "stream (%p): lags with %6d ticks = %10.5f frames (rate=%10.5f), %"PRId64", %"PRIu64", %d\n", 847 847 this, lag_ticks, lag_frames, srate, ts, ts_expected, fc); 848 848 } else if (lag_frames <= -1.0) { 849 849 // the stream leads 850 debugOutput(DEBUG_LEVEL_VERBOSE, "stream (%p): leads with %6d ticks = %10.5f frames (rate=%10.5f), % ld, %lu, %d\n",850 debugOutput(DEBUG_LEVEL_VERBOSE, "stream (%p): leads with %6d ticks = %10.5f frames (rate=%10.5f), %"PRId64", %"PRIu64", %d\n", 851 851 this, lag_ticks, lag_frames, srate, ts, ts_expected, fc); 852 852 } … … 862 862 { 863 863 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 864 "stream (%p): dry run %d frames (@ ts=% ld)\n",864 "stream (%p): dry run %d frames (@ ts=%"PRId64")\n", 865 865 this, nbframes, ts); 866 866 // dry run on this side means that we put silence in all enabled ports … … 873 873 { 874 874 bool result; 875 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "StreamProcessor::dropFrames(%d, % ld)\n", nbframes, ts);875 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "StreamProcessor::dropFrames(%d, %"PRId64")\n", nbframes, ts); 876 876 result = m_data_buffer->dropFrames(nbframes); 877 877 SIGNAL_ACTIVITY_ISO_RECV; … … 883 883 bool result; 884 884 debugOutputExtreme( DEBUG_LEVEL_VERBOSE, 885 "(%p, %s) putFrames(%d, %11 lu)\n",885 "(%p, %s) putFrames(%d, %11"PRIu64")\n", 886 886 this, getTypeString(), nbframes, ts); 887 887 assert( getType() == ePT_Transmit ); … … 896 896 { 897 897 debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 898 "StreamProcessor::putFramesWet(%d, % lu)\n",898 "StreamProcessor::putFramesWet(%d, %"PRIu64")\n", 899 899 nbframes, ts); 900 900 // transfer the data 901 901 m_data_buffer->blockProcessWriteFrames(nbframes, ts); 902 902 debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 903 " New timestamp: % lu\n", ts);903 " New timestamp: %"PRIu64"\n", ts); 904 904 return true; // FIXME: what about failure? 905 905 } … … 909 909 { 910 910 debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 911 "StreamProcessor::putFramesDry(%d, % lu)\n",911 "StreamProcessor::putFramesDry(%d, %"PRIu64")\n", 912 912 nbframes, ts); 913 913 // do nothing … … 919 919 { 920 920 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, 921 "StreamProcessor::putSilenceFrames(%d, % lu)\n",921 "StreamProcessor::putSilenceFrames(%d, %"PRIu64")\n", 922 922 nbframes, ts); 923 923 … … 1070 1070 // make the scratch buffer one period of frames long 1071 1071 m_scratch_buffer_size_bytes = m_StreamProcessorManager.getPeriodSize() * getEventsPerFrame() * getEventSize(); 1072 debugOutput( DEBUG_LEVEL_VERBOSE, " Allocate scratch buffer of % ld quadlets\n", m_scratch_buffer_size_bytes);1072 debugOutput( DEBUG_LEVEL_VERBOSE, " Allocate scratch buffer of %zd quadlets\n", m_scratch_buffer_size_bytes); 1073 1073 if(m_scratch_buffer) delete[] m_scratch_buffer; 1074 1074 m_scratch_buffer = new byte_t[m_scratch_buffer_size_bytes]; … … 1159 1159 #ifdef DEBUG 1160 1160 uint64_t now = m_1394service.getCycleTimerTicks(); 1161 debugOutput(DEBUG_LEVEL_VERBOSE," Now : %011 lu(%03us %04uc %04ut)\n",1161 debugOutput(DEBUG_LEVEL_VERBOSE," Now : %011"PRIu64" (%03us %04uc %04ut)\n", 1162 1162 now, 1163 1163 (unsigned int)TICKS_TO_SECS(now), 1164 1164 (unsigned int)TICKS_TO_CYCLES(now), 1165 1165 (unsigned int)TICKS_TO_OFFSET(now)); 1166 debugOutput(DEBUG_LEVEL_VERBOSE," Start at : %011 lu(%03us %04uc %04ut)\n",1166 debugOutput(DEBUG_LEVEL_VERBOSE," Start at : %011"PRIu64" (%03us %04uc %04ut)\n", 1167 1167 tx, 1168 1168 (unsigned int)TICKS_TO_SECS(tx), … … 1205 1205 #ifdef DEBUG 1206 1206 uint64_t now = m_1394service.getCycleTimerTicks(); 1207 debugOutput(DEBUG_LEVEL_VERBOSE," Now : %011 lu(%03us %04uc %04ut)\n",1207 debugOutput(DEBUG_LEVEL_VERBOSE," Now : %011"PRIu64" (%03us %04uc %04ut)\n", 1208 1208 now, 1209 1209 (unsigned int)TICKS_TO_SECS(now), 1210 1210 (unsigned int)TICKS_TO_CYCLES(now), 1211 1211 (unsigned int)TICKS_TO_OFFSET(now)); 1212 debugOutput(DEBUG_LEVEL_VERBOSE," Start at : %011 lu(%03us %04uc %04ut)\n",1212 debugOutput(DEBUG_LEVEL_VERBOSE," Start at : %011"PRIu64" (%03us %04uc %04ut)\n", 1213 1213 tx, 1214 1214 (unsigned int)TICKS_TO_SECS(tx), … … 1229 1229 #ifdef DEBUG 1230 1230 uint64_t now = m_1394service.getCycleTimerTicks(); 1231 debugOutput(DEBUG_LEVEL_VERBOSE," Now : %011 lu(%03us %04uc %04ut)\n",1231 debugOutput(DEBUG_LEVEL_VERBOSE," Now : %011"PRIu64" (%03us %04uc %04ut)\n", 1232 1232 now, 1233 1233 (unsigned int)TICKS_TO_SECS(now), 1234 1234 (unsigned int)TICKS_TO_CYCLES(now), 1235 1235 (unsigned int)TICKS_TO_OFFSET(now)); 1236 debugOutput(DEBUG_LEVEL_VERBOSE," Stop at : %011 lu(%03us %04uc %04ut)\n",1236 debugOutput(DEBUG_LEVEL_VERBOSE," Stop at : %011"PRIu64" (%03us %04uc %04ut)\n", 1237 1237 tx, 1238 1238 (unsigned int)TICKS_TO_SECS(tx), … … 1254 1254 #ifdef DEBUG 1255 1255 uint64_t now = m_1394service.getCycleTimerTicks(); 1256 debugOutput(DEBUG_LEVEL_VERBOSE," Now : %011 lu(%03us %04uc %04ut)\n",1256 debugOutput(DEBUG_LEVEL_VERBOSE," Now : %011"PRIu64" (%03us %04uc %04ut)\n", 1257 1257 now, 1258 1258 (unsigned int)TICKS_TO_SECS(now), 1259 1259 (unsigned int)TICKS_TO_CYCLES(now), 1260 1260 (unsigned int)TICKS_TO_OFFSET(now)); 1261 debugOutput(DEBUG_LEVEL_VERBOSE," Stop at : %011 lu(%03us %04uc %04ut)\n",1261 debugOutput(DEBUG_LEVEL_VERBOSE," Stop at : %011"PRIu64" (%03us %04uc %04ut)\n", 1262 1262 tx, 1263 1263 (unsigned int)TICKS_TO_SECS(tx), … … 1901 1901 } 1902 1902 uint64_t now = m_1394service.getCycleTimerTicks(); 1903 debugOutputShort( DEBUG_LEVEL_NORMAL, " Now : %011 lu(%03us %04uc %04ut)\n",1903 debugOutputShort( DEBUG_LEVEL_NORMAL, " Now : %011"PRIu64" (%03us %04uc %04ut)\n", 1904 1904 now, 1905 1905 (unsigned int)TICKS_TO_SECS(now), branches/libffado-2.0/src/libstreaming/motu/MotuReceiveStreamProcessor.cpp
r1721 r1722 182 182 #ifdef DEBUG 183 183 if(isRunning()) { 184 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"STMP: % luticks | tpf=%f\n",184 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"STMP: %"PRIu64"ticks | tpf=%f\n", 185 185 m_last_timestamp, getTicksPerFrame()); 186 186 } branches/libffado-2.0/src/libstreaming/motu/MotuTransmitStreamProcessor.cpp
r1721 r1722 197 197 // we are too late 198 198 debugOutput(DEBUG_LEVEL_VERBOSE, 199 "Too late: CY=%04u, TC=%04u, CUT=%04d, TSP=%011 lu(%04u)\n",199 "Too late: CY=%04u, TC=%04u, CUT=%04d, TSP=%011"PRIu64" (%04u)\n", 200 200 cycle, 201 201 transmit_at_cycle, cycles_until_transmit, … … 232 232 { 233 233 debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, 234 "Too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011 lu (%04u), TSP=%011lu(%04u)\n",234 "Too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011"PRIu64" (%04u), TSP=%011"PRIu64" (%04u)\n", 235 235 cycle, 236 236 transmit_at_cycle, cycles_until_transmit, … … 241 241 { 242 242 debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, 243 "Way too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011 lu (%04u), TSP=%011lu(%04u)\n",243 "Way too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011"PRIu64" (%04u), TSP=%011"PRIu64" (%04u)\n", 244 244 cycle, 245 245 transmit_at_cycle, cycles_until_transmit, … … 289 289 uint32_t pkt_ctr ) 290 290 { 291 debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, "XMIT EMPTY: CY=%04 lu, TSP=%011lu(%04u)\n",292 CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp,291 debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, "XMIT EMPTY: CY=%04d, TSP=%011"PRIu64" (%04u)\n", 292 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp, 293 293 ( unsigned int ) TICKS_TO_CYCLES ( m_last_timestamp ) ); 294 294 … … 318 318 unsigned int cycle = CYCLE_TIMER_GET_CYCLES(pkt_ctr); 319 319 320 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "XMIT SILENT: CY=%04u, TSP=%011 lu(%04u)\n",320 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "XMIT SILENT: CY=%04u, TSP=%011"PRIu64" (%04u)\n", 321 321 cycle, m_last_timestamp, 322 322 ( unsigned int ) TICKS_TO_CYCLES ( m_last_timestamp ) ); branches/libffado-2.0/src/libstreaming/StreamProcessorManager.cpp
r1721 r1722 192 192 debugError("(%p) sem_[timed]wait error (result=%d errno=EINVAL)\n", 193 193 this, result); 194 debugError("(%p) timeout_nsec=%ld ts.sec=%ld ts.nsec=%ld\n", 195 this, m_activity_wait_timeout_nsec, ts.tv_sec, ts.tv_nsec); 194 debugError("(%p) timeout_nsec=%"PRId64" ts.sec=%"PRId64" ts.nsec=%"PRId64"\n", 195 this, m_activity_wait_timeout_nsec, 196 (int64_t)ts.tv_sec, (int64_t)ts.tv_nsec); 196 197 return eAR_Error; 197 198 } else { 198 199 debugError("(%p) sem_[timed]wait error (result=%d errno=%d)\n", 199 200 this, result, errno); 200 debugError("(%p) timeout_nsec=%ld ts.sec=%ld ts.nsec=%ld\n", 201 this, m_activity_wait_timeout_nsec, ts.tv_sec, ts.tv_nsec); 201 debugError("(%p) timeout_nsec=%"PRId64" ts.sec=%"PRId64" ts.nsec=%"PRId64"\n", 202 this, m_activity_wait_timeout_nsec, 203 (int64_t)ts.tv_sec, (int64_t)ts.tv_nsec); 202 204 return eAR_Error; 203 205 } … … 540 542 #ifdef DEBUG 541 543 int64_t now = Util::SystemTimeSource::getCurrentTime(); 542 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "CTR pred: % ld, syncdelay: %lld, diff: %lld\n", ticks_at_period, ticks_at_period_margin, ticks_at_period_margin-ticks_at_period );543 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "PREWAIT pred: % ld, now: %lld, wait: %lld\n", pred_system_time_at_xfer, now, pred_system_time_at_xfer-now );544 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "CTR pred: %"PRId64", syncdelay: %"PRId64", diff: %"PRId64"\n", ticks_at_period, ticks_at_period_margin, ticks_at_period_margin-ticks_at_period ); 545 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "PREWAIT pred: %"PRId64", now: %"PRId64", wait: %"PRId64"\n", pred_system_time_at_xfer, now, pred_system_time_at_xfer-now ); 544 546 #endif 545 547 … … 549 551 #ifdef DEBUG 550 552 now = Util::SystemTimeSource::getCurrentTime(); 551 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "POSTWAIT pred: % ld, now: %lld, excess: %lld\n", pred_system_time_at_xfer, now, now-pred_system_time_at_xfer );553 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "POSTWAIT pred: %"PRId64", now: %"PRId64", excess: %"PRId64"\n", pred_system_time_at_xfer, now, now-pred_system_time_at_xfer ); 552 554 #endif 553 555 } … … 570 572 // figure out where we are now 571 573 uint64_t time_of_first_sample = m_SyncSource->getTimeAtPeriod(); 572 debugOutput( DEBUG_LEVEL_VERBOSE, " sync at TS=%011 lu(%03us %04uc %04ut)...\n",574 debugOutput( DEBUG_LEVEL_VERBOSE, " sync at TS=%011"PRIu64" (%03us %04uc %04ut)...\n", 573 575 time_of_first_sample, 574 576 (unsigned int)TICKS_TO_SECS(time_of_first_sample), … … 587 589 time_of_first_sample = addTicks(time_of_first_sample, 588 590 time_for_startup_ticks); 589 debugOutput( DEBUG_LEVEL_VERBOSE, " add %d frames (%011 luticks)...\n",591 debugOutput( DEBUG_LEVEL_VERBOSE, " add %d frames (%011"PRIu64" ticks)...\n", 590 592 time_for_startup_frames, time_for_startup_ticks); 591 593 592 debugOutput( DEBUG_LEVEL_VERBOSE, " => first sample at TS=%011 lu(%03us %04uc %04ut)...\n",594 debugOutput( DEBUG_LEVEL_VERBOSE, " => first sample at TS=%011"PRIu64" (%03us %04uc %04ut)...\n", 593 595 time_of_first_sample, 594 596 (unsigned int)TICKS_TO_SECS(time_of_first_sample), … … 603 605 uint64_t time_to_start_recv = substractTicks(time_of_first_sample, 604 606 prestart_cycles_for_recv * TICKS_PER_CYCLE); 605 debugOutput( DEBUG_LEVEL_VERBOSE, " => xmit starts at TS=%011 lu(%03us %04uc %04ut)...\n",607 debugOutput( DEBUG_LEVEL_VERBOSE, " => xmit starts at TS=%011"PRIu64" (%03us %04uc %04ut)...\n", 606 608 time_to_start_xmit, 607 609 (unsigned int)TICKS_TO_SECS(time_to_start_xmit), 608 610 (unsigned int)TICKS_TO_CYCLES(time_to_start_xmit), 609 611 (unsigned int)TICKS_TO_OFFSET(time_to_start_xmit)); 610 debugOutput( DEBUG_LEVEL_VERBOSE, " => recv starts at TS=%011 lu(%03us %04uc %04ut)...\n",612 debugOutput( DEBUG_LEVEL_VERBOSE, " => recv starts at TS=%011"PRIu64" (%03us %04uc %04ut)...\n", 611 613 time_to_start_recv, 612 614 (unsigned int)TICKS_TO_SECS(time_to_start_recv), … … 660 662 signed int fc; 661 663 (*it)->getBufferHeadTimestamp ( &ts, &fc ); 662 debugOutput( DEBUG_LEVEL_VERBOSE, " transmit buffer tail %010 ld => head TS %010lu, fc=%d...\n",664 debugOutput( DEBUG_LEVEL_VERBOSE, " transmit buffer tail %010"PRId64" => head TS %010"PRIu64", fc=%d...\n", 663 665 time_of_first_sample, (uint64_t)ts, fc); 664 666 } … … 690 692 } 691 693 if(!m_SyncSource->scheduleStartRunning(time_to_start_sync)) { 692 debugError("m_SyncSource->scheduleStartRunning(%11 lu) failed\n", time_to_start_sync);694 debugError("m_SyncSource->scheduleStartRunning(%11"PRIu64") failed\n", time_to_start_sync); 693 695 return false; 694 696 } … … 700 702 if(*it != m_SyncSource) { 701 703 if(!(*it)->scheduleStartRunning(time_to_start_recv)) { 702 debugError("%p->scheduleStartRunning(%11 lu) failed\n", *it, time_to_start_recv);704 debugError("%p->scheduleStartRunning(%11"PRIu64") failed\n", *it, time_to_start_recv); 703 705 return false; 704 706 } … … 710 712 if(*it != m_SyncSource) { 711 713 if(!(*it)->scheduleStartRunning(time_to_start_xmit)) { 712 debugError("%p->scheduleStartRunning(%11 lu) failed\n", *it, time_to_start_xmit);714 debugError("%p->scheduleStartRunning(%11"PRIu64") failed\n", *it, time_to_start_xmit); 713 715 return false; 714 716 } … … 743 745 #endif 744 746 745 debugOutput( DEBUG_LEVEL_VERBOSE, " initial time of transfer %010 ld, rate %f...\n",747 debugOutput( DEBUG_LEVEL_VERBOSE, " initial time of transfer %010"PRId64", rate %f...\n", 746 748 m_time_of_transfer, rate); 747 749 … … 762 764 763 765 int64_t transmit_tail_timestamp = addTicks(m_time_of_transfer, delay_in_ticks); 764 debugOutput( DEBUG_LEVEL_VERBOSE, " preset transmit tail TS %010 ld, rate %f...\n",766 debugOutput( DEBUG_LEVEL_VERBOSE, " preset transmit tail TS %010"PRId64", rate %f...\n", 765 767 transmit_tail_timestamp, rate); 766 768 … … 773 775 signed int fc; 774 776 (*it)->getBufferHeadTimestamp ( &ts, &fc ); 775 debugOutput( DEBUG_LEVEL_VERBOSE, " => transmit head TS %010 ld, fc=%d...\n",777 debugOutput( DEBUG_LEVEL_VERBOSE, " => transmit head TS %010"PRId64", fc=%d...\n", 776 778 (uint64_t)ts, fc); 777 779 } … … 830 832 StreamProcessor *s = m_ReceiveProcessors.at(i); 831 833 diff = diffTicks(m_SyncSource->getTimeAtPeriod(), s->getTimeAtPeriod()); 832 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, " offset between SyncSP %p and SP %p is % ldticks...\n",834 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, " offset between SyncSP %p and SP %p is %"PRId64" ticks...\n", 833 835 m_SyncSource, s, diff); 834 836 if ( nb_sync_runs == periods_per_align_try ) { … … 850 852 diff_between_streams[i] /= periods_per_align_try; 851 853 diff_between_streams_frames[i] = (int)roundf(diff_between_streams[i] / s->getTicksPerFrame()); 852 debugOutput( DEBUG_LEVEL_VERBOSE, " avg offset between SyncSP %p and SP %p is % ldticks, %d frames...\n",854 debugOutput( DEBUG_LEVEL_VERBOSE, " avg offset between SyncSP %p and SP %p is %"PRId64" ticks, %d frames...\n", 853 855 m_SyncSource, s, diff_between_streams[i], diff_between_streams_frames[i]); 854 856 … … 1100 1102 #ifdef DEBUG 1101 1103 int64_t now = Util::SystemTimeSource::getCurrentTime(); 1102 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "CTR pred: % ld, syncdelay: %lld, diff: %lld\n", ticks_at_period, ticks_at_period_margin, ticks_at_period_margin-ticks_at_period );1103 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "PREWAIT pred: % ld, now: %lld, wait: %lld\n", pred_system_time_at_xfer, now, pred_system_time_at_xfer-now );1104 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "CTR pred: %"PRId64", syncdelay: %"PRId64", diff: %"PRId64"\n", ticks_at_period, ticks_at_period_margin, ticks_at_period_margin-ticks_at_period ); 1105 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "PREWAIT pred: %"PRId64", now: %"PRId64", wait: %"PRId64"\n", pred_system_time_at_xfer, now, pred_system_time_at_xfer-now ); 1104 1106 #endif 1105 1107 … … 1109 1111 #ifdef DEBUG 1110 1112 now = Util::SystemTimeSource::getCurrentTime(); 1111 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "POSTWAIT pred: % ld, now: %lld, excess: %lld\n", pred_system_time_at_xfer, now, now-pred_system_time_at_xfer );1113 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "POSTWAIT pred: %"PRId64", now: %"PRId64", excess: %"PRId64"\n", pred_system_time_at_xfer, now, now-pred_system_time_at_xfer ); 1112 1114 #endif 1113 1115 … … 1239 1241 // so 50 ticks = 10%, which is a rather large jitter value. 1240 1242 if(diff-ticks_per_period > 50 || diff-ticks_per_period < -50) { 1241 debugOutput(DEBUG_LEVEL_VERBOSE, "rather large TSP difference TS=%011 lu => TS=%011lu(%d, nom %d)\n",1243 debugOutput(DEBUG_LEVEL_VERBOSE, "rather large TSP difference TS=%011"PRIu64" => TS=%011"PRIu64" (%d, nom %d)\n", 1242 1244 m_time_of_transfer2, m_time_of_transfer, diff, ticks_per_period); 1243 1245 } … … 1246 1248 1247 1249 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 1248 "transfer period %d at % luticks...\n",1250 "transfer period %d at %"PRIu64" ticks...\n", 1249 1251 m_nbperiods, m_time_of_transfer); 1250 1252 … … 1262 1264 } 1263 1265 debugOutputExtreme( DEBUG_LEVEL_VERY_VERBOSE, 1264 "XF at %011 luticks, RBF=%d, XBF=%d, SUM=%d...\n",1266 "XF at %011"PRIu64" ticks, RBF=%d, XBF=%d, SUM=%d...\n", 1265 1267 m_time_of_transfer, rcv_bf, xmt_bf, rcv_bf+xmt_bf); 1266 1268 … … 1335 1337 if(m_SyncSource == NULL) return false; 1336 1338 debugOutputExtreme( DEBUG_LEVEL_VERY_VERBOSE, 1337 "transfer(%d) at TS=%011 lu(%03us %04uc %04ut)...\n",1339 "transfer(%d) at TS=%011"PRIu64" (%03us %04uc %04ut)...\n", 1338 1340 t, m_time_of_transfer, 1339 1341 (unsigned int)TICKS_TO_SECS(m_time_of_transfer), … … 1349 1351 ++it ) { 1350 1352 if(!(*it)->getFrames(m_period, m_time_of_transfer)) { 1351 debugWarning("could not getFrames(%u, %11 lu) from stream processor (%p)\n",1353 debugWarning("could not getFrames(%u, %11"PRIu64") from stream processor (%p)\n", 1352 1354 m_period, m_time_of_transfer,*it); 1353 1355 retval &= false; // buffer underrun … … 1372 1374 1373 1375 if(!(*it)->putFrames(m_period, transmit_timestamp)) { 1374 debugWarning("could not putFrames(%u,% lu) to stream processor (%p)\n",1376 debugWarning("could not putFrames(%u,%"PRIu64") to stream processor (%p)\n", 1375 1377 m_period, transmit_timestamp, *it); 1376 1378 retval &= false; // buffer underrun … … 1413 1415 if(m_SyncSource == NULL) return false; 1414 1416 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, 1415 "transferSilence(%d) at TS=%011 lu(%03us %04uc %04ut)...\n",1417 "transferSilence(%d) at TS=%011"PRIu64" (%03us %04uc %04ut)...\n", 1416 1418 t, m_time_of_transfer, 1417 1419 (unsigned int)TICKS_TO_SECS(m_time_of_transfer), … … 1427 1429 ++it ) { 1428 1430 if(!(*it)->dropFrames(m_period, m_time_of_transfer)) { 1429 debugWarning("could not dropFrames(%u, %11 lu) from stream processor (%p)\n",1431 debugWarning("could not dropFrames(%u, %11"PRIu64") from stream processor (%p)\n", 1430 1432 m_period, m_time_of_transfer,*it); 1431 1433 retval &= false; // buffer underrun … … 1450 1452 1451 1453 if(!(*it)->putSilenceFrames(m_period, transmit_timestamp)) { 1452 debugWarning("could not putSilenceFrames(%u,% lu) to stream processor (%p)\n",1454 debugWarning("could not putSilenceFrames(%u,%"PRIu64") to stream processor (%p)\n", 1453 1455 m_period, transmit_timestamp, *it); 1454 1456 retval &= false; // buffer underrun … … 1623 1625 #ifdef DEBUG 1624 1626 if(idx >= (int)m_CapturePorts_shadow.size()) { 1625 debugError("Capture port %d out of range (% lu)\n", idx, m_CapturePorts_shadow.size());1627 debugError("Capture port %d out of range (%zd)\n", idx, m_CapturePorts_shadow.size()); 1626 1628 return NULL; 1627 1629 } … … 1631 1633 #ifdef DEBUG 1632 1634 if(idx >= (int)m_PlaybackPorts_shadow.size()) { 1633 debugError("Playback port %d out of range (% lu)\n", idx, m_PlaybackPorts_shadow.size());1635 debugError("Playback port %d out of range (%zd)\n", idx, m_PlaybackPorts_shadow.size()); 1634 1636 return NULL; 1635 1637 } branches/libffado-2.0/src/libutil/Configuration.cpp
r1721 r1722 190 190 int64_t i = s; 191 191 debugOutput(DEBUG_LEVEL_NORMAL, 192 " %s%s = % ld (0x%016lX)\n",192 " %s%s = %"PRId64" (0x%016"PRIX64")\n", 193 193 prefix.c_str(), s.getName(), i, i); 194 194 } … … 259 259 if(t == Setting::TypeInt64) { 260 260 ref = *s; 261 debugOutput(DEBUG_LEVEL_VERBOSE, "path '%s' has value % ld\n", path.c_str(), ref);261 debugOutput(DEBUG_LEVEL_VERBOSE, "path '%s' has value %"PRId64"\n", path.c_str(), ref); 262 262 return true; 263 263 } else { branches/libffado-2.0/src/libutil/serialize_expat.cpp
r1721 r1722 117 117 Xml::Node& n = pNode->add( Xml::Node(tokens[tokens.size() - 1].c_str(), NULL) ); 118 118 char* valstr; 119 asprintf( &valstr, "% ld", value );119 asprintf( &valstr, "%"PRId64"", value ); 120 120 n.set_child_text( valstr ); 121 121 free( valstr ); branches/libffado-2.0/src/libutil/StreamStatistics.cpp
r1721 r1722 55 55 void StreamStatistics::dumpInfo() { 56 56 debugOutputShort( DEBUG_LEVEL_VERBOSE, 57 "--- Stats for %s: min=%d avg=%f max=% ld cnt=%ld sum=%ld\n",57 "--- Stats for %s: min=%d avg=%f max=%"PRId64" cnt=%"PRId64" sum=%"PRId64"\n", 58 58 m_name.c_str(), m_min, m_average, m_max, m_count, m_sum); 59 59 debugOutputShort( DEBUG_LEVEL_VERBOSE, " Signal stats\n"); branches/libffado-2.0/src/libutil/SystemTimeSource.cpp
r1721 r1722 55 55 ts.tv_nsec = (wake_at_usec % (1000000LL)) * 1000LL; 56 56 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 57 "clock_nanosleep until %ld sec, %lldnanosec\n",58 (int64_t)ts.tv_sec, (int64_t)ts.tv_nsec);57 "clock_nanosleep until %"PRId64" sec, %"PRId64" nanosec\n", 58 (int64_t)ts.tv_sec, (int64_t)ts.tv_nsec); 59 59 int err = clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &ts, NULL); 60 60 if(err) { branches/libffado-2.0/src/libutil/Time.h
r864 r1722 25 25 #define __Time__ 26 26 27 #define __STDC_FORMAT_MACROS 27 28 #include <inttypes.h> 28 29 … … 34 35 */ 35 36 typedef uint64_t ffado_microsecs_t; 37 #define PRI_FFADO_MICROSECS_T PRIu64 36 38 37 39 static inline void SleepRelativeUsec(ffado_microsecs_t usec) { branches/libffado-2.0/src/libutil/TimestampedBuffer.cpp
r1721 r1722 505 505 if (written < write_size) 506 506 { 507 debugWarning("ringbuffer full, %u, % lu\n", write_size, written);507 debugWarning("ringbuffer full, %u, %zd\n", write_size, written); 508 508 return false; 509 509 } … … 534 534 if (written < write_size) 535 535 { 536 debugWarning("ringbuffer full, request: %u, actual: % lu\n", write_size, written);536 debugWarning("ringbuffer full, request: %u, actual: %zd\n", write_size, written); 537 537 return false; 538 538 } … … 645 645 646 646 if(vec[0].len + vec[1].len < m_process_block_size) { // this indicates a full event buffer 647 debugError("Event buffer overrun in buffer %p, fill: % lu, bytes2write: %u \n",647 debugError("Event buffer overrun in buffer %p, fill: %zd, bytes2write: %u \n", 648 648 this, ffado_ringbuffer_read_space(m_event_buffer), bytes2write); 649 649 debugShowBackLog(); branches/libffado-2.0/support/firmware/fireworks-downloader.cpp
r1721 r1722 23 23 */ 24 24 25 #include "fbtypes.h" 25 26 #include "downloader.h" 26 27 … … 213 214 214 215 if (node_id < 0) { 215 printMessage("Could not find device with GUID 0x%016 lX\n", guid);216 printMessage("Could not find device with GUID 0x%016"PRIX64"\n", guid); 216 217 return -1; 217 218 } branches/libffado-2.0/tests/streaming/teststreaming3.cpp
r1721 r1722 264 264 } 265 265 266 debugOutput(DEBUG_LEVEL_NORMAL, "verbose level = % ld\n",arguments.verbose);266 debugOutput(DEBUG_LEVEL_NORMAL, "verbose level = %d\n", (int)arguments.verbose); 267 267 setDebugLevel(arguments.verbose); 268 268 branches/libffado-2.0/tests/systemtests/test-isorecv-1.cpp
r1720 r1722 188 188 } 189 189 190 debugOutput(DEBUG_LEVEL_INFO, "Select 1394 port % ld...\n",arguments.port);190 debugOutput(DEBUG_LEVEL_INFO, "Select 1394 port %d...\n", (int) arguments.port); 191 191 do 192 192 { … … 225 225 } 226 226 227 debugOutput(DEBUG_LEVEL_INFO, "Setting RT priority (% ld)...\n",arguments.rtprio);227 debugOutput(DEBUG_LEVEL_INFO, "Setting RT priority (%d)...\n", (int)arguments.rtprio); 228 228 set_realtime_priority(arguments.rtprio); 229 229 branches/libffado-2.0/tests/systemtests/test-isoxmit-1.cpp
r1721 r1722 232 232 } 233 233 234 debugOutput(DEBUG_LEVEL_NORMAL, "verbose level = % ld\n",arguments.verbose);234 debugOutput(DEBUG_LEVEL_NORMAL, "verbose level = %d\n", (int) arguments.verbose); 235 235 setDebugLevel(arguments.verbose); 236 236 … … 243 243 } 244 244 245 debugOutput(DEBUG_LEVEL_INFO, "Select 1394 port % ld...\n",arguments.port);245 debugOutput(DEBUG_LEVEL_INFO, "Select 1394 port %d...\n", (int)arguments.port); 246 246 do 247 247 { … … 270 270 raw1394_set_bus_reset_handler(handle, myResetHandler); 271 271 272 debugOutput(DEBUG_LEVEL_INFO, "Setting RT priority (% ld)...\n",arguments.rtprio);272 debugOutput(DEBUG_LEVEL_INFO, "Setting RT priority (%d)...\n", (int)arguments.rtprio); 273 273 set_realtime_priority(arguments.rtprio); 274 274 branches/libffado-2.0/tests/test-ffado.cpp
r1721 r1722 351 351 352 352 int devices_on_bus = m_deviceManager->getNbDevices(); 353 printf(" port = % ld, devices_on_bus = %d\n",arguments.port, devices_on_bus);353 printf(" port = %d, devices_on_bus = %d\n", (int)arguments.port, devices_on_bus); 354 354 355 355 for(i=0;i<devices_on_bus;i++) { … … 443 443 service.setVerboseLevel(arguments.verbose); 444 444 if ( !service.initialize( arguments.port ) ) { 445 printf("Could not initialize IEEE 1394 service on port % ld\n",arguments.port);445 printf("Could not initialize IEEE 1394 service on port %d\n", (int)arguments.port); 446 446 return exitfunction(-1); 447 447 } … … 455 455 456 456 if (!service.setSplitTimeoutUsecs(nodeid, usecs)) { 457 printf("Failed to set SPLIT_TIMEOUT to %u for node %X on port % ld\n",458 usecs, nodeid, arguments.port);457 printf("Failed to set SPLIT_TIMEOUT to %u for node %X on port %d\n", 458 usecs, nodeid, (int)arguments.port); 459 459 return exitfunction(-1); 460 460 } … … 466 466 service.setVerboseLevel(arguments.verbose); 467 467 if ( !service.initialize( arguments.port ) ) { 468 printf("Could not initialize IEEE 1394 service on port % ld\n",arguments.port);468 printf("Could not initialize IEEE 1394 service on port %d\n", (int)arguments.port); 469 469 return exitfunction(-1); 470 470 } … … 478 478 int usecs = service.getSplitTimeoutUsecs(nodeid); 479 479 if (usecs < 0) { 480 printf("Failed to get SPLIT_TIMEOUT for node %X on port % ld\n",481 nodeid, arguments.port);482 return exitfunction(-1); 483 } 484 printf("SPLIT_TIMEOUT for node %X on port % ld is %u\n",485 nodeid, arguments.port, usecs);480 printf("Failed to get SPLIT_TIMEOUT for node %X on port %d\n", 481 nodeid, (int)arguments.port); 482 return exitfunction(-1); 483 } 484 printf("SPLIT_TIMEOUT for node %X on port %d is %u\n", 485 nodeid, (int)arguments.port, usecs); 486 486 487 487 return exitfunction(0); … … 511 511 uint64_t result_rcv = sytRecvToFullTicks(syt_timestamp, rcv_cycle, ctr_now); 512 512 uint64_t result_xmt = sytXmitToFullTicks(syt_timestamp, rcv_cycle, ctr_now); 513 printf("RCV: 0x%010 lX %010lu XMT: 0x%010lX %010lu CTR: %010lu\n",513 printf("RCV: 0x%010"PRIX64" %010"PRIu64" XMT: 0x%010"PRIX64" %010"PRIu64" CTR: %010"PRIu64"\n", 514 514 result_rcv, result_rcv, result_xmt, result_xmt, CYCLE_TIMER_TO_TICKS(ctr_now)); 515 515