Changeset 1763
- Timestamp:
- 12/19/09 08:12:53 (14 years ago)
- Files:
-
- trunk/libffado (modified) (2 props)
- trunk/libffado/config.h.in (modified) (1 diff)
- trunk/libffado/SConstruct (modified) (9 diffs)
- trunk/libffado/src/bebob/bebob_avdevice.cpp (modified) (2 diffs)
- trunk/libffado/src/bebob/bebob_avplug.cpp (modified) (1 diff)
- trunk/libffado/src/bebob/bebob_dl_bcd.cpp (modified) (4 diffs)
- trunk/libffado/src/bebob/bebob_dl_mgr.cpp (modified) (1 diff)
- trunk/libffado/src/bebob/bebob_dl_mgr.h (modified) (1 diff)
- trunk/libffado/src/bebob/focusrite/focusrite_generic.cpp (modified) (12 diffs)
- trunk/libffado/src/bebob/focusrite/focusrite_saffire.cpp (modified) (1 diff)
- trunk/libffado/src/bebob/focusrite/focusrite_saffirepro.cpp (modified) (4 diffs)
- trunk/libffado/src/bebob/terratec/terratec_device.cpp (modified) (2 diffs)
- trunk/libffado/src/bebob/terratec/terratec_device.h (modified) (1 diff)
- trunk/libffado/src/debugmodule/debugmodule.cpp (modified) (1 diff)
- trunk/libffado/src/debugmodule/debugmodule.h (modified) (2 diffs)
- trunk/libffado/src/devicemanager.cpp (modified) (9 diffs)
- trunk/libffado/src/devicemanager.h (modified) (1 diff)
- trunk/libffado/src/DeviceStringParser.cpp (modified) (7 diffs)
- trunk/libffado/src/DeviceStringParser.h (modified) (1 diff)
- trunk/libffado/src/dice/dice_avdevice.cpp (modified) (45 diffs)
- trunk/libffado/src/dice/dice_eap.cpp (modified) (4 diffs)
- trunk/libffado/src/fbtypes.h (modified) (2 diffs)
- trunk/libffado/src/fireworks/efc/efc_cmds_flash.cpp (modified) (4 diffs)
- trunk/libffado/src/fireworks/efc/efc_cmds_hardware.cpp (modified) (2 diffs)
- trunk/libffado/src/fireworks/efc/efc_cmds_hardware_ctrl.cpp (modified) (2 diffs)
- trunk/libffado/src/fireworks/efc/efc_cmds_ioconfig.cpp (modified) (1 diff)
- trunk/libffado/src/fireworks/efc/efc_cmds_mixer.cpp (modified) (1 diff)
- trunk/libffado/src/fireworks/efc/efc_cmds_monitor.cpp (modified) (1 diff)
- trunk/libffado/src/fireworks/fireworks_control.cpp (modified) (4 diffs)
- trunk/libffado/src/fireworks/fireworks_device.cpp (modified) (6 diffs)
- trunk/libffado/src/fireworks/fireworks_firmware.cpp (modified) (3 diffs)
- trunk/libffado/src/fireworks/fireworks_session_block.cpp (modified) (1 diff)
- trunk/libffado/src/genericavc/stanton/scs.cpp (modified) (12 diffs)
- trunk/libffado/src/libavc/audiosubunit/avc_descriptor_audio.h (modified) (1 diff)
- trunk/libffado/src/libavc/descriptors/avc_descriptor.cpp (modified) (1 diff)
- trunk/libffado/src/libavc/descriptors/avc_descriptor_cmd.cpp (modified) (1 diff)
- trunk/libffado/src/libavc/general/avc_plug.cpp (modified) (1 diff)
- trunk/libffado/src/libcontrol/Element.cpp (modified) (1 diff)
- trunk/libffado/src/libieee1394/ARMHandler.cpp (modified) (1 diff)
- trunk/libffado/src/libieee1394/configrom.cpp (modified) (7 diffs)
- trunk/libffado/src/libieee1394/cycletimer.h (modified) (14 diffs)
- trunk/libffado/src/libieee1394/CycleTimerHelper.cpp (modified) (19 diffs)
- trunk/libffado/src/libieee1394/ieee1394service.cpp (modified) (22 diffs)
- trunk/libffado/src/libieee1394/IsoHandler.cpp (modified) (3 diffs)
- trunk/libffado/src/libieee1394/IsoHandlerManager.cpp (modified) (5 diffs)
- trunk/libffado/src/libieee1394/test-cyclecalc.cpp (modified) (2 diffs)
- trunk/libffado/src/libstreaming/amdtp-oxford/AmdtpOxfordReceiveStreamProcessor.cpp (modified) (1 diff)
- trunk/libffado/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp (modified) (2 diffs)
- trunk/libffado/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.h (modified) (1 diff)
- trunk/libffado/src/libstreaming/amdtp/AmdtpStreamProcessor-common.h (copied) (copied from branches/libffado-2.0/src/libstreaming/amdtp/AmdtpStreamProcessor-common.h)
- trunk/libffado/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp (modified) (11 diffs)
- trunk/libffado/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.h (modified) (1 diff)
- trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp (modified) (40 diffs)
- trunk/libffado/src/libstreaming/generic/StreamProcessor.h (modified) (3 diffs)
- trunk/libffado/src/libstreaming/motu/MotuReceiveStreamProcessor.cpp (modified) (1 diff)
- trunk/libffado/src/libstreaming/motu/MotuTransmitStreamProcessor.cpp (modified) (5 diffs)
- trunk/libffado/src/libstreaming/StreamProcessorManager.cpp (modified) (33 diffs)
- trunk/libffado/src/libstreaming/StreamProcessorManager.h (modified) (1 diff)
- trunk/libffado/src/libutil/Configuration.cpp (modified) (3 diffs)
- trunk/libffado/src/libutil/PosixThread.cpp (modified) (5 diffs)
- trunk/libffado/src/libutil/serialize_expat.cpp (modified) (1 diff)
- trunk/libffado/src/libutil/serialize_libxml.cpp (modified) (2 diffs)
- trunk/libffado/src/libutil/StreamStatistics.cpp (modified) (1 diff)
- trunk/libffado/src/libutil/SystemTimeSource.cpp (modified) (1 diff)
- trunk/libffado/src/libutil/Time.h (modified) (2 diffs)
- trunk/libffado/src/libutil/TimestampedBuffer.cpp (modified) (5 diffs)
- trunk/libffado/src/libutil/TimestampedBuffer.h (modified) (1 diff)
- trunk/libffado/src/motu/motu_avdevice.cpp (modified) (18 diffs)
- trunk/libffado/src/motu/motu_avdevice.h (modified) (8 diffs)
- trunk/libffado/src/motu/motu_controls.cpp (modified) (6 diffs)
- trunk/libffado/src/motu/motu_controls.h (modified) (1 diff)
- trunk/libffado/src/motu/motu_mark3_controls.cpp (copied) (copied from branches/libffado-2.0/src/motu/motu_mark3_controls.cpp)
- trunk/libffado/src/motu/motu_mark3_controls.h (copied) (copied from branches/libffado-2.0/src/motu/motu_mark3_controls.h)
- trunk/libffado/src/motu/motu_mark3_mixerdefs.cpp (copied) (copied from branches/libffado-2.0/src/motu/motu_mark3_mixerdefs.cpp)
- trunk/libffado/src/motu/motu_mark3_mixerdefs.h (copied) (copied from branches/libffado-2.0/src/motu/motu_mark3_mixerdefs.h)
- trunk/libffado/src/motu/motu_mixer.cpp (copied) (copied from branches/libffado-2.0/src/motu/motu_mixer.cpp)
- trunk/libffado/src/motu/motu_mixerdefs.cpp (copied) (copied from branches/libffado-2.0/src/motu/motu_mixerdefs.cpp) (2 diffs)
- trunk/libffado/src/motu/motu_mixerdefs.h (copied) (copied from branches/libffado-2.0/src/motu/motu_mixerdefs.h) (1 diff)
- trunk/libffado/src/SConscript (modified) (1 diff)
- trunk/libffado/support/dbus/SConscript (modified) (1 diff)
- trunk/libffado/support/firmware/fireworks-downloader.cpp (modified) (2 diffs)
- trunk/libffado/support/mixer-qt4/ffado/mixer/motu.py (modified) (1 diff)
- trunk/libffado/support/mixer-qt4/ffado/mixer/phase88.ui (modified) (20 diffs)
- trunk/libffado/support/mixer-qt4/ffado/mixer/saffire.py (modified) (1 diff, 1 prop)
- trunk/libffado/support/mixer-qt4/ffado/regdialog.py (modified) (2 diffs)
- trunk/libffado/tests/streaming/test-ipcclient.cpp (modified) (1 diff)
- trunk/libffado/tests/streaming/teststreaming-ipc.cpp (modified) (4 diffs)
- trunk/libffado/tests/streaming/teststreaming3.cpp (modified) (1 diff)
- trunk/libffado/tests/systemtests/gen-loadpulses.cpp (modified) (3 diffs)
- trunk/libffado/tests/systemtests/test-clock_nanosleep.cpp (modified) (3 diffs)
- trunk/libffado/tests/systemtests/test-isorecv-1.cpp (modified) (2 diffs)
- trunk/libffado/tests/systemtests/test-isoxmit-1.cpp (modified) (3 diffs)
- trunk/libffado/tests/systemtests/test-sysload.cpp (modified) (3 diffs)
- trunk/libffado/tests/test-bufferops.cpp (modified) (4 diffs)
- trunk/libffado/tests/test-dice-eap.cpp (modified) (1 diff)
- trunk/libffado/tests/test-ffado.cpp (modified) (6 diffs)
- trunk/libffado/tests/test-focusrite.cpp (modified) (1 diff)
- trunk/libffado/tests/test-ieee1394service.cpp (modified) (9 diffs)
- trunk/libffado/tests/test-scs.cpp (modified) (1 diff)
- trunk/libffado/tests/test-timestampedbuffer.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado
- Property svnmerge-blocked changed from
/branches/libffado-2.0:1563,1565,1750
to /branches/libffado-2.0:1563,1565,1750 - Property svnmerge-integrated changed from
/branches/libffado-2.0:1-1532,1566-1570,1572-1578,1582-1617,1619-1631,1633,1636-1660,1662-1676,1680-1686
to /branches/libffado-2.0:1-1562,1564,1566-1749,1751-1762
- Property svnmerge-blocked changed from
trunk/libffado/config.h.in
r1673 r1763 117 117 // more robust. It should be noted though that shifting the transfer 118 118 // time to a later time instant also causes the xmit buffer fill to be 119 // lower on average. 119 // lower on average. This can be counteracted by increasing the 120 // STREAMPROCESSORMANAGER_XMIT_PREBUFFER_FRAMES option 120 121 #define STREAMPROCESSORMANAGER_SIGNAL_DELAY_TICKS (3072*0) 122 123 // the number of frames that we prebuffer in the 1394 ISO layer 124 // this adds directly to the roundtrip latency 125 #define STREAMPROCESSORMANAGER_XMIT_PREBUFFER_FRAMES 100 121 126 122 127 // causes the waitForPeriod() call to wait until sufficient trunk/libffado/SConstruct
r1747 r1763 24 24 # 25 25 26 FFADO_API_VERSION ="8"26 FFADO_API_VERSION = "8" 27 27 FFADO_VERSION="2.999.0" 28 28 … … 33 33 import distutils.sysconfig 34 34 35 build_dir = ARGUMENTS.get('BUILDDIR', "")36 if build_dir:37 build_base=build_dir+'/'38 if not os.path.isdir( build_base ):39 os.makedirs( build_base )40 print "Building into: " + build_base41 else:42 build_base=''43 44 35 if not os.path.isdir( "cache" ): 45 36 os.makedirs( "cache" ) 46 37 47 opts = Options( "cache/"+build_base+"options.cache" ) 48 49 # 50 # If this is just to display a help-text for the variable used via ARGUMENTS, then its wrong... 51 opts.Add( "BUILDDIR", "Path to place the built files in", "") 38 opts = Options( "cache/options.cache" ) 52 39 53 40 opts.AddOptions( … … 138 125 139 126 # make sure the necessary dirs exist 140 if not os.path.isdir( "cache /" + build_base):141 os.makedirs( "cache/" + build_base)127 if not os.path.isdir( "cache" ): 128 os.makedirs( "cache" ) 142 129 if not os.path.isdir( 'cache/objects' ): 143 130 os.makedirs( 'cache/objects' ) … … 145 132 CacheDir( 'cache/objects' ) 146 133 147 opts.Save( 'cache/ ' + build_base + "options.cache", env )134 opts.Save( 'cache/options.cache', env ) 148 135 149 136 def ConfigGuess( context ): … … 200 187 conf = Configure( env, 201 188 custom_tests = tests, 202 conf_dir = "cache/" + build_base,203 log_file = "cache/" + build_base + 'config.log' )189 conf_dir = "cache/", 190 log_file = 'cache/config.log' ) 204 191 205 192 if env['SERIALIZE_USE_EXPAT']: … … 365 352 env['BUILD_STATIC_LIB'] = True 366 353 367 if build_base: 368 env['build_base']="#/"+build_base 369 else: 370 env['build_base']="#/" 354 env['build_base']="#/" 371 355 372 356 # … … 529 513 env['REVISION'] = '' 530 514 531 env['FFADO_API_VERSION']=FFADO_API_VERSION 515 # avoid the 1.999.41- type of version for exported versions 516 if env['REVISION'] != '': 517 env['REVISIONSTRING'] = '-' + env['REVISION'] 518 else: 519 env['REVISIONSTRING'] = '' 520 521 env['FFADO_API_VERSION'] = FFADO_API_VERSION 532 522 533 523 env['PACKAGE'] = "libffado" … … 557 547 # ensure that the config.h is updated 558 548 env.Depends( "config.h", "SConstruct" ) 559 env.Depends( "config.h", 'cache/ ' + build_base + "options.cache")549 env.Depends( "config.h", 'cache/options.cache' ) 560 550 561 551 # update version.h whenever the version or SVN revision changes … … 573 563 subdirs.append('tests') 574 564 575 if build_base: 576 #env.SConscript( dirs=subdirs, exports="env", build_dir=build_base ) 577 builddirs = list() 578 for dir in subdirs: 579 builddirs.append( build_base + dir ) 580 env.SConscript( dirs=subdirs, exports="env", build_dir=builddirs ) 581 else: 582 env.SConscript( dirs=subdirs, exports="env" ) 565 env.SConscript( dirs=subdirs, exports="env" ) 583 566 584 567 if 'debian' in COMMAND_LINE_TARGETS: trunk/libffado/src/bebob/bebob_avdevice.cpp
r1543 r1763 724 724 725 725 char* configId; 726 asprintf(&configId, "%016 llx", 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 llx", BeBoB::Device::getConfigurationId() );802 asprintf(&configId, "%016"PRIx64"", BeBoB::Device::getConfigurationId() ); 803 803 if ( !configId ) { 804 804 debugError( "Could not create id string\n" ); trunk/libffado/src/bebob/bebob_avplug.cpp
r1245 r1763 583 583 { 584 584 debugError( "number of output plugs (%d) disagree with " 585 "number of elements in plug address vector (% d)\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()); trunk/libffado/src/bebob/bebob_dl_bcd.cpp
r864 r1763 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: % d bytes 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: % d byte 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: % d byte 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: % d byte 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; trunk/libffado/src/bebob/bebob_dl_mgr.cpp
r1336 r1763 165 165 166 166 return false; 167 } 168 169 std::string 170 BeBoB::BootloaderManager::getSoftwareDate() 171 { 172 return makeDate( m_cachedInfoRegs.m_softwareDate ); 173 } 174 175 std::string 176 BeBoB::BootloaderManager::getSoftwareTime() 177 { 178 return makeDate( m_cachedInfoRegs.m_softwareTime ); 167 179 } 168 180 trunk/libffado/src/bebob/bebob_dl_mgr.h
r932 r1763 67 67 bool setStartBootloader( bool bStartBootloader ) 68 68 { m_bStartBootloader = bStartBootloader; return true; } 69 70 int getSoftwareVersion() {return m_cachedInfoRegs.m_softwareVersion;}; 71 std::string getSoftwareDate(); 72 std::string getSoftwareTime(); 73 69 74 protected: 70 75 enum EObjectType { trunk/libffado/src/bebob/focusrite/focusrite_generic.cpp
r1543 r1763 58 58 FocusriteDevice::setSpecificValue(uint32_t id, uint32_t v) 59 59 { 60 debugOutput(DEBUG_LEVEL_VERBOSE, "Writing parameter address space id 0x%08 lX (%u), data: 0x%08lX\n",60 debugOutput(DEBUG_LEVEL_VERBOSE, "Writing parameter address space id 0x%08X (%u), data: 0x%08X\n", 61 61 id, id, v); 62 62 bool use_avc = false; … … 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... % llu\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... % llu\n", wait );96 debugOutput( DEBUG_LEVEL_VERBOSE, "Rate control... %"PRIu64"\n", wait ); 97 97 Util::SystemTimeSource::SleepUsecRelative(wait); 98 98 } … … 105 105 retval = getSpecificValueARM(id, v); 106 106 } 107 debugOutput(DEBUG_LEVEL_VERBOSE,"Read parameter address space id 0x%08 lX (%u): %08lX\n", id, id, *v);107 debugOutput(DEBUG_LEVEL_VERBOSE,"Read parameter address space id 0x%08X (%u): %08X\n", id, id, *v); 108 108 return retval; 109 109 } … … 161 161 FocusriteDevice::setSpecificValueARM(uint32_t id, uint32_t v) 162 162 { 163 fb_quadlet_t data =v;164 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing parameter address space id 0x%08 lX (%u), data: 0x%08lX\n",163 fb_quadlet_t data = v; 164 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing parameter address space id 0x%08X (%u), data: 0x%08X\n", 165 165 id, id, data); 166 166 … … 169 169 170 170 if(!get1394Service().write_quadlet( nodeId, addr, CondSwapToBus32(data) ) ) { 171 debugError("Could not write to node 0x%04X addr 0x%012 X\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 } … … 179 179 { 180 180 fb_quadlet_t result; 181 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading parameter address space id 0x%08 lX\n", id);181 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading parameter address space id 0x%08X\n", id); 182 182 183 183 fb_nodeaddr_t addr = FR_PARAM_SPACE_START + (id * 4); … … 185 185 186 186 if(!get1394Service().read_quadlet( nodeId, addr, &result ) ) { 187 debugError("Could not read from node 0x%04 llX addr 0x%012llX\n", nodeId, addr);188 return false; 189 } 190 191 result =CondSwapFromBus32(result);192 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Read result: 0x%08 llX\n", result);187 debugError("Could not read from node 0x%04X addr 0x%012"PRIX64"\n", nodeId, addr); 188 return false; 189 } 190 191 result = CondSwapFromBus32(result); 192 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Read result: 0x%08X\n", result); 193 193 194 194 *v = result; … … 385 385 RegisterControl::setValue(uint64_t addr, uint64_t v) 386 386 { 387 debugOutput(DEBUG_LEVEL_VERBOSE, "setValue for addr % llu to %llu\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 % llu = %lu\n",405 debugOutput(DEBUG_LEVEL_VERBOSE, "getValue for %"PRIu64" = %u\n", 406 406 addr, val); 407 407 return val; … … 576 576 struct sCellInfo c = m_CellInfo.at(row).at(col); 577 577 578 debugOutput(DEBUG_LEVEL_VERBOSE, "setValue for id %d row %d col %d to %lf (% ld)\n",578 debugOutput(DEBUG_LEVEL_VERBOSE, "setValue for id %d row %d col %d to %lf (%d)\n", 579 579 c.address, row, col, val, v); 580 580 … … 597 597 return 0; 598 598 } else { 599 debugOutput(DEBUG_LEVEL_VERBOSE, "getValue for id %d row %d col %d = % lu\n",599 debugOutput(DEBUG_LEVEL_VERBOSE, "getValue for id %d row %d col %d = %u\n", 600 600 c.address, row, col, val); 601 601 return val; trunk/libffado/src/bebob/focusrite/focusrite_saffire.cpp
r1617 r1763 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 % llu\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 % llu\n",54 debugOutput( DEBUG_LEVEL_VERBOSE, "No command interval time setting found, defaulting to %"PRIu64"\n", 55 55 m_cmd_time_interval ); 56 56 } trunk/libffado/src/bebob/focusrite/focusrite_saffirepro.cpp
r1617 r1763 423 423 return; 424 424 } 425 debugOutput(DEBUG_LEVEL_VERBOSE, "SYNC_CONFIG field value: %08 lX\n", sync );425 debugOutput(DEBUG_LEVEL_VERBOSE, "SYNC_CONFIG field value: %08X\n", sync ); 426 426 427 427 switch(sync & FR_SAFFIREPRO_CMD_ID_SYNC_CONFIG_MASK) { 428 428 default: 429 debugWarning( "Unexpected SYNC_CONFIG field value: %08 lX\n", sync );429 debugWarning( "Unexpected SYNC_CONFIG field value: %08X\n", sync ); 430 430 case FR_SAFFIREPRO_CMD_SYNC_CONFIG_INTERNAL: 431 431 m_internal_clocksource.active=true; … … 466 466 break; 467 467 default: 468 debugWarning( "Unexpected SYNC_CONFIG_STATE field value: %08 lX\n", sync );468 debugWarning( "Unexpected SYNC_CONFIG_STATE field value: %08X\n", sync ); 469 469 } 470 470 } … … 772 772 break; 773 773 } 774 debugOutput( DEBUG_LEVEL_VERBOSE, "setSampleRate (try %d) failed. Try again...\n" 774 debugOutput( DEBUG_LEVEL_VERBOSE, "setSampleRate (try %d) failed. Try again...\n", ntries); 775 775 } 776 776 … … 872 872 } 873 873 874 debugOutput( DEBUG_LEVEL_VERBOSE, 875 "getCount32: %08lX\n", v ); 874 debugOutput( DEBUG_LEVEL_VERBOSE, "getCount32: %08X\n", v ); 876 875 return v; 877 876 } trunk/libffado/src/bebob/terratec/terratec_device.cpp
r1543 r1763 23 23 24 24 #include "terratec_device.h" 25 #include "src/bebob/bebob_dl_mgr.h" 26 #include "src/bebob/bebob_dl_bcd.h" 25 27 26 28 namespace BeBoB { … … 45 47 BeBoB::Device::showDevice(); 46 48 } 47 /* 'externalsync': ['/Mixer/Selector_8', self.comboExtSync], 48 'syncsource': ['/Mixer/Selector_9', self.comboSyncSource], */ 49 50 bool 51 Phase88Device::discover() 52 { 53 BeBoB::BootloaderManager blMgr( get1394Service(), getNodeId() ); 54 blMgr.printInfoRegisters(); 55 if (blMgr.getSoftwareVersion() < 0x01120d1f) { 56 debugError("The firmware of this Phase88 device is too old. Please update the firmware.\n"); 57 return false; 58 } 59 return BeBoB::Device::discover(); 60 } 61 49 62 void 50 63 Phase88Device::updateClockSources() { trunk/libffado/src/bebob/terratec/terratec_device.h
r1543 r1763 37 37 virtual ~Phase88Device(); 38 38 39 virtual bool discover(); 40 39 41 virtual void showDevice(); 40 42 trunk/libffado/src/debugmodule/debugmodule.cpp
r1713 r1763 185 185 int chars_written=0; 186 186 int retval=0; 187 retval = snprintf(msg, MB_BUFFERSIZE, "%011 llu: %s (%s)[%4d] %s: ",187 retval = snprintf(msg, MB_BUFFERSIZE, "%011"PRIu64": %s (%s)[%4u] %s: ", 188 188 ts_usec, getPreSequence( level ), 189 189 fname, line, function ); trunk/libffado/src/debugmodule/debugmodule.h
r1568 r1763 302 302 void printShort( debug_level_t level, 303 303 const char* format, 304 ... ) const; 304 ... ) const 305 #ifdef __GNUC__ 306 __attribute__((format(printf, 3, 4))) 307 #endif 308 ; 305 309 306 310 void print( debug_level_t level, … … 309 313 unsigned int line, 310 314 const char* format, 311 ... ) const; 315 ... ) const 316 #ifdef __GNUC__ 317 __attribute__((format(printf, 6, 7))) 318 #endif 319 ; 312 320 313 321 bool setLevel( debug_level_t level ) trunk/libffado/src/devicemanager.cpp
r1543 r1763 120 120 { 121 121 if (!deleteElement(*it)) { 122 debugWarning("failed to remove AvDevice from Control::Container\n");122 debugWarning("failed to remove Device from Control::Container\n"); 123 123 } 124 124 delete *it; … … 439 439 // the device has disappeared, remove it from the control tree 440 440 if (!deleteElement(*it)) { 441 debugWarning("failed to remove AvDevice from Control::Container\n");441 debugWarning("failed to remove Device from Control::Container\n"); 442 442 } 443 443 // delete the device … … 455 455 { 456 456 if (!deleteElement(*it)) { 457 debugWarning("failed to remove AvDevice from Control::Container\n");457 debugWarning("failed to remove Device from Control::Container\n"); 458 458 } 459 459 delete *it; … … 542 542 { 543 543 if (!deleteElement(*it2)) { 544 debugWarning("failed to remove AvDevice from Control::Container\n");544 debugWarning("failed to remove Device from Control::Container\n"); 545 545 } 546 546 delete *it2; … … 652 652 653 653 if (!addElement(avDevice)) { 654 debugWarning("failed to add AvDevice to Control::Container\n");654 debugWarning("failed to add Device to Control::Container\n"); 655 655 } 656 656 … … 670 670 // a device id always corresponds to the same device 671 671 sort(m_avDevices.begin(), m_avDevices.end(), FFADODevice::compareGUID); 672 672 673 int i=0; 674 if(m_deviceStringParser->countDeviceStrings()) { // only if there are devicestrings 675 // first map the devices to a position using the device spec strings 676 std::map<fb_octlet_t, int> positionMap; 677 for ( FFADODeviceVectorIterator it = m_avDevices.begin(); 678 it != m_avDevices.end(); 679 ++it ) 680 { 681 int pos = m_deviceStringParser->matchPosition((*it)->getConfigRom()); 682 fb_octlet_t guid = (*it)->getConfigRom().getGuid(); 683 positionMap[guid] = pos; 684 debugOutput( DEBUG_LEVEL_VERBOSE, "Mapping %s to position %d...\n", (*it)->getConfigRom().getGuidString().c_str(), pos ); 685 } 686 687 // now run over all positions, and add the devices that belong to it 688 FFADODeviceVector sorted; 689 int nbPositions = m_deviceStringParser->countDeviceStrings(); 690 for (i=0; i < nbPositions; i++) { 691 for ( FFADODeviceVectorIterator it = m_avDevices.begin(); 692 it != m_avDevices.end(); 693 ++it ) 694 { 695 fb_octlet_t guid = (*it)->getConfigRom().getGuid(); 696 if(positionMap[guid] == i) { 697 sorted.push_back(*it); 698 } 699 } 700 } 701 // assign the new vector 702 flushDebugOutput(); 703 assert(sorted.size() == m_avDevices.size()); 704 m_avDevices = sorted; 705 } 706 707 // set device id's 708 i = 0; 673 709 for ( FFADODeviceVectorIterator it = m_avDevices.begin(); 674 710 it != m_avDevices.end(); … … 710 746 { 711 747 if (!deleteElement(*it)) { 712 debugWarning("failed to remove AvDevice from Control::Container\n");748 debugWarning("failed to remove Device from Control::Container\n"); 713 749 } 714 750 delete *it; … … 827 863 828 864 bool 865 DeviceManager::startStreamingOnDevice(FFADODevice *device) 866 { 867 assert(device); 868 869 int j=0; 870 bool all_streams_started = true; 871 bool device_start_failed = false; 872 for(j=0; j < device->getStreamCount(); j++) { 873 debugOutput(DEBUG_LEVEL_VERBOSE,"Starting stream %d of device %p\n", j, device); 874 // start the stream 875 if (!device->startStreamByIndex(j)) { 876 debugWarning("Could not start stream %d of device %p\n", j, device); 877 all_streams_started = false; 878 break; 879 } 880 } 881 882 if(!all_streams_started) { 883 // disable all streams that did start up correctly 884 for(j = j-1; j >= 0; j--) { 885 debugOutput(DEBUG_LEVEL_VERBOSE,"Stopping stream %d of device %p\n", j, device); 886 // stop the stream 887 if (!device->stopStreamByIndex(j)) { 888 debugWarning("Could not stop stream %d of device %p\n", j, device); 889 } 890 } 891 device_start_failed = true; 892 } else { 893 if (!device->enableStreaming()) { 894 debugWarning("Could not enable streaming on device %p!\n", device); 895 device_start_failed = true; 896 } 897 } 898 return !device_start_failed; 899 } 900 901 bool 829 902 DeviceManager::startStreaming() { 903 bool device_start_failed = false; 904 FFADODeviceVectorIterator it; 905 906 // create the connections for all devices 907 // iterate over the found devices 908 for ( it = m_avDevices.begin(); 909 it != m_avDevices.end(); 910 ++it ) 911 { 912 if (!startStreamingOnDevice(*it)) { 913 debugWarning("Could not start streaming on device %p!\n", *it); 914 device_start_failed = true; 915 break; 916 } 917 } 918 919 // if one of the devices failed to start, 920 // the previous routine should have cleaned up the failing one. 921 // we still have to stop all devices that were started before this one. 922 if(device_start_failed) { 923 for (FFADODeviceVectorIterator it2 = m_avDevices.begin(); 924 it2 != it; 925 ++it2 ) 926 { 927 if (!stopStreamingOnDevice(*it2)) { 928 debugWarning("Could not stop streaming on device %p!\n", *it2); 929 } 930 } 931 return false; 932 } 933 934 // start the stream processor manager to tune in to the channels 935 if(m_processorManager->start()) { 936 return true; 937 } else { 938 debugWarning("Failed to start SPM!\n"); 939 for( it = m_avDevices.begin(); 940 it != m_avDevices.end(); 941 ++it ) 942 { 943 if (!stopStreamingOnDevice(*it)) { 944 debugWarning("Could not stop streaming on device %p!\n", *it); 945 } 946 } 947 return false; 948 } 949 } 950 951 bool 952 DeviceManager::resetStreaming() { 953 return true; 954 } 955 956 bool 957 DeviceManager::stopStreamingOnDevice(FFADODevice *device) 958 { 959 assert(device); 960 bool result = true; 961 962 if (!device->disableStreaming()) { 963 debugWarning("Could not disable streaming on device %p!\n", device); 964 } 965 966 int j=0; 967 for(j=0; j < device->getStreamCount(); j++) { 968 debugOutput(DEBUG_LEVEL_VERBOSE,"Stopping stream %d of device %p\n", j, device); 969 // stop the stream 970 // start the stream 971 if (!device->stopStreamByIndex(j)) { 972 debugWarning("Could not stop stream %d of device %p\n", j, device); 973 result = false; 974 continue; 975 } 976 } 977 return result; 978 } 979 980 bool 981 DeviceManager::stopStreaming() 982 { 983 bool result = true; 984 m_processorManager->stop(); 985 830 986 // create the connections for all devices 831 987 // iterate over the found devices … … 835 991 ++it ) 836 992 { 837 FFADODevice *device = *it; 838 assert(device); 839 840 int j=0; 841 for(j=0; j < device->getStreamCount(); j++) { 842 debugOutput(DEBUG_LEVEL_VERBOSE,"Starting stream %d of device %p\n", j, device); 843 // start the stream 844 if (!device->startStreamByIndex(j)) { 845 debugWarning("Could not start stream %d of device %p\n", j, device); 846 continue; 847 } 848 } 849 850 if (!device->enableStreaming()) { 851 debugWarning("Could not enable streaming on device %p!\n", device); 852 } 853 } 854 855 if(m_processorManager->start()) { 856 return true; 857 } else { 858 stopStreaming(); 859 return false; 860 } 861 } 862 863 bool 864 DeviceManager::resetStreaming() { 865 return true; 866 } 867 868 bool 869 DeviceManager::stopStreaming() 870 { 871 bool result = true; 872 m_processorManager->stop(); 873 874 // create the connections for all devices 875 // iterate over the found devices 876 // add the stream processors of the devices to the managers 877 for ( FFADODeviceVectorIterator it = m_avDevices.begin(); 878 it != m_avDevices.end(); 879 ++it ) 880 { 881 FFADODevice *device = *it; 882 assert(device); 883 884 if (!device->disableStreaming()) { 885 debugWarning("Could not disable streaming on device %p!\n", device); 886 } 887 888 int j=0; 889 for(j=0; j < device->getStreamCount(); j++) { 890 debugOutput(DEBUG_LEVEL_VERBOSE,"Stopping stream %d of device %p\n", j, device); 891 // stop the stream 892 // start the stream 893 if (!device->stopStreamByIndex(j)) { 894 debugWarning("Could not stop stream %d of device %p\n", j, device); 895 result = false; 896 continue; 897 } 898 } 993 stopStreamingOnDevice(*it); 899 994 } 900 995 return result; trunk/libffado/src/devicemanager.h
r1336 r1763 90 90 bool prepareStreaming(); 91 91 bool finishStreaming(); 92 bool startStreamingOnDevice(FFADODevice *device); 92 93 bool startStreaming(); 94 bool stopStreamingOnDevice(FFADODevice *device); 93 95 bool stopStreaming(); 94 96 bool resetStreaming(); trunk/libffado/src/DeviceStringParser.cpp
r1147 r1763 160 160 DeviceStringParser::DeviceString::match(ConfigRom& configRom) 161 161 { 162 debugOutput(DEBUG_LEVEL_VERBOSE, "match %p \n", &configRom);162 debugOutput(DEBUG_LEVEL_VERBOSE, "match %p (%s)\n", &configRom, configRom.getGuidString().c_str()); 163 163 bool match; 164 164 switch(m_Type) { … … 172 172 match &= ((configRom.getNodeId() & 0x3F) == m_node); 173 173 } 174 if(match) { 175 debugOutput(DEBUG_LEVEL_VERBOSE, "(eBusNode) device matches device string %s\n", m_String.c_str()); 176 } 174 177 return match; 175 178 case eGUID: 176 179 //GUID should not be 0 177 return m_guid && (m_guid == configRom.getGuid()); 180 match = m_guid && (m_guid == configRom.getGuid()); 181 if(match) { 182 debugOutput(DEBUG_LEVEL_VERBOSE, "(eGUID) device matches device string %s\n", m_String.c_str()); 183 } 184 return match; 178 185 case eInvalid: 179 186 default: 180 debug Output(DEBUG_LEVEL_VERBOSE, "no match %p\n", &configRom);187 debugError("invalid DeviceString type (%d)\n", m_Type); 181 188 return false; 182 189 } … … 196 203 case eGUID: 197 204 retval = m_guid && (m_guid == x.m_guid); 198 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "eGUID 0x%016 X == 0x%016X? %d\n",205 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "eGUID 0x%016"PRIX64" == 0x%016"PRIX64"? %d\n", 199 206 m_guid, x.m_guid, retval); 200 207 return retval; … … 218 225 case eGUID: 219 226 debugOutput(DEBUG_LEVEL_INFO, "type: eGUID\n"); 220 debugOutput(DEBUG_LEVEL_INFO, " GUID: %016 LLX\n", m_guid);227 debugOutput(DEBUG_LEVEL_INFO, " GUID: %016"PRIX64"\n", m_guid); 221 228 break; 222 229 case eInvalid: … … 282 289 DeviceStringParser::match(ConfigRom& c) 283 290 { 291 return matchPosition(c) != -1; 292 } 293 294 int 295 DeviceStringParser::matchPosition(ConfigRom& c) 296 { 297 int pos = 0; 284 298 for ( DeviceStringVectorIterator it = m_DeviceStrings.begin(); 285 299 it != m_DeviceStrings.end(); … … 287 301 { 288 302 if((*it)->match(c)) { 289 return true; 290 } 291 } 292 return false; 293 } 303 return pos; 304 } 305 pos++; 306 } 307 return -1; 308 } 309 294 310 bool 295 311 DeviceStringParser::addDeviceString(DeviceString *o) … … 370 386 } 371 387 372 373 388 void 374 389 DeviceStringParser::show() trunk/libffado/src/DeviceStringParser.h
r1568 r1763 75 75 76 76 bool match(ConfigRom &); 77 int matchPosition(ConfigRom& c); 77 78 78 79 bool parseString(std::string s); trunk/libffado/src/dice/dice_avdevice.cpp
r1727 r1763 376 376 readGlobalReg(DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, &clock_caps); 377 377 uint16_t clocks_supported = (clock_caps >> 16) & 0xFFFF; 378 debugOutput(DEBUG_LEVEL_VERBOSE," Clock caps: 0x%08 X, supported=0x%04X\n",378 debugOutput(DEBUG_LEVEL_VERBOSE," Clock caps: 0x%08"PRIX32", supported=0x%04X\n", 379 379 clock_caps, clocks_supported); 380 380 … … 382 382 readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &clock_select); 383 383 byte_t clock_selected = (clock_select) & 0xFF; 384 debugOutput(DEBUG_LEVEL_VERBOSE," Clock select: 0x%08 X, selected=0x%04X\n",384 debugOutput(DEBUG_LEVEL_VERBOSE," Clock select: 0x%08"PRIX32", selected=0x%04X\n", 385 385 clock_select, clock_selected); 386 386 quadlet_t extended_status; … … 389 389 uint16_t clock_status = (extended_status) & 0xFFFF; 390 390 uint16_t clock_slipping = (extended_status >> 16) & 0xFFFF; 391 debugOutput(DEBUG_LEVEL_VERBOSE," Clock status: 0x%08 X, status=0x%04X, slip=0x%04X\n",391 debugOutput(DEBUG_LEVEL_VERBOSE," Clock status: 0x%08"PRIX32", status=0x%04X, slip=0x%04X\n", 392 392 extended_status, clock_status, clock_slipping); 393 393 #endif … … 540 540 readGlobalReg(DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, &clock_caps); 541 541 uint16_t clocks_supported = (clock_caps >> 16) & 0xFFFF; 542 debugOutput(DEBUG_LEVEL_VERBOSE," Clock caps: 0x%08 X, supported=0x%04X\n",542 debugOutput(DEBUG_LEVEL_VERBOSE," Clock caps: 0x%08"PRIX32", supported=0x%04X\n", 543 543 clock_caps, clocks_supported); 544 544 … … 546 546 readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &clock_select); 547 547 byte_t id = (clock_select) & 0xFF; 548 debugOutput(DEBUG_LEVEL_VERBOSE," Clock select: 0x%08 X, selected=0x%04X\n",548 debugOutput(DEBUG_LEVEL_VERBOSE," Clock select: 0x%08"PRIX32", selected=0x%04X\n", 549 549 clock_select, id); 550 550 quadlet_t extended_status; … … 553 553 uint16_t clock_status = (extended_status) & 0xFFFF; 554 554 uint16_t clock_slipping = (extended_status >> 16) & 0xFFFF; 555 debugOutput(DEBUG_LEVEL_VERBOSE," Clock status: 0x%08 X, status=0x%04X, slip=0x%04X\n",555 debugOutput(DEBUG_LEVEL_VERBOSE," Clock status: 0x%08"PRIX32", status=0x%04X, slip=0x%04X\n", 556 556 extended_status, clock_status, clock_slipping); 557 557 #endif … … 610 610 611 611 readGlobalRegBlock(DICE_REGISTER_GLOBAL_OWNER, reinterpret_cast<fb_quadlet_t *>(&tmp_octlet), sizeof(fb_octlet_t)); 612 debugOutput(DEBUG_LEVEL_VERBOSE," Owner : 0x%016 X\n",tmp_octlet);612 debugOutput(DEBUG_LEVEL_VERBOSE," Owner : 0x%016"PRIX64"\n",tmp_octlet); 613 613 614 614 readGlobalReg(DICE_REGISTER_GLOBAL_NOTIFICATION, &tmp_quadlet); 615 debugOutput(DEBUG_LEVEL_VERBOSE," Notification : 0x%08 X\n",tmp_quadlet);615 debugOutput(DEBUG_LEVEL_VERBOSE," Notification : 0x%08"PRIX32"\n",tmp_quadlet); 616 616 617 617 readGlobalReg(DICE_REGISTER_GLOBAL_NOTIFICATION, &tmp_quadlet); … … 631 631 632 632 readGlobalReg(DICE_REGISTER_GLOBAL_EXTENDED_STATUS, &tmp_quadlet); 633 debugOutput(DEBUG_LEVEL_VERBOSE, " Extended Status : 0x%08X\n",tmp_quadlet);633 debugOutput(DEBUG_LEVEL_VERBOSE, " Extended Status : 0x%08"PRIX32"\n", tmp_quadlet); 634 634 635 635 readGlobalReg(DICE_REGISTER_GLOBAL_SAMPLE_RATE, &tmp_quadlet); 636 debugOutput(DEBUG_LEVEL_NORMAL, " Samplerate : 0x%08X (%lu)\n",tmp_quadlet,tmp_quadlet);636 debugOutput(DEBUG_LEVEL_NORMAL, " Samplerate : 0x%08"PRIX32" (%"PRIu32")\n", tmp_quadlet, tmp_quadlet); 637 637 638 638 readGlobalRegBlock(DICE_REGISTER_GLOBAL_VERSION, reinterpret_cast<fb_quadlet_t *>(&tmp_quadlet), sizeof(fb_quadlet_t)); 639 debugOutput(DEBUG_LEVEL_NORMAL," Version : 0x%08 X\n", tmp_quadlet);639 debugOutput(DEBUG_LEVEL_NORMAL," Version : 0x%08"PRIX32"\n", tmp_quadlet); 640 640 641 641 readGlobalReg(DICE_REGISTER_GLOBAL_VERSION, &tmp_quadlet); 642 debugOutput(DEBUG_LEVEL_NORMAL," Version : 0x%08 X(%u.%u.%u.%u)\n",642 debugOutput(DEBUG_LEVEL_NORMAL," Version : 0x%08"PRIX32" (%u.%u.%u.%u)\n", 643 643 tmp_quadlet, 644 644 DICE_DRIVER_SPEC_VERSION_NUMBER_GET_A(tmp_quadlet), … … 649 649 650 650 readGlobalReg(DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, &tmp_quadlet); 651 debugOutput(DEBUG_LEVEL_VERBOSE," Clock caps : 0x%08 X\n",tmp_quadlet);651 debugOutput(DEBUG_LEVEL_VERBOSE," Clock caps : 0x%08"PRIX32"\n", tmp_quadlet); 652 652 653 653 diceNameVector names=getClockSourceNameString(); … … 677 677 678 678 readTxReg(i, DICE_REGISTER_TX_AC3_CAPABILITIES_BASE, &tmp_quadlet); 679 debugOutput(DEBUG_LEVEL_VERBOSE," AC3 caps : 0x%08 X\n", tmp_quadlet);679 debugOutput(DEBUG_LEVEL_VERBOSE," AC3 caps : 0x%08"PRIX32"\n", tmp_quadlet); 680 680 readTxReg(i, DICE_REGISTER_TX_AC3_ENABLE_BASE, &tmp_quadlet); 681 debugOutput(DEBUG_LEVEL_VERBOSE," AC3 enable : 0x%08 X\n", tmp_quadlet);681 debugOutput(DEBUG_LEVEL_VERBOSE," AC3 enable : 0x%08"PRIX32"\n", tmp_quadlet); 682 682 683 683 diceNameVector channel_names=getTxNameString(i); … … 707 707 708 708 readTxReg(i, DICE_REGISTER_RX_AC3_CAPABILITIES_BASE, &tmp_quadlet); 709 debugOutput(DEBUG_LEVEL_VERBOSE," AC3 caps : 0x%08 X\n", tmp_quadlet);709 debugOutput(DEBUG_LEVEL_VERBOSE," AC3 caps : 0x%08"PRIX32"\n", tmp_quadlet); 710 710 readTxReg(i, DICE_REGISTER_RX_AC3_ENABLE_BASE, &tmp_quadlet); 711 debugOutput(DEBUG_LEVEL_VERBOSE," AC3 enable : 0x%08 X\n", tmp_quadlet);711 debugOutput(DEBUG_LEVEL_VERBOSE," AC3 enable : 0x%08"PRIX32"\n", tmp_quadlet); 712 712 713 713 diceNameVector channel_names=getRxNameString(i); … … 1132 1132 1133 1133 if (result != DICE_OWNER_NO_OWNER) { 1134 debugWarning("Could not register ourselves as device owner, unexpected register value: 0x%016 llX\n", result);1134 debugWarning("Could not register ourselves as device owner, unexpected register value: 0x%016"PRIX64"\n", result); 1135 1135 return false; 1136 1136 } … … 1260 1260 } 1261 1261 int isochannel = reg_isoch; 1262 debugOutput(DEBUG_LEVEL_VERBOSE, "(%p) Snooping RX from channel %d\n", isochannel); 1262 debugOutput(DEBUG_LEVEL_VERBOSE, 1263 "(%p) Snooping RX from channel %d\n", 1264 this, isochannel); 1263 1265 p->setChannel(isochannel); 1264 1266 } else { … … 1266 1268 int isochannel = allocateIsoChannel(p->getMaxPacketSize()); 1267 1269 if(isochannel<0) { 1268 debugError("Could not allocate iso channel for SP %d (ATX %d)\n", i,n);1270 debugError("Could not allocate iso channel for SP %d (ATX %d)\n", i, n); 1269 1271 return false; 1270 1272 } 1271 debugOutput(DEBUG_LEVEL_VERBOSE, "(%p) Allocated channel %lu for RX\n", isochannel); 1273 debugOutput(DEBUG_LEVEL_VERBOSE, 1274 "(%p) Allocated channel %u for RX\n", 1275 this, isochannel); 1272 1276 p->setChannel(isochannel); 1273 1277 … … 1281 1285 } 1282 1286 if(reg_isoch != 0xFFFFFFFFUL) { 1283 debugError("ISO_CHANNEL register != 0xFFFFFFFF (=0x%08 X) for ATX %d\n", reg_isoch, n);1287 debugError("ISO_CHANNEL register != 0xFFFFFFFF (=0x%08"PRIX32") for ATX %d\n", reg_isoch, n); 1284 1288 p->setChannel(-1); 1285 1289 deallocateIsoChannel(isochannel); … … 1311 1315 } 1312 1316 int isochannel = reg_isoch; 1313 debugOutput(DEBUG_LEVEL_VERBOSE, "(%p) Snooping TX from channel %d\n", isochannel);1317 debugOutput(DEBUG_LEVEL_VERBOSE, "(%p) Snooping TX from channel %d\n", this, isochannel); 1314 1318 p->setChannel(isochannel); 1315 1319 } else { … … 1320 1324 return false; 1321 1325 } 1322 debugOutput(DEBUG_LEVEL_VERBOSE, "(%p) Allocated channel % lu for TX\n", isochannel);1326 debugOutput(DEBUG_LEVEL_VERBOSE, "(%p) Allocated channel %u for TX\n", this, isochannel); 1323 1327 p->setChannel(isochannel); 1324 1328 … … 1332 1336 } 1333 1337 if(reg_isoch != 0xFFFFFFFFUL) { 1334 debugError("ISO_CHANNEL register != 0xFFFFFFFF (=0x%08 X) for ARX %d\n", reg_isoch, n);1338 debugError("ISO_CHANNEL register != 0xFFFFFFFF (=0x%08"PRIX32") for ARX %d\n", reg_isoch, n); 1335 1339 p->setChannel(-1); 1336 1340 deallocateIsoChannel(isochannel); … … 1381 1385 } 1382 1386 if(reg_isoch != isochannel) { 1383 debugError("ISO_CHANNEL register != 0x%08 X (=0x%08X) for ATX %d\n", isochannel, reg_isoch, n);1387 debugError("ISO_CHANNEL register != 0x%08"PRIX32" (=0x%08"PRIX32") for ATX %d\n", isochannel, reg_isoch, n); 1384 1388 return false; 1385 1389 } … … 1417 1421 } 1418 1422 if(reg_isoch != isochannel) { 1419 debugError("ISO_CHANNEL register != 0x%08 X (=0x%08X) for ARX %d\n", isochannel, reg_isoch, n);1423 debugError("ISO_CHANNEL register != 0x%08"PRIX32" (=0x%08"PRIX32") for ARX %d\n", isochannel, reg_isoch, n); 1420 1424 return false; 1421 1425 } … … 1734 1738 bool 1735 1739 Device::readReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 1736 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08 llX\n", offset);1740 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08"PRIX64"\n", offset); 1737 1741 1738 1742 if(offset >= DICE_INVALID_OFFSET) { 1739 debugError("invalid offset: 0x%016 llX\n", offset);1743 debugError("invalid offset: 0x%016"PRIX64"\n", offset); 1740 1744 return false; 1741 1745 } … … 1745 1749 1746 1750 if(!get1394Service().read_quadlet( nodeId, addr, result ) ) { 1747 debugError("Could not read from node 0x%04X addr 0x% 012X\n", nodeId, addr);1751 debugError("Could not read from node 0x%04X addr 0x%12"PRIX64"\n", nodeId, addr); 1748 1752 return false; 1749 1753 } … … 1751 1755 *result = CondSwapFromBus32(*result); 1752 1756 1753 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Read result: 0x%08 X\n", *result);1757 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Read result: 0x%08"PRIX32"\n", *result); 1754 1758 1755 1759 return true; … … 1758 1762 bool 1759 1763 Device::writeReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 1760 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08 llX, data: 0x%08X\n",1764 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08"PRIX64", data: 0x%08"PRIX32"\n", 1761 1765 offset, data); 1762 1766 1763 1767 if(offset >= DICE_INVALID_OFFSET) { 1764 debugError("invalid offset: 0x%01 6llX\n", offset);1768 debugError("invalid offset: 0x%012"PRIX64"\n", offset); 1765 1769 return false; 1766 1770 } … … 1770 1774 1771 1775 if(!get1394Service().write_quadlet( nodeId, addr, CondSwapToBus32(data) ) ) { 1772 debugError("Could not write to node 0x%04X addr 0x% 012X\n", nodeId, addr);1776 debugError("Could not write to node 0x%04X addr 0x%12"PRIX64"\n", nodeId, addr); 1773 1777 return false; 1774 1778 } … … 1778 1782 bool 1779 1783 Device::readRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1780 debugOutput(DEBUG_LEVEL_VERBOSE,"Reading base register offset 0x%08llX, length %u, to %p\n", 1781 offset, length, data); 1784 debugOutput(DEBUG_LEVEL_VERBOSE, 1785 "Reading base register offset 0x%08"PRIX64", length %zd, to %p\n", 1786 offset, length, data); 1782 1787 const int blocksize_quads = 512/4; 1783 1788 1784 1789 if(offset >= DICE_INVALID_OFFSET) { 1785 debugError("invalid offset: 0x%01 6llX\n", offset);1790 debugError("invalid offset: 0x%012"PRIX64"\n", offset); 1786 1791 return false; 1787 1792 } … … 1796 1801 fb_quadlet_t *curr_data = data + quads_done; 1797 1802 int quads_todo = length_quads - quads_done; 1798 debugOutput(DEBUG_LEVEL_VERBOSE, "reading addr: 0x%01 6llX, %d quads to %p\n", curr_addr, quads_todo, curr_data);1803 debugOutput(DEBUG_LEVEL_VERBOSE, "reading addr: 0x%012"PRIX64", %d quads to %p\n", curr_addr, quads_todo, curr_data); 1799 1804 1800 1805 if (quads_todo > blocksize_quads) { … … 1809 1814 1810 1815 if(!get1394Service().read( nodeId, curr_addr, quads_todo, curr_data ) ) { 1811 debugError("Could not read %d quadlets from node 0x%04X addr 0x%012 llX\n", quads_todo, nodeId, curr_addr);1816 debugError("Could not read %d quadlets from node 0x%04X addr 0x%012"PRIX64"\n", quads_todo, nodeId, curr_addr); 1812 1817 return false; 1813 1818 } … … 1821 1826 bool 1822 1827 Device::writeRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1823 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08 llX, length: %u\n",1828 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08"PRIX64", length: %zd\n", 1824 1829 offset, length); 1825 1830 const int blocksize_quads = 512/4; 1826 1831 1827 1832 if(offset >= DICE_INVALID_OFFSET) { 1828 debugError("invalid offset: 0x%01 6llX\n", offset);1833 debugError("invalid offset: 0x%012"PRIX64"\n", offset); 1829 1834 return false; 1830 1835 } … … 1853 1858 1854 1859 if(!get1394Service().write( nodeId, addr, quads_todo, curr_data ) ) { 1855 debugError("Could not write %d quadlets to node 0x%04X addr 0x%012 llX\n", quads_todo, nodeId, curr_addr);1860 debugError("Could not write %d quadlets to node 0x%04X addr 0x%012"PRIX64"\n", quads_todo, nodeId, curr_addr); 1856 1861 return false; 1857 1862 } … … 1864 1869 bool 1865 1870 Device::readGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 1866 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register offset 0x%04 llX\n", offset);1871 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register offset 0x%04"PRIX64"\n", offset); 1867 1872 1868 1873 fb_nodeaddr_t offset_gl = globalOffsetGen(offset, sizeof(fb_quadlet_t)); … … 1872 1877 bool 1873 1878 Device::writeGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 1874 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register offset 0x%08 llX, data: 0x%08X\n",1879 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register offset 0x%08"PRIX64", data: 0x%08"PRIX32"\n", 1875 1880 offset, data); 1876 1881 … … 1881 1886 bool 1882 1887 Device::readGlobalRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1883 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register block offset 0x%04 llX, length %ubytes\n",1888 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register block offset 0x%04"PRIX64", length %zd bytes\n", 1884 1889 offset, length); 1885 1890 … … 1890 1895 bool 1891 1896 Device::writeGlobalRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1892 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register block offset 0x%04 llX, length %ubytes\n",1897 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register block offset 0x%04"PRIX64", length: %zd bytes\n", 1893 1898 offset, length); 1894 1899 … … 1908 1913 // out-of-range check 1909 1914 if(offset+length > m_global_reg_offset+m_global_reg_size) { 1910 debugError("register offset+length too large: 0x%0 llX\n", offset + length);1915 debugError("register offset+length too large: 0x%04"PRIX64"\n", offset + length); 1911 1916 return DICE_INVALID_OFFSET; 1912 1917 } … … 1917 1922 bool 1918 1923 Device::readTxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) { 1919 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Reading tx %d register offset 0x%04 llX\n", i, offset);1924 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Reading tx %d register offset 0x%04"PRIX64"\n", i, offset); 1920 1925 1921 1926 fb_nodeaddr_t offset_tx = txOffsetGen(i, offset, sizeof(fb_quadlet_t)); … … 1925 1930 bool 1926 1931 Device::writeTxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t data) { 1927 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing tx %d register offset 0x%08 llX, data: 0x%08X\n",1932 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing tx %d register offset 0x%08"PRIX64", data: 0x%08"PRIX32"\n", 1928 1933 i, offset, data); 1929 1934 … … 1934 1939 bool 1935 1940 Device::readTxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1936 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04 llX, length %ubytes\n",1941 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04"PRIX64", length: %zd bytes\n", 1937 1942 offset, length); 1938 1943 … … 1943 1948 bool 1944 1949 Device::writeTxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1945 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04 llX, length %ubytes\n",1950 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04"PRIX64", length: %zd bytes\n", 1946 1951 offset, length); 1947 1952 … … 1975 1980 // out-of-range check 1976 1981 if(offset_tx + length > m_tx_reg_offset+4+m_tx_reg_size*m_nb_tx) { 1977 debugError("register offset+length too large: 0x%0 llX\n", offset_tx + length);1982 debugError("register offset+length too large: 0x%04"PRIX64"\n", offset_tx + length); 1978 1983 return DICE_INVALID_OFFSET; 1979 1984 } … … 1984 1989 bool 1985 1990 Device::readRxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) { 1986 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx %d register offset 0x%04 llX\n", i, offset);1991 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx %d register offset 0x%04"PRIX64"\n", i, offset); 1987 1992 1988 1993 fb_nodeaddr_t offset_rx=rxOffsetGen(i, offset, sizeof(fb_quadlet_t)); … … 1992 1997 bool 1993 1998 Device::writeRxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t data) { 1994 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register offset 0x%08 llX, data: 0x%08X\n",1999 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register offset 0x%08"PRIX64", data: 0x%08"PRIX32"\n", 1995 2000 offset, data); 1996 2001 … … 2001 2006 bool 2002 2007 Device::readRxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 2003 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04 llX, length %ubytes\n",2008 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04"PRIX64", length: %zd bytes\n", 2004 2009 offset, length); 2005 2010 … … 2010 2015 bool 2011 2016 Device::writeRxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 2012 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04 llX, length %ubytes\n",2017 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04"PRIX64", length: %zd bytes\n", 2013 2018 offset, length); 2014 2019 … … 2042 2047 // out-of-range check 2043 2048 if(offset_rx + length > m_rx_reg_offset+4+m_rx_reg_size*m_nb_rx) { 2044 debugError("register offset+length too large: 0x%0 llX\n", offset_rx + length);2049 debugError("register offset+length too large: 0x%04"PRIX64"\n", offset_rx + length); 2045 2050 return DICE_INVALID_OFFSET; 2046 2051 } trunk/libffado/src/dice/dice_eap.cpp
r1742 r1763 676 676 // out-of-range check 677 677 if(length > maxlen) { 678 debugError("requested length too large: % d > %d\n", length, maxlen);678 debugError("requested length too large: %zd > %"PRIu64"\n", length, maxlen); 679 679 return DICE_INVALID_OFFSET; 680 680 } … … 827 827 m_input_route_map[i] = rcfg->getRouteForDestination(dest, ch); 828 828 829 debugOutput(DEBUG_LEVEL_VERBOSE, "Mixer input channel %2d source: %s \n", i,829 debugOutput(DEBUG_LEVEL_VERBOSE, "Mixer input channel %2d source: %s (%d)\n", i, 830 830 srcBlockToString(m_input_route_map[i].src), 831 831 m_input_route_map[i].srcChannel); … … 1978 1978 return false; 1979 1979 } 1980 debugOutput(DEBUG_LEVEL_VERBOSE, " Entries: TX: % lu, RX: %lu\n", m_nb_tx, m_nb_rx);1980 debugOutput(DEBUG_LEVEL_VERBOSE, " Entries: TX: %u, RX: %u\n", m_nb_tx, m_nb_rx); 1981 1981 1982 1982 if(m_tx_configs) { … … 2070 2070 Device::EAP::StreamConfig::showConfigBlock(struct ConfigBlock &b) 2071 2071 { 2072 debugOutput(DEBUG_LEVEL_VERBOSE, " Channel count : % lu audio, %lu midi\n", b.nb_audio, b.nb_midi);2072 debugOutput(DEBUG_LEVEL_VERBOSE, " Channel count : %u audio, %u midi\n", b.nb_audio, b.nb_midi); 2073 2073 debugOutput(DEBUG_LEVEL_VERBOSE, " AC3 Map : 0x%08X\n", b.ac3_map); 2074 2074 diceNameVector channel_names = getNamesForBlock(b); trunk/libffado/src/fbtypes.h
r1336 r1763 25 25 #define FBTYPES_H 26 26 27 #ifndef __STDC_FORMAT_MACROS 28 #define __STDC_FORMAT_MACROS 29 #endif 30 #include <inttypes.h> 31 27 32 #include <libraw1394/raw1394.h> 28 33 … … 35 40 typedef nodeaddr_t fb_nodeaddr_t; 36 41 42 #define FORMAT_FB_OCTLET_T "0x%016" PRIX64 43 #define FORMAT_FB_NODEID_T "0x%016" PRIX64 44 #define FORMAT_FB_NODEADDR_T "0x%016" PRIX64 45 37 46 class DeviceManager; 38 47 trunk/libffado/src/fireworks/efc/efc_cmds_flash.cpp
r1136 r1763 68 68 EfcCmd::showEfcCmd(); 69 69 debugOutput(DEBUG_LEVEL_NORMAL, "EFC Flash Erase:\n"); 70 debugOutput(DEBUG_LEVEL_NORMAL, " Address : % lu\n", m_address);70 debugOutput(DEBUG_LEVEL_NORMAL, " Address : %u\n", m_address); 71 71 } 72 72 … … 120 120 EfcCmd::showEfcCmd(); 121 121 debugOutput(DEBUG_LEVEL_NORMAL, "EFC Flash Read:\n"); 122 debugOutput(DEBUG_LEVEL_NORMAL, " Address : % lu\n", m_address);123 debugOutput(DEBUG_LEVEL_NORMAL, " Length (quadlets) : % lu\n", m_nb_quadlets);122 debugOutput(DEBUG_LEVEL_NORMAL, " Address : %u\n", m_address); 123 debugOutput(DEBUG_LEVEL_NORMAL, " Length (quadlets) : %u\n", m_nb_quadlets); 124 124 debugOutput(DEBUG_LEVEL_NORMAL, " Data : \n"); 125 125 for (unsigned int i=0; i < m_nb_quadlets; i++) { … … 174 174 EfcCmd::showEfcCmd(); 175 175 debugOutput(DEBUG_LEVEL_NORMAL, "EFC Flash Write:\n"); 176 debugOutput(DEBUG_LEVEL_NORMAL, " Address : % lu\n", m_address);177 debugOutput(DEBUG_LEVEL_NORMAL, " Length (quadlets) : % lu\n", m_nb_quadlets);176 debugOutput(DEBUG_LEVEL_NORMAL, " Address : %u\n", m_address); 177 debugOutput(DEBUG_LEVEL_NORMAL, " Length (quadlets) : %u\n", m_nb_quadlets); 178 178 debugOutput(DEBUG_LEVEL_NORMAL, " Data : \n"); 179 179 for (unsigned int i=0; i < m_nb_quadlets; i++) { … … 292 292 EfcCmd::showEfcCmd(); 293 293 debugOutput(DEBUG_LEVEL_NORMAL, "EFC Flash Get Session Base:\n"); 294 debugOutput(DEBUG_LEVEL_NORMAL, " Address : % lu\n", m_address);294 debugOutput(DEBUG_LEVEL_NORMAL, " Address : %u\n", m_address); 295 295 } 296 296 trunk/libffado/src/fireworks/efc/efc_cmds_hardware.cpp
r1135 r1763 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 llX\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 debugOutput(DEBUG_LEVEL_NORMAL, " Version : % lu\n", m_version);131 debugOutput(DEBUG_LEVEL_NORMAL, " Version : %u\n", m_version); 132 132 debugOutput(DEBUG_LEVEL_NORMAL, " Vendor : %s\n", m_vendor_name); 133 133 debugOutput(DEBUG_LEVEL_NORMAL, " Model : %s\n", m_model_name); … … 232 232 debugOutput(DEBUG_LEVEL_NORMAL, " # Output Meters : %d\n", m_nb_output_meters); 233 233 for (i=0;i<m_nb_output_meters;i++) { 234 debugOutput(DEBUG_LEVEL_NORMAL, " Meter %d: % ld\n", i, m_meters[i]);234 debugOutput(DEBUG_LEVEL_NORMAL, " Meter %d: %d\n", i, m_meters[i]); 235 235 } 236 236 237 237 debugOutput(DEBUG_LEVEL_NORMAL, " # Input Meters : %d\n", m_nb_input_meters); 238 238 for (;i<m_nb_output_meters+m_nb_input_meters;i++) { 239 debugOutput(DEBUG_LEVEL_NORMAL, " Meter %d: % ld\n", i, m_meters[i]);239 debugOutput(DEBUG_LEVEL_NORMAL, " Meter %d: %d\n", i, m_meters[i]); 240 240 } 241 241 } trunk/libffado/src/fireworks/efc/efc_cmds_hardware_ctrl.cpp
r1336 r1763 73 73 EfcCmd::showEfcCmd(); 74 74 debugOutput(DEBUG_LEVEL_NORMAL, "EFC Get Clock:\n"); 75 debugOutput(DEBUG_LEVEL_NORMAL, " Clock : % lu\n", m_clock);76 debugOutput(DEBUG_LEVEL_NORMAL, " Samplerate : % lu\n", m_samplerate);77 debugOutput(DEBUG_LEVEL_NORMAL, " Index : % lu\n", m_index);75 debugOutput(DEBUG_LEVEL_NORMAL, " Clock : %u\n", m_clock); 76 debugOutput(DEBUG_LEVEL_NORMAL, " Samplerate : %u\n", m_samplerate); 77 debugOutput(DEBUG_LEVEL_NORMAL, " Index : %u\n", m_index); 78 78 } 79 79 … … 124 124 EfcCmd::showEfcCmd(); 125 125 debugOutput(DEBUG_LEVEL_NORMAL, "EFC Set Clock:\n"); 126 debugOutput(DEBUG_LEVEL_NORMAL, " Clock : % lu\n", m_clock);127 debugOutput(DEBUG_LEVEL_NORMAL, " Samplerate : % lu\n", m_samplerate);128 debugOutput(DEBUG_LEVEL_NORMAL, " Index : % lu\n", m_index);126 debugOutput(DEBUG_LEVEL_NORMAL, " Clock : %u\n", m_clock); 127 debugOutput(DEBUG_LEVEL_NORMAL, " Samplerate : %u\n", m_samplerate); 128 debugOutput(DEBUG_LEVEL_NORMAL, " Index : %u\n", m_index); 129 129 } 130 130 trunk/libffado/src/fireworks/efc/efc_cmds_ioconfig.cpp
r1336 r1763 162 162 (m_type==eCT_Get?"GET":"SET"), 163 163 eIOConfigRegisterToString(m_reg)); 164 debugOutput(DEBUG_LEVEL_NORMAL, " Value : % lu\n", m_value);164 debugOutput(DEBUG_LEVEL_NORMAL, " Value : %u\n", m_value); 165 165 } 166 166 trunk/libffado/src/fireworks/efc/efc_cmds_mixer.cpp
r1136 r1763 245 245 eMixerTargetToString(m_target), 246 246 eMixerCommandToString(m_command)); 247 debugOutput(DEBUG_LEVEL_NORMAL, " Channel : % ld\n", m_channel);248 debugOutput(DEBUG_LEVEL_NORMAL, " Value : % lu\n", m_value);247 debugOutput(DEBUG_LEVEL_NORMAL, " Channel : %d\n", m_channel); 248 debugOutput(DEBUG_LEVEL_NORMAL, " Value : %u\n", m_value); 249 249 } 250 250 trunk/libffado/src/fireworks/efc/efc_cmds_monitor.cpp
r1136 r1763 150 150 (m_type==eCT_Get?"GET":"SET"), 151 151 eMonitorCommandToString(m_command)); 152 debugOutput(DEBUG_LEVEL_NORMAL, " Input : % ld\n", m_input);153 debugOutput(DEBUG_LEVEL_NORMAL, " Output : % ld\n", m_output);154 debugOutput(DEBUG_LEVEL_NORMAL, " Value : % lu\n", m_value);152 debugOutput(DEBUG_LEVEL_NORMAL, " Input : %d\n", m_input); 153 debugOutput(DEBUG_LEVEL_NORMAL, " Output : %d\n", m_output); 154 debugOutput(DEBUG_LEVEL_NORMAL, " Value : %u\n", m_value); 155 155 } 156 156 trunk/libffado/src/fireworks/fireworks_control.cpp
r1336 r1763 321 321 break; 322 322 } 323 debugOutput(DEBUG_LEVEL_VERBOSE, "setValue for channel %d to %lf = % lf\n",323 debugOutput(DEBUG_LEVEL_VERBOSE, "setValue for channel %d to %lf = %u\n", 324 324 m_Slave->m_channel, val, m_Slave->m_value); 325 325 return true; … … 339 339 return 0.0; 340 340 } 341 debugOutput(DEBUG_LEVEL_VERBOSE, "getValue for channel %d = % lf\n",341 debugOutput(DEBUG_LEVEL_VERBOSE, "getValue for channel %d = %u\n", 342 342 m_Slave->m_channel, m_Slave->m_value); 343 343 return m_Slave->m_value; … … 451 451 } 452 452 453 debugOutput(DEBUG_LEVEL_VERBOSE, "setValue for channel %d to % ld (reg: 0x%08X => 0x%08X)\n",453 debugOutput(DEBUG_LEVEL_VERBOSE, "setValue for channel %d to %d (reg: 0x%08X => 0x%08X)\n", 454 454 m_Slave->m_channel, val, old_reg, reg); 455 455 return true; … … 583 583 return 0; 584 584 } 585 debugOutput(DEBUG_LEVEL_VERBOSE, "setValue to % ld \n", val);585 debugOutput(DEBUG_LEVEL_VERBOSE, "setValue to %d \n", val); 586 586 return true; 587 587 } else { trunk/libffado/src/fireworks/fireworks_device.cpp
r1543 r1763 43 43 44 44 #define ECHO_FLASH_ERASE_TIMEOUT_MILLISECS 2000 45 #define FIREWORKS_MIN_FIRMWARE_VERSION 0x04080000 45 46 46 47 #include <sstream> … … 136 137 // get the info from the EFC 137 138 if ( !discoverUsingEFC() ) { 138 debugError( "Could not discover using EFC\n" );139 139 return false; 140 140 } … … 161 161 if (!doEfcOverAVC(m_HwInfo)) { 162 162 debugError("Could not read hardware capabilities\n"); 163 return false; 164 } 165 166 // check the firmware version 167 if (m_HwInfo.m_arm_version < FIREWORKS_MIN_FIRMWARE_VERSION) { 168 debugError("Firmware version %u.%u (rev %u) not recent enough. FFADO requires at least version %u.%u (rev %u).\n", 169 (m_HwInfo.m_arm_version >> 24) & 0xFF, 170 (m_HwInfo.m_arm_version >> 16) & 0xFF, 171 (m_HwInfo.m_arm_version >> 0) & 0xFFFF, 172 (FIREWORKS_MIN_FIRMWARE_VERSION >> 24) & 0xFF, 173 (FIREWORKS_MIN_FIRMWARE_VERSION >> 16) & 0xFF, 174 (FIREWORKS_MIN_FIRMWARE_VERSION >> 0) & 0xFFFF 175 ); 163 176 return false; 164 177 } … … 547 560 Device::clockIdToClockSource(uint32_t clockid) { 548 561 ClockSource s; 549 debugOutput(DEBUG_LEVEL_VERBOSE, "clock id: % lu\n", clockid);562 debugOutput(DEBUG_LEVEL_VERBOSE, "clock id: %u\n", clockid); 550 563 551 564 // the polled values are used to detect … … 611 624 return EFC_CMD_HW_CLOCK_UNSPECIFIED; 612 625 } 613 debugOutput(DEBUG_LEVEL_VERBOSE, "Active clock: 0x%08 lX\n",gccmd.m_clock);626 debugOutput(DEBUG_LEVEL_VERBOSE, "Active clock: 0x%08X\n",gccmd.m_clock); 614 627 gccmd.showEfcCmd(); 615 628 … … 624 637 return false; 625 638 } 626 debugOutput(DEBUG_LEVEL_VERBOSE, "Set clock: 0x%08 lX\n", id);639 debugOutput(DEBUG_LEVEL_VERBOSE, "Set clock: 0x%08X\n", id); 627 640 628 641 EfcSetClockCmd sccmd; trunk/libffado/src/fireworks/fireworks_firmware.cpp
r1336 r1763 172 172 unsigned int version_minor = (m_version & 0x00FF0000) >> 16; 173 173 unsigned int version_build = (m_version & 0x0000FFFF); 174 debugOutput(DEBUG_LEVEL_NORMAL, " Address Offset : 0x%08 lX\n", m_flash_offset_address);175 debugOutput(DEBUG_LEVEL_NORMAL, " Length (Quadlets) : 0x%08 lX\n", m_length_quads);176 debugOutput(DEBUG_LEVEL_NORMAL, " CRC 32 : 0x%08 lX\n", m_CRC32);177 debugOutput(DEBUG_LEVEL_NORMAL, " Checksum : 0x%08 lX\n", m_checksum);174 debugOutput(DEBUG_LEVEL_NORMAL, " Address Offset : 0x%08X\n", m_flash_offset_address); 175 debugOutput(DEBUG_LEVEL_NORMAL, " Length (Quadlets) : 0x%08X\n", m_length_quads); 176 debugOutput(DEBUG_LEVEL_NORMAL, " CRC 32 : 0x%08X\n", m_CRC32); 177 debugOutput(DEBUG_LEVEL_NORMAL, " Checksum : 0x%08X\n", m_checksum); 178 178 debugOutput(DEBUG_LEVEL_NORMAL, " Firmware version : %02u.%02u.%02u (0x%08X)\n", 179 179 version_major, version_minor, version_build, m_version); 180 180 debugOutput(DEBUG_LEVEL_NORMAL, " Append CRC : %s\n", (m_append_crc?"Yes":"No")); 181 debugOutput(DEBUG_LEVEL_NORMAL, " Footprint (Quadlets) : 0x%08 lX\n", m_footprint_quads);181 debugOutput(DEBUG_LEVEL_NORMAL, " Footprint (Quadlets) : 0x%08X\n", m_footprint_quads); 182 182 #endif 183 183 } … … 298 298 } 299 299 300 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, " Header %02d: %08 lX\n",300 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, " Header %02d: %08X\n", 301 301 i, m_header[i]); 302 302 } … … 337 337 } 338 338 339 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, " Data %02d: %08 lX\n",339 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, " Data %02d: %08X\n", 340 340 i, m_data[i]); 341 341 } trunk/libffado/src/fireworks/fireworks_session_block.cpp
r1336 r1763 255 255 256 256 if (len != h.size_quads*4) { 257 debugWarning("size not correct: got % d, 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 trunk/libffado/src/genericavc/stanton/scs.cpp
r1550 r1763 69 69 // read the current value present in the register, i.e. read-ping 70 70 if(!readRegBlock(addr, (quadlet_t *)cmdBuffer, 1) ) { 71 debugError("Could not read from addr 0x%012 llX\n", addr);71 debugError("Could not read from addr 0x%012"PRIX64"\n", addr); 72 72 } else { 73 73 int version = cmdBuffer[0] & 0xFFFF; … … 84 84 // execute the command 85 85 if(!writeRegBlock(addr, (quadlet_t *)cmdBuffer, 1)) { 86 debugError("Could not write to addr 0x%012 llX\n", addr);86 debugError("Could not write to addr 0x%012"PRIX64"\n", addr); 87 87 } else { 88 88 debugOutput(DEBUG_LEVEL_VERBOSE, "Write Ping succeeded\n"); … … 126 126 // execute the command 127 127 if(!writeRegBlock(addr, (quadlet_t *)cmdBuffer, 2)) { 128 debugError("Could not write to addr 0x%012 llX\n", addr);128 debugError("Could not write to addr 0x%012"PRIX64"\n", addr); 129 129 return false; 130 130 } … … 140 140 // execute the command 141 141 if(!writeRegBlock(addr, (quadlet_t *)cmdBuffer, 2)) { 142 debugError("Could not write to addr 0x%012 llX\n", addr);142 debugError("Could not write to addr 0x%012"PRIX64"\n", addr); 143 143 return false; 144 144 } … … 149 149 bool 150 150 ScsDevice::writeHSS1394Message(enum eMessageType message_type, byte_t* buffer, size_t len) { 151 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing message type: %02X, length: % ubytes\n",151 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing message type: %02X, length: %zd bytes\n", 152 152 message_type, len); 153 153 size_t len_quadlets = len/4 + 1; … … 169 169 // execute the command 170 170 if(!writeRegBlock(addr, (quadlet_t *)cmdBuffer, len_quadlets)) { 171 debugError("Could not write to addr 0x%012 llX\n", addr);171 debugError("Could not write to addr 0x%012"PRIX64"\n", addr); 172 172 return false; 173 173 } … … 177 177 bool 178 178 ScsDevice::readRegBlock(fb_nodeaddr_t addr, fb_quadlet_t *data, size_t length_quads, size_t blocksize_quads) { 179 debugOutput(DEBUG_LEVEL_VERBOSE,"Reading register 0x%016 llX, length %uquadlets, to %p\n",179 debugOutput(DEBUG_LEVEL_VERBOSE,"Reading register 0x%016"PRIX64", length %zd quadlets, to %p\n", 180 180 addr, length_quads, data); 181 181 … … 187 187 int quads_todo = length_quads - quads_done; 188 188 if (quads_todo > (int)blocksize_quads) { 189 debugOutput(DEBUG_LEVEL_VERBOSE, "Truncating read from %d to % d quadlets\n", quads_todo, blocksize_quads);189 debugOutput(DEBUG_LEVEL_VERBOSE, "Truncating read from %d to %zd quadlets\n", quads_todo, blocksize_quads); 190 190 quads_todo = blocksize_quads; 191 191 } … … 196 196 #endif 197 197 198 debugOutput(DEBUG_LEVEL_VERBOSE, "reading addr: 0x%016 llX, %d quads to %p\n", curr_addr, quads_todo, curr_data);198 debugOutput(DEBUG_LEVEL_VERBOSE, "reading addr: 0x%016"PRIX64", %d quads to %p\n", curr_addr, quads_todo, curr_data); 199 199 if(!get1394Service().read( nodeId, curr_addr, quads_todo, curr_data ) ) { 200 debugError("Could not read %d quadlets from node 0x%04X addr 0x%012 llX\n", quads_todo, nodeId, curr_addr);200 debugError("Could not read %d quadlets from node 0x%04X addr 0x%012"PRIX64"\n", quads_todo, nodeId, curr_addr); 201 201 return false; 202 202 } … … 210 210 bool 211 211 ScsDevice::writeRegBlock(fb_nodeaddr_t addr, fb_quadlet_t *data, size_t length_quads, size_t blocksize_quads) { 212 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing register 0x%016llX, length: %u quadlets, from %p\n", 213 addr, length_quads, addr); 212 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, 213 "Writing register 0x%016"PRIX64", length: %zd quadlets, from %p\n", 214 addr, length_quads, data); 214 215 215 216 fb_quadlet_t data_out[length_quads]; … … 224 225 int quads_todo = length_quads - quads_done; 225 226 if (quads_todo > (int)blocksize_quads) { 226 debugOutput(DEBUG_LEVEL_VERBOSE, "Truncating write from %d to % d quadlets\n", quads_todo, blocksize_quads);227 debugOutput(DEBUG_LEVEL_VERBOSE, "Truncating write from %d to %zd quadlets\n", quads_todo, blocksize_quads); 227 228 quads_todo = blocksize_quads; 228 229 } … … 233 234 #endif 234 235 235 debugOutput(DEBUG_LEVEL_VERBOSE, "writing addr: 0x%016 llX, %d quads from %p\n", curr_addr, quads_todo, curr_data);236 debugOutput(DEBUG_LEVEL_VERBOSE, "writing addr: 0x%016"PRIX64", %d quads from %p\n", curr_addr, quads_todo, curr_data); 236 237 if(!get1394Service().write( nodeId, addr, quads_todo, curr_data ) ) { 237 debugError("Could not write %d quadlets to node 0x%04X addr 0x%012 llX\n", quads_todo, nodeId, curr_addr);238 debugError("Could not write %d quadlets to node 0x%04X addr 0x%012"PRIX64"\n", quads_todo, nodeId, curr_addr); 238 239 return false; 239 240 } trunk/libffado/src/libavc/audiosubunit/avc_descriptor_audio.h
r1538 r1763 43 43 class Ieee1394Service; 44 44 45 // forward declarations 46 namespace Util { 47 namespace Cmd { 48 class IOSSerialize; 49 class IISDeserialize; 50 } 51 } 52 45 53 namespace AVC { 46 47 48 class Util::Cmd::IOSSerialize;49 class Util::Cmd::IISDeserialize;50 54 51 55 class AVCAudioClusterInformation trunk/libffado/src/libavc/descriptors/avc_descriptor.cpp
r1254 r1763 249 249 // copy the payload 250 250 251 if (bytes_read +readDescCmd.m_data_length>m_descriptor_length) {251 if (bytes_read + readDescCmd.m_data_length > m_descriptor_length) { 252 252 debugWarning("Device returned too much data, truncating\n"); 253 253 readDescCmd.m_data_length=m_descriptor_length-bytes_read; 254 254 } 255 255 256 debugOutput(DEBUG_LEVEL_VERBOSE, " copying %u bytes to internal buffer offset %u\n",readDescCmd.m_data_length, bytes_read); 256 debugOutput(DEBUG_LEVEL_VERBOSE, 257 " copying %u bytes to internal buffer offset %zd\n", 258 readDescCmd.m_data_length, bytes_read); 257 259 258 260 memcpy(m_data+bytes_read,readDescCmd.m_data, readDescCmd.m_data_length); trunk/libffado/src/libavc/descriptors/avc_descriptor_cmd.cpp
r1234 r1763 120 120 break; 121 121 default: 122 debugError("Can't handle command type % s\n", getCommandType());122 debugError("Can't handle command type %d\n", getCommandType()); 123 123 return false; 124 124 } trunk/libffado/src/libavc/general/avc_plug.cpp
r1568 r1763 1423 1423 case eAPD_Output: 1424 1424 return string("Output"); 1425 default:1426 case eAPT_Unknown:1427 return string("Unknown");1428 1425 } 1429 1426 } trunk/libffado/src/libcontrol/Element.cpp
r1630 r1763 327 327 { 328 328 Util::MutexLockHelper lock(getLock()); 329 debugOutput( DEBUG_LEVEL_NORMAL, "Container %s (% d Elements)\n",329 debugOutput( DEBUG_LEVEL_NORMAL, "Container %s (%zd Elements)\n", 330 330 getName().c_str(), m_Children.size()); 331 331 trunk/libffado/src/libieee1394/ARMHandler.cpp
r1550 r1763 123 123 debugOutput(DEBUG_LEVEL_VERBOSE, " tlabel: 0x%02X, tcode: 0x%02X, extended tcode: 0x%02X\n", 124 124 arm_req->tlabel, arm_req->tcode, arm_req->extended_transaction_code); 125 debugOutput(DEBUG_LEVEL_VERBOSE, " generation: % lu\n",125 debugOutput(DEBUG_LEVEL_VERBOSE, " generation: %u\n", 126 126 arm_req->generation); 127 debugOutput(DEBUG_LEVEL_VERBOSE, " buffer length: % lu\n",127 debugOutput(DEBUG_LEVEL_VERBOSE, " buffer length: %u\n", 128 128 arm_req->buffer_length); 129 129 printBufferBytes(DEBUG_LEVEL_VERBOSE, arm_req->buffer_length, arm_req->buffer); trunk/libffado/src/libieee1394/configrom.cpp
r1336 r1763 486 486 { 487 487 debugOutput( DEBUG_LEVEL_VERBOSE, 488 "Checking for updated node id for device with GUID 0x%016 llX...\n",488 "Checking for updated node id for device with GUID 0x%016"PRIX64"...\n", 489 489 getGuid()); 490 490 … … 517 517 518 518 debugOutput( DEBUG_LEVEL_VERBOSE, 519 " Node has GUID 0x%016 llX\n",519 " Node has GUID 0x%016"PRIX64"\n", 520 520 guid); 521 521 … … 524 524 if ( nodeId != getNodeId() ) { 525 525 debugOutput( DEBUG_LEVEL_VERBOSE, 526 "Device with GUID 0x%016 llXchanged node id "526 "Device with GUID 0x%016"PRIX64" changed node id " 527 527 "from %d to %d\n", 528 528 getGuid(), … … 532 532 } else { 533 533 debugOutput( DEBUG_LEVEL_VERBOSE, 534 "Device with GUID 0x%016 llXkept node id %d\n",534 "Device with GUID 0x%016"PRIX64" kept node id %d\n", 535 535 getGuid(), 536 536 getNodeId()); … … 549 549 550 550 debugOutput( DEBUG_LEVEL_VERBOSE, 551 "Device with GUID 0x%016 llXcould not be found on "551 "Device with GUID 0x%016"PRIX64" could not be found on " 552 552 "the bus anymore (removed?)\n", 553 553 getGuid() ); … … 562 562 debugOutput(DEBUG_LEVEL_NORMAL, "Config ROM\n" ); 563 563 debugOutput(DEBUG_LEVEL_NORMAL, "\tCurrent Node Id:\t%d\n", getNodeId() ); 564 debugOutput(DEBUG_LEVEL_NORMAL, "\tGUID:\t\t\t0x%016 llX\n", getGuid());564 debugOutput(DEBUG_LEVEL_NORMAL, "\tGUID:\t\t\t0x%016"PRIX64"\n", getGuid()); 565 565 debugOutput(DEBUG_LEVEL_NORMAL, "\tVendor Name:\t\t%s\n", getVendorName().c_str() ); 566 566 debugOutput(DEBUG_LEVEL_NORMAL, "\tModel Name:\t\t%s\n", getModelName().c_str() ); … … 583 583 printMessage("Config ROM\n" ); 584 584 printMessage("\tCurrent Node Id:\t%d\n", getNodeId() ); 585 printMessage("\tGUID:\t\t\t0x%016 llX\n", getGuid());585 printMessage("\tGUID:\t\t\t0x%016"PRIX64"\n", getGuid()); 586 586 printMessage("\tVendor Name:\t\t%s\n", getVendorName().c_str() ); 587 587 printMessage("\tModel Name:\t\t%s\n", getModelName().c_str() ); trunk/libffado/src/libieee1394/cycletimer.h
r1531 r1763 95 95 #ifdef DEBUG 96 96 if (x >= TICKS_PER_SECOND * 128L) { 97 debugWarning("insufficient wrapping: % llu\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: % lld\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): % llu\n",x);147 debugWarning("insufficient wrapping (max): %"PRIu64"\n",x); 148 148 } 149 149 if (x < 0) { 150 debugWarning("insufficient wrapping (min): % lld\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=% lld max=%lld\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: % llu(%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 llu TSC=%08lX SYT=%04X\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 llu TSC=%08lX SYT=%04X\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: % llu(%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 llu TSC=%08lX SYT=%04X\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 } trunk/libffado/src/libieee1394/CycleTimerHelper.cpp
r1531 r1763 164 164 m_cycle_timer_prev, maxtries2); 165 165 } 166 debugOutput( DEBUG_LEVEL_VERBOSE, " read : CTR: %11 lu, local: %17llu\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 llu(%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: %11 lu, local: %17llu\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 llu(%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 ), … … 310 310 bw_abs, bw_rel); 311 311 debugOutput(DEBUG_LEVEL_VERBOSE, 312 " usecs/update: % lu, ticks/update: %lu, m_dll_e2: %f\n",312 " usecs/update: %u, ticks/update: %u, m_dll_e2: %f\n", 313 313 m_usecs_per_update, m_ticks_per_update, m_dll_e2); 314 314 debugOutput(DEBUG_LEVEL_VERBOSE, … … 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 % lld/%f (now: %lld, 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: % lld, max: +/- %ld (try: %d) %lld\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 395 Util::SystemTimeSource::SleepUsecRelative(USECS_PER_CYCLE );395 Util::SystemTimeSource::SleepUsecRelative(USECS_PER_CYCLE / 2); 396 396 } 397 397 … … 409 409 // // simulate a random scheduling delay between (0-10ms) 410 410 // ffado_microsecs_t tmp = Util::SystemTimeSource::SleepUsecRandom(10000); 411 // debugOutput( DEBUG_LEVEL_VERBOSE, " (%p) random sleep of % llu usecs...\n", this, tmp);411 // debugOutput( DEBUG_LEVEL_VERBOSE, " (%p) random sleep of %u usecs...\n", this, tmp); 412 412 413 413 if(m_unhandled_busreset) { … … 419 419 } 420 420 421 debugOutputExtreme( DEBUG_LEVEL_ULTRA_VERBOSE, " read : CTR: %11 lu, local: %17llu\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 llu(%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: % lld>> %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=% lld, diff_ticks = %lld, ticks_late = %lld\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: % lldusecs\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=% lld ticks_late=%lld\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=% lld\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 llu(%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 llu(%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 llu, 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 llu - DLL %010lu = %010ld (%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 … … 625 625 if (y_step_in_ticks_int > 0) { 626 626 retval = addTicks(offset_in_ticks_int, y_step_in_ticks_int); 627 /* debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, "y_step_in_ticks_int > 0: % lld, time_diff: %f, rate: %f, retval: %lu\n",627 /* debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, "y_step_in_ticks_int > 0: %d, time_diff: %f, rate: %f, retval: %u\n", 628 628 y_step_in_ticks_int, time_diff, my_vars.rate, retval);*/ 629 629 } else { … … 631 631 632 632 // this can happen if the update thread was woken up earlier than it should have been 633 /* debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, "y_step_in_ticks_int <= 0: % lld, time_diff: %f, rate: %f, retval: %lu\n",633 /* debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, "y_step_in_ticks_int <= 0: %d, time_diff: %f, rate: %f, retval: %u\n", 634 634 y_step_in_ticks_int, time_diff, my_vars.rate, retval);*/ 635 635 } … … 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): % llu -> %llu\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 llu(%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 llu(%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 ), trunk/libffado/src/libieee1394/ieee1394service.cpp
r1660 r1763 57 57 , m_armHelperRealtime( NULL ) 58 58 , m_handle( 0 ) 59 , m_handle_lock( new Util::PosixMutex("SR CVHND") )59 , m_handle_lock( new Util::PosixMutex("SRVCHND") ) 60 60 , m_util_handle( 0 ) 61 61 , m_port( -1 ) … … 85 85 , m_armHelperRealtime( NULL ) 86 86 , m_handle( 0 ) 87 , m_handle_lock( new Util::PosixMutex("SR CVHND") )87 , m_handle_lock( new Util::PosixMutex("SRVCHND") ) 88 88 , m_util_handle( 0 ) 89 89 , m_port( -1 ) … … 122 122 ++it ) 123 123 { 124 debugOutput(DEBUG_LEVEL_VERBOSE, "Unregistering ARM handler for 0x%016 llX\n", (*it)->getStart());124 debugOutput(DEBUG_LEVEL_VERBOSE, "Unregistering ARM handler for 0x%016"PRIX64"\n", (*it)->getStart()); 125 125 if(m_armHelperNormal) { 126 126 int err = raw1394_arm_unregister(m_armHelperNormal->get1394Handle(), (*it)->getStart()); 127 127 if (err) { 128 debugError(" Failed to unregister ARM handler for 0x%016 llX\n", (*it)->getStart());128 debugError(" Failed to unregister ARM handler for 0x%016"PRIX64"\n", (*it)->getStart()); 129 129 debugError(" Error: %s\n", strerror(errno)); 130 130 } … … 557 557 #ifdef DEBUG 558 558 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, 559 "read: node 0x%hX, addr = 0x%016 llX, length = %u\n",559 "read: node 0x%hX, addr = 0x%016"PRIX64", length = %zd\n", 560 560 nodeId, addr, length); 561 561 printBuffer( DEBUG_LEVEL_VERY_VERBOSE, length, buffer ); … … 566 566 #ifdef DEBUG 567 567 debugOutput(DEBUG_LEVEL_VERBOSE, 568 "raw1394_read failed: node 0x%hX, addr = 0x%016 llX, length = %u\n",568 "raw1394_read failed: node 0x%hX, addr = 0x%016"PRIX64", length = %zd\n", 569 569 nodeId, addr, length); 570 570 #endif … … 612 612 613 613 #ifdef DEBUG 614 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"write: node 0x%hX, addr = 0x%016 llX, length = %d\n",614 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"write: node 0x%hX, addr = 0x%016"PRIX64", length = %zd\n", 615 615 nodeId, addr, length); 616 616 printBuffer( DEBUG_LEVEL_VERY_VERBOSE, length, data ); … … 649 649 } 650 650 #ifdef DEBUG 651 debugOutput(DEBUG_LEVEL_VERBOSE,"lockCompareSwap64: node 0x%X, addr = 0x%016 llX\n",651 debugOutput(DEBUG_LEVEL_VERBOSE,"lockCompareSwap64: node 0x%X, addr = 0x%016"PRIX64"\n", 652 652 nodeId, addr); 653 debugOutput(DEBUG_LEVEL_VERBOSE," if (*(addr)==0x%016 llX) *(addr)=0x%016llX\n",653 debugOutput(DEBUG_LEVEL_VERBOSE," if (*(addr)==0x%016"PRIX64") *(addr)=0x%016"PRIX64"\n", 654 654 compare_value, swap_value); 655 655 fb_octlet_t buffer; … … 657 657 debugWarning("Could not read register\n"); 658 658 } else { 659 debugOutput(DEBUG_LEVEL_VERBOSE,"before = 0x%016 llX\n", buffer);659 debugOutput(DEBUG_LEVEL_VERBOSE,"before = 0x%016"PRIX64"\n", buffer); 660 660 } 661 661 #endif … … 681 681 debugWarning("Could not read register\n"); 682 682 } else { 683 debugOutput(DEBUG_LEVEL_VERBOSE,"after = 0x%016 llX\n", buffer);683 debugOutput(DEBUG_LEVEL_VERBOSE,"after = 0x%016"PRIX64"\n", buffer); 684 684 } 685 685 #endif … … 831 831 } 832 832 833 // check the request and figure out what happened 834 if(m_fcp_block.status == eFS_Waiting) { 835 debugOutput(DEBUG_LEVEL_VERBOSE, "FCP response timed out\n"); 836 retval = false; 837 goto out; 838 } 839 if(m_fcp_block.status == eFS_Error) { 840 debugError("FCP request/response error\n"); 841 retval = false; 842 goto out; 843 } 844 845 out: 833 846 // stop listening for FCP responses 834 847 err = raw1394_stop_fcp_listen(m_handle); … … 836 849 debugOutput(DEBUG_LEVEL_VERBOSE, "could not stop FCP listen (err=%d, errno=%d)\n", err, errno); 837 850 retval = false; 838 goto out; 839 } 840 841 // check the request and figure out what happened 842 if(m_fcp_block.status == eFS_Waiting) { 843 debugOutput(DEBUG_LEVEL_VERBOSE, "FCP response timed out\n"); 844 retval = false; 845 goto out; 846 } 847 if(m_fcp_block.status == eFS_Error) { 848 debugError("FCP request/response error\n"); 849 retval = false; 850 goto out; 851 } 852 853 out: 851 } 852 854 853 m_fcp_block.status = eFS_Empty; 855 854 return retval; … … 876 875 fb_quadlet_t *data_quads = (fb_quadlet_t *)data; 877 876 #ifdef DEBUG 878 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"fcp response: node 0x%hX, response = %d, length = % d bytes\n",877 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"fcp response: node 0x%hX, response = %d, length = %zd bytes\n", 879 878 nodeid, response, length); 880 879 printBuffer(DEBUG_LEVEL_VERY_VERBOSE, (length+3)/4, data_quads ); … … 906 905 } else if(FCP_MASK_SUBUNIT_AND_OPCODE(first_quadlet) 907 906 != FCP_MASK_SUBUNIT_AND_OPCODE(CondSwapFromBus32(m_fcp_block.request[0]))) { 908 debugOutput(DEBUG_LEVEL_VERBOSE, "FCP response not for this request: %08 lX != %08lX\n",907 debugOutput(DEBUG_LEVEL_VERBOSE, "FCP response not for this request: %08X != %08X\n", 909 908 FCP_MASK_SUBUNIT_AND_OPCODE(first_quadlet), 910 909 FCP_MASK_SUBUNIT_AND_OPCODE(CondSwapFromBus32(m_fcp_block.request[0]))); … … 970 969 return 0; 971 970 } 972 debugOutput(DEBUG_LEVEL_VERBOSE, " READ HI: 0x%08 lX\n", split_timeout_hi);971 debugOutput(DEBUG_LEVEL_VERBOSE, " READ HI: 0x%08X\n", split_timeout_hi); 973 972 974 973 if(!readNoLock( 0xffc0 | nodeId, CSR_REGISTER_BASE + CSR_SPLIT_TIMEOUT_LO, 1, … … 977 976 return 0; 978 977 } 979 debugOutput(DEBUG_LEVEL_VERBOSE, " READ LO: 0x%08 lX\n", split_timeout_low);978 debugOutput(DEBUG_LEVEL_VERBOSE, " READ LO: 0x%08X\n", split_timeout_low); 980 979 981 980 split_timeout_hi = CondSwapFromBus32(split_timeout_hi); … … 1073 1072 1074 1073 bool Ieee1394Service::registerARMHandler(ARMHandler *h) { 1075 debugOutput(DEBUG_LEVEL_VERBOSE, "Registering ARM handler (%p) for 0x%016llX, length %u\n", 1076 h, h->getStart(), h->getLength()); 1074 debugOutput(DEBUG_LEVEL_VERBOSE, 1075 "Registering ARM handler (%p) for 0x%016"PRIX64", length %zu\n", 1076 h, h->getStart(), h->getLength()); 1077 1077 1078 1078 // FIXME: note that this will result in the ARM handlers not running in a realtime context … … 1083 1083 h->getClientTransactions()); 1084 1084 if (err) { 1085 debugError("Failed to register ARM handler for 0x%016 llX\n", h->getStart());1085 debugError("Failed to register ARM handler for 0x%016"PRIX64"\n", h->getStart()); 1086 1086 debugError(" Error: %s\n", strerror(errno)); 1087 1087 return false; … … 1092 1092 1093 1093 bool Ieee1394Service::unregisterARMHandler( ARMHandler *h ) { 1094 debugOutput(DEBUG_LEVEL_VERBOSE, "Unregistering ARM handler (%p) for 0x%016 llX\n",1094 debugOutput(DEBUG_LEVEL_VERBOSE, "Unregistering ARM handler (%p) for 0x%016"PRIX64"\n", 1095 1095 h, h->getStart()); 1096 1096 … … 1123 1123 */ 1124 1124 nodeaddr_t Ieee1394Service::findFreeARMBlock( nodeaddr_t start, size_t length, size_t step ) { 1125 debugOutput(DEBUG_LEVEL_VERBOSE, "Finding free ARM block of %d bytes, from 0x%016llX in steps of %d bytes\n", 1126 length, start, step); 1125 debugOutput(DEBUG_LEVEL_VERBOSE, 1126 "Finding free ARM block of %zd bytes, from 0x%016"PRIX64" in steps of %zd bytes\n", 1127 length, start, step); 1127 1128 1128 1129 int cnt=0; … … 1135 1136 1136 1137 if (err) { 1137 debugOutput(DEBUG_LEVEL_VERBOSE, " -> cannot use 0x%016 llX\n", start);1138 debugOutput(DEBUG_LEVEL_VERBOSE, " -> cannot use 0x%016"PRIX64"\n", start); 1138 1139 debugError(" Error: %s\n", strerror(errno)); 1139 1140 start += step; 1140 1141 } else { 1141 debugOutput(DEBUG_LEVEL_VERBOSE, " -> use 0x%016 llX\n", start);1142 debugOutput(DEBUG_LEVEL_VERBOSE, " -> use 0x%016"PRIX64"\n", start); 1142 1143 err = raw1394_arm_unregister(m_handle, start); 1143 1144 if (err) { … … 1188 1189 raw1394_arm_response_t arm_resp = arm_req_resp->response; 1189 1190 1190 debugOutput(DEBUG_LEVEL_VERBOSE,"ARM handler for address 0x%016 llXcalled\n",1191 debugOutput(DEBUG_LEVEL_VERBOSE,"ARM handler for address 0x%016"PRIX64" called\n", 1191 1192 (*it)->getStart()); 1192 1193 debugOutput(DEBUG_LEVEL_VERBOSE," request type : 0x%02X\n", request_type); … … 1583 1584 debugOutput( DEBUG_LEVEL_VERBOSE, " CycleTimerHelper: %p, IsoManager: %p, WatchDog: %p\n", 1584 1585 m_pCTRHelper, m_pIsoManager, m_pWatchdog ); 1585 debugOutput( DEBUG_LEVEL_VERBOSE, " Time: %011 llu(%03us %04ucy %04uticks)\n",1586 debugOutput( DEBUG_LEVEL_VERBOSE, " Time: %011"PRIu64" (%03us %04ucy %04uticks)\n", 1586 1587 ctr, 1587 1588 (unsigned int)TICKS_TO_SECS( ctr ), trunk/libffado/src/libieee1394/IsoHandler.cpp
r1731 r1763 261 261 262 262 // wake ourselves up 263 raw1394_wake_up(m_handle);263 if(m_handle) raw1394_wake_up(m_handle); 264 264 } 265 265 … … 396 396 if((pkt_ctr & ~0x0FFFL) != pkt_ctr_ref) { 397 397 debugWarning("reconstructed CTR counter discrepancy\n"); 398 debugWarning(" ingredients: %X, %lX, %lX, %lX, %lX, %ld, %ld, %ld, %lld\n", 399 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); 400 debugWarning(" diffcy = %ld \n", diff_cycles); 398 debugWarning(" ingredients: %X, %X, %X, %X, %X, %d, %ld, %ld, %"PRId64"\n", 399 cycle, pkt_ctr_ref, pkt_ctr, 400 now, m_last_now, now_secs_ref, 401 (long int)CYCLE_TIMER_GET_SECS(now), 402 (long int)CYCLE_TIMER_GET_SECS(m_last_now), 403 tmp); 404 debugWarning(" diffcy = %"PRId64" \n", diff_cycles); 401 405 } 402 406 #endif … … 475 479 if(((pkt_ctr & ~0x0FFFL) != pkt_ctr_ref) && (m_packets > m_buf_packets)) { 476 480 debugWarning("reconstructed CTR counter discrepancy\n"); 477 debugWarning(" ingredients: %X, %lX, %lX, %lX, %lX, %ld, %ld, %ld, %lld\n", 478 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); 479 debugWarning(" diffcy = %ld \n", diff_cycles); 481 debugWarning(" ingredients: %X, %X, %X, %X, %X, %d, %ld, %ld, %"PRId64"\n", 482 cycle, pkt_ctr_ref, pkt_ctr, 483 now, m_last_now, now_secs_ref, 484 (long int)CYCLE_TIMER_GET_SECS(now), 485 (long int)CYCLE_TIMER_GET_SECS(m_last_now), 486 tmp); 487 debugWarning(" diffcy = %"PRId64" \n", diff_cycles); 480 488 } 481 489 #endif trunk/libffado/src/libieee1394/IsoHandlerManager.cpp
r1731 r1763 114 114 115 115 if (!h->handleBusReset()) { 116 debugWarning("Failed to handle busreset on %p\n" );116 debugWarning("Failed to handle busreset on %p\n", h); 117 117 retval = false; 118 118 } … … 261 261 262 262 if(no_one_to_poll) { 263 debugOutput (DEBUG_LEVEL_ULTRA_VERBOSE,263 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 264 264 "(%p, %s) No one to poll, waiting for something to happen\n", 265 265 this, (m_handlerType == IsoHandler::eHT_Transmit? "Transmit": "Receive")); … … 325 325 326 326 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 327 "(%p, %s) check handler %d: diff = % lld, max = %lld, now: %08lX, last: %08lX\n",327 "(%p, %s) check handler %d: diff = %"PRId64", max = %"PRId64", now: %08X, last: %08X\n", 328 328 this, (m_handlerType == IsoHandler::eHT_Transmit? "Transmit": "Receive"), 329 329 i, measured_diff_ticks, max_diff_ticks, ctr_at_poll_return, last_packet_seen); 330 330 if(measured_diff_ticks > max_diff_ticks) { 331 debugFatal("(%p, %s) Handler died: now: %08 lX, last: %08lX, diff: %lld (max: %lld)\n",331 debugFatal("(%p, %s) Handler died: now: %08X, last: %08X, diff: %"PRId64" (max: %"PRId64")\n", 332 332 this, (m_handlerType == IsoHandler::eHT_Transmit? "Transmit": "Receive"), 333 333 ctr_at_poll_return, last_packet_seen, measured_diff_ticks, max_diff_ticks); … … 410 410 debugError("(%p) sem_timedwait error (result=%d errno=EINVAL)\n", 411 411 this, result); 412 debugError("(%p) timeout_nsec=%lld ts.sec=%d ts.nsec=%lld\n", 413 this, m_activity_wait_timeout_nsec, ts.tv_sec, ts.tv_nsec); 412 debugError("(%p) timeout_nsec=%lld ts.sec=%"PRId64" ts.nsec=%"PRId64"\n", 413 this, m_activity_wait_timeout_nsec, 414 (int64_t)ts.tv_sec, (int64_t)ts.tv_nsec); 414 415 return eAR_Error; 415 416 } else { 416 417 debugError("(%p) sem_timedwait error (result=%d errno=%d)\n", 417 418 this, result, errno); 418 debugError("(%p) timeout_nsec=%lld ts.sec=%d ts.nsec=%lld\n", 419 this, m_activity_wait_timeout_nsec, ts.tv_sec, ts.tv_nsec); 419 debugError("(%p) timeout_nsec=%lld ts.sec=%"PRId64" ts.nsec=%"PRId64"\n", 420 this, m_activity_wait_timeout_nsec, 421 (int64_t)ts.tv_sec, (int64_t)ts.tv_nsec); 420 422 return eAR_Error; 421 423 } … … 885 887 886 888 m_StreamProcessors.push_back(stream); 887 debugOutput( DEBUG_LEVEL_VERBOSE, " % d streams, %d handlers registered\n",889 debugOutput( DEBUG_LEVEL_VERBOSE, " %zd streams, %zd handlers registered\n", 888 890 m_StreamProcessors.size(), m_IsoHandlers.size()); 889 891 return true; trunk/libffado/src/libieee1394/test-cyclecalc.cpp
r1047 r1763 52 52 (unsigned int)CYCLE_TIMER_GET_OFFSET(now_ctr)); 53 53 54 debugOutput(DEBUG_LEVEL_VERBOSE,"NOW : %011 llu(%03us %04uc %04ut)\n",54 debugOutput(DEBUG_LEVEL_VERBOSE,"NOW : %011"PRIu64" (%03us %04uc %04ut)\n", 55 55 now, 56 56 (unsigned int)TICKS_TO_SECS(now), … … 68 68 #endif 69 69 70 debugOutput(DEBUG_LEVEL_VERBOSE,"CALC_TS : %011 llu(%03us %04uc %04ut)\n",70 debugOutput(DEBUG_LEVEL_VERBOSE,"CALC_TS : %011"PRIu64" (%03us %04uc %04ut)\n", 71 71 calc_ts, 72 72 (unsigned int)TICKS_TO_SECS(calc_ts), trunk/libffado/src/libstreaming/amdtp-oxford/AmdtpOxfordReceiveStreamProcessor.cpp
r1535 r1763 190 190 m_dll_e2 += m_dll_c * err; 191 191 192 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Generated TSP: %16 llu %lld %d %d\n",192 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Generated TSP: %16"PRIu64" %"PRId64" %"PRId32" %"PRId64"\n", 193 193 m_next_packet_timestamp, m_next_packet_timestamp-m_last_timestamp, 194 194 frames_in_tempbuffer, ((length / sizeof (quadlet_t)) - 2) / m_dimension); trunk/libffado/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp
r1531 r1763 148 148 if(isRunning()) { 149 149 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 150 "STMP: % lluticks | 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 llu ticks | delta_t: %5lld| 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 } … … 378 378 sample_int |= 0x01000000; // flag that there is a midi event present 379 379 *buffer = sample_int; 380 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "(%p) MIDI [%d]: %08X\n", this, i, sample_int); 380 381 } else if(IEC61883_AM824_HAS_LABEL(sample_int, IEC61883_AM824_LABEL_MIDI_2X) 381 382 || IEC61883_AM824_HAS_LABEL(sample_int, IEC61883_AM824_LABEL_MIDI_3X) ) { trunk/libffado/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.h
r1535 r1763 29 29 */ 30 30 31 #include "debugmodule/debugmodule.h" 32 33 #include "../generic/StreamProcessor.h" 34 #include "../util/cip.h" 35 36 #include <libiec61883/iec61883.h> 37 #include <pthread.h> 38 39 #define AMDTP_MAX_PACKET_SIZE 2048 40 41 #define IEC61883_STREAM_TYPE_MIDI 0x0D 42 #define IEC61883_STREAM_TYPE_SPDIF 0x00 43 #define IEC61883_STREAM_TYPE_MBLA 0x06 44 45 #define IEC61883_AM824_LABEL_MASK 0xFF000000 46 #define IEC61883_AM824_GET_LABEL(x) (((x) & 0xFF000000) >> 24) 47 #define IEC61883_AM824_SET_LABEL(x,y) ((x) | ((y)<<24)) 48 49 #define IEC61883_AM824_LABEL_MIDI_NO_DATA 0x80 50 #define IEC61883_AM824_LABEL_MIDI_1X 0x81 51 #define IEC61883_AM824_LABEL_MIDI_2X 0x82 52 #define IEC61883_AM824_LABEL_MIDI_3X 0x83 53 54 #define IEC61883_AM824_HAS_LABEL(x, lbl) (((x) & 0xFF000000) == (((quadlet_t)(lbl))<<24)) 31 #include "AmdtpStreamProcessor-common.h" 55 32 56 33 namespace Streaming { trunk/libffado/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp
r1531 r1763 96 96 97 97 debugOutputExtreme( DEBUG_LEVEL_ULTRA_VERBOSE, 98 "Try for cycle %d\n", CYCLE_TIMER_GET_CYCLES(pkt_ctr) );98 "Try for cycle %d\n", (int) CYCLE_TIMER_GET_CYCLES(pkt_ctr) ); 99 99 // check whether the packet buffer has packets for us to send. 100 100 // the base timestamp is the one of the next sample in the buffer … … 142 142 { 143 143 debugOutput( DEBUG_LEVEL_NORMAL, 144 "Insufficient frames (P): N=%02d, CY=%04 u, TC=%04u, CUT=%04d\n",145 fc, CYCLE_TIMER_GET_CYCLES(pkt_ctr),144 "Insufficient frames (P): N=%02d, CY=%04d, TC=%04u, CUT=%04d\n", 145 fc, (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), 146 146 transmit_at_cycle, cycles_until_transmit ); 147 147 // we are too late … … 154 154 155 155 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 156 "Insufficient frames (NP): N=%02d, CY=%04 u, TC=%04u, CUT=%04d, NOW=%04d\n",157 fc, CYCLE_TIMER_GET_CYCLES(pkt_ctr),156 "Insufficient frames (NP): N=%02d, CY=%04d, TC=%04u, CUT=%04d, NOW=%04d\n", 157 fc, (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), 158 158 transmit_at_cycle, cycles_until_transmit, now_cycle ); 159 159 #endif … … 201 201 // we are too late 202 202 debugOutput(DEBUG_LEVEL_VERBOSE, 203 "Too late: CY=%04 u, TC=%04u, CUT=%04d, TSP=%011llu(%04u)\n",204 CYCLE_TIMER_GET_CYCLES(pkt_ctr),203 "Too late: CY=%04d, TC=%04u, CUT=%04d, TSP=%011"PRIu64" (%04u)\n", 204 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), 205 205 transmit_at_cycle, cycles_until_transmit, 206 206 presentation_time, (unsigned int)TICKS_TO_CYCLES(presentation_time) ); … … 230 230 // for timestamp tracing 231 231 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 232 "XMIT PKT: TSP= %011 llu(%04u) (%04u) (%04u)\n",232 "XMIT PKT: TSP= %011"PRIu64" (%04u) (%04u) (%04u)\n", 233 233 presentation_time, 234 234 (unsigned int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), … … 240 240 { 241 241 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 242 "Too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011 llu (%04u), TSP=%011llu(%04u)\n",243 CYCLE_TIMER_GET_CYCLES(pkt_ctr),242 "Too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011"PRIu64" (%04u), TSP=%011"PRId64" (%04u)\n", 243 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), 244 244 transmit_at_cycle, cycles_until_transmit, 245 245 transmit_at_time, (unsigned int)TICKS_TO_CYCLES(transmit_at_time), … … 249 249 { 250 250 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 251 "Way too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011 llu (%04u), TSP=%011llu(%04u)\n",252 CYCLE_TIMER_GET_CYCLES(pkt_ctr),251 "Way too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011"PRIu64" (%04u), TSP=%011"PRId64"(%04u)\n", 252 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), 253 253 transmit_at_cycle, cycles_until_transmit, 254 254 transmit_at_time, (unsigned int)TICKS_TO_CYCLES(transmit_at_time), … … 269 269 if (m_data_buffer->readFrames(m_syt_interval, (char *)(data + 8))) 270 270 { 271 debugOutputExtreme(DEBUG_LEVEL_VER Y_VERBOSE,272 "XMIT DATA: TSP= %011 llu(%04u)\n",271 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 272 "XMIT DATA: TSP= %011"PRIu64" (%04u)\n", 273 273 m_last_timestamp, 274 274 (unsigned int)TICKS_TO_CYCLES(m_last_timestamp)); 275 #if 0 276 // debug code to output the packet content 277 char tmpbuff[8192]; 278 int cnt=0; 279 quadlet_t *tmp = (quadlet_t *)((char *)(data + 8)); 280 281 for(int i=0; i<m_syt_interval; i++) { 282 cnt += snprintf(tmpbuff + cnt, 8192-cnt, "[%02d] ", i); 283 for(int j=0; j<m_dimension; j++) { 284 cnt += snprintf(tmpbuff + cnt, 8192-cnt, "%08X ", *tmp); 285 tmp++; 286 } 287 cnt += snprintf(tmpbuff + cnt, 8192-cnt, "\n"); 288 } 289 debugOutput(DEBUG_LEVEL_VERBOSE, "\n%s\n", tmpbuff); 290 #endif 275 291 return eCRV_OK; 276 292 } … … 286 302 struct iec61883_packet *packet = ( struct iec61883_packet * ) data; 287 303 debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 288 "XMIT SILENT (cy %04d): CY=%04u, TSP=%011llu(%04u)\n",289 CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp,304 "XMIT SILENT (cy %04d): TSP=%011"PRIu64" (%04u)\n", 305 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp, 290 306 (unsigned int)TICKS_TO_CYCLES(m_last_timestamp)); 291 307 … … 323 339 struct iec61883_packet *packet = ( struct iec61883_packet * ) data; 324 340 debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 325 "XMIT EMPTY (cy %04d): CY=%04u, TSP=%011llu(%04u)\n",326 CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp,341 "XMIT EMPTY (cy %04d): TSP=%011"PRIu64" (%04u)\n", 342 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp, 327 343 (unsigned int)TICKS_TO_CYCLES(m_last_timestamp) ); 328 344 packet->sid = m_local_node_id; … … 1036 1052 *target_event = CondSwapToBus32(tmpval); 1037 1053 1038 // debugOutput( DEBUG_LEVEL_VERBOSE, "MIDI port %s, pos=%u, loc=%u, nevents=%u, dim=%d\n",1039 //p.port->getName().c_str(), p.position, p.location, nevents, m_dimension );1040 // debugOutput( DEBUG_LEVEL_VERBOSE, "base=%p, target=%p, value=%08X\n",1041 //data, target_event, tmpval );1054 debugOutputExtreme( DEBUG_LEVEL_VERBOSE, "MIDI port %s, pos=%u, loc=%u, nevents=%u, dim=%d\n", 1055 p.port->getName().c_str(), p.position, p.location, nevents, m_dimension ); 1056 debugOutputExtreme( DEBUG_LEVEL_VERBOSE, "base=%p, target=%p, value=%08X\n", 1057 data, target_event, tmpval ); 1042 1058 } else { 1043 1059 // can't send a byte, either because there is no byte, trunk/libffado/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.h
r1531 r1763 30 30 #include "config.h" 31 31 32 #include "debugmodule/debugmodule.h" 33 34 #include "../generic/StreamProcessor.h" 35 #include "../util/cip.h" 36 37 #include <libiec61883/iec61883.h> 38 #include <pthread.h> 39 40 #define AMDTP_MAX_PACKET_SIZE 2048 41 42 #define IEC61883_STREAM_TYPE_MIDI 0x0D 43 #define IEC61883_STREAM_TYPE_SPDIF 0x00 44 #define IEC61883_STREAM_TYPE_MBLA 0x06 45 46 #define IEC61883_AM824_LABEL_MASK 0xFF000000 47 #define IEC61883_AM824_GET_LABEL(x) (((x) & 0xFF000000) >> 24) 48 #define IEC61883_AM824_SET_LABEL(x,y) ((x) | ((y)<<24)) 49 50 #define IEC61883_AM824_LABEL_MIDI_NO_DATA 0x80 51 #define IEC61883_AM824_LABEL_MIDI_1X 0x81 52 #define IEC61883_AM824_LABEL_MIDI_2X 0x82 53 #define IEC61883_AM824_LABEL_MIDI_3X 0x83 54 55 #define IEC61883_AM824_HAS_LABEL(x, lbl) (((x) & 0xFF000000) == (((quadlet_t)(lbl))<<24)) 32 #include "AmdtpStreamProcessor-common.h" 56 33 57 34 namespace Streaming { trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp
r1535 r1763 77 77 , m_ticks_per_frame( 0 ) 78 78 , m_dll_bandwidth_hz ( STREAMPROCESSOR_DLL_BW_HZ ) 79 , m_ sync_delay_frames( 0 )79 , m_extra_buffer_frames( 0 ) 80 80 , m_in_xrun( false ) 81 81 { … … 130 130 m_in_xrun = true; 131 131 SIGNAL_ACTIVITY_ALL; 132 }133 134 uint64_t StreamProcessor::getTimeNow() {135 return m_1394service.getCycleTimerTicks();136 132 } 137 133 … … 172 168 * Buffer management and manipulation * 173 169 ***********************************************/ 170 void 171 StreamProcessor::getBufferHeadTimestamp(ffado_timestamp_t *ts, signed int *fc) 172 { 173 m_data_buffer->getBufferHeadTimestamp(ts, fc); 174 } 175 176 void 177 StreamProcessor::getBufferTailTimestamp(ffado_timestamp_t *ts, signed int *fc) 178 { 179 m_data_buffer->getBufferTailTimestamp(ts, fc); 180 } 181 182 void StreamProcessor::setBufferTailTimestamp(ffado_timestamp_t new_timestamp) 183 { 184 m_data_buffer->setBufferTailTimestamp(new_timestamp); 185 } 186 187 void 188 StreamProcessor::setBufferHeadTimestamp(ffado_timestamp_t new_timestamp) 189 { 190 m_data_buffer->setBufferHeadTimestamp(new_timestamp); 191 } 174 192 175 193 int StreamProcessor::getBufferFill() { … … 177 195 } 178 196 179 int64_t180 StreamProcessor::getTimeUntilNextPeriodSignalUsecs()181 {182 uint64_t time_at_period=getTimeAtPeriod();183 184 // we delay the period signal with the sync delay185 // this makes that the period signals lag a little compared to reality186 // ISO buffering causes the packets to be received at max187 // m_handler->getWakeupInterval() later than the time they were received.188 // hence their payload is available this amount of time later. However, the189 // period boundary is predicted based upon earlier samples, and therefore can190 // pass before these packets are processed. Adding this extra term makes that191 // the period boundary is signalled later192 time_at_period = addTicks(time_at_period, m_StreamProcessorManager.getSyncSource().getSyncDelay());193 194 uint64_t cycle_timer=m_1394service.getCycleTimerTicks();195 196 // calculate the time until the next period197 int32_t until_next=diffTicks(time_at_period,cycle_timer);198 199 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "=> TAP=%11llu, CTR=%11llu, UTN=%11ld\n",200 time_at_period, cycle_timer, until_next201 );202 203 // now convert to usecs204 // don't use the mapping function because it only works205 // for absolute times, not the relative time we are206 // using here (which can also be negative).207 return (int64_t)(((float)until_next) / TICKS_PER_USEC);208 }209 210 197 void 211 StreamProcessor::setSyncDelay(unsigned int ticks) { 212 213 // round the sync delay to an integer number of packets now we know the frame rate 214 int frames = (int)((float)ticks / getTicksPerFrame()); 215 frames = (frames / getNominalFramesPerPacket()) + 1; 216 frames *= getNominalFramesPerPacket(); 217 218 #ifdef DEBUG 219 float ticks2 = frames * getTicksPerFrame(); 220 debugOutput(DEBUG_LEVEL_VERBOSE, "Setting SP %p SyncDelay to %u ticks => rounded to %u frames, %f ticks\n", 221 this, ticks, frames, ticks2); 222 #endif 223 m_sync_delay_frames = frames; 198 StreamProcessor::setExtraBufferFrames(unsigned int frames) { 199 debugOutput(DEBUG_LEVEL_VERBOSE, "Setting extra buffer to %d frames\n", frames); 200 m_extra_buffer_frames = frames; 224 201 } 225 202 226 203 unsigned int 227 StreamProcessor::getSyncDelayFrames() { 228 return m_sync_delay_frames; 229 } 230 231 unsigned int 232 StreamProcessor::getSyncDelay() { 233 return (unsigned int)(m_sync_delay_frames * getTicksPerFrame()); 204 StreamProcessor::getExtraBufferFrames() { 205 return m_extra_buffer_frames; 234 206 } 235 207 236 208 uint64_t 237 StreamProcessor::getTimeAtPeriodUsecs() 238 { 239 return (uint64_t)((float)getTimeAtPeriod() * TICKS_PER_USEC); 240 } 241 242 uint64_t 243 StreamProcessor::getTimeAtPeriod() 209 StreamProcessor::getTimeAtPeriod() 244 210 { 245 211 if (getType() == ePT_Receive) { … … 412 378 if (m_last_timestamp > 0 && m_last_timestamp2 > 0) { 413 379 int64_t tsp_diff = diffTicks(m_last_timestamp, m_last_timestamp2); 414 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "TSP diff: % lld\n", tsp_diff);380 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "TSP diff: %"PRId64"\n", tsp_diff); 415 381 double tsp_diff_d = tsp_diff; 416 382 double fs_syt = 1.0/tsp_diff_d; … … 433 399 if(diff-ticks_per_packet > 50 || diff-ticks_per_packet < -50) { 434 400 debugOutput(DEBUG_LEVEL_VERBOSE, 435 "cy %04 u rather large TSP difference TS=%011llu => TS=%011llu(%d, nom %d)\n",436 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, 437 403 m_last_timestamp, diff, ticks_per_packet); 438 404 // !!!HACK!!! FIXME: this is the result of a failure in wrapping/unwrapping somewhere … … 444 410 diff = diffTicks(last_timestamp_fixed, m_last_timestamp2); 445 411 if(diff-ticks_per_packet < 50 && diff-ticks_per_packet > -50) { 446 debugWarning("cy %04 u rather large TSP difference TS=%011llu => TS=%011llu(%d, nom %d)\n",447 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, 448 414 m_last_timestamp, diff, ticks_per_packet); 449 415 debugWarning("HACK: fixed by adding one second of ticks. This is a bug being run-time fixed.\n"); … … 454 420 diff = diffTicks(last_timestamp_fixed, m_last_timestamp2); 455 421 if(diff-ticks_per_packet < 50 && diff-ticks_per_packet > -50) { 456 debugWarning("cy %04 u rather large TSP difference TS=%011llu => TS=%011llu(%d, nom %d)\n",457 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, 458 424 m_last_timestamp, diff, ticks_per_packet); 459 425 debugWarning("HACK: fixed by subtracing one second of ticks. This is a bug being run-time fixed.\n"); … … 463 429 } 464 430 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 465 "%04u %011 llu %011llu%d %d\n",466 CYCLE_TIMER_GET_CYCLES(pkt_ctr),431 "%04u %011"PRIu64" %011"PRIu64" %d %d\n", 432 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), 467 433 m_last_timestamp2, m_last_timestamp, 468 434 diff, ticks_per_packet); … … 471 437 472 438 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 473 "RECV: CY=%04u TS=%011 llu\n",474 CYCLE_TIMER_GET_CYCLES(pkt_ctr),439 "RECV: CY=%04u TS=%011"PRIu64"\n", 440 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), 475 441 m_last_timestamp); 476 442 … … 640 606 if (result == eCRV_Packet) { 641 607 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 642 "XMIT SILENT: CY=%04u TS=%011 llu\n",643 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); 644 610 645 611 // assumed not to xrun … … 691 657 if (result == eCRV_Packet || result == eCRV_Defer) { 692 658 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 693 "XMIT: CY=%04u TS=%011 llu\n",694 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); 695 661 696 662 // valid packet timestamp … … 728 694 if (m_last_timestamp > 0 && m_last_timestamp2 > 0) { 729 695 int64_t tsp_diff = diffTicks(m_last_timestamp, m_last_timestamp2); 730 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "TSP diff: % lld\n", tsp_diff);696 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "TSP diff: %"PRId64"\n", tsp_diff); 731 697 double tsp_diff_d = tsp_diff; 732 698 double fs_syt = 1.0/tsp_diff_d; … … 737 703 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "Nom fs: %12f, Instantanous fs: %12f, diff: %12f (%12f)\n", 738 704 fs_nom, fs_syt, fs_diff, fs_diff_norm); 739 // debugOutput(DEBUG_LEVEL_VERBOSE, "Diff fs: %12f, m_last_timestamp: %011 llu, m_last_timestamp2: %011llu\n",705 // debugOutput(DEBUG_LEVEL_VERBOSE, "Diff fs: %12f, m_last_timestamp: %011"PRIu64", m_last_timestamp2: %011"PRIu64"\n", 740 706 // fs_diff, m_last_timestamp, m_last_timestamp2); 741 707 if (fs_diff_norm > 0.01 || fs_diff_norm < -0.01) { … … 750 716 if(diff-ticks_per_packet > 50 || diff-ticks_per_packet < -50) { 751 717 debugOutput(DEBUG_LEVEL_VERBOSE, 752 "cy %04d, rather large TSP difference TS=%011 llu => TS=%011llu(%d, nom %d)\n",753 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, 754 720 m_last_timestamp, diff, ticks_per_packet); 755 721 } 756 722 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 757 "%04d %011 llu %011llu%d %d\n",758 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, 759 725 m_last_timestamp, diff, ticks_per_packet); 760 726 } … … 791 757 goto send_empty_packet; 792 758 } else if (result == eCRV_Again) { 793 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "have to retry cycle %d\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)); 794 760 if(m_state != m_next_state) { 795 761 debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state from %s to %s\n", … … 826 792 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 827 793 "XMIT EMPTY: CY=%04u\n", 828 CYCLE_TIMER_GET_CYCLES(pkt_ctr));794 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr)); 829 795 830 796 generateEmptyPacketHeader(data, length, tag, sy, pkt_ctr); … … 843 809 bool result; 844 810 debugOutputExtreme( DEBUG_LEVEL_VERBOSE, 845 "(%p, %s) getFrames(%d, %11 llu)\n",811 "(%p, %s) getFrames(%d, %11"PRIu64")\n", 846 812 this, getTypeString(), nbframes, ts); 847 813 assert( getType() == ePT_Receive ); … … 874 840 lag_frames = (((float)lag_ticks) / srate); 875 841 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 876 "stream (%p): drifts %6d ticks = %10.5f frames (rate=%10.5f), % lld, %llu, %d\n",842 "stream (%p): drifts %6d ticks = %10.5f frames (rate=%10.5f), %"PRId64", %"PRIu64", %d\n", 877 843 this, lag_ticks, lag_frames, srate, ts, ts_expected, fc); 878 844 if (lag_frames >= 1.0) { 879 845 // the stream lags 880 debugOutput(DEBUG_LEVEL_VERBOSE, "stream (%p): lags with %6d ticks = %10.5f frames (rate=%10.5f), % lld, %llu, %d\n",846 debugOutput(DEBUG_LEVEL_VERBOSE, "stream (%p): lags with %6d ticks = %10.5f frames (rate=%10.5f), %"PRId64", %"PRIu64", %d\n", 881 847 this, lag_ticks, lag_frames, srate, ts, ts_expected, fc); 882 848 } else if (lag_frames <= -1.0) { 883 849 // the stream leads 884 debugOutput(DEBUG_LEVEL_VERBOSE, "stream (%p): leads with %6d ticks = %10.5f frames (rate=%10.5f), % lld, %llu, %d\n",850 debugOutput(DEBUG_LEVEL_VERBOSE, "stream (%p): leads with %6d ticks = %10.5f frames (rate=%10.5f), %"PRId64", %"PRIu64", %d\n", 885 851 this, lag_ticks, lag_frames, srate, ts, ts_expected, fc); 886 852 } … … 896 862 { 897 863 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 898 "stream (%p): dry run %d frames (@ ts=% lld)\n",864 "stream (%p): dry run %d frames (@ ts=%"PRId64")\n", 899 865 this, nbframes, ts); 900 866 // dry run on this side means that we put silence in all enabled ports … … 907 873 { 908 874 bool result; 909 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "StreamProcessor::dropFrames(%d, % lld)\n", nbframes, ts);875 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "StreamProcessor::dropFrames(%d, %"PRId64")\n", nbframes, ts); 910 876 result = m_data_buffer->dropFrames(nbframes); 911 877 SIGNAL_ACTIVITY_ISO_RECV; … … 917 883 bool result; 918 884 debugOutputExtreme( DEBUG_LEVEL_VERBOSE, 919 "(%p, %s) putFrames(%d, %11 llu)\n",885 "(%p, %s) putFrames(%d, %11"PRIu64")\n", 920 886 this, getTypeString(), nbframes, ts); 921 887 assert( getType() == ePT_Transmit ); … … 930 896 { 931 897 debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 932 "StreamProcessor::putFramesWet(%d, % llu)\n",898 "StreamProcessor::putFramesWet(%d, %"PRIu64")\n", 933 899 nbframes, ts); 934 900 // transfer the data 935 901 m_data_buffer->blockProcessWriteFrames(nbframes, ts); 936 902 debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 937 " New timestamp: % llu\n", ts);903 " New timestamp: %"PRIu64"\n", ts); 938 904 return true; // FIXME: what about failure? 939 905 } … … 943 909 { 944 910 debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 945 "StreamProcessor::putFramesDry(%d, % llu)\n",911 "StreamProcessor::putFramesDry(%d, %"PRIu64")\n", 946 912 nbframes, ts); 947 913 // do nothing … … 953 919 { 954 920 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, 955 "StreamProcessor::putSilenceFrames(%d, % llu)\n",921 "StreamProcessor::putSilenceFrames(%d, %"PRIu64")\n", 956 922 nbframes, ts); 957 923 … … 1104 1070 // make the scratch buffer one period of frames long 1105 1071 m_scratch_buffer_size_bytes = m_StreamProcessorManager.getPeriodSize() * getEventsPerFrame() * getEventSize(); 1106 debugOutput( DEBUG_LEVEL_VERBOSE, " Allocate scratch buffer of % d quadlets\n");1072 debugOutput( DEBUG_LEVEL_VERBOSE, " Allocate scratch buffer of %zd quadlets\n", m_scratch_buffer_size_bytes); 1107 1073 if(m_scratch_buffer) delete[] m_scratch_buffer; 1108 1074 m_scratch_buffer = new byte_t[m_scratch_buffer_size_bytes]; … … 1193 1159 #ifdef DEBUG 1194 1160 uint64_t now = m_1394service.getCycleTimerTicks(); 1195 debugOutput(DEBUG_LEVEL_VERBOSE," Now : %011 llu(%03us %04uc %04ut)\n",1161 debugOutput(DEBUG_LEVEL_VERBOSE," Now : %011"PRIu64" (%03us %04uc %04ut)\n", 1196 1162 now, 1197 1163 (unsigned int)TICKS_TO_SECS(now), 1198 1164 (unsigned int)TICKS_TO_CYCLES(now), 1199 1165 (unsigned int)TICKS_TO_OFFSET(now)); 1200 debugOutput(DEBUG_LEVEL_VERBOSE," Start at : %011 llu(%03us %04uc %04ut)\n",1166 debugOutput(DEBUG_LEVEL_VERBOSE," Start at : %011"PRIu64" (%03us %04uc %04ut)\n", 1201 1167 tx, 1202 1168 (unsigned int)TICKS_TO_SECS(tx), … … 1239 1205 #ifdef DEBUG 1240 1206 uint64_t now = m_1394service.getCycleTimerTicks(); 1241 debugOutput(DEBUG_LEVEL_VERBOSE," Now : %011 llu(%03us %04uc %04ut)\n",1207 debugOutput(DEBUG_LEVEL_VERBOSE," Now : %011"PRIu64" (%03us %04uc %04ut)\n", 1242 1208 now, 1243 1209 (unsigned int)TICKS_TO_SECS(now), 1244 1210 (unsigned int)TICKS_TO_CYCLES(now), 1245 1211 (unsigned int)TICKS_TO_OFFSET(now)); 1246 debugOutput(DEBUG_LEVEL_VERBOSE," Start at : %011 llu(%03us %04uc %04ut)\n",1212 debugOutput(DEBUG_LEVEL_VERBOSE," Start at : %011"PRIu64" (%03us %04uc %04ut)\n", 1247 1213 tx, 1248 1214 (unsigned int)TICKS_TO_SECS(tx), … … 1263 1229 #ifdef DEBUG 1264 1230 uint64_t now = m_1394service.getCycleTimerTicks(); 1265 debugOutput(DEBUG_LEVEL_VERBOSE," Now : %011 llu(%03us %04uc %04ut)\n",1231 debugOutput(DEBUG_LEVEL_VERBOSE," Now : %011"PRIu64" (%03us %04uc %04ut)\n", 1266 1232 now, 1267 1233 (unsigned int)TICKS_TO_SECS(now), 1268 1234 (unsigned int)TICKS_TO_CYCLES(now), 1269 1235 (unsigned int)TICKS_TO_OFFSET(now)); 1270 debugOutput(DEBUG_LEVEL_VERBOSE," Stop at : %011 llu(%03us %04uc %04ut)\n",1236 debugOutput(DEBUG_LEVEL_VERBOSE," Stop at : %011"PRIu64" (%03us %04uc %04ut)\n", 1271 1237 tx, 1272 1238 (unsigned int)TICKS_TO_SECS(tx), … … 1288 1254 #ifdef DEBUG 1289 1255 uint64_t now = m_1394service.getCycleTimerTicks(); 1290 debugOutput(DEBUG_LEVEL_VERBOSE," Now : %011 llu(%03us %04uc %04ut)\n",1256 debugOutput(DEBUG_LEVEL_VERBOSE," Now : %011"PRIu64" (%03us %04uc %04ut)\n", 1291 1257 now, 1292 1258 (unsigned int)TICKS_TO_SECS(now), 1293 1259 (unsigned int)TICKS_TO_CYCLES(now), 1294 1260 (unsigned int)TICKS_TO_OFFSET(now)); 1295 debugOutput(DEBUG_LEVEL_VERBOSE," Stop at : %011 llu(%03us %04uc %04ut)\n",1261 debugOutput(DEBUG_LEVEL_VERBOSE," Stop at : %011"PRIu64" (%03us %04uc %04ut)\n", 1296 1262 tx, 1297 1263 (unsigned int)TICKS_TO_SECS(tx), … … 1384 1350 StreamProcessor::doStop() 1385 1351 { 1352 assert(m_data_buffer); 1353 1386 1354 float ticks_per_frame; 1387 unsigned int ringbuffer_size_frames = (m_StreamProcessorManager.getNbBuffers() + 1) * m_StreamProcessorManager.getPeriodSize(); 1355 unsigned int ringbuffer_size_frames = m_StreamProcessorManager.getNbBuffers() * m_StreamProcessorManager.getPeriodSize(); 1356 ringbuffer_size_frames += m_extra_buffer_frames; 1357 ringbuffer_size_frames += 1; // to ensure that we can fit it all in there 1388 1358 1389 1359 debugOutput(DEBUG_LEVEL_VERBOSE, "Enter from state: %s\n", ePSToString(m_state)); … … 1392 1362 switch(m_state) { 1393 1363 case ePS_Created: 1394 assert(m_data_buffer);1395 1396 1364 // prepare the framerate estimate 1397 1365 ticks_per_frame = (TICKS_PER_SECOND*1.0) / ((float)m_StreamProcessorManager.getNominalRate()); … … 1399 1367 m_local_node_id= m_1394service.getLocalNodeId() & 0x3f; 1400 1368 m_correct_last_timestamp = false; 1401 1369 1402 1370 debugOutput(DEBUG_LEVEL_VERBOSE, "Initializing remote ticks/frame to %f\n", ticks_per_frame); 1403 1371 1404 1372 // initialize internal buffer 1405 1373 result &= m_data_buffer->setBufferSize(ringbuffer_size_frames); 1406 1374 1407 1375 result &= m_data_buffer->setEventSize( getEventSize() ); 1408 1376 result &= m_data_buffer->setEventsPerFrame( getEventsPerFrame() ); … … 1413 1381 } 1414 1382 result &= m_data_buffer->setNominalRate(ticks_per_frame); 1415 result &= m_data_buffer->setWrapValue(128L *TICKS_PER_SECOND);1383 result &= m_data_buffer->setWrapValue(128L * TICKS_PER_SECOND); 1416 1384 result &= m_data_buffer->setBandwidth(STREAMPROCESSOR_DLL_FAST_BW_HZ / (double)TICKS_PER_SECOND); 1417 1385 result &= m_data_buffer->prepare(); // FIXME: the name … … 1419 1387 debugOutput(DEBUG_LEVEL_VERBOSE, "DLL info: nominal tpf: %f, update period: %d, bandwidth: %e 1/ticks (%e Hz)\n", 1420 1388 m_data_buffer->getNominalRate(), m_data_buffer->getUpdatePeriod(), m_data_buffer->getBandwidth(), m_data_buffer->getBandwidth() * TICKS_PER_SECOND); 1421 1422 1389 break; 1423 1390 case ePS_DryRunning: … … 1432 1399 } 1433 1400 1434 result &= m_data_buffer->clearBuffer(); // FIXME: don't like the reset() name 1401 // clear all data 1402 result &= m_data_buffer->clearBuffer(); 1435 1403 // make the buffer transparent 1436 1404 m_data_buffer->setTransparent(true); … … 1549 1517 { 1550 1518 debugOutput(DEBUG_LEVEL_VERBOSE, "Enter from state: %s\n", ePSToString(m_state)); 1551 unsigned int ringbuffer_size_frames; 1519 1520 unsigned int ringbuffer_size_frames = m_StreamProcessorManager.getNbBuffers() * m_StreamProcessorManager.getPeriodSize(); 1521 ringbuffer_size_frames += m_extra_buffer_frames; 1522 ringbuffer_size_frames += 1; // to ensure that we can fit it all in there 1523 1552 1524 switch(m_state) { 1553 1525 case ePS_DryRunning: … … 1556 1528 // be picked up by the packet iterator 1557 1529 1558 if(!m_data_buffer->clearBuffer()) { 1559 debugError("Could not reset data buffer\n"); 1530 // clear the buffer / resize it to the most recent 1531 // size setting 1532 if(!m_data_buffer->resizeBuffer(ringbuffer_size_frames)) { 1533 debugError("Could not resize data buffer\n"); 1560 1534 return false; 1561 1535 } 1536 1562 1537 if (getType() == ePT_Transmit) { 1563 1538 ringbuffer_size_frames = m_StreamProcessorManager.getNbBuffers() * m_StreamProcessorManager.getPeriodSize(); 1564 1565 // add sync delay 1566 int syncdelay_in_frames = m_StreamProcessorManager.getSyncSource().getSyncDelayFrames(); 1567 ringbuffer_size_frames += syncdelay_in_frames; 1568 1569 debugOutput(DEBUG_LEVEL_VERBOSE, "Prefill transmit SP %p with %u frames (sync_delay_frames = %d)\n", 1570 this, ringbuffer_size_frames, syncdelay_in_frames); 1539 ringbuffer_size_frames += m_extra_buffer_frames; 1540 1541 debugOutput(DEBUG_LEVEL_VERBOSE, "Prefill transmit SP %p with %u frames (xmit prebuffer = %d)\n", 1542 this, ringbuffer_size_frames, m_extra_buffer_frames); 1571 1543 // prefill the buffer 1572 1544 if(!transferSilence(ringbuffer_size_frames)) { … … 1929 1901 } 1930 1902 uint64_t now = m_1394service.getCycleTimerTicks(); 1931 debugOutputShort( DEBUG_LEVEL_NORMAL, " Now : %011 llu(%03us %04uc %04ut)\n",1903 debugOutputShort( DEBUG_LEVEL_NORMAL, " Now : %011"PRIu64" (%03us %04uc %04ut)\n", 1932 1904 now, 1933 1905 (unsigned int)TICKS_TO_SECS(now), … … 1948 1920 24576000.0/m_StreamProcessorManager.getSyncSource().m_data_buffer->getRate(), 1949 1921 24576000.0/m_data_buffer->getRate()); 1950 float d = getSyncDelay();1951 debugOutputShort(DEBUG_LEVEL_NORMAL, " Sync delay : %f ticks (%f frames, %f cy)\n",1952 d, d/getTicksPerFrame(),1953 d/((float)TICKS_PER_CYCLE));1954 1922 #endif 1955 1923 m_data_buffer->dumpInfo(); trunk/libffado/src/libstreaming/generic/StreamProcessor.h
r1531 r1763 298 298 //--- data buffering and accounting 299 299 public: 300 void getBufferHeadTimestamp ( ffado_timestamp_t *ts, signed int *fc ) 301 {m_data_buffer->getBufferHeadTimestamp(ts, fc);}; 302 void getBufferTailTimestamp ( ffado_timestamp_t *ts, signed int *fc ) 303 {m_data_buffer->getBufferTailTimestamp(ts, fc);}; 304 305 void setBufferTailTimestamp ( ffado_timestamp_t new_timestamp ) 306 {m_data_buffer->setBufferTailTimestamp(new_timestamp);}; 307 void setBufferHeadTimestamp ( ffado_timestamp_t new_timestamp ) 308 {m_data_buffer->setBufferHeadTimestamp(new_timestamp);}; 300 void getBufferHeadTimestamp ( ffado_timestamp_t *ts, signed int *fc ); 301 void getBufferTailTimestamp ( ffado_timestamp_t *ts, signed int *fc ); 302 303 void setBufferTailTimestamp ( ffado_timestamp_t new_timestamp ); 304 void setBufferHeadTimestamp ( ffado_timestamp_t new_timestamp ); 309 305 protected: 310 306 Util::TimestampedBuffer *m_data_buffer; … … 332 328 333 329 /** 334 * \brief return the time until the next period boundary should be signaled (in microseconds) 335 * 336 * Return the time until the next period boundary signal. If this StreamProcessor 337 * is the current synchronization source, this function is called to 338 * determine when a buffer transfer can be made. When this value is 339 * smaller than 0, a period boundary is assumed to be crossed, hence a 340 * transfer can be made. 341 * 342 * \return the time in usecs 343 */ 344 int64_t getTimeUntilNextPeriodSignalUsecs(); 345 /** 346 * \brief return the time of the next period boundary (in microseconds) 347 * 348 * Returns the time of the next period boundary, in microseconds. The 349 * goal of this function is to determine the exact point of the period 330 * \brief return the time of the next period boundary (in internal units) 331 * 332 * Returns the time of the next period boundary, in internal units, i.e. 333 * in ticks of the 1394 clock of the bus the device is attached to. 334 * The goal of this function is to determine the exact point of the period 350 335 * boundary. This is assumed to be the point at which the buffer transfer should 351 336 * take place, meaning that it can be used as a reference timestamp for transmitting 352 337 * StreamProcessors 353 338 * 354 * \return the time in usecs355 */356 uint64_t getTimeAtPeriodUsecs();357 358 /**359 * \brief return the time of the next period boundary (in internal units)360 *361 * The same as getTimeAtPeriodUsecs() but in internal units.362 *363 339 * @return the time in internal units 364 340 */ 365 341 uint64_t getTimeAtPeriod(); 366 342 367 uint64_t getTimeNow(); // FIXME: should disappear 368 369 370 /** 371 * Returns the sync delay. This is the time a syncsource 372 * delays a period signal, e.g. to cope with buffering. 373 * @return the sync delay (in ticks) 374 */ 375 unsigned int getSyncDelay(); 376 unsigned int getSyncDelayFrames(); 377 /** 378 * sets the sync delay 379 * 380 * note: will be rounded to an integer number of packets 381 * 382 * @param d sync delay 383 */ 384 void setSyncDelay(unsigned int ticks); 343 /** 344 * For RECEIVE: 345 * this is the extra amount of space in the receive buffer 346 * 347 * For XMIT: 348 * Sets the number of frames that should be prebuffered 349 * into the ISO transmit buffers. A higher number here means 350 * more reliable operation. It also means higher latency 351 * 352 * @param frames 353 */ 354 void setExtraBufferFrames(unsigned int frames); 355 unsigned int getExtraBufferFrames(); 385 356 386 357 /** … … 453 424 float m_ticks_per_frame; 454 425 float m_dll_bandwidth_hz; 455 unsigned int m_ sync_delay_frames;426 unsigned int m_extra_buffer_frames; 456 427 private: 457 428 bool m_in_xrun; trunk/libffado/src/libstreaming/motu/MotuReceiveStreamProcessor.cpp
r1498 r1763 187 187 #ifdef DEBUG 188 188 if(isRunning()) { 189 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"STMP: % lluticks | tpf=%f\n",189 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"STMP: %"PRIu64"ticks | tpf=%f\n", 190 190 m_last_timestamp, getTicksPerFrame()); 191 191 } trunk/libffado/src/libstreaming/motu/MotuTransmitStreamProcessor.cpp
r1498 r1763 207 207 // we are too late 208 208 debugOutput(DEBUG_LEVEL_VERBOSE, 209 "Too late: CY=%04u, TC=%04u, CUT=%04d, TSP=%011 llu(%04u)\n",209 "Too late: CY=%04u, TC=%04u, CUT=%04d, TSP=%011"PRIu64" (%04u)\n", 210 210 cycle, 211 211 transmit_at_cycle, cycles_until_transmit, … … 242 242 { 243 243 debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, 244 "Too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011 llu (%04u), TSP=%011llu(%04u)\n",244 "Too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011"PRIu64" (%04u), TSP=%011"PRIu64" (%04u)\n", 245 245 cycle, 246 246 transmit_at_cycle, cycles_until_transmit, … … 251 251 { 252 252 debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, 253 "Way too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011 llu (%04u), TSP=%011llu(%04u)\n",253 "Way too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011"PRIu64" (%04u), TSP=%011"PRIu64" (%04u)\n", 254 254 cycle, 255 255 transmit_at_cycle, cycles_until_transmit, … … 330 330 uint32_t pkt_ctr ) 331 331 { 332 debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, "XMIT EMPTY: CY=%04 u, TSP=%011llu(%04u)\n",333 CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp,332 debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, "XMIT EMPTY: CY=%04d, TSP=%011"PRIu64" (%04u)\n", 333 (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), m_last_timestamp, 334 334 ( unsigned int ) TICKS_TO_CYCLES ( m_last_timestamp ) ); 335 335 … … 359 359 unsigned int cycle = CYCLE_TIMER_GET_CYCLES(pkt_ctr); 360 360 361 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "XMIT SILENT: CY=%04u, TSP=%011 llu(%04u)\n",361 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "XMIT SILENT: CY=%04u, TSP=%011"PRIu64" (%04u)\n", 362 362 cycle, m_last_timestamp, 363 363 ( unsigned int ) TICKS_TO_CYCLES ( m_last_timestamp ) ); trunk/libffado/src/libstreaming/StreamProcessorManager.cpp
r1531 r1763 53 53 , m_nb_buffers( 0 ) 54 54 , m_period( 0 ) 55 , m_sync_delay( 0 ) 55 56 , m_audio_datatype( eADT_Float ) 56 57 , m_nominal_framerate ( 0 ) … … 77 78 , m_nb_buffers(nb_buffers) 78 79 , m_period(period) 80 , m_sync_delay( 0 ) 79 81 , m_audio_datatype( eADT_Float ) 80 82 , m_nominal_framerate ( framerate ) … … 191 193 debugError("(%p) sem_[timed]wait error (result=%d errno=EINVAL)\n", 192 194 this, result); 193 debugError("(%p) timeout_nsec=%lld ts.sec=%d ts.nsec=%lld\n", 194 this, m_activity_wait_timeout_nsec, ts.tv_sec, ts.tv_nsec); 195 debugError("(%p) timeout_nsec=%"PRId64" ts.sec=%"PRId64" ts.nsec=%"PRId64"\n", 196 this, m_activity_wait_timeout_nsec, 197 (int64_t)ts.tv_sec, (int64_t)ts.tv_nsec); 195 198 return eAR_Error; 196 199 } else { 197 200 debugError("(%p) sem_[timed]wait error (result=%d errno=%d)\n", 198 201 this, result, errno); 199 debugError("(%p) timeout_nsec=%lld ts.sec=%d ts.nsec=%lld\n", 200 this, m_activity_wait_timeout_nsec, ts.tv_sec, ts.tv_nsec); 202 debugError("(%p) timeout_nsec=%"PRId64" ts.sec=%"PRId64" ts.nsec=%"PRId64"\n", 203 this, m_activity_wait_timeout_nsec, 204 (int64_t)ts.tv_sec, (int64_t)ts.tv_nsec); 201 205 return eAR_Error; 202 206 } … … 472 476 // get the options 473 477 int signal_delay_ticks = STREAMPROCESSORMANAGER_SIGNAL_DELAY_TICKS; 478 int xmit_prebuffer_frames = STREAMPROCESSORMANAGER_XMIT_PREBUFFER_FRAMES; 474 479 int sync_wait_time_msec = STREAMPROCESSORMANAGER_SYNC_WAIT_TIME_MSEC; 475 480 int cycles_for_startup = STREAMPROCESSORMANAGER_CYCLES_FOR_STARTUP; … … 478 483 Util::Configuration &config = m_parent.getConfiguration(); 479 484 config.getValueForSetting("streaming.spm.signal_delay_ticks", signal_delay_ticks); 485 config.getValueForSetting("streaming.spm.xmit_prebuffer_frames", xmit_prebuffer_frames); 480 486 config.getValueForSetting("streaming.spm.sync_wait_time_msec", sync_wait_time_msec); 481 487 config.getValueForSetting("streaming.spm.cycles_for_startup", cycles_for_startup); … … 514 520 // at which the buffer is transfer()'ed. This makes things somewhat 515 521 // more robust. 516 max_of_min_delay += signal_delay_ticks; 517 518 // Note that the equivalent number of frames is added to the 519 // transmit buffer to ensure that it keeps a good buffer fill, no matter 520 // what the sync delay is. 521 m_SyncSource->setSyncDelay(max_of_min_delay); 522 unsigned int syncdelay = m_SyncSource->getSyncDelay(); 523 debugOutput( DEBUG_LEVEL_VERBOSE, " sync delay = %d => %d ticks (%03us %04uc %04ut)...\n", 524 max_of_min_delay, syncdelay, 525 (unsigned int)TICKS_TO_SECS(syncdelay), 526 (unsigned int)TICKS_TO_CYCLES(syncdelay), 527 (unsigned int)TICKS_TO_OFFSET(syncdelay)); 522 m_sync_delay = max_of_min_delay + signal_delay_ticks; 528 523 529 524 //STEP X: when we implement such a function, we can wait for a signal from the devices that they … … 540 535 nb_sync_runs /= getPeriodSize(); 541 536 542 int64_t time_till_next_period;543 537 while(nb_sync_runs--) { // or while not sync-ed? 544 538 // check if we were woken up too soon 545 time_till_next_period = m_SyncSource->getTimeUntilNextPeriodSignalUsecs(); 546 debugOutput( DEBUG_LEVEL_VERBOSE, "waiting for %d usecs...\n", time_till_next_period); 547 if(time_till_next_period > 0) { 548 // wait for the period 549 SleepRelativeUsec(time_till_next_period); 550 } 539 uint64_t ticks_at_period = m_SyncSource->getTimeAtPeriod(); 540 uint64_t ticks_at_period_margin = ticks_at_period + m_sync_delay; 541 uint64_t pred_system_time_at_xfer = m_SyncSource->getParent().get1394Service().getSystemTimeForCycleTimerTicks(ticks_at_period_margin); 542 543 #ifdef DEBUG 544 int64_t now = Util::SystemTimeSource::getCurrentTime(); 545 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 ); 546 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "PREWAIT pred: %"PRId64", now: %"PRId64", wait: %"PRId64"\n", pred_system_time_at_xfer, now, pred_system_time_at_xfer-now ); 547 #endif 548 549 // wait until it's time to transfer 550 Util::SystemTimeSource::SleepUsecAbsolute(pred_system_time_at_xfer); 551 552 #ifdef DEBUG 553 now = Util::SystemTimeSource::getCurrentTime(); 554 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "POSTWAIT pred: %"PRId64", now: %"PRId64", excess: %"PRId64"\n", pred_system_time_at_xfer, now, now-pred_system_time_at_xfer ); 555 #endif 551 556 } 552 557 … … 564 569 debugOutput( DEBUG_LEVEL_VERBOSE, " sync source frame rate: %f fps (%f tpf)\n", syncrate, tpf); 565 570 566 m_SyncSource->setSyncDelay(max_of_min_delay);567 syncdelay = m_SyncSource->getSyncDelay();568 debugOutput( DEBUG_LEVEL_VERBOSE, " updated sync delay = %d => %d ticks (%f frames) (%03us %04uc %04ut)...\n",569 max_of_min_delay, syncdelay, syncdelay/tpf,570 (unsigned int)TICKS_TO_SECS(syncdelay),571 (unsigned int)TICKS_TO_CYCLES(syncdelay),572 (unsigned int)TICKS_TO_OFFSET(syncdelay));573 574 571 // we now should have decent sync info on the sync source 575 572 // determine a point in time where the system should start 576 573 // figure out where we are now 577 574 uint64_t time_of_first_sample = m_SyncSource->getTimeAtPeriod(); 578 debugOutput( DEBUG_LEVEL_VERBOSE, " sync at TS=%011 llu(%03us %04uc %04ut)...\n",575 debugOutput( DEBUG_LEVEL_VERBOSE, " sync at TS=%011"PRIu64" (%03us %04uc %04ut)...\n", 579 576 time_of_first_sample, 580 577 (unsigned int)TICKS_TO_SECS(time_of_first_sample), … … 593 590 time_of_first_sample = addTicks(time_of_first_sample, 594 591 time_for_startup_ticks); 595 debugOutput( DEBUG_LEVEL_VERBOSE, " add %d frames (%011 lluticks)...\n",592 debugOutput( DEBUG_LEVEL_VERBOSE, " add %d frames (%011"PRIu64" ticks)...\n", 596 593 time_for_startup_frames, time_for_startup_ticks); 597 594 598 debugOutput( DEBUG_LEVEL_VERBOSE, " => first sample at TS=%011 llu(%03us %04uc %04ut)...\n",595 debugOutput( DEBUG_LEVEL_VERBOSE, " => first sample at TS=%011"PRIu64" (%03us %04uc %04ut)...\n", 599 596 time_of_first_sample, 600 597 (unsigned int)TICKS_TO_SECS(time_of_first_sample), … … 609 606 uint64_t time_to_start_recv = substractTicks(time_of_first_sample, 610 607 prestart_cycles_for_recv * TICKS_PER_CYCLE); 611 debugOutput( DEBUG_LEVEL_VERBOSE, " => xmit starts at TS=%011 llu(%03us %04uc %04ut)...\n",608 debugOutput( DEBUG_LEVEL_VERBOSE, " => xmit starts at TS=%011"PRIu64" (%03us %04uc %04ut)...\n", 612 609 time_to_start_xmit, 613 610 (unsigned int)TICKS_TO_SECS(time_to_start_xmit), 614 611 (unsigned int)TICKS_TO_CYCLES(time_to_start_xmit), 615 612 (unsigned int)TICKS_TO_OFFSET(time_to_start_xmit)); 616 debugOutput( DEBUG_LEVEL_VERBOSE, " => recv starts at TS=%011 llu(%03us %04uc %04ut)...\n",613 debugOutput( DEBUG_LEVEL_VERBOSE, " => recv starts at TS=%011"PRIu64" (%03us %04uc %04ut)...\n", 617 614 time_to_start_recv, 618 615 (unsigned int)TICKS_TO_SECS(time_to_start_recv), 619 616 (unsigned int)TICKS_TO_CYCLES(time_to_start_recv), 620 617 (unsigned int)TICKS_TO_OFFSET(time_to_start_recv)); 618 619 // print the sync delay 620 int sync_delay_frames = (int)((float)m_sync_delay / m_SyncSource->getTicksPerFrame()); 621 debugOutput( DEBUG_LEVEL_VERBOSE, " sync delay: %d = %d + %d ticks (%03us %04uc %04ut) [%d frames]...\n", 622 m_sync_delay, max_of_min_delay, signal_delay_ticks, 623 (unsigned int)TICKS_TO_SECS(m_sync_delay), 624 (unsigned int)TICKS_TO_CYCLES(m_sync_delay), 625 (unsigned int)TICKS_TO_OFFSET(m_sync_delay), 626 sync_delay_frames); 627 628 // the amount of prebuffer frames should be a multiple of the common block size 629 // as otherwise the position of MIDI is messed up 630 if(xmit_prebuffer_frames % max_packet_size_frames) { 631 int tmp = 0; 632 while(tmp < xmit_prebuffer_frames) { 633 tmp += max_packet_size_frames; 634 } 635 debugOutput(DEBUG_LEVEL_VERBOSE, 636 "The number of prebuffer frames (%d) is not a multiple of the common block size (%d), increased to %d...\n", 637 xmit_prebuffer_frames, max_packet_size_frames, tmp); 638 xmit_prebuffer_frames = tmp; 639 } 640 641 // check if this can even work. 642 // the worst case point where we can receive a period is at 1 period + sync delay 643 // this means that the number of frames in the xmit buffer has to be at least 644 // 1 period + sync delay 645 if(xmit_prebuffer_frames + m_period * m_nb_buffers < m_period + sync_delay_frames) { 646 debugWarning("The amount of transmit buffer frames (%d) is too small (< %d). " 647 "This will most likely cause xruns.\n", 648 xmit_prebuffer_frames + m_period * m_nb_buffers, 649 m_period + sync_delay_frames); 650 } 621 651 622 652 // at this point the buffer head timestamp of the transmit buffers can be set … … 625 655 it != m_TransmitProcessors.end(); 626 656 ++it ) { 657 // set the number of prebuffer frames 658 (*it)->setExtraBufferFrames(xmit_prebuffer_frames); 659 660 // set the TSP of the first sample in the buffer 627 661 (*it)->setBufferHeadTimestamp(time_of_first_sample); 628 662 ffado_timestamp_t ts; 629 663 signed int fc; 630 664 (*it)->getBufferHeadTimestamp ( &ts, &fc ); 631 debugOutput( DEBUG_LEVEL_VERBOSE, " transmit buffer tail %010 lld => head TS %010lld, fc=%d...\n",665 debugOutput( DEBUG_LEVEL_VERBOSE, " transmit buffer tail %010"PRId64" => head TS %010"PRIu64", fc=%d...\n", 632 666 time_of_first_sample, (uint64_t)ts, fc); 667 } 668 669 // the receive processors can be delayed by sync_delay ticks 670 // this means that in the worst case we have to be able to accomodate 671 // an extra sync_delay ticks worth of frames in the receive SP buffer 672 // the sync delay should be rounded to an integer amount of max_packet_size 673 int tmp = sync_delay_frames / max_packet_size_frames; 674 tmp = tmp + 1; 675 sync_delay_frames = tmp * max_packet_size_frames; 676 if (sync_delay_frames < 1024) sync_delay_frames = 1024; //HACK 677 678 for ( StreamProcessorVectorIterator it = m_ReceiveProcessors.begin(); 679 it != m_ReceiveProcessors.end(); 680 ++it ) { 681 // set the number of extra buffer frames 682 (*it)->setExtraBufferFrames(sync_delay_frames); 633 683 } 634 684 … … 643 693 } 644 694 if(!m_SyncSource->scheduleStartRunning(time_to_start_sync)) { 645 debugError("m_SyncSource->scheduleStartRunning(%11 llu) failed\n", time_to_start_sync);695 debugError("m_SyncSource->scheduleStartRunning(%11"PRIu64") failed\n", time_to_start_sync); 646 696 return false; 647 697 } … … 653 703 if(*it != m_SyncSource) { 654 704 if(!(*it)->scheduleStartRunning(time_to_start_recv)) { 655 debugError("%p->scheduleStartRunning(%11 llu) failed\n", *it, time_to_start_recv);705 debugError("%p->scheduleStartRunning(%11"PRIu64") failed\n", *it, time_to_start_recv); 656 706 return false; 657 707 } … … 663 713 if(*it != m_SyncSource) { 664 714 if(!(*it)->scheduleStartRunning(time_to_start_xmit)) { 665 debugError("%p->scheduleStartRunning(%11 llu) failed\n", *it, time_to_start_xmit);715 debugError("%p->scheduleStartRunning(%11"PRIu64") failed\n", *it, time_to_start_xmit); 666 716 return false; 667 717 } … … 696 746 #endif 697 747 698 debugOutput( DEBUG_LEVEL_VERBOSE, " initial time of transfer %010 lld, rate %f...\n",748 debugOutput( DEBUG_LEVEL_VERBOSE, " initial time of transfer %010"PRId64", rate %f...\n", 699 749 m_time_of_transfer, rate); 700 750 701 int64_t delay_in_ticks = (int64_t)(((float)((m_nb_buffers-1) * m_period)) * rate); 702 // also add the sync delay 703 delay_in_ticks = addTicks(delay_in_ticks, m_SyncSource->getSyncDelay()); 704 751 // FIXME: ideally we'd want the SP itself to account for the xmit_prebuffer_frames 752 // but that would also require to use a different approach to setting the initial TSP's 753 int64_t delay_in_ticks = (int64_t)(((float)((m_nb_buffers-1) * m_period + xmit_prebuffer_frames)) * rate); 705 754 706 755 // then use this information to initialize the xmit handlers … … 709 758 // to the period transfer time instant plus what's nb_buffers - 1 710 759 // in ticks. This due to the fact that we (should) have received one period 711 // worth of ticks at t =m_time_of_transfer760 // worth of ticks at t = m_time_of_transfer 712 761 // hence one period of frames should also have been transmitted, which means 713 762 // that there should be (nb_buffers - 1) * periodsize of frames in the xmit buffer 763 // there are also xmit_prebuffer_frames frames extra present in the buffer 714 764 // that allows us to calculate the tail timestamp for the buffer. 715 765 716 766 int64_t transmit_tail_timestamp = addTicks(m_time_of_transfer, delay_in_ticks); 717 debugOutput( DEBUG_LEVEL_VERBOSE, " preset transmit tail TS %010 lld, rate %f...\n",767 debugOutput( DEBUG_LEVEL_VERBOSE, " preset transmit tail TS %010"PRId64", rate %f...\n", 718 768 transmit_tail_timestamp, rate); 719 769 … … 726 776 signed int fc; 727 777 (*it)->getBufferHeadTimestamp ( &ts, &fc ); 728 debugOutput( DEBUG_LEVEL_VERBOSE, " => transmit head TS %010 lld, fc=%d...\n",778 debugOutput( DEBUG_LEVEL_VERBOSE, " => transmit head TS %010"PRId64", fc=%d...\n", 729 779 (uint64_t)ts, fc); 730 780 } … … 783 833 StreamProcessor *s = m_ReceiveProcessors.at(i); 784 834 diff = diffTicks(m_SyncSource->getTimeAtPeriod(), s->getTimeAtPeriod()); 785 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, " offset between SyncSP %p and SP %p is % lldticks...\n",835 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, " offset between SyncSP %p and SP %p is %"PRId64" ticks...\n", 786 836 m_SyncSource, s, diff); 787 837 if ( nb_sync_runs == periods_per_align_try ) { … … 805 855 diff_between_streams[i] /= periods_per_align_try; 806 856 diff_between_streams_frames[i] = (int)roundf(diff_between_streams[i] / s->getTicksPerFrame()); 807 debugOutput( DEBUG_LEVEL_VERBOSE, " avg offset between SyncSP %p and SP %p is % lldticks, %d frames...\n",857 debugOutput( DEBUG_LEVEL_VERBOSE, " avg offset between SyncSP %p and SP %p is %"PRId64" ticks, %d frames...\n", 808 858 m_SyncSource, s, diff_between_streams[i], diff_between_streams_frames[i]); 809 859 … … 1078 1128 m_SyncSource->getBufferFill()); 1079 1129 uint64_t ticks_at_period = m_SyncSource->getTimeAtPeriod(); 1080 uint64_t ticks_at_period_margin = ticks_at_period + m_ SyncSource->getSyncDelay();1130 uint64_t ticks_at_period_margin = ticks_at_period + m_sync_delay; 1081 1131 uint64_t pred_system_time_at_xfer = m_SyncSource->getParent().get1394Service().getSystemTimeForCycleTimerTicks(ticks_at_period_margin); 1082 1132 1083 1133 #ifdef DEBUG 1084 1134 int64_t now = Util::SystemTimeSource::getCurrentTime(); 1085 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "pred: %lld, now: %lld, wait: %lld\n", pred_system_time_at_xfer, now, pred_system_time_at_xfer-now ); 1135 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 ); 1136 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "PREWAIT pred: %"PRId64", now: %"PRId64", wait: %"PRId64"\n", pred_system_time_at_xfer, now, pred_system_time_at_xfer-now ); 1086 1137 #endif 1087 1138 … … 1091 1142 #ifdef DEBUG 1092 1143 now = Util::SystemTimeSource::getCurrentTime(); 1093 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, " pred: %lld now: %lld, excess: %lld\n", pred_system_time_at_xfer, now, now-pred_system_time_at_xfer );1144 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "POSTWAIT pred: %"PRId64", now: %"PRId64", excess: %"PRId64"\n", pred_system_time_at_xfer, now, now-pred_system_time_at_xfer ); 1094 1145 #endif 1095 1146 1096 1147 // the period should be ready now 1148 #ifdef DEBUG 1149 int rcv_fills[10]; 1150 int xmt_fills[10]; 1151 int i; 1152 i=0; 1153 for ( StreamProcessorVectorIterator it = m_ReceiveProcessors.begin(); 1154 it != m_ReceiveProcessors.end(); 1155 ++it ) { 1156 rcv_fills[i] = (*it)->getBufferFill(); 1157 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "RECV SP %p bufferfill: %05d\n", *it, rcv_fills[i]); 1158 i++; 1159 } 1160 i=0; 1161 for ( StreamProcessorVectorIterator it = m_TransmitProcessors.begin(); 1162 it != m_TransmitProcessors.end(); 1163 ++it ) { 1164 xmt_fills[i] = (*it)->getBufferFill(); 1165 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "XMIT SP %p bufferfill: %05d\n", *it, xmt_fills[i]); 1166 i++; 1167 } 1168 for(i=0;i<1;i++) { 1169 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "SP %02d RECV: %05d [%05d] XMIT: %05d [%05d] DIFF: %05d\n", i, 1170 rcv_fills[i], rcv_fills[i] - m_period, 1171 xmt_fills[i], xmt_fills[i] - m_period, 1172 rcv_fills[i] - xmt_fills[i]); 1173 } 1174 #endif 1097 1175 1098 1176 #if STREAMPROCESSORMANAGER_ALLOW_DELAYED_PERIOD_SIGNAL … … 1194 1272 // so 50 ticks = 10%, which is a rather large jitter value. 1195 1273 if(diff-ticks_per_period > 50 || diff-ticks_per_period < -50) { 1196 debugOutput(DEBUG_LEVEL_VERBOSE, "rather large TSP difference TS=%011 llu => TS=%011llu(%d, nom %d)\n",1274 debugOutput(DEBUG_LEVEL_VERBOSE, "rather large TSP difference TS=%011"PRIu64" => TS=%011"PRIu64" (%d, nom %d)\n", 1197 1275 m_time_of_transfer2, m_time_of_transfer, diff, ticks_per_period); 1198 1276 } … … 1201 1279 1202 1280 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 1203 "transfer period %d at % lluticks...\n",1281 "transfer period %d at %"PRIu64" ticks...\n", 1204 1282 m_nbperiods, m_time_of_transfer); 1205 1283 1206 // this is to notify the client of the delay that we introduced by waiting 1207 m_delayed_usecs = - m_SyncSource->getTimeUntilNextPeriodSignalUsecs(); 1208 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 1209 "delayed for %d usecs...\n", 1210 m_delayed_usecs); 1211 1212 #ifdef DEBUG 1284 #ifdef DEBUG 1213 1285 int rcv_bf=0, xmt_bf=0; 1214 1286 for ( StreamProcessorVectorIterator it = m_ReceiveProcessors.begin(); … … 1223 1295 } 1224 1296 debugOutputExtreme( DEBUG_LEVEL_VERY_VERBOSE, 1225 "XF at %011 lluticks, RBF=%d, XBF=%d, SUM=%d...\n",1297 "XF at %011"PRIu64" ticks, RBF=%d, XBF=%d, SUM=%d...\n", 1226 1298 m_time_of_transfer, rcv_bf, xmt_bf, rcv_bf+xmt_bf); 1227 1299 … … 1255 1327 } 1256 1328 } 1257 #endif1329 #endif 1258 1330 m_nbperiods++; 1331 1332 // this is to notify the client of the delay that we introduced by waiting 1333 pred_system_time_at_xfer = m_SyncSource->getParent().get1394Service().getSystemTimeForCycleTimerTicks(m_time_of_transfer); 1334 1335 m_delayed_usecs = Util::SystemTimeSource::getCurrentTime() - pred_system_time_at_xfer; 1336 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 1337 "delayed for %d usecs...\n", 1338 m_delayed_usecs); 1339 1259 1340 // now we can signal the client that we are (should be) ready 1260 1341 return !xrun_occurred; … … 1287 1368 if(m_SyncSource == NULL) return false; 1288 1369 debugOutputExtreme( DEBUG_LEVEL_VERY_VERBOSE, 1289 "transfer(%d) at TS=%011 llu(%03us %04uc %04ut)...\n",1370 "transfer(%d) at TS=%011"PRIu64" (%03us %04uc %04ut)...\n", 1290 1371 t, m_time_of_transfer, 1291 1372 (unsigned int)TICKS_TO_SECS(m_time_of_transfer), … … 1301 1382 ++it ) { 1302 1383 if(!(*it)->getFrames(m_period, m_time_of_transfer)) { 1303 debugWarning("could not getFrames(%u, %11 llu) from stream processor (%p)\n",1384 debugWarning("could not getFrames(%u, %11"PRIu64") from stream processor (%p)\n", 1304 1385 m_period, m_time_of_transfer,*it); 1305 1386 retval &= false; // buffer underrun … … 1310 1391 // 1394 time 1311 1392 float rate = m_SyncSource->getTicksPerFrame(); 1312 int64_t one_ringbuffer_in_ticks=(int64_t)(((float)((m_nb_buffers * m_period))) * rate);1313 1314 // the data we are putting into the buffer is intended to be transmitted1315 // one ringbuffer size after it has been received1316 1317 // we also add one syncdelay as a safety margin, since that's the amount of time we can get1318 // postponed.1319 int syncdelay = m_SyncSource->getSyncDelay();1320 int64_t transmit_timestamp = addTicks(m_time_of_transfer, one_ringbuffer_in_ticks + syncdelay);1321 1393 1322 1394 for ( StreamProcessorVectorIterator it = m_TransmitProcessors.begin(); 1323 1395 it != m_TransmitProcessors.end(); 1324 1396 ++it ) { 1325 // FIXME: in the SPM it would be nice to have system time instead of 1326 // 1394 time 1397 // this is the delay in frames between the point where a frame is received and 1398 // when it is transmitted again 1399 unsigned int one_ringbuffer_in_frames = m_nb_buffers * m_period + (*it)->getExtraBufferFrames(); 1400 int64_t one_ringbuffer_in_ticks = (int64_t)(((float)one_ringbuffer_in_frames) * rate); 1401 1402 // the data we are putting into the buffer is intended to be transmitted 1403 // one ringbuffer size after it has been received 1404 int64_t transmit_timestamp = addTicks(m_time_of_transfer, one_ringbuffer_in_ticks); 1405 1327 1406 if(!(*it)->putFrames(m_period, transmit_timestamp)) { 1328 debugWarning("could not putFrames(%u,% llu) to stream processor (%p)\n",1407 debugWarning("could not putFrames(%u,%"PRIu64") to stream processor (%p)\n", 1329 1408 m_period, transmit_timestamp, *it); 1330 1409 retval &= false; // buffer underrun … … 1367 1446 if(m_SyncSource == NULL) return false; 1368 1447 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, 1369 "transferSilence(%d) at TS=%011 llu(%03us %04uc %04ut)...\n",1448 "transferSilence(%d) at TS=%011"PRIu64" (%03us %04uc %04ut)...\n", 1370 1449 t, m_time_of_transfer, 1371 1450 (unsigned int)TICKS_TO_SECS(m_time_of_transfer), … … 1381 1460 ++it ) { 1382 1461 if(!(*it)->dropFrames(m_period, m_time_of_transfer)) { 1383 debugWarning("could not dropFrames(%u, %11 llu) from stream processor (%p)\n",1462 debugWarning("could not dropFrames(%u, %11"PRIu64") from stream processor (%p)\n", 1384 1463 m_period, m_time_of_transfer,*it); 1385 1464 retval &= false; // buffer underrun … … 1390 1469 // 1394 time 1391 1470 float rate = m_SyncSource->getTicksPerFrame(); 1392 int64_t one_ringbuffer_in_ticks=(int64_t)(((float)(m_nb_buffers * m_period)) * rate);1393 1394 // the data we are putting into the buffer is intended to be transmitted1395 // one ringbuffer size after it has been received1396 // we also add one syncdelay as a safety margin, since that's the amount of time we can get1397 // postponed.1398 int syncdelay = m_SyncSource->getSyncDelay();1399 int64_t transmit_timestamp = addTicks(m_time_of_transfer, one_ringbuffer_in_ticks + syncdelay);1400 1471 1401 1472 for ( StreamProcessorVectorIterator it = m_TransmitProcessors.begin(); 1402 1473 it != m_TransmitProcessors.end(); 1403 1474 ++it ) { 1404 // FIXME: in the SPM it would be nice to have system time instead of 1405 // 1394 time 1475 // this is the delay in frames between the point where a frame is received and 1476 // when it is transmitted again 1477 unsigned int one_ringbuffer_in_frames = m_nb_buffers * m_period + (*it)->getExtraBufferFrames(); 1478 int64_t one_ringbuffer_in_ticks = (int64_t)(((float)one_ringbuffer_in_frames) * rate); 1479 1480 // the data we are putting into the buffer is intended to be transmitted 1481 // one ringbuffer size after it has been received 1482 int64_t transmit_timestamp = addTicks(m_time_of_transfer, one_ringbuffer_in_ticks); 1483 1406 1484 if(!(*it)->putSilenceFrames(m_period, transmit_timestamp)) { 1407 debugWarning("could not putSilenceFrames(%u,% llu) to stream processor (%p)\n",1485 debugWarning("could not putSilenceFrames(%u,%"PRIu64") to stream processor (%p)\n", 1408 1486 m_period, transmit_timestamp, *it); 1409 1487 retval &= false; // buffer underrun … … 1578 1656 #ifdef DEBUG 1579 1657 if(idx >= (int)m_CapturePorts_shadow.size()) { 1580 debugError("Capture port %d out of range (% d)\n", idx, m_CapturePorts_shadow.size());1658 debugError("Capture port %d out of range (%zd)\n", idx, m_CapturePorts_shadow.size()); 1581 1659 return NULL; 1582 1660 } … … 1586 1664 #ifdef DEBUG 1587 1665 if(idx >= (int)m_PlaybackPorts_shadow.size()) { 1588 debugError("Playback port %d out of range (% d)\n", idx, m_PlaybackPorts_shadow.size());1666 debugError("Playback port %d out of range (%zd)\n", idx, m_PlaybackPorts_shadow.size()); 1589 1667 return NULL; 1590 1668 } trunk/libffado/src/libstreaming/StreamProcessorManager.h
r1531 r1763 190 190 unsigned int m_nb_buffers; 191 191 unsigned int m_period; 192 unsigned int m_sync_delay; 192 193 enum eADT_AudioDataType m_audio_datatype; 193 194 unsigned int m_nominal_framerate; trunk/libffado/src/libutil/Configuration.cpp
r1568 r1763 182 182 int32_t i = s; 183 183 debugOutput(DEBUG_LEVEL_NORMAL, 184 " %s%s = % ld (0x%08lX)\n",184 " %s%s = %d (0x%08X)\n", 185 185 prefix.c_str(), s.getName(), i, i); 186 186 } … … 190 190 int64_t i = s; 191 191 debugOutput(DEBUG_LEVEL_NORMAL, 192 " %s%s = % lld (0x%016llX)\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 % d\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 { trunk/libffado/src/libutil/PosixThread.cpp
r1550 r1763 149 149 if (res) { 150 150 debugError("Cannot create realtime thread (%d: %s)\n", res, strerror(res)); 151 debugError(" priority: %d %s\n", fPriority);151 debugError(" priority: %d\n", fPriority); 152 152 return -1; 153 153 } … … 172 172 { 173 173 if (fThread) { // If thread has been started 174 debugOutput( DEBUG_LEVEL_VERBOSE, "(%s) Kill %p (thread: %p)\n", m_id.c_str(), this, fThread);174 debugOutput( DEBUG_LEVEL_VERBOSE, "(%s) Kill %p (thread: %p)\n", m_id.c_str(), this, (void *)fThread); 175 175 void* status; 176 176 pthread_cancel(fThread); … … 178 178 pthread_join(fThread, &status); 179 179 m_lock.Unlock(); 180 debugOutput( DEBUG_LEVEL_VERBOSE, "(%s) Killed %p (thread: %p)\n", m_id.c_str(), this, fThread);180 debugOutput( DEBUG_LEVEL_VERBOSE, "(%s) Killed %p (thread: %p)\n", m_id.c_str(), this, (void *)fThread); 181 181 return 0; 182 182 } else { … … 188 188 { 189 189 if (fThread) { // If thread has been started 190 debugOutput( DEBUG_LEVEL_VERBOSE, "(%s) Stop %p (thread: %p)\n", m_id.c_str(), this, fThread);190 debugOutput( DEBUG_LEVEL_VERBOSE, "(%s) Stop %p (thread: %p)\n", m_id.c_str(), this, (void *)fThread); 191 191 void* status; 192 192 fRunning = false; // Request for the thread to stop … … 195 195 fThread = NULL; 196 196 m_lock.Unlock(); 197 debugOutput( DEBUG_LEVEL_VERBOSE, "(%s) Stopped %p (thread: %p)\n", m_id.c_str(), this, fThread);197 debugOutput( DEBUG_LEVEL_VERBOSE, "(%s) Stopped %p (thread: %p)\n", m_id.c_str(), this, (void *)fThread); 198 198 return 0; 199 199 } else { trunk/libffado/src/libutil/serialize_expat.cpp
r1254 r1763 117 117 Xml::Node& n = pNode->add( Xml::Node(tokens[tokens.size() - 1].c_str(), NULL) ); 118 118 char* valstr; 119 asprintf( &valstr, "% lld", value );119 asprintf( &valstr, "%"PRId64"", value ); 120 120 n.set_child_text( valstr ); 121 121 free( valstr ); trunk/libffado/src/libutil/serialize_libxml.cpp
r1568 r1763 89 89 90 90 { 91 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "write %s = % d\n",91 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "write %s = %lld\n", 92 92 strMemberName.c_str(), value ); 93 93 … … 266 266 value = strtoll( pElement->get_child_text()->get_content().c_str(), 267 267 &tail, 0 ); 268 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "found %s = % d\n",268 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "found %s = %lld\n", 269 269 strMemberName.c_str(), value ); 270 270 return true; trunk/libffado/src/libutil/StreamStatistics.cpp
r864 r1763 55 55 void StreamStatistics::dumpInfo() { 56 56 debugOutputShort( DEBUG_LEVEL_VERBOSE, 57 "--- Stats for %s: min=% ld avg=%f max=%ld cnt=%ld sum=%ld\n",57 "--- Stats for %s: min=%"PRId64" 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"); trunk/libffado/src/libutil/SystemTimeSource.cpp
r1165 r1763 55 55 ts.tv_nsec = (wake_at_usec % (1000000LL)) * 1000LL; 56 56 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 57 "clock_nanosleep until %lld 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) { trunk/libffado/src/libutil/Time.h
r864 r1763 25 25 #define __Time__ 26 26 27 #ifndef __STDC_FORMAT_MACROS 28 #define __STDC_FORMAT_MACROS 29 #endif 27 30 #include <inttypes.h> 28 31 … … 34 37 */ 35 38 typedef uint64_t ffado_microsecs_t; 39 #define PRI_FFADO_MICROSECS_T PRIu64 36 40 37 41 static inline void SleepRelativeUsec(ffado_microsecs_t usec) { trunk/libffado/src/libutil/TimestampedBuffer.cpp
r1531 r1763 383 383 m_current_rate = m_nominal_rate; 384 384 385 if( !(m_event_buffer=ffado_ringbuffer_create( 386 (m_events_per_frame * m_buffer_size) * m_event_size))) { 387 debugFatal("Could not allocate memory event ringbuffer\n"); 385 if( !resizeBuffer(m_buffer_size) ) { 386 debugError("Failed to allocate the event buffer\n"); 388 387 return false; 389 388 } … … 408 407 m_buffer_tail_timestamp = TIMESTAMP_MAX + 1.0; 409 408 m_buffer_next_tail_timestamp = TIMESTAMP_MAX + 1.0; 409 410 return true; 411 } 412 413 /** 414 * Resizes the timestamped buffer 415 * @return true if successful, false if not 416 */ 417 bool 418 TimestampedBuffer::resizeBuffer(unsigned int new_size) 419 { 420 assert(new_size); 421 assert(m_events_per_frame); 422 assert(m_event_size); 423 424 // if present, free the previous buffer 425 if(m_event_buffer) { 426 ffado_ringbuffer_free(m_event_buffer); 427 } 428 // allocate a new one 429 if( !(m_event_buffer = ffado_ringbuffer_create( 430 (m_events_per_frame * new_size) * m_event_size))) { 431 debugFatal("Could not allocate memory event ringbuffer\n"); 432 433 return false; 434 } 435 resetFrameCounter(); 436 437 m_current_rate = m_nominal_rate; 438 m_dll_e2 = m_current_rate * (float)m_update_period; 439 440 m_buffer_size = new_size; 410 441 411 442 return true; … … 474 505 if (written < write_size) 475 506 { 476 debugWarning("ringbuffer full, %u, % u\n", write_size, written);507 debugWarning("ringbuffer full, %u, %zd\n", write_size, written); 477 508 return false; 478 509 } … … 503 534 if (written < write_size) 504 535 { 505 debugWarning("ringbuffer full, request: %u, actual: % u\n", write_size, written);536 debugWarning("ringbuffer full, request: %u, actual: %zd\n", write_size, written); 506 537 return false; 507 538 } … … 614 645 615 646 if(vec[0].len + vec[1].len < m_process_block_size) { // this indicates a full event buffer 616 debugError("Event buffer overrun in buffer %p, fill: % u, bytes2write: %u \n",647 debugError("Event buffer overrun in buffer %p, fill: %zd, bytes2write: %u \n", 617 648 this, ffado_ringbuffer_read_space(m_event_buffer), bytes2write); 618 649 debugShowBackLog(); trunk/libffado/src/libutil/TimestampedBuffer.h
r1531 r1763 152 152 void dumpInfo(); 153 153 void setVerboseLevel ( int l ) {setDebugLevel ( l );}; 154 155 bool resizeBuffer(unsigned int size); 154 156 155 157 private: trunk/libffado/src/motu/motu_avdevice.cpp
r1605 r1763 26 26 27 27 #include "motu/motu_avdevice.h" 28 #include "motu/motu_mixerdefs.h" 29 #include "motu/motu_mark3_mixerdefs.h" 28 30 29 31 #include "devicemanager.h" … … 67 69 {FW_VENDORID_MOTU, 0, 0x00000005, 0x000001f2, MOTU_MODEL_896HD, "MOTU", "896HD"}, 68 70 {FW_VENDORID_MOTU, 0, 0x00000015, 0x000001f2, MOTU_MODEL_828mk3, "MOTU", "828Mk3"}, 71 {FW_VENDORID_MOTU, 0, 0x00000019, 0x000001f2, MOTU_MODEL_ULTRALITEmk3, "MOTU", "UltraLineMk3"}, 69 72 }; 70 73 … … 202 205 const PortEntry Ports_ULTRALITE[] = 203 206 { 204 {"Main-L", MOTU_PA_ INOUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 40},205 {"Main-R", MOTU_PA_ INOUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 43},207 {"Main-L", MOTU_PA_OUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 40}, 208 {"Main-R", MOTU_PA_OUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 43}, 206 209 {"Mix-L", MOTU_PA_IN | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 10}, 207 210 {"Mix-R", MOTU_PA_IN | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 13}, … … 218 221 {"Phones-L", MOTU_PA_OUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 10}, 219 222 {"Phones-R", MOTU_PA_OUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 13}, 223 {"SPDIF1", MOTU_PA_IN | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 40}, 224 {"SPDIF2", MOTU_PA_IN | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 43}, 220 225 {"Padding1", MOTU_PA_IN | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY|MOTU_PA_PADDING, 46}, 221 226 {"Padding2", MOTU_PA_IN | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY|MOTU_PA_PADDING, 49}, … … 306 311 }; 307 312 308 // Mixer registers 309 const MatrixMixBus MixerBuses_Traveler[] = { 310 {"Mix 1", 0x4000, }, 311 {"Mix 2", 0x4100, }, 312 {"Mix 3", 0x4200, }, 313 {"Mix 4", 0x4300, }, 313 const PortEntry Ports_ULTRALITEmk3[] = 314 { 315 {"Main-L", MOTU_PA_OUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 40}, 316 {"Main-R", MOTU_PA_OUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 43}, 317 {"Mix-L", MOTU_PA_IN | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 10}, 318 {"Mix-R", MOTU_PA_IN | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 13}, 319 {"Mic1", MOTU_PA_IN | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 16}, 320 {"Mic2", MOTU_PA_IN | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 19}, 321 {"Analog1", MOTU_PA_OUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 16}, 322 {"Analog2", MOTU_PA_OUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 19}, 323 {"Analog3", MOTU_PA_INOUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 22}, 324 {"Analog4", MOTU_PA_INOUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 25}, 325 {"Analog5", MOTU_PA_INOUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 28}, 326 {"Analog6", MOTU_PA_INOUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 31}, 327 {"Analog7", MOTU_PA_INOUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 34}, 328 {"Analog8", MOTU_PA_INOUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 37}, 329 {"Phones-L", MOTU_PA_OUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 10}, 330 {"Phones-R", MOTU_PA_OUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 13}, 331 {"SPDIF1", MOTU_PA_IN | MOTU_PA_RATE_1x2x|MOTU_PA_OPTICAL_ANY, 40}, 332 {"SPDIF2", MOTU_PA_IN | MOTU_PA_RATE_1x2x|MOTU_PA_OPTICAL_ANY, 43}, 333 {"Padding1", MOTU_PA_IN | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY|MOTU_PA_PADDING, 46}, 334 {"Padding2", MOTU_PA_IN | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY|MOTU_PA_PADDING, 49}, 335 {"SPDIF1", MOTU_PA_OUT | MOTU_PA_RATE_1x2x|MOTU_PA_OPTICAL_ANY, 46}, 336 {"SPDIF2", MOTU_PA_OUT | MOTU_PA_RATE_1x2x|MOTU_PA_OPTICAL_ANY, 49}, 314 337 }; 315 316 const MatrixMixChannel MixerChannels_Traveler[] = {317 {"Analog 1", MOTU_CTRL_STD_CHANNEL, 0x0000, },318 {"Analog 2", MOTU_CTRL_STD_CHANNEL, 0x0004, },319 {"Analog 3", MOTU_CTRL_STD_CHANNEL, 0x0008, },320 {"Analog 4", MOTU_CTRL_STD_CHANNEL, 0x000c, },321 {"Analog 5", MOTU_CTRL_STD_CHANNEL, 0x0010, },322 {"Analog 6", MOTU_CTRL_STD_CHANNEL, 0x0014, },323 {"Analog 7", MOTU_CTRL_STD_CHANNEL, 0x0018, },324 {"Analog 8", MOTU_CTRL_STD_CHANNEL, 0x001c, },325 {"AES/EBU 1", MOTU_CTRL_STD_CHANNEL, 0x0020, },326 {"AES/EBU 2", MOTU_CTRL_STD_CHANNEL, 0x0024, },327 {"SPDIF 1", MOTU_CTRL_STD_CHANNEL, 0x0028, },328 {"SPDIF 2", MOTU_CTRL_STD_CHANNEL, 0x002c, },329 {"ADAT 1", MOTU_CTRL_STD_CHANNEL, 0x0030, },330 {"ADAT 2", MOTU_CTRL_STD_CHANNEL, 0x0034, },331 {"ADAT 3", MOTU_CTRL_STD_CHANNEL, 0x0038, },332 {"ADAT 4", MOTU_CTRL_STD_CHANNEL, 0x003c, },333 {"ADAT 5", MOTU_CTRL_STD_CHANNEL, 0x0040, },334 {"ADAT 6", MOTU_CTRL_STD_CHANNEL, 0x0044, },335 {"ADAT 7", MOTU_CTRL_STD_CHANNEL, 0x0048, },336 {"ADAT 8", MOTU_CTRL_STD_CHANNEL, 0x004c, },337 };338 339 const MixerCtrl MixerCtrls_Traveler[] = {340 {"Mix1/Mix_", "Mix 1 ", "", MOTU_CTRL_STD_MIX, 0x0c20, },341 {"Mix2/Mix_", "Mix 2 ", "", MOTU_CTRL_STD_MIX, 0x0c24, },342 {"Mix3/Mix_", "Mix 3 ", "", MOTU_CTRL_STD_MIX, 0x0c28, },343 {"Mix4/Mix_", "Mix 4 ", "", MOTU_CTRL_STD_MIX, 0x0c2c, },344 {"Mainout_", "MainOut ", "", MOTU_CTRL_MIX_FADER, 0x0c0c, },345 {"Phones_", "Phones ", "", MOTU_CTRL_MIX_FADER, 0x0c10, },346 347 /* For mic/line input controls, the "register" is the zero-based channel number */348 {"Control/Ana1_", "Analog 1 input ", "", MOTU_CTRL_TRAVELER_MIC_INPUT_CTRLS, 0},349 {"Control/Ana2_", "Analog 2 input ", "", MOTU_CTRL_TRAVELER_MIC_INPUT_CTRLS, 1},350 {"Control/Ana3_", "Analog 3 input ", "", MOTU_CTRL_TRAVELER_MIC_INPUT_CTRLS, 2},351 {"Control/Ana4_", "Analog 4 input ", "", MOTU_CTRL_TRAVELER_MIC_INPUT_CTRLS, 3},352 {"Control/Ana5_", "Analog 5 input ", "", MOTU_CTRL_TRAVELER_LINE_INPUT_CTRLS, 4},353 {"Control/Ana6_", "Analog 6 input ", "", MOTU_CTRL_TRAVELER_LINE_INPUT_CTRLS, 5},354 {"Control/Ana7_", "Analog 7 input ", "", MOTU_CTRL_TRAVELER_LINE_INPUT_CTRLS, 6},355 {"Control/Ana8_", "Analog 8 input ", "", MOTU_CTRL_TRAVELER_LINE_INPUT_CTRLS, 7},356 357 /* For phones source control, "register" is currently unused */358 {"Control/Phones_", "Phones source", "", MOTU_CTRL_PHONES_SRC, 0},359 360 /* For optical mode controls, the "register" is used to indicate direction */361 {"Control/OpticalIn_mode", "Optical input mode ", "", MOTU_CTRL_OPTICAL_MODE, MOTU_CTRL_DIR_IN},362 {"Control/OpticalOut_mode", "Optical output mode ", "", MOTU_CTRL_OPTICAL_MODE, MOTU_CTRL_DIR_OUT},363 };364 365 const MatrixMixBus MixerBuses_Ultralite[] = {366 {"Mix 1", 0x4000, },367 {"Mix 2", 0x4100, },368 {"Mix 3", 0x4200, },369 {"Mix 4", 0x4300, },370 };371 372 const MatrixMixChannel MixerChannels_Ultralite[] = {373 {"Analog 1", MOTU_CTRL_STD_CHANNEL, 0x0000, },374 {"Analog 2", MOTU_CTRL_STD_CHANNEL, 0x0004, },375 {"Analog 3", MOTU_CTRL_STD_CHANNEL, 0x0008, },376 {"Analog 4", MOTU_CTRL_STD_CHANNEL, 0x000c, },377 {"Analog 5", MOTU_CTRL_STD_CHANNEL, 0x0010, },378 {"Analog 6", MOTU_CTRL_STD_CHANNEL, 0x0014, },379 {"Analog 7", MOTU_CTRL_STD_CHANNEL, 0x0018, },380 {"Analog 8", MOTU_CTRL_STD_CHANNEL, 0x001c, },381 {"AES/EBU 1", MOTU_CTRL_STD_CHANNEL, MOTU_CTRL_NONE, },382 {"AES/EBU 2", MOTU_CTRL_STD_CHANNEL, MOTU_CTRL_NONE, },383 {"SPDIF 1", MOTU_CTRL_STD_CHANNEL, 0x0020, },384 {"SPDIF 2", MOTU_CTRL_STD_CHANNEL, 0x0024, },385 {"ADAT 1", MOTU_CTRL_STD_CHANNEL, MOTU_CTRL_NONE, },386 {"ADAT 2", MOTU_CTRL_STD_CHANNEL, MOTU_CTRL_NONE, },387 {"ADAT 3", MOTU_CTRL_STD_CHANNEL, MOTU_CTRL_NONE, },388 {"ADAT 4", MOTU_CTRL_STD_CHANNEL, MOTU_CTRL_NONE, },389 {"ADAT 5", MOTU_CTRL_STD_CHANNEL, MOTU_CTRL_NONE, },390 {"ADAT 6", MOTU_CTRL_STD_CHANNEL, MOTU_CTRL_NONE, },391 {"ADAT 7", MOTU_CTRL_STD_CHANNEL, MOTU_CTRL_NONE, },392 {"ADAT 8", MOTU_CTRL_STD_CHANNEL, MOTU_CTRL_NONE, },393 };394 395 const MixerCtrl MixerCtrls_Ultralite[] = {396 {"Mix1/Mix_", "Mix 1 ", "", MOTU_CTRL_STD_MIX, 0x0c20, },397 {"Mix2/Mix_", "Mix 2 ", "", MOTU_CTRL_STD_MIX, 0x0c24, },398 {"Mix3/Mix_", "Mix 3 ", "", MOTU_CTRL_STD_MIX, 0x0c28, },399 {"Mix4/Mix_", "Mix 4 ", "", MOTU_CTRL_STD_MIX, 0x0c2c, },400 {"Mainout_", "MainOut ", "", MOTU_CTRL_MIX_FADER, 0x0c0c, },401 {"Phones_", "Phones ", "", MOTU_CTRL_MIX_FADER, 0x0c10, },402 403 /* For mic/line input controls, the "register" is the zero-based channel number */404 {"Control/Ana1_", "Analog 1 input ", "", MOTU_CTRL_ULTRALITE_INPUT_CTRLS, 0},405 {"Control/Ana2_", "Analog 2 input ", "", MOTU_CTRL_ULTRALITE_INPUT_CTRLS, 1},406 {"Control/Ana3_", "Analog 3 input ", "", MOTU_CTRL_ULTRALITE_INPUT_CTRLS, 2},407 {"Control/Ana4_", "Analog 4 input ", "", MOTU_CTRL_ULTRALITE_INPUT_CTRLS, 3},408 {"Control/Ana5_", "Analog 5 input ", "", MOTU_CTRL_ULTRALITE_INPUT_CTRLS, 4},409 {"Control/Ana6_", "Analog 6 input ", "", MOTU_CTRL_ULTRALITE_INPUT_CTRLS, 5},410 {"Control/Ana7_", "Analog 7 input ", "", MOTU_CTRL_ULTRALITE_INPUT_CTRLS, 6},411 {"Control/Ana8_", "Analog 8 input ", "", MOTU_CTRL_ULTRALITE_INPUT_CTRLS, 7},412 {"Control/Spdif1_", "SPDIF 1 input ", "", MOTU_CTRL_ULTRALITE_INPUT_CTRLS, 6},413 {"Control/Spdif2_", "SPDIF 2 input ", "", MOTU_CTRL_ULTRALITE_INPUT_CTRLS, 7},414 415 /* For phones source control, "register" is currently unused */416 {"Control/Phones_", "Phones source", "", MOTU_CTRL_PHONES_SRC, 0},417 418 /* For optical mode controls, the "register" is used to indicate direction */419 {"Control/OpticalIn_mode", "Optical input mode ", "", MOTU_CTRL_OPTICAL_MODE, MOTU_CTRL_DIR_IN},420 {"Control/OpticalOut_mode", "Optical output mode ", "", MOTU_CTRL_OPTICAL_MODE, MOTU_CTRL_DIR_OUT},421 };422 423 const MatrixMixBus MixerBuses_896HD[] = {424 {"Mix 1", 0x4000, },425 {"Mix 2", 0x4100, },426 {"Mix 3", 0x4200, },427 {"Mix 4", 0x4300, },428 };429 430 const MatrixMixChannel MixerChannels_896HD[] = {431 {"Analog 1", MOTU_CTRL_STD_CHANNEL, 0x0000, },432 {"Analog 2", MOTU_CTRL_STD_CHANNEL, 0x0004, },433 {"Analog 3", MOTU_CTRL_STD_CHANNEL, 0x0008, },434 {"Analog 4", MOTU_CTRL_STD_CHANNEL, 0x000c, },435 {"Analog 5", MOTU_CTRL_STD_CHANNEL, 0x0010, },436 {"Analog 6", MOTU_CTRL_STD_CHANNEL, 0x0014, },437 {"Analog 7", MOTU_CTRL_STD_CHANNEL, 0x0018, },438 {"Analog 8", MOTU_CTRL_STD_CHANNEL, 0x001c, },439 {"AES/EBU 1", MOTU_CTRL_STD_CHANNEL, 0x0020, },440 {"AES/EBU 2", MOTU_CTRL_STD_CHANNEL, 0x0024, },441 {"SPDIF 1", MOTU_CTRL_STD_CHANNEL, 0x0048, },442 {"SPDIF 2", MOTU_CTRL_STD_CHANNEL, 0x004c, },443 {"ADAT 1", MOTU_CTRL_STD_CHANNEL, 0x0028, },444 {"ADAT 2", MOTU_CTRL_STD_CHANNEL, 0x002c, },445 {"ADAT 3", MOTU_CTRL_STD_CHANNEL, 0x0030, },446 {"ADAT 4", MOTU_CTRL_STD_CHANNEL, 0x0034, },447 {"ADAT 5", MOTU_CTRL_STD_CHANNEL, 0x0038, },448 {"ADAT 6", MOTU_CTRL_STD_CHANNEL, 0x003c, },449 {"ADAT 7", MOTU_CTRL_STD_CHANNEL, 0x0040, },450 {"ADAT 8", MOTU_CTRL_STD_CHANNEL, 0x0044, },451 };452 453 const MixerCtrl MixerCtrls_896HD[] = {454 {"Mix1/Mix_", "Mix 1 ", "", MOTU_CTRL_STD_MIX, 0x0c20, },455 {"Mix2/Mix_", "Mix 2 ", "", MOTU_CTRL_STD_MIX, 0x0c24, },456 {"Mix3/Mix_", "Mix 3 ", "", MOTU_CTRL_STD_MIX, 0x0c28, },457 {"Mix4/Mix_", "Mix 4 ", "", MOTU_CTRL_STD_MIX, 0x0c2c, },458 {"Mainout_", "MainOut ", "", MOTU_CTRL_MIX_FADER, 0x0c0c, },459 {"Phones_", "Phones ", "", MOTU_CTRL_MIX_FADER, 0x0c10, },460 461 /* For phones source control, "register" is currently unused */462 {"Control/Phones_", "Phones source", "", MOTU_CTRL_PHONES_SRC, 0},463 464 /* For optical mode controls, the "register" is used to indicate direction */465 {"Control/OpticalIn_mode", "Optical input mode ", "", MOTU_CTRL_OPTICAL_MODE, MOTU_CTRL_DIR_IN},466 {"Control/OpticalOut_mode", "Optical output mode ", "", MOTU_CTRL_OPTICAL_MODE, MOTU_CTRL_DIR_OUT},467 468 /* For meter controls the "register" indicates which meter controls are available */469 {"Control/Meter_", "Meter ", "", MOTU_CTRL_METER,470 MOTU_CTRL_METER_PEAKHOLD | MOTU_CTRL_METER_CLIPHOLD | MOTU_CTRL_METER_AESEBU_SRC |471 MOTU_CTRL_METER_PROG_SRC},472 };473 474 const MatrixMixBus MixerBuses_828Mk2[] = {475 {"Mix 1", 0x4000, },476 {"Mix 2", 0x4100, },477 {"Mix 3", 0x4200, },478 {"Mix 4", 0x4300, },479 };480 481 const MatrixMixChannel MixerChannels_828Mk2[] = {482 {"Analog 1", MOTU_CTRL_STD_CHANNEL, 0x0000, },483 {"Analog 2", MOTU_CTRL_STD_CHANNEL, 0x0004, },484 {"Analog 3", MOTU_CTRL_STD_CHANNEL, 0x0008, },485 {"Analog 4", MOTU_CTRL_STD_CHANNEL, 0x000c, },486 {"Analog 5", MOTU_CTRL_STD_CHANNEL, 0x0010, },487 {"Analog 6", MOTU_CTRL_STD_CHANNEL, 0x0014, },488 {"Analog 7", MOTU_CTRL_STD_CHANNEL, 0x0018, },489 {"Analog 8", MOTU_CTRL_STD_CHANNEL, 0x001c, },490 {"Mic 1", MOTU_CTRL_STD_CHANNEL, 0x0020, },491 {"Mic 2", MOTU_CTRL_STD_CHANNEL, 0x0024, },492 {"SPDIF 1", MOTU_CTRL_STD_CHANNEL, 0x0028, },493 {"SPDIF 2", MOTU_CTRL_STD_CHANNEL, 0x002c, },494 {"ADAT 1", MOTU_CTRL_STD_CHANNEL, 0x0030, },495 {"ADAT 2", MOTU_CTRL_STD_CHANNEL, 0x0034, },496 {"ADAT 3", MOTU_CTRL_STD_CHANNEL, 0x0038, },497 {"ADAT 4", MOTU_CTRL_STD_CHANNEL, 0x003c, },498 {"ADAT 5", MOTU_CTRL_STD_CHANNEL, 0x0040, },499 {"ADAT 6", MOTU_CTRL_STD_CHANNEL, 0x0044, },500 {"ADAT 7", MOTU_CTRL_STD_CHANNEL, 0x0048, },501 {"ADAT 8", MOTU_CTRL_STD_CHANNEL, 0x004c, },502 };503 504 const MixerCtrl MixerCtrls_828Mk2[] = {505 {"Mix1/Mix_", "Mix 1 ", "", MOTU_CTRL_STD_MIX, 0x0c20, },506 {"Mix2/Mix_", "Mix 2 ", "", MOTU_CTRL_STD_MIX, 0x0c24, },507 {"Mix3/Mix_", "Mix 3 ", "", MOTU_CTRL_STD_MIX, 0x0c28, },508 {"Mix4/Mix_", "Mix 4 ", "", MOTU_CTRL_STD_MIX, 0x0c2c, },509 {"Mainout_", "MainOut ", "", MOTU_CTRL_MIX_FADER, 0x0c0c, },510 {"Phones_", "Phones ", "", MOTU_CTRL_MIX_FADER, 0x0c10, },511 512 /* For mic/line input controls, the "register" is the zero-based channel number */513 {"Control/Ana1_", "Analog 1 input ", "", MOTU_CTRL_TRAVELER_LINE_INPUT_CTRLS, 0},514 {"Control/Ana2_", "Analog 2 input ", "", MOTU_CTRL_TRAVELER_LINE_INPUT_CTRLS, 1},515 {"Control/Ana3_", "Analog 3 input ", "", MOTU_CTRL_TRAVELER_LINE_INPUT_CTRLS, 2},516 {"Control/Ana4_", "Analog 4 input ", "", MOTU_CTRL_TRAVELER_LINE_INPUT_CTRLS, 3},517 {"Control/Ana5_", "Analog 5 input ", "", MOTU_CTRL_TRAVELER_LINE_INPUT_CTRLS, 4},518 {"Control/Ana6_", "Analog 6 input ", "", MOTU_CTRL_TRAVELER_LINE_INPUT_CTRLS, 5},519 {"Control/Ana7_", "Analog 7 input ", "", MOTU_CTRL_TRAVELER_LINE_INPUT_CTRLS, 6},520 {"Control/Ana8_", "Analog 8 input ", "", MOTU_CTRL_TRAVELER_LINE_INPUT_CTRLS, 7},521 522 /* For phones source control, "register" is currently unused */523 {"Control/Phones_", "Phones source", "", MOTU_CTRL_PHONES_SRC, 0},524 525 /* For optical mode controls, the "register" is used to indicate direction */526 {"Control/OpticalIn_mode", "Optical input mode ", "", MOTU_CTRL_OPTICAL_MODE, MOTU_CTRL_DIR_IN},527 {"Control/OpticalOut_mode", "Optical output mode ", "", MOTU_CTRL_OPTICAL_MODE, MOTU_CTRL_DIR_OUT},528 };529 530 const MotuMixer Mixer_Traveler = MOTUMIXER(531 MixerCtrls_Traveler, MixerBuses_Traveler, MixerChannels_Traveler);532 533 const MotuMixer Mixer_Ultralite = MOTUMIXER(534 MixerCtrls_Ultralite, MixerBuses_Ultralite, MixerChannels_Ultralite);535 536 const MotuMixer Mixer_828Mk2 = MOTUMIXER(537 MixerCtrls_828Mk2, MixerBuses_828Mk2, MixerChannels_828Mk2);538 539 const MotuMixer Mixer_896HD = MOTUMIXER(540 MixerCtrls_896HD, MixerBuses_896HD, MixerChannels_896HD);541 338 542 339 /* The order of DevicesProperty entries must match the numeric order of the … … 544 341 */ 545 342 const DevicePropertyEntry DevicesProperty[] = { 546 // { Ports_map, N_ELEMENTS( Ports_map ), MaxSR, MixerDescrPtr }, 547 { Ports_828MKII, N_ELEMENTS( Ports_828MKII ), 96000, &Mixer_828Mk2, }, 548 { Ports_TRAVELER, N_ELEMENTS( Ports_TRAVELER ), 192000, &Mixer_Traveler, }, 549 { Ports_ULTRALITE, N_ELEMENTS( Ports_ULTRALITE ), 96000, &Mixer_Ultralite, }, 550 { Ports_8PRE, N_ELEMENTS( Ports_8PRE ), 96000 }, 551 { Ports_828MKI, N_ELEMENTS( Ports_828MKI ), 48000 }, 552 { Ports_896HD, N_ELEMENTS( Ports_896HD ), 192000, &Mixer_896HD, }, 553 { Ports_828mk3, N_ELEMENTS( Ports_828mk3 ), 192000 }, 343 // { Ports_map, N_ELEMENTS( Ports_map ), MaxSR, MixerDescrPtr, Mark3MixerDescrPtr }, 344 { Ports_828MKII, N_ELEMENTS( Ports_828MKII ), 96000, &Mixer_828Mk2, NULL, }, 345 { Ports_TRAVELER, N_ELEMENTS( Ports_TRAVELER ), 192000, &Mixer_Traveler, NULL, }, 346 { Ports_ULTRALITE, N_ELEMENTS( Ports_ULTRALITE ), 96000, &Mixer_Ultralite, NULL, }, 347 { Ports_8PRE, N_ELEMENTS( Ports_8PRE ), 96000, &Mixer_8pre, NULL, }, 348 { Ports_828MKI, N_ELEMENTS( Ports_828MKI ), 48000 }, 349 { Ports_896HD, N_ELEMENTS( Ports_896HD ), 192000, &Mixer_896HD, NULL, }, 350 { Ports_828mk3, N_ELEMENTS( Ports_828mk3 ), 192000 }, 351 { Ports_ULTRALITEmk3, N_ELEMENTS( Ports_ULTRALITEmk3 ), 192000 }, 554 352 }; 555 353 … … 584 382 585 383 destroyMixer(); 586 }587 588 bool589 MotuDevice::buildMixerAudioControls(void) {590 591 bool result = true;592 MotuMatrixMixer *fader_mmixer = NULL;593 MotuMatrixMixer *pan_mmixer = NULL;594 MotuMatrixMixer *solo_mmixer = NULL;595 MotuMatrixMixer *mute_mmixer = NULL;596 const struct MatrixMixBus *buses = NULL;597 const struct MatrixMixChannel *channels = NULL;598 unsigned int bus, ch, i;599 600 if (DevicesProperty[m_motu_model-1].mixer == NULL) {601 debugOutput(DEBUG_LEVEL_WARNING, "No mixer controls defined for model %d\n", m_motu_model);602 result = false;603 } else {604 buses = DevicesProperty[m_motu_model-1].mixer->mixer_buses;605 if (buses == NULL) {606 debugOutput(DEBUG_LEVEL_WARNING, "No buses defined for model %d\n", m_motu_model);607 result = false;608 }609 channels = DevicesProperty[m_motu_model-1].mixer->mixer_channels;610 if (channels == NULL) {611 debugOutput(DEBUG_LEVEL_WARNING, "No channels defined for model %d\n", m_motu_model);612 result = false;613 }614 }615 if (result == false) {616 return true;617 }618 619 /* Create the top-level matrix mixers */620 fader_mmixer = new ChannelFaderMatrixMixer(*this, "fader");621 result &= m_MixerContainer->addElement(fader_mmixer);622 pan_mmixer = new ChannelPanMatrixMixer(*this, "pan");623 result &= m_MixerContainer->addElement(pan_mmixer);624 solo_mmixer = new ChannelBinSwMatrixMixer(*this, "solo",625 MOTU_CTRL_MASK_SOLO_VALUE, MOTU_CTRL_MASK_SOLO_SETENABLE);626 result &= m_MixerContainer->addElement(solo_mmixer);627 mute_mmixer = new ChannelBinSwMatrixMixer(*this, "mute",628 MOTU_CTRL_MASK_MUTE_VALUE, MOTU_CTRL_MASK_MUTE_SETENABLE);629 result &= m_MixerContainer->addElement(mute_mmixer);630 631 for (bus=0; bus<DevicesProperty[m_motu_model-1].mixer->n_mixer_buses; bus++) {632 fader_mmixer->addRowInfo(buses[bus].name, 0, buses[bus].address);633 pan_mmixer->addRowInfo(buses[bus].name, 0, buses[bus].address);634 solo_mmixer->addRowInfo(buses[bus].name, 0, buses[bus].address);635 mute_mmixer->addRowInfo(buses[bus].name, 0, buses[bus].address);636 }637 638 for (ch=0; ch<DevicesProperty[m_motu_model-1].mixer->n_mixer_channels; ch++) {639 uint32_t flags = channels[ch].flags;640 if (flags & MOTU_CTRL_CHANNEL_FADER)641 fader_mmixer->addColInfo(channels[ch].name, 0, channels[ch].addr_ofs);642 if (flags & MOTU_CTRL_CHANNEL_PAN)643 pan_mmixer->addColInfo(channels[ch].name, 0, channels[ch].addr_ofs);644 if (flags & MOTU_CTRL_CHANNEL_SOLO)645 solo_mmixer->addColInfo(channels[ch].name, 0, channels[ch].addr_ofs);646 if (flags & MOTU_CTRL_CHANNEL_MUTE)647 mute_mmixer->addColInfo(channels[ch].name, 0, channels[ch].addr_ofs);648 flags &= ~(MOTU_CTRL_CHANNEL_FADER|MOTU_CTRL_CHANNEL_PAN|MOTU_CTRL_CHANNEL_SOLO|MOTU_CTRL_CHANNEL_MUTE);649 if (flags) {650 debugOutput(DEBUG_LEVEL_WARNING, "Control %s: unknown flag bits 0x%08x\n", channels[ch].name, flags);651 }652 }653 654 // Single non-matrixed mixer controls get added here. Channel controls are supported655 // here, but usually these will be a part of a matrix mixer.656 for (i=0; i<DevicesProperty[m_motu_model-1].mixer->n_mixer_ctrls; i++) {657 const struct MixerCtrl *ctrl = &DevicesProperty[m_motu_model-1].mixer->mixer_ctrl[i];658 unsigned int type;659 char name[100];660 char label[100];661 662 if (ctrl == NULL) {663 debugOutput(DEBUG_LEVEL_WARNING, "NULL control at index %d for model %d\n", i, m_motu_model);664 continue;665 }666 type = ctrl->type;667 if (type & MOTU_CTRL_CHANNEL_FADER) {668 snprintf(name, 100, "%s%s", ctrl->name, "fader");669 snprintf(label,100, "%s%s", ctrl->label,"fader");670 result &= m_MixerContainer->addElement(671 new ChannelFader(*this, ctrl->dev_register, name, label, ctrl->desc));672 type &= ~MOTU_CTRL_CHANNEL_FADER;673 }674 if (type & MOTU_CTRL_CHANNEL_PAN) {675 snprintf(name, 100, "%s%s", ctrl->name, "pan");676 snprintf(label,100, "%s%s", ctrl->label,"pan");677 result &= m_MixerContainer->addElement(678 new ChannelPan(*this,679 ctrl->dev_register,680 name, label,681 ctrl->desc));682 type &= ~MOTU_CTRL_CHANNEL_PAN;683 }684 if (type & MOTU_CTRL_CHANNEL_MUTE) {685 snprintf(name, 100, "%s%s", ctrl->name, "mute");686 snprintf(label,100, "%s%s", ctrl->label,"mute");687 result &= m_MixerContainer->addElement(688 new MotuBinarySwitch(*this, ctrl->dev_register,689 MOTU_CTRL_MASK_MUTE_VALUE, MOTU_CTRL_MASK_MUTE_SETENABLE,690 name, label, ctrl->desc));691 type &= ~MOTU_CTRL_CHANNEL_MUTE;692 }693 if (type & MOTU_CTRL_CHANNEL_SOLO) {694 snprintf(name, 100, "%s%s", ctrl->name, "solo");695 snprintf(label,100, "%s%s", ctrl->label,"solo");696 result &= m_MixerContainer->addElement(697 new MotuBinarySwitch(*this, ctrl->dev_register,698 MOTU_CTRL_MASK_SOLO_VALUE, MOTU_CTRL_MASK_SOLO_SETENABLE,699 name, label, ctrl->desc));700 type &= ~MOTU_CTRL_CHANNEL_SOLO;701 }702 703 if (type & MOTU_CTRL_MIX_FADER) {704 snprintf(name, 100, "%s%s", ctrl->name, "fader");705 snprintf(label,100, "%s%s", ctrl->label,"fader");706 result &= m_MixerContainer->addElement(707 new MixFader(*this, ctrl->dev_register, name, label, ctrl->desc));708 type &= ~MOTU_CTRL_MIX_FADER;709 }710 if (type & MOTU_CTRL_MIX_MUTE) {711 snprintf(name, 100, "%s%s", ctrl->name, "mute");712 snprintf(label,100, "%s%s", ctrl->label,"mute");713 result &= m_MixerContainer->addElement(714 new MixMute(*this, ctrl->dev_register, name, label, ctrl->desc));715 type &= ~MOTU_CTRL_MIX_MUTE;716 }717 if (type & MOTU_CTRL_MIX_DEST) {718 snprintf(name, 100, "%s%s", ctrl->name, "dest");719 snprintf(label,100, "%s%s", ctrl->label,"dest");720 result &= m_MixerContainer->addElement(721 new MixDest(*this, ctrl->dev_register, name, label, ctrl->desc));722 type &= ~MOTU_CTRL_MIX_DEST;723 }724 725 if (type & MOTU_CTRL_INPUT_UL_GAIN) {726 snprintf(name, 100, "%s%s", ctrl->name, "trimgain");727 snprintf(label,100, "%s%s", ctrl->label,"trimgain");728 result &= m_MixerContainer->addElement(729 new InputGainPadInv(*this, ctrl->dev_register, MOTU_CTRL_MODE_UL_GAIN,730 name, label, ctrl->desc));731 type &= ~MOTU_CTRL_INPUT_UL_GAIN;732 }733 if (type & MOTU_CTRL_INPUT_PHASE_INV) {734 snprintf(name, 100, "%s%s", ctrl->name, "invert");735 snprintf(label,100, "%s%s", ctrl->label,"invert");736 result &= m_MixerContainer->addElement(737 new InputGainPadInv(*this, ctrl->dev_register, MOTU_CTRL_MODE_PHASE_INV,738 name, label, ctrl->desc));739 type &= ~MOTU_CTRL_INPUT_PHASE_INV;740 }741 if (type & MOTU_CTRL_INPUT_TRIMGAIN) {742 snprintf(name, 100, "%s%s", ctrl->name, "trimgain");743 snprintf(label,100, "%s%s", ctrl->label,"trimgain");744 result &= m_MixerContainer->addElement(745 new InputGainPadInv(*this, ctrl->dev_register, MOTU_CTRL_MODE_TRIMGAIN,746 name, label, ctrl->desc));747 type &= ~MOTU_CTRL_INPUT_TRIMGAIN;748 }749 if (type & MOTU_CTRL_INPUT_PAD) {750 snprintf(name, 100, "%s%s", ctrl->name, "pad");751 snprintf(label,100, "%s%s", ctrl->label,"pad");752 result &= m_MixerContainer->addElement(753 new InputGainPadInv(*this, ctrl->dev_register, MOTU_CTRL_MODE_PAD,754 name, label, ctrl->desc));755 type &= ~MOTU_CTRL_INPUT_PAD;756 }757 758 if (type & MOTU_CTRL_INPUT_LEVEL) {759 snprintf(name, 100, "%s%s", ctrl->name, "level");760 snprintf(label,100, "%s%s", ctrl->label,"level");761 result &= m_MixerContainer->addElement(762 new MotuBinarySwitch(*this, MOTU_REG_INPUT_LEVEL,763 1<<ctrl->dev_register, 0, name, label, ctrl->desc));764 type &= ~MOTU_CTRL_INPUT_LEVEL;765 }766 if (type & MOTU_CTRL_INPUT_BOOST) {767 snprintf(name, 100, "%s%s", ctrl->name, "boost");768 snprintf(label,100, "%s%s", ctrl->label,"boost");769 result &= m_MixerContainer->addElement(770 new MotuBinarySwitch(*this, MOTU_REG_INPUT_BOOST,771 1<<ctrl->dev_register, 0, name, label, ctrl->desc));772 type &= ~MOTU_CTRL_INPUT_BOOST;773 }774 if (type & MOTU_CTRL_PHONES_SRC) {775 snprintf(name, 100, "%s%s", ctrl->name, "src");776 snprintf(label,100, "%s%s", ctrl->label,"src");777 result &= m_MixerContainer->addElement(778 new PhonesSrc(*this, name, label, ctrl->desc));779 type &= ~MOTU_CTRL_PHONES_SRC;780 }781 if (type & MOTU_CTRL_OPTICAL_MODE) {782 result &= m_MixerContainer->addElement(783 new OpticalMode(*this, ctrl->dev_register,784 ctrl->name, ctrl->label, ctrl->desc));785 type &= ~MOTU_CTRL_OPTICAL_MODE;786 }787 if (type & MOTU_CTRL_METER) {788 if (ctrl->dev_register & MOTU_CTRL_METER_PEAKHOLD) {789 snprintf(name, 100, "%s%s", ctrl->name, "peakhold_time");790 snprintf(label,100, "%s%s", ctrl->label,"peakhold time");791 result &= m_MixerContainer->addElement(792 new MeterControl(*this, MOTU_METER_PEAKHOLD_MASK,793 MOTU_METER_PEAKHOLD_SHIFT, name, label, ctrl->desc));794 }795 if (ctrl->dev_register & MOTU_CTRL_METER_CLIPHOLD) {796 snprintf(name, 100, "%s%s", ctrl->name, "cliphold_time");797 snprintf(label,100, "%s%s", ctrl->label,"cliphold time");798 result &= m_MixerContainer->addElement(799 new MeterControl(*this, MOTU_METER_CLIPHOLD_MASK,800 MOTU_METER_CLIPHOLD_SHIFT, name, label, ctrl->desc));801 }802 if (ctrl->dev_register & MOTU_CTRL_METER_AESEBU_SRC) {803 snprintf(name, 100, "%s%s", ctrl->name, "aesebu_src");804 snprintf(label,100, "%s%s", ctrl->label,"AESEBU source");805 result &= m_MixerContainer->addElement(806 new MeterControl(*this, MOTU_METER_AESEBU_SRC_MASK,807 MOTU_METER_AESEBU_SRC_SHIFT, name, label, ctrl->desc));808 }809 if (ctrl->dev_register & MOTU_CTRL_METER_PROG_SRC) {810 snprintf(name, 100, "%s%s", ctrl->name, "src");811 snprintf(label,100, "%s%s", ctrl->label,"source");812 result &= m_MixerContainer->addElement(813 new MeterControl(*this, MOTU_METER_PROG_SRC_MASK,814 MOTU_METER_PROG_SRC_SHIFT, name, label, ctrl->desc));815 }816 type &= ~MOTU_CTRL_METER;817 }818 819 if (type) {820 debugOutput(DEBUG_LEVEL_WARNING, "Unknown mixer control type flag bits 0x%08x\n", ctrl->type);821 }822 }823 return result;824 }825 826 bool827 MotuDevice::buildMixer() {828 bool result = true;829 830 destroyMixer();831 debugOutput(DEBUG_LEVEL_VERBOSE, "Building a MOTU mixer...\n");832 833 // create the mixer object container834 m_MixerContainer = new Control::Container(this, "Mixer");835 if (!m_MixerContainer) {836 debugError("Could not create mixer container...\n");837 return false;838 }839 840 // Create and populate the top-level matrix mixers841 result = buildMixerAudioControls();842 843 /* Now add some general device information controls. These may yet844 * become device-specific if it turns out to be easier that way.845 */846 result &= m_MixerContainer->addElement(847 new InfoElement(*this, MOTU_INFO_MODEL, "Info/Model", "Model identifier", ""));848 result &= m_MixerContainer->addElement(849 new InfoElement(*this, MOTU_INFO_IS_STREAMING, "Info/IsStreaming", "Is device streaming", ""));850 result &= m_MixerContainer->addElement(851 new InfoElement(*this, MOTU_INFO_SAMPLE_RATE, "Info/SampleRate", "Device sample rate", ""));852 853 if (!addElement(m_MixerContainer)) {854 debugWarning("Could not register mixer to device\n");855 // clean up856 destroyMixer();857 return false;858 }859 860 // Special controls861 m_ControlContainer = new Control::Container(this, "Control");862 if (!m_ControlContainer) {863 debugError("Could not create control container...\n");864 destroyMixer();865 return false;866 }867 868 // Special controls get added here869 870 if (!result) {871 debugWarning("One or more device control elements could not be created\n");872 // clean up those that couldn't be created873 destroyMixer();874 return false;875 }876 if (!addElement(m_ControlContainer)) {877 debugWarning("Could not register controls to device\n");878 // clean up879 destroyMixer();880 return false;881 }882 883 return true;884 }885 886 887 bool888 MotuDevice::destroyMixer() {889 bool ret = true;890 debugOutput(DEBUG_LEVEL_VERBOSE, "destroy mixer...\n");891 892 if (m_MixerContainer == NULL) {893 debugOutput(DEBUG_LEVEL_VERBOSE, "no mixer to destroy...\n");894 } else895 if (!deleteElement(m_MixerContainer)) {896 debugError("Mixer present but not registered to the avdevice\n");897 ret = false;898 } else {899 // remove and delete (as in free) child control elements900 m_MixerContainer->clearElements(true);901 delete m_MixerContainer;902 m_MixerContainer = NULL;903 }904 905 // remove control container906 if (m_ControlContainer == NULL) {907 debugOutput(DEBUG_LEVEL_VERBOSE, "no controls to destroy...\n");908 } else909 if (!deleteElement(m_ControlContainer)) {910 debugError("Controls present but not registered to the avdevice\n");911 ret = false;912 } else {913 // remove and delete (as in free) child control elements914 m_ControlContainer->clearElements(true);915 delete m_ControlContainer;916 m_ControlContainer = NULL;917 }918 return ret;919 384 } 920 385 … … 1010 475 * Retrieve the current sample rate from the MOTU device. 1011 476 */ 1012 quadlet_t q = ReadRegister(MOTU_REG_CLK_CTRL);477 quadlet_t q = 0; 1013 478 int rate = 0; 1014 479 480 if (m_motu_model == MOTU_MODEL_828MkI) { 481 /* The original MOTU interfaces did things rather differently */ 482 q = ReadRegister(MOTU_G1_REG_CONFIG); 483 if ((q & MOTU_G1_RATE_MASK) == MOTU_G1_RATE_44100) 484 rate = 44100; 485 else 486 rate = 48000; 487 return rate; 488 } 489 490 q = ReadRegister(MOTU_REG_CLK_CTRL); 1015 491 switch (q & MOTU_RATE_BASE_MASK) { 1016 492 case MOTU_RATE_BASE_44100: … … 1057 533 if ( samplingFrequency > DevicesProperty[m_motu_model-1].MaxSampleRate ) 1058 534 return false; 535 536 /* The original MOTU devices do things differently; they are much 537 * simpler than the later interfaces. 538 */ 539 if (m_motu_model == MOTU_MODEL_828MkI) { 540 reg = ReadRegister(MOTU_G1_REG_CONFIG); 541 if (samplingFrequency > 0) { 542 reg &= ~MOTU_G1_RATE_MASK; 543 switch (samplingFrequency) { 544 case 44100: 545 reg |= MOTU_G1_RATE_44100; 546 break; 547 case 48000: 548 reg |= MOTU_G1_RATE_48000; 549 default: 550 // Unsupported rate 551 return false; 552 } 553 } 554 if (clock_source != MOTU_CLKSRC_UNCHANGED) { 555 switch (clock_source) { 556 case MOTU_CLKSRC_INTERNAL: 557 clock_source = MOTU_G1_CLKSRC_INTERNAL; break; 558 case MOTU_CLKSRC_SPDIF_TOSLINK: 559 clock_source = MOTU_G1_CLKSRC_SPDIF; break; 560 case MOTU_CLKSRC_ADAT_9PIN: 561 clock_source = MOTU_G1_CLKSRC_ADAT_9PIN; break; 562 default: 563 // Unsupported clock source 564 return false; 565 } 566 reg &= ~MOTU_G1_CLKSRC_MASK; 567 reg |= clock_source; 568 } 569 if (WriteRegister(MOTU_G1_REG_CONFIG, reg) != 0) 570 return false; 571 return true; 572 } 573 574 /* The rest of this function deals with later generation devices */ 1059 575 1060 576 reg = ReadRegister(MOTU_REG_CLK_CTRL); … … 1220 736 MotuDevice::clockIdToClockSource(unsigned int id) { 1221 737 ClockSource s; 738 bool g1_model = (m_motu_model == MOTU_MODEL_828MkI); 1222 739 s.id = id; 1223 740 … … 1235 752 s.type = eCT_ADAT; 1236 753 s.description = "ADAT optical"; 754 s.valid = s.active = s.locked = !g1_model; 1237 755 break; 1238 756 case MOTU_CLKSRC_SPDIF_TOSLINK: … … 1252 770 s.type = eCT_WordClock; 1253 771 s.description = "Wordclock"; 772 s.valid = s.active = s.locked = !g1_model; 1254 773 break; 1255 774 case MOTU_CLKSRC_ADAT_9PIN: … … 1260 779 s.type = eCT_AES; 1261 780 s.description = "AES/EBU"; 781 s.valid = s.active = s.locked = !g1_model; 1262 782 break; 1263 783 default: … … 1563 1083 quadlet_t isoctrl = ReadRegister(MOTU_REG_ISOCTRL); 1564 1084 1085 if (m_motu_model == MOTU_MODEL_828MkI) { 1086 // The 828MkI device does this differently. 1087 // To be implemented 1088 return false; 1089 } 1090 1565 1091 // NOTE: this assumes that you have two streams 1566 1092 switch (i) { … … 1614 1140 // TODO: connection management: break connection 1615 1141 // cfr the start function 1142 1143 if (m_motu_model == MOTU_MODEL_828MkI) { 1144 // The 828MkI device does this differently. 1145 // To be implemented 1146 return false; 1147 } 1616 1148 1617 1149 // NOTE: this assumes that you have two streams … … 1650 1182 1651 1183 unsigned int MotuDevice::getOpticalMode(unsigned int dir) { 1652 unsigned int reg = ReadRegister(MOTU_REG_ROUTE_PORT_CONF); 1653 1654 debugOutput(DEBUG_LEVEL_VERBOSE, "optical mode: %x %x %x %x\n",dir, reg, reg & MOTU_OPTICAL_IN_MODE_MASK, 1655 reg & MOTU_OPTICAL_OUT_MODE_MASK); 1184 unsigned int reg; 1185 1186 if (m_motu_model == MOTU_MODEL_828MkI) { 1187 // The early devices used a different register layout. 1188 unsigned int mask, shift; 1189 reg = ReadRegister(MOTU_G1_REG_CONFIG); 1190 mask = (dir==MOTU_DIR_IN)?MOTU_G1_OPT_IN_MODE_MASK:MOTU_G1_OPT_OUT_MODE_MASK; 1191 shift = (dir==MOTU_DIR_IN)?MOTU_G1_OPT_IN_MODE_BIT0:MOTU_G1_OPT_OUT_MODE_BIT0; 1192 switch (reg & mask) { 1193 case MOTU_G1_OPTICAL_OFF: return MOTU_OPTICAL_MODE_OFF; 1194 case MOTU_G1_OPTICAL_TOSLINK: return MOTU_OPTICAL_MODE_TOSLINK; 1195 // MOTU_G1_OPTICAL_OFF and MOTU_G1_OPTICAL_ADAT seem to be 1196 // identical, so currently we don't know how to differentiate 1197 // these two modes. 1198 // case MOTU_G1_OPTICAL_ADAT: return MOTU_OPTICAL_MODE_ADAT; 1199 } 1200 return 0; 1201 } 1202 1203 reg = ReadRegister(MOTU_REG_ROUTE_PORT_CONF); 1656 1204 1657 1205 if (dir == MOTU_DIR_IN) … … 1662 1210 1663 1211 signed int MotuDevice::setOpticalMode(unsigned int dir, unsigned int mode) { 1664 unsigned int reg = ReadRegister(MOTU_REG_ROUTE_PORT_CONF);1212 unsigned int reg; 1665 1213 unsigned int opt_ctrl = 0x0000002; 1666 1214 … … 1670 1218 if (m_motu_model==MOTU_MODEL_896HD && mode==MOTU_OPTICAL_MODE_TOSLINK) 1671 1219 return -1; 1220 1221 if (m_motu_model == MOTU_MODEL_828MkI) { 1222 // The earlier MOTUs handle this differently. 1223 unsigned int mask, shift, g1mode = 0; 1224 reg = ReadRegister(MOTU_G1_REG_CONFIG); 1225 mask = (dir==MOTU_DIR_IN)?MOTU_G1_OPT_IN_MODE_MASK:MOTU_G1_OPT_OUT_MODE_MASK; 1226 shift = (dir==MOTU_DIR_IN)?MOTU_G1_OPT_IN_MODE_BIT0:MOTU_G1_OPT_OUT_MODE_BIT0; 1227 switch (mode) { 1228 case MOTU_OPTICAL_MODE_OFF: g1mode = MOTU_G1_OPTICAL_OFF; break; 1229 case MOTU_OPTICAL_MODE_ADAT: g1mode = MOTU_G1_OPTICAL_ADAT; break; 1230 // See comment in getOpticalMode() about mode ambiguity 1231 // case MOTU_OPTICAL_MODE_TOSLINK: g1mode = MOTU_G1_OPTICAL_TOSLINK; break; 1232 } 1233 reg = (reg & ~mask) | (g1mode << shift); 1234 return WriteRegister(MOTU_G1_REG_CONFIG, reg); 1235 } 1236 1237 reg = ReadRegister(MOTU_REG_ROUTE_PORT_CONF); 1672 1238 1673 1239 // Set up the optical control register value according to the current trunk/libffado/src/motu/motu_avdevice.h
r1531 r1763 35 35 36 36 #include "motu_controls.h" 37 #include "motu_mark3_controls.h" 37 38 38 39 #define MOTU_BASE_ADDR 0xfffff0000000ULL … … 88 89 #define MOTU_REG_INPUT_GAIN_PHINV1 0x0c74 89 90 #define MOTU_REG_INPUT_GAIN_PHINV2 0x0c78 91 92 /* Device register definitions for the earliest generation devices */ 93 #define MOTU_G1_REG_CONFIG 0x0b00 94 #define MOTU_G1_REG_ISOCTRL 0x0b10 95 96 /* There's an unknown subtlety regarding the optical mode of the "generation 97 * 1" devices such as the 828Mk1. It seems that the same configuration 98 * register setting is used for "off" and "adat" modes. There must be more 99 * to this though because the number of audio channels sent presumedly 100 * changes when adat mode is selected; there must be some way that the 101 * device deduces the mode. 102 */ 103 #define MOTU_G1_OPT_IN_MODE_MASK 0x8000 104 #define MOTU_G1_OPT_IN_MODE_BIT0 15 105 #define MOTU_G1_OPT_OUT_MODE_MASK 0x4000 106 #define MOTU_G1_OPT_OUT_MODE_BIT0 14 107 #define MOTU_G1_OPTICAL_OFF 0x0000 108 #define MOTU_G1_OPTICAL_TOSLINK 0x0001 109 #define MOTU_G1_OPTICAL_ADAT 0x0000 110 111 #define MOTU_G1_RATE_MASK 0x0004 112 #define MOTU_G1_RATE_44100 0x0000 113 #define MOTU_G1_RATE_48000 0x0004 114 115 #define MOTU_G1_CLKSRC_MASK 0x0003 116 #define MOTU_G1_CLKSRC_INTERNAL 0x0000 117 #define MOTU_G1_CLKSRC_ADAT_9PIN 0x0001 118 #define MOTU_G1_CLKSRC_SPDIF 0x0002 119 #define MOTU_G1_CLKSRC_UNCHANGED MOTU_CLKSRC_UNCHANGED 120 121 #define MOTU_G1_MONIN_MASK 0x3f00 122 #define MOTU_G1_MONIN_L_SRC_MASK 0x0600 123 #define MOTU_G1_MONIN_R_SRC_MASK 0x3000 124 #define MOTU_G1_MONIN_L_MUTE_MASK 0x0100 // Yes, the sense of these 2 bits 125 #define MOTU_G1_MONIN_R_EN_MASK 0x0800 // really are reversed 126 #define MOTU_G1_MONIN_L_MUTE 0x0100 127 #define MOTU_G1_MONIN_L_ENABLE 0x0000 128 #define MOTU_G1_MONIN_R_MUTE 0x0000 129 #define MOTU_G1_MONIN_R_ENABLE 0x0800 130 #define MOTU_G1_MONIN_L_CH1 0x0000 131 #define MOTU_G1_MONIN_L_CH3 0x0020 132 #define MOTU_G1_MONIN_L_CH5 0x0040 133 #define MOTU_G1_MONIN_L_CH7 0x0060 134 #define MOTU_G1_MONIN_R_CH2 0x0000 135 #define MOTU_G1_MONIN_R_CH4 0x1000 136 #define MOTU_G1_MONIN_R_CH6 0x2000 137 #define MOTU_G1_MONIN_R_CH8 0x3000 138 139 /* Mark3 device registers - these don't have MOTU_BASE_ADDR as the base 140 * address so for now we'll define them as absolute addresses. 141 */ 142 #define MOTU_MARK3_REG_MIXER 0xffff00010000LL 90 143 91 144 /* Port Active Flags (ports declaration) */ … … 122 175 123 176 enum EMotuModel { 124 MOTU_MODEL_NONE = 0x0000, 125 MOTU_MODEL_828mkII = 0x0001, 126 MOTU_MODEL_TRAVELER = 0x0002, 127 MOTU_MODEL_ULTRALITE= 0x0003, 128 MOTU_MODEL_8PRE = 0x0004, 129 MOTU_MODEL_828MkI = 0x0005, 130 MOTU_MODEL_896HD = 0x0006, 131 MOTU_MODEL_828mk3 = 0x0007, 177 MOTU_MODEL_NONE = 0x0000, 178 MOTU_MODEL_828mkII = 0x0001, 179 MOTU_MODEL_TRAVELER = 0x0002, 180 MOTU_MODEL_ULTRALITE = 0x0003, 181 MOTU_MODEL_8PRE = 0x0004, 182 MOTU_MODEL_828MkI = 0x0005, 183 MOTU_MODEL_896HD = 0x0006, 184 MOTU_MODEL_828mk3 = 0x0007, 185 MOTU_MODEL_ULTRALITEmk3 = 0x0008, 132 186 }; 133 187 … … 148 202 }; 149 203 204 // Structures used for pre-Mark3 device mixer definitions 150 205 struct MixerCtrl { 151 206 const char *name, *label, *desc; … … 153 208 unsigned int dev_register; 154 209 }; 155 156 210 struct MatrixMixBus { 157 211 const char *name; 158 212 unsigned int address; 159 213 }; 160 161 214 struct MatrixMixChannel { 162 215 const char *name; … … 164 217 unsigned int addr_ofs; 165 218 }; 166 167 219 struct MotuMixer { 168 220 const MixerCtrl *mixer_ctrl; … … 174 226 }; 175 227 228 // Structures used for devices which use the "Mark3" mixer protocol 229 struct MotuMark3Mixer { 230 }; 231 176 232 struct DevicePropertyEntry { 177 233 const PortEntry* port_entry; 178 234 unsigned int n_port_entries; 179 235 signed int MaxSampleRate; 236 // A device will set at most one of the *mixer fields 180 237 const struct MotuMixer *mixer; 238 const struct MotuMark3Mixer *m3mixer; 181 239 // Others features can be added here like MIDI port presence. 182 240 }; 241 242 extern const DevicePropertyEntry DevicesProperty[]; 183 243 184 244 /* Macro to calculate the size of an array */ … … 244 304 private: 245 305 bool buildMixerAudioControls(void); 306 bool buildMark3MixerAudioControls(void); 246 307 bool addPort(Streaming::StreamProcessor *s_processor, 247 308 char *name, trunk/libffado/src/motu/motu_controls.cpp
r1531 r1763 301 301 if (v > 0x80) 302 302 v = 0x80; 303 debugOutput(DEBUG_LEVEL_VERBOSE, "ChannelFader setValue for row %d col %d to %lf (% ld)\n",303 debugOutput(DEBUG_LEVEL_VERBOSE, "ChannelFader setValue for row %d col %d to %lf (%d)\n", 304 304 row, col, val, v); 305 305 reg = getCellRegister(row,col); … … 331 331 val = m_parent.ReadRegister(reg) & 0xff; 332 332 333 debugOutput(DEBUG_LEVEL_VERBOSE, "ChannelFader getValue for row %d col %d = % lu\n",333 debugOutput(DEBUG_LEVEL_VERBOSE, "ChannelFader getValue for row %d col %d = %u\n", 334 334 row, col, val); 335 335 return val; … … 353 353 v = 0x80; 354 354 355 debugOutput(DEBUG_LEVEL_VERBOSE, "ChannelPan setValue for row %d col %d to %lf (% ld)\n",355 debugOutput(DEBUG_LEVEL_VERBOSE, "ChannelPan setValue for row %d col %d to %lf (%d)\n", 356 356 row, col, val, v); 357 357 reg = getCellRegister(row,col); … … 387 387 val = ((val >> 8) & 0xff) - 0x40; 388 388 389 debugOutput(DEBUG_LEVEL_VERBOSE, "ChannelPan getValue for row %d col %d = % lu\n",389 debugOutput(DEBUG_LEVEL_VERBOSE, "ChannelPan getValue for row %d col %d = %u\n", 390 390 row, col, val); 391 391 return val; … … 414 414 uint32_t v, reg; 415 415 416 debugOutput(DEBUG_LEVEL_VERBOSE, "BinSw setValue for row %d col %d to %lf (% ld)\n",416 debugOutput(DEBUG_LEVEL_VERBOSE, "BinSw setValue for row %d col %d to %lf (%d)\n", 417 417 row, col, val, val==0?0:1); 418 418 reg = getCellRegister(row,col); … … 460 460 val = (val & m_value_mask) != 0; 461 461 462 debugOutput(DEBUG_LEVEL_VERBOSE, "BinSw getValue for row %d col %d = % lu\n",462 debugOutput(DEBUG_LEVEL_VERBOSE, "BinSw getValue for row %d col %d = %u\n", 463 463 row, col, val); 464 464 return val; trunk/libffado/src/motu/motu_controls.h
r1742 r1763 23 23 * 24 24 */ 25 26 /* DBus controls used with devices which utilise a pre-Mark3 mixer interface */ 25 27 26 28 #include "debugmodule/debugmodule.h" trunk/libffado/src/motu/motu_mixerdefs.cpp
r1579 r1763 254 254 }; 255 255 256 const MatrixMixBus MixerBuses_8pre[] = { 257 {"Mix 1", 0x4000, }, 258 {"Mix 2", 0x4100, }, 259 {"Mix 3", 0x4200, }, 260 {"Mix 4", 0x4300, }, 261 }; 262 263 const MatrixMixChannel MixerChannels_8pre[] = { 264 {"Analog 1", MOTU_CTRL_STD_CHANNEL, 0x0000, }, 265 {"Analog 2", MOTU_CTRL_STD_CHANNEL, 0x0004, }, 266 {"Analog 3", MOTU_CTRL_STD_CHANNEL, 0x0008, }, 267 {"Analog 4", MOTU_CTRL_STD_CHANNEL, 0x000c, }, 268 {"Analog 5", MOTU_CTRL_STD_CHANNEL, 0x0010, }, 269 {"Analog 6", MOTU_CTRL_STD_CHANNEL, 0x0014, }, 270 {"Analog 7", MOTU_CTRL_STD_CHANNEL, 0x0018, }, 271 {"Analog 8", MOTU_CTRL_STD_CHANNEL, 0x001c, }, 272 {"ADAT 1", MOTU_CTRL_STD_CHANNEL, 0x0020, }, 273 {"ADAT 2", MOTU_CTRL_STD_CHANNEL, 0x0024, }, 274 {"ADAT 3", MOTU_CTRL_STD_CHANNEL, 0x0028, }, 275 {"ADAT 4", MOTU_CTRL_STD_CHANNEL, 0x002c, }, 276 {"ADAT 5", MOTU_CTRL_STD_CHANNEL, 0x0030, }, 277 {"ADAT 6", MOTU_CTRL_STD_CHANNEL, 0x0034, }, 278 {"ADAT 7", MOTU_CTRL_STD_CHANNEL, 0x0038, }, 279 {"ADAT 8", MOTU_CTRL_STD_CHANNEL, 0x003c, }, 280 }; 281 282 const MixerCtrl MixerCtrls_8pre[] = { 283 {"Mix1/Mix_", "Mix 1 ", "", MOTU_CTRL_STD_MIX, 0x0c20, }, 284 {"Mix2/Mix_", "Mix 2 ", "", MOTU_CTRL_STD_MIX, 0x0c24, }, 285 {"Mix3/Mix_", "Mix 3 ", "", MOTU_CTRL_STD_MIX, 0x0c28, }, 286 {"Mix4/Mix_", "Mix 4 ", "", MOTU_CTRL_STD_MIX, 0x0c2c, }, 287 288 /* For phones source control, "register" is currently unused */ 289 {"Control/Phones_", "Phones source", "", MOTU_CTRL_PHONES_SRC, 0}, 290 291 /* For optical mode controls, the "register" is used to indicate direction */ 292 {"Control/OpticalIn_mode", "Optical input mode ", "", MOTU_CTRL_OPTICAL_MODE, MOTU_CTRL_DIR_IN}, 293 {"Control/OpticalOut_mode", "Optical output mode ", "", MOTU_CTRL_OPTICAL_MODE, MOTU_CTRL_DIR_OUT}, 294 }; 295 256 296 const MotuMixer Mixer_Traveler = MOTUMIXER( 257 297 MixerCtrls_Traveler, MixerBuses_Traveler, MixerChannels_Traveler); … … 266 306 MixerCtrls_896HD, MixerBuses_896HD, MixerChannels_896HD); 267 307 308 const MotuMixer Mixer_8pre = MOTUMIXER( 309 MixerCtrls_8pre, MixerBuses_8pre, MixerChannels_8pre); 310 268 311 } trunk/libffado/src/motu/motu_mixerdefs.h
r1579 r1763 38 38 extern const MotuMixer Mixer_828Mk2; 39 39 extern const MotuMixer Mixer_896HD; 40 extern const MotuMixer Mixer_8pre; 40 41 41 42 } trunk/libffado/src/SConscript
r1747 r1763 150 150 motu/motu_avdevice.cpp \ 151 151 motu/motu_controls.cpp \ 152 motu/motu_mark3_controls.cpp \ 153 motu/motu_mixerdefs.cpp \ 154 motu/motu_mark3_mixerdefs.cpp \ 155 motu/motu_mixer.cpp \ 152 156 libstreaming/motu/MotuPort.cpp \ 153 157 libstreaming/motu/MotuPortInfo.cpp \ trunk/libffado/support/dbus/SConscript
r1694 r1763 39 39 if not env.GetOption( "clean" ): 40 40 env.MergeFlags( env["DBUS1_FLAGS"] ) 41 env.MergeFlags( env['LIBRAW1394_FLAGS'] ) 41 42 if not env['SERIALIZE_USE_EXPAT']: 42 43 env.MergeFlags( env['LIBXML26_FLAGS'] ) trunk/libffado/support/firmware/fireworks-downloader.cpp
r1498 r1763 23 23 */ 24 24 25 #include "fbtypes.h" 25 26 #include "downloader.h" 26 27 … … 214 215 215 216 if (node_id < 0) { 216 printMessage("Could not find device with GUID 0x%016 llX\n", guid);217 printMessage("Could not find device with GUID 0x%016"PRIX64"\n", guid); 217 218 return -1; 218 219 } trunk/libffado/support/mixer-qt4/ffado/mixer/motu.py
r1691 r1763 628 628 self.optical_out_mode.setEnabled(False) 629 629 630 # The 896HD doesn't have optical SPDIF (aka Toslink) capability631 if (self.model == MOTU_MODEL_896HD):630 # The 896HD and 8pre don't have optical SPDIF (aka Toslink) capability 631 if (self.model==MOTU_MODEL_896HD or self.model==MOTU_MODEL_8PRE): 632 632 self.optical_in_mode.removeItem(2) 633 633 self.optical_out_mode.removeItem(2) trunk/libffado/support/mixer-qt4/ffado/mixer/phase88.ui
r1640 r1763 1 <ui version="4.0" > 1 <?xml version="1.0" encoding="UTF-8"?> 2 <ui version="4.0"> 2 3 <comment>Copyright (C) 2005-2008 by Pieter Palmers 3 4 … … 18 19 </comment> 19 20 <class>Phase88ControlUI</class> 20 <widget class="QWidget" name="Phase88ControlUI" 21 <property name="geometry" 21 <widget class="QWidget" name="Phase88ControlUI"> 22 <property name="geometry"> 22 23 <rect> 23 24 <x>0</x> … … 27 28 </rect> 28 29 </property> 29 <property name="windowTitle" 30 <property name="windowTitle"> 30 31 <string>Terratec Phase 88 Control</string> 31 32 </property> 32 <layout class="QGridLayout" 33 <item row="0" column="0" 34 <widget class="QLabel" name="textLabel1" 35 <property name="text" 33 <layout class="QGridLayout"> 34 <item row="0" column="0"> 35 <widget class="QLabel" name="textLabel1"> 36 <property name="text"> 36 37 <string>Mixer bus output:</string> 37 38 </property> 38 <property name="wordWrap" 39 <property name="wordWrap"> 39 40 <bool>false</bool> 40 41 </property> 41 42 </widget> 42 43 </item> 43 <item row="0" column="1" 44 <widget class="QComboBox" name="comboOutAssign" 45 <item> 46 <property name="text" 44 <item row="0" column="1"> 45 <widget class="QComboBox" name="comboOutAssign"> 46 <item> 47 <property name="text"> 47 48 <string>S/PDIF Out</string> 48 49 </property> 49 50 </item> 50 51 <item> 51 <property name="text" 52 <property name="text"> 52 53 <string>Line Out 1/2</string> 53 54 </property> 54 55 </item> 55 56 <item> 56 <property name="text" 57 <property name="text"> 57 58 <string>Line Out 3/4</string> 58 59 </property> 59 60 </item> 60 61 <item> 61 <property name="text" 62 <property name="text"> 62 63 <string>Line Out 5/6</string> 63 64 </property> 64 65 </item> 65 66 <item> 66 <property name="text" 67 <property name="text"> 67 68 <string>Line Out 7/8</string> 68 69 </property> 69 70 </item> 70 71 <item> 71 <property name="text" 72 <property name="text"> 72 73 <string>None</string> 73 74 </property> … … 75 76 </widget> 76 77 </item> 77 <item row="1" column="0" colspan="2" 78 <widget class="QGroupBox" name="groupBox1" 79 <property name="title" 78 <item row="1" column="0" colspan="2"> 79 <widget class="QGroupBox" name="groupBox1"> 80 <property name="title"> 80 81 <string>Hardware Mixer</string> 81 82 </property> 82 <layout class="QHBoxLayout" 83 <layout class="QHBoxLayout"> 83 84 <item> 84 <layout class="QGridLayout" 85 <item row="0" column="0" 86 <widget class="QLabel" name="textLabel2" 87 <property name="text" 85 <layout class="QGridLayout"> 86 <item row="0" column="0"> 87 <widget class="QLabel" name="textLabel2"> 88 <property name="text"> 88 89 <string>1/2</string> 89 90 </property> 90 <property name="wordWrap" 91 <property name="wordWrap"> 91 92 <bool>false</bool> 92 93 </property> 93 94 </widget> 94 95 </item> 95 <item row="0" column="1" 96 <widget class="QLabel" name="textLabel2_2" 97 <property name="text" 96 <item row="0" column="1"> 97 <widget class="QLabel" name="textLabel2_2"> 98 <property name="text"> 98 99 <string>3/4</string> 99 100 </property> 100 <property name="wordWrap" 101 <property name="wordWrap"> 101 102 <bool>false</bool> 102 103 </property> 103 104 </widget> 104 105 </item> 105 <item row="0" column="2" 106 <widget class="QLabel" name="textLabel2_3" 107 <property name="text" 106 <item row="0" column="2"> 107 <widget class="QLabel" name="textLabel2_3"> 108 <property name="text"> 108 109 <string>5/6</string> 109 110 </property> 110 <property name="wordWrap" 111 <property name="wordWrap"> 111 112 <bool>false</bool> 112 113 </property> 113 114 </widget> 114 115 </item> 115 <item row="0" column="3" 116 <widget class="QLabel" name="textLabel2_4" 117 <property name="text" 116 <item row="0" column="3"> 117 <widget class="QLabel" name="textLabel2_4"> 118 <property name="text"> 118 119 <string>7/8</string> 119 120 </property> 120 <property name="wordWrap" 121 <property name="wordWrap"> 121 122 <bool>false</bool> 122 123 </property> 123 124 </widget> 124 125 </item> 125 <item row="0" column="4" 126 <widget class="QLabel" name="textLabel2_4_2" 127 <property name="text" 126 <item row="0" column="4"> 127 <widget class="QLabel" name="textLabel2_4_2"> 128 <property name="text"> 128 129 <string>S/PDIF</string> 129 130 </property> 130 <property name="wordWrap" 131 <property name="wordWrap"> 131 132 <bool>false</bool> 132 133 </property> 133 134 </widget> 134 135 </item> 135 <item row="0" column="5" 136 <widget class="QLabel" name="textLabel2_4_2_2" 137 <property name="text" 136 <item row="0" column="5"> 137 <widget class="QLabel" name="textLabel2_4_2_2"> 138 <property name="text"> 138 139 <string>WavePlay</string> 139 140 </property> 140 <property name="wordWrap" 141 <property name="wordWrap"> 141 142 <bool>false</bool> 142 143 </property> 143 144 </widget> 144 145 </item> 145 <item row="0" column="6" 146 <widget class="QLabel" name="textLabel2_4_2_2_2" 147 <property name="text" 146 <item row="0" column="6"> 147 <widget class="QLabel" name="textLabel2_4_2_2_2"> 148 <property name="text"> 148 149 <string>Master</string> 149 150 </property> 150 <property name="wordWrap" 151 <property name="wordWrap"> 151 152 <bool>false</bool> 152 153 </property> 153 154 </widget> 154 155 </item> 155 <item row="1" column="0" 156 <widget class="QSlider" name="sldInput12" 157 <property name="sizePolicy" 158 <sizepolicy vsizetype="Expanding" hsizetype="Expanding">156 <item row="1" column="0"> 157 <widget class="QSlider" name="sldInput12"> 158 <property name="sizePolicy"> 159 <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> 159 160 <horstretch>0</horstretch> 160 161 <verstretch>0</verstretch> 161 162 </sizepolicy> 162 163 </property> 163 <property name="minimum" 164 <property name="minimum"> 164 165 <number>0</number> 165 166 </property> 166 <property name="maximum" 167 <property name="maximum"> 167 168 <number>32767</number> 168 169 </property> 169 <property name="singleStep" 170 <number>10000</number> 171 </property> 172 <property name="pageStep" 170 <property name="singleStep"> 171 <number>10000</number> 172 </property> 173 <property name="pageStep"> 173 174 <number>1000</number> 174 175 </property> 175 <property name="orientation" 176 <property name="orientation"> 176 177 <enum>Qt::Vertical</enum> 177 178 </property> 178 <property name="tickInterval" 179 <number>10000</number> 180 </property> 181 </widget> 182 </item> 183 <item row="1" column="1" 184 <widget class="QSlider" name="sldInput34" 185 <property name="sizePolicy" 186 <sizepolicy vsizetype="Expanding" hsizetype="Expanding">179 <property name="tickInterval"> 180 <number>10000</number> 181 </property> 182 </widget> 183 </item> 184 <item row="1" column="1"> 185 <widget class="QSlider" name="sldInput34"> 186 <property name="sizePolicy"> 187 <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> 187 188 <horstretch>0</horstretch> 188 189 <verstretch>0</verstretch> 189 190 </sizepolicy> 190 191 </property> 191 <property name="minimum" 192 <property name="minimum"> 192 193 <number>0</number> 193 194 </property> 194 <property name="maximum" 195 <property name="maximum"> 195 196 <number>32767</number> 196 197 </property> 197 <property name="singleStep" 198 <number>10000</number> 199 </property> 200 <property name="pageStep" 198 <property name="singleStep"> 199 <number>10000</number> 200 </property> 201 <property name="pageStep"> 201 202 <number>1000</number> 202 203 </property> 203 <property name="orientation" 204 <property name="orientation"> 204 205 <enum>Qt::Vertical</enum> 205 206 </property> 206 <property name="tickInterval" 207 <number>10000</number> 208 </property> 209 </widget> 210 </item> 211 <item row="1" column="2" 212 <widget class="QSlider" name="sldInput56" 213 <property name="sizePolicy" 214 <sizepolicy vsizetype="Expanding" hsizetype="Expanding">207 <property name="tickInterval"> 208 <number>10000</number> 209 </property> 210 </widget> 211 </item> 212 <item row="1" column="2"> 213 <widget class="QSlider" name="sldInput56"> 214 <property name="sizePolicy"> 215 <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> 215 216 <horstretch>0</horstretch> 216 217 <verstretch>0</verstretch> 217 218 </sizepolicy> 218 219 </property> 219 <property name="minimum" 220 <property name="minimum"> 220 221 <number>0</number> 221 222 </property> 222 <property name="maximum" 223 <property name="maximum"> 223 224 <number>32767</number> 224 225 </property> 225 <property name="singleStep" 226 <number>10000</number> 227 </property> 228 <property name="pageStep" 226 <property name="singleStep"> 227 <number>10000</number> 228 </property> 229 <property name="pageStep"> 229 230 <number>1000</number> 230 231 </property> 231 <property name="orientation" 232 <property name="orientation"> 232 233 <enum>Qt::Vertical</enum> 233 234 </property> 234 <property name="tickInterval" 235 <number>10000</number> 236 </property> 237 </widget> 238 </item> 239 <item row="1" column="3" 240 <widget class="QSlider" name="sldInput78" 241 <property name="sizePolicy" 242 <sizepolicy vsizetype="Expanding" hsizetype="Expanding">235 <property name="tickInterval"> 236 <number>10000</number> 237 </property> 238 </widget> 239 </item> 240 <item row="1" column="3"> 241 <widget class="QSlider" name="sldInput78"> 242 <property name="sizePolicy"> 243 <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> 243 244 <horstretch>0</horstretch> 244 245 <verstretch>0</verstretch> 245 246 </sizepolicy> 246 247 </property> 247 <property name="minimum" 248 <property name="minimum"> 248 249 <number>0</number> 249 250 </property> 250 <property name="maximum" 251 <property name="maximum"> 251 252 <number>32767</number> 252 253 </property> 253 <property name="singleStep" 254 <number>10000</number> 255 </property> 256 <property name="pageStep" 254 <property name="singleStep"> 255 <number>10000</number> 256 </property> 257 <property name="pageStep"> 257 258 <number>1000</number> 258 259 </property> 259 <property name="orientation" 260 <property name="orientation"> 260 261 <enum>Qt::Vertical</enum> 261 262 </property> 262 <property name="tickInterval" 263 <number>10000</number> 264 </property> 265 </widget> 266 </item> 267 <item row="1" column="4" 268 <widget class="QSlider" name="sldInputSPDIF" 269 <property name="sizePolicy" 270 <sizepolicy vsizetype="Expanding" hsizetype="Expanding">263 <property name="tickInterval"> 264 <number>10000</number> 265 </property> 266 </widget> 267 </item> 268 <item row="1" column="4"> 269 <widget class="QSlider" name="sldInputSPDIF"> 270 <property name="sizePolicy"> 271 <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> 271 272 <horstretch>0</horstretch> 272 273 <verstretch>0</verstretch> 273 274 </sizepolicy> 274 275 </property> 275 <property name="minimum" 276 <property name="minimum"> 276 277 <number>0</number> 277 278 </property> 278 <property name="maximum" 279 <property name="maximum"> 279 280 <number>32767</number> 280 281 </property> 281 <property name="singleStep" 282 <number>10000</number> 283 </property> 284 <property name="pageStep" 282 <property name="singleStep"> 283 <number>10000</number> 284 </property> 285 <property name="pageStep"> 285 286 <number>1000</number> 286 287 </property> 287 <property name="orientation" 288 <property name="orientation"> 288 289 <enum>Qt::Vertical</enum> 289 290 </property> 290 <property name="tickInterval" 291 <number>10000</number> 292 </property> 293 </widget> 294 </item> 295 <item row="1" column="5" 296 <widget class="QSlider" name="sldInputWavePlay" 297 <property name="sizePolicy" 298 <sizepolicy vsizetype="Expanding" hsizetype="Expanding">291 <property name="tickInterval"> 292 <number>10000</number> 293 </property> 294 </widget> 295 </item> 296 <item row="1" column="5"> 297 <widget class="QSlider" name="sldInputWavePlay"> 298 <property name="sizePolicy"> 299 <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> 299 300 <horstretch>0</horstretch> 300 301 <verstretch>0</verstretch> 301 302 </sizepolicy> 302 303 </property> 303 <property name="minimum" 304 <property name="minimum"> 304 305 <number>0</number> 305 306 </property> 306 <property name="maximum" 307 <property name="maximum"> 307 308 <number>32767</number> 308 309 </property> 309 <property name="singleStep" 310 <number>10000</number> 311 </property> 312 <property name="pageStep" 310 <property name="singleStep"> 311 <number>10000</number> 312 </property> 313 <property name="pageStep"> 313 314 <number>1000</number> 314 315 </property> 315 <property name="orientation" 316 <property name="orientation"> 316 317 <enum>Qt::Vertical</enum> 317 318 </property> 318 <property name="tickInterval" 319 <number>10000</number> 320 </property> 321 </widget> 322 </item> 323 <item row="1" column="6" 324 <widget class="QSlider" name="sldInputMaster" 325 <property name="sizePolicy" 326 <sizepolicy vsizetype="Expanding" hsizetype="Expanding">319 <property name="tickInterval"> 320 <number>10000</number> 321 </property> 322 </widget> 323 </item> 324 <item row="1" column="6"> 325 <widget class="QSlider" name="sldInputMaster"> 326 <property name="sizePolicy"> 327 <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> 327 328 <horstretch>0</horstretch> 328 329 <verstretch>0</verstretch> 329 330 </sizepolicy> 330 331 </property> 331 <property name="minimum" 332 <property name="minimum"> 332 333 <number>0</number> 333 334 </property> 334 <property name="maximum" 335 <property name="maximum"> 335 336 <number>32767</number> 336 337 </property> 337 <property name="singleStep" 338 <number>10000</number> 339 </property> 340 <property name="pageStep" 338 <property name="singleStep"> 339 <number>10000</number> 340 </property> 341 <property name="pageStep"> 341 342 <number>1000</number> 342 343 </property> 343 <property name="orientation" 344 <property name="orientation"> 344 345 <enum>Qt::Vertical</enum> 345 346 </property> 346 <property name="tickInterval" 347 <property name="tickInterval"> 347 348 <number>10000</number> 348 349 </property> … … 354 355 </widget> 355 356 </item> 356 <item row="2" column="0" 357 <widget class="QLabel" name="textLabel1_2" 358 <property name="text" 357 <item row="2" column="0"> 358 <widget class="QLabel" name="textLabel1_2"> 359 <property name="text"> 359 360 <string>Waveplay Channel Source</string> 360 361 </property> 361 <property name="wordWrap" 362 <property name="wordWrap"> 362 363 <bool>false</bool> 363 364 </property> 364 365 </widget> 365 366 </item> 366 <item row="2" column="1" 367 <widget class="QComboBox" name="comboInAssign" 368 <item> 369 <property name="text" 367 <item row="2" column="1"> 368 <widget class="QComboBox" name="comboInAssign"> 369 <item> 370 <property name="text"> 370 371 <string>S/PDIF</string> 371 372 </property> 372 373 </item> 373 374 <item> 374 <property name="text" 375 <property name="text"> 375 376 <string>CH 1/2</string> 376 377 </property> 377 378 </item> 378 379 <item> 379 <property name="text" 380 <property name="text"> 380 381 <string>CH 3/4</string> 381 382 </property> 382 383 </item> 383 384 <item> 384 <property name="text" 385 <property name="text"> 385 386 <string>CH5/6</string> 386 387 </property> 387 388 </item> 388 389 <item> 389 <property name="text" 390 <property name="text"> 390 391 <string>CH7/8</string> 391 392 </property> … … 393 394 </widget> 394 395 </item> 395 <item row="3" column="0" 396 <widget class="QLabel" name="textLabel1_2_2" 397 <property name="text" 396 <item row="3" column="0"> 397 <widget class="QLabel" name="textLabel1_2_2"> 398 <property name="text"> 398 399 <string>In 7/8 Input Select</string> 399 400 </property> 400 <property name="wordWrap" 401 <property name="wordWrap"> 401 402 <bool>false</bool> 402 403 </property> 403 404 </widget> 404 405 </item> 405 <item row="3" column="1" > 406 <widget class="QComboBox" name="comboFrontBack" > 407 <item> 408 <property name="text" > 406 <item row="3" column="1"> 407 <widget class="QComboBox" name="comboFrontBack"> 408 <item> 409 <property name="text"> 410 <string>Back</string> 411 </property> 412 </item> 413 <item> 414 <property name="text"> 409 415 <string>Front</string> 410 416 </property> 411 417 </item> 412 <item> 413 <property name="text" > 414 <string>Back</string> 415 </property> 416 </item> 417 </widget> 418 </item> 419 <item row="4" column="0" > 420 <widget class="QLabel" name="textLabel1_2_3_2" > 421 <property name="text" > 418 </widget> 419 </item> 420 <item row="4" column="0"> 421 <widget class="QLabel" name="textLabel1_2_3_2"> 422 <property name="text"> 422 423 <string>Sync Source</string> 423 424 </property> 424 <property name="wordWrap" 425 <property name="wordWrap"> 425 426 <bool>false</bool> 426 427 </property> 427 428 </widget> 428 429 </item> 429 <item row="4" column="1" 430 <widget class="QComboBox" name="comboSyncSource" 431 <item> 432 <property name="text" 430 <item row="4" column="1"> 431 <widget class="QComboBox" name="comboSyncSource"> 432 <item> 433 <property name="text"> 433 434 <string>Internal</string> 434 435 </property> 435 436 </item> 436 437 <item> 437 <property name="text" 438 <property name="text"> 438 439 <string>External</string> 439 440 </property> … … 441 442 </widget> 442 443 </item> 443 <item row="5" column="0" 444 <widget class="QLabel" name="textLabel1_2_3" 445 <property name="text" 444 <item row="5" column="0"> 445 <widget class="QLabel" name="textLabel1_2_3"> 446 <property name="text"> 446 447 <string>External Sync Source</string> 447 448 </property> 448 <property name="wordWrap" 449 <property name="wordWrap"> 449 450 <bool>false</bool> 450 451 </property> 451 452 </widget> 452 453 </item> 453 <item row="5" column="1" 454 <widget class="QComboBox" name="comboExtSync" 455 <item> 456 <property name="text" 454 <item row="5" column="1"> 455 <widget class="QComboBox" name="comboExtSync"> 456 <item> 457 <property name="text"> 457 458 <string>S/PDIF</string> 458 459 </property> 459 460 </item> 460 461 <item> 461 <property name="text" 462 <property name="text"> 462 463 <string>WordClock</string> 463 464 </property> … … 467 468 </layout> 468 469 </widget> 469 <layoutdefault spacing="6" margin="11" 470 <layoutdefault spacing="6" margin="11"/> 470 471 <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> 471 472 <resources/> … … 477 478 <slot>switchOutAssign(int)</slot> 478 479 <hints> 479 <hint type="sourcelabel" 480 <x>20</x> 481 <y>20</y> 482 </hint> 483 <hint type="destinationlabel" 480 <hint type="sourcelabel"> 481 <x>20</x> 482 <y>20</y> 483 </hint> 484 <hint type="destinationlabel"> 484 485 <x>20</x> 485 486 <y>20</y> … … 493 494 <slot>switchFrontState(int)</slot> 494 495 <hints> 495 <hint type="sourcelabel" 496 <x>20</x> 497 <y>20</y> 498 </hint> 499 <hint type="destinationlabel" 496 <hint type="sourcelabel"> 497 <x>20</x> 498 <y>20</y> 499 </hint> 500 <hint type="destinationlabel"> 500 501 <x>20</x> 501 502 <y>20</y> … … 509 510 <slot>switchWaveInAssign(int)</slot> 510 511 <hints> 511 <hint type="sourcelabel" 512 <x>20</x> 513 <y>20</y> 514 </hint> 515 <hint type="destinationlabel" 512 <hint type="sourcelabel"> 513 <x>20</x> 514 <y>20</y> 515 </hint> 516 <hint type="destinationlabel"> 516 517 <x>20</x> 517 518 <y>20</y> … … 525 526 <slot>switchSyncSource(int)</slot> 526 527 <hints> 527 <hint type="sourcelabel" 528 <x>20</x> 529 <y>20</y> 530 </hint> 531 <hint type="destinationlabel" 528 <hint type="sourcelabel"> 529 <x>20</x> 530 <y>20</y> 531 </hint> 532 <hint type="destinationlabel"> 532 533 <x>20</x> 533 534 <y>20</y> … … 541 542 <slot>switchExtSyncSource(int)</slot> 542 543 <hints> 543 <hint type="sourcelabel" 544 <x>20</x> 545 <y>20</y> 546 </hint> 547 <hint type="destinationlabel" 544 <hint type="sourcelabel"> 545 <x>20</x> 546 <y>20</y> 547 </hint> 548 <hint type="destinationlabel"> 548 549 <x>20</x> 549 550 <y>20</y> … … 557 558 <slot>setVolume12(int)</slot> 558 559 <hints> 559 <hint type="sourcelabel" 560 <x>20</x> 561 <y>20</y> 562 </hint> 563 <hint type="destinationlabel" 560 <hint type="sourcelabel"> 561 <x>20</x> 562 <y>20</y> 563 </hint> 564 <hint type="destinationlabel"> 564 565 <x>20</x> 565 566 <y>20</y> … … 573 574 <slot>setVolume34(int)</slot> 574 575 <hints> 575 <hint type="sourcelabel" 576 <x>20</x> 577 <y>20</y> 578 </hint> 579 <hint type="destinationlabel" 576 <hint type="sourcelabel"> 577 <x>20</x> 578 <y>20</y> 579 </hint> 580 <hint type="destinationlabel"> 580 581 <x>20</x> 581 582 <y>20</y> … … 589 590 <slot>setVolume56(int)</slot> 590 591 <hints> 591 <hint type="sourcelabel" 592 <x>20</x> 593 <y>20</y> 594 </hint> 595 <hint type="destinationlabel" 592 <hint type="sourcelabel"> 593 <x>20</x> 594 <y>20</y> 595 </hint> 596 <hint type="destinationlabel"> 596 597 <x>20</x> 597 598 <y>20</y> … … 605 606 <slot>setVolume78(int)</slot> 606 607 <hints> 607 <hint type="sourcelabel" 608 <x>20</x> 609 <y>20</y> 610 </hint> 611 <hint type="destinationlabel" 608 <hint type="sourcelabel"> 609 <x>20</x> 610 <y>20</y> 611 </hint> 612 <hint type="destinationlabel"> 612 613 <x>20</x> 613 614 <y>20</y> … … 621 622 <slot>setVolumeMaster(int)</slot> 622 623 <hints> 623 <hint type="sourcelabel" 624 <x>20</x> 625 <y>20</y> 626 </hint> 627 <hint type="destinationlabel" 624 <hint type="sourcelabel"> 625 <x>20</x> 626 <y>20</y> 627 </hint> 628 <hint type="destinationlabel"> 628 629 <x>20</x> 629 630 <y>20</y> … … 637 638 <slot>setVolumeSPDIF(int)</slot> 638 639 <hints> 639 <hint type="sourcelabel" 640 <x>20</x> 641 <y>20</y> 642 </hint> 643 <hint type="destinationlabel" 640 <hint type="sourcelabel"> 641 <x>20</x> 642 <y>20</y> 643 </hint> 644 <hint type="destinationlabel"> 644 645 <x>20</x> 645 646 <y>20</y> … … 653 654 <slot>setVolumeWavePlay(int)</slot> 654 655 <hints> 655 <hint type="sourcelabel" 656 <x>20</x> 657 <y>20</y> 658 </hint> 659 <hint type="destinationlabel" 656 <hint type="sourcelabel"> 657 <x>20</x> 658 <y>20</y> 659 </hint> 660 <hint type="destinationlabel"> 660 661 <x>20</x> 661 662 <y>20</y> trunk/libffado/support/mixer-qt4/ffado/mixer/saffire.py
- Property svn:mergeinfo set
r1691 r1763 104 104 def initValues(self): 105 105 selected = self.samplerateselect.selected() 106 self.samplerate = int(self.samplerateselect.getEnumLabel( selected )) 106 label = self.samplerateselect.getEnumLabel( selected ) 107 try: 108 self.samplerate = int(label) 109 except: 110 # FIXME: this should be handled properly 111 self.samplerate = 44100 107 112 108 113 # Saffire: 0x130e010001???? trunk/libffado/support/mixer-qt4/ffado/regdialog.py
r1664 r1763 1 # -*- coding: utf-8 -*- 1 2 # 2 3 # Copyright (C) 2005-2008 by Pieter Palmers … … 34 35 <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> 35 36 You are running this version of FFADO for the first time with this device. </p> 37 <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If FFADO is useful to you, please consider a donation through <a href="http://www.ffado.org/?q=donations ">http://www.ffado.org/?q=donations</a>.</p> 36 38 <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> 37 39 In order to collect usage statistics we would like to send some information about your system to ffado.org. trunk/libffado/tests/streaming/test-ipcclient.cpp
r1256 r1763 195 195 196 196 printMessage("Testing shared memory streaming IPC\n"); 197 printMessage(" period % d, nb_buffers %d, playback %d, capture %d\n",197 printMessage(" period %ld, nb_buffers %ld, playback %ld, capture %ld\n", 198 198 arguments.period, arguments.nb_buffers, 199 199 arguments.playback, trunk/libffado/tests/streaming/teststreaming-ipc.cpp
r1254 r1763 287 287 } 288 288 289 debugOutput(DEBUG_LEVEL_NORMAL, "verbose level = % d\n", arguments.verbose);289 debugOutput(DEBUG_LEVEL_NORMAL, "verbose level = %ld\n", arguments.verbose); 290 290 setDebugLevel(arguments.verbose); 291 291 … … 308 308 309 309 debugOutput(DEBUG_LEVEL_NORMAL, "FFADO streaming test application (3)\n"); 310 printMessage(" period % d, nb_buffers %d, playback %d, capture %d\n",310 printMessage(" period %ld, nb_buffers %ld, playback %ld, capture %ld\n", 311 311 arguments.period, arguments.nb_buffers, 312 312 arguments.playback, … … 374 374 printMessage("Device channel count: %d capture, %d playback\n", 375 375 nb_in_channels, nb_out_channels); 376 printMessage("Requested channel count: % d capture, %d playback\n",376 printMessage("Requested channel count: %ld capture, %ld playback\n", 377 377 arguments.capture, arguments.playback); 378 378 379 379 if(arguments.playback > nb_out_channels) { 380 debugError("Too many playback channels requested (want: % d, have:%d)\n",380 debugError("Too many playback channels requested (want: %ld, have:%d)\n", 381 381 arguments.playback, nb_out_channels); 382 382 return -1; 383 383 } 384 384 if(arguments.capture > nb_in_channels) { 385 debugError("Too many capture channels requested (want: % d, have:%d)\n",385 debugError("Too many capture channels requested (want: %ld, have:%d)\n", 386 386 arguments.capture, nb_in_channels); 387 387 return -1; … … 460 460 // enter the loop 461 461 debugOutput(DEBUG_LEVEL_NORMAL, 462 "Entering receive loop (IN: % d, OUT: %d)\n",462 "Entering receive loop (IN: %ld, OUT: %ld)\n", 463 463 arguments.capture, arguments.playback); 464 464 trunk/libffado/tests/streaming/teststreaming3.cpp
r1568 r1763 262 262 } 263 263 264 debugOutput(DEBUG_LEVEL_NORMAL, "verbose level = %d\n", arguments.verbose);264 debugOutput(DEBUG_LEVEL_NORMAL, "verbose level = %d\n", (int)arguments.verbose); 265 265 setDebugLevel(arguments.verbose); 266 266 trunk/libffado/tests/systemtests/gen-loadpulses.cpp
r1234 r1763 33 33 #include <argp.h> 34 34 35 #ifndef __STDC_FORMAT_MACROS 36 #define __STDC_FORMAT_MACROS 37 #endif 35 38 #include <inttypes.h> 36 39 … … 157 160 debugOutput(DEBUG_LEVEL_INFO, "System Load pulse generator\n"); 158 161 debugOutput(DEBUG_LEVEL_INFO, " Arguments:\n"); 159 debugOutput(DEBUG_LEVEL_INFO, " RT priority : % d\n", arguments.rtprio);160 debugOutput(DEBUG_LEVEL_INFO, " Countdown : % d\n", arguments.countdown);161 debugOutput(DEBUG_LEVEL_INFO, " Period : % d usec\n", arguments.period);162 debugOutput(DEBUG_LEVEL_INFO, " Pulse duration : % d usec\n", arguments.duration);163 164 debugOutput(DEBUG_LEVEL_INFO, "Setting RT priority (% d)...\n", arguments.rtprio);162 debugOutput(DEBUG_LEVEL_INFO, " RT priority : %ld\n", arguments.rtprio); 163 debugOutput(DEBUG_LEVEL_INFO, " Countdown : %ld\n", arguments.countdown); 164 debugOutput(DEBUG_LEVEL_INFO, " Period : %ld usec\n", arguments.period); 165 debugOutput(DEBUG_LEVEL_INFO, " Pulse duration : %ld usec\n", arguments.duration); 166 167 debugOutput(DEBUG_LEVEL_INFO, "Setting RT priority (%ld)...\n", arguments.rtprio); 165 168 set_realtime_priority(arguments.rtprio); 166 169 … … 185 188 int64_t usecs_late = toc - sleep_time; 186 189 if(usecs_late > 1000) { 187 debugWarning("late wakeup: % lldusecs\n", usecs_late);190 debugWarning("late wakeup: %"PRId64" usecs\n", usecs_late); 188 191 } 189 192 190 193 // try and detect lockup () 191 194 if(usecs_late > 100000) { 192 debugWarning("very late wakeup: % lldusecs\n", usecs_late);195 debugWarning("very late wakeup: %"PRId64" usecs\n", usecs_late); 193 196 // force exit, since this is a loop out of control 194 197 run=0; trunk/libffado/tests/systemtests/test-clock_nanosleep.cpp
r1079 r1763 23 23 24 24 #include "debugmodule/debugmodule.h" 25 #include "libutil/Time.h" 25 26 26 27 // needed for clock_nanosleep … … 69 70 ts.tv_nsec = (wake_at_usec % (1000000LL)) * 1000LL; 70 71 debugOutput(DEBUG_LEVEL_VERBOSE, 71 "clock_nanosleep until % lld sec, %lldnanosec\n",72 "clock_nanosleep until %"PRId64" sec, %"PRId64" nanosec\n", 72 73 (int64_t)ts.tv_sec, (int64_t)ts.tv_nsec); 73 74 int err = clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &ts, NULL); … … 105 106 wake_at += SLEEP_PERIOD_USECS; 106 107 107 debugOutput( DEBUG_LEVEL_VERBOSE, "cuckoo from %p at %012llu\n", obj, getCurrentTimeAsUsecs()); 108 debugOutput(DEBUG_LEVEL_VERBOSE, 109 "cuckoo from %p at %012"PRI_FFADO_MICROSECS_T"\n", 110 obj, getCurrentTimeAsUsecs()); 108 111 109 112 pthread_testcancel(); trunk/libffado/tests/systemtests/test-isorecv-1.cpp
r1700 r1763 188 188 } 189 189 190 debugOutput(DEBUG_LEVEL_INFO, "Select 1394 port %d...\n", arguments.port);190 debugOutput(DEBUG_LEVEL_INFO, "Select 1394 port %d...\n", (int) arguments.port); 191 191 int ret = -1; 192 192 do … … 226 226 } 227 227 228 debugOutput(DEBUG_LEVEL_INFO, "Setting RT priority (%d)...\n", arguments.rtprio);228 debugOutput(DEBUG_LEVEL_INFO, "Setting RT priority (%d)...\n", (int)arguments.rtprio); 229 229 set_realtime_priority(arguments.rtprio); 230 230 trunk/libffado/tests/systemtests/test-isoxmit-1.cpp
r1700 r1763 233 233 } 234 234 235 debugOutput(DEBUG_LEVEL_NORMAL, "verbose level = %d\n", arguments.verbose);235 debugOutput(DEBUG_LEVEL_NORMAL, "verbose level = %d\n", (int) arguments.verbose); 236 236 setDebugLevel(arguments.verbose); 237 237 … … 244 244 } 245 245 246 debugOutput(DEBUG_LEVEL_INFO, "Select 1394 port %d...\n", arguments.port);246 debugOutput(DEBUG_LEVEL_INFO, "Select 1394 port %d...\n", (int)arguments.port); 247 247 int ret = -1; 248 248 do … … 269 269 raw1394_set_bus_reset_handler(handle, myResetHandler); 270 270 271 debugOutput(DEBUG_LEVEL_INFO, "Setting RT priority (%d)...\n", arguments.rtprio);271 debugOutput(DEBUG_LEVEL_INFO, "Setting RT priority (%d)...\n", (int)arguments.rtprio); 272 272 set_realtime_priority(arguments.rtprio); 273 273 trunk/libffado/tests/systemtests/test-sysload.cpp
r1234 r1763 33 33 #include <argp.h> 34 34 35 #ifndef __STDC_FORMAT_MACROS 36 #define __STDC_FORMAT_MACROS 37 #endif 35 38 #include <inttypes.h> 36 39 … … 157 160 debugOutput(DEBUG_LEVEL_INFO, "Simple RT system loader\n"); 158 161 debugOutput(DEBUG_LEVEL_INFO, " Arguments:\n"); 159 debugOutput(DEBUG_LEVEL_INFO, " RT priority : % d\n", arguments.rtprio);160 debugOutput(DEBUG_LEVEL_INFO, " Countdown : % d\n", arguments.countdown);161 debugOutput(DEBUG_LEVEL_INFO, " Period : % d usec\n", arguments.period);162 debugOutput(DEBUG_LEVEL_INFO, " CPU load : % d%%\n", arguments.cpu_pct);163 164 debugOutput(DEBUG_LEVEL_INFO, "Setting RT priority (% d)...\n", arguments.rtprio);162 debugOutput(DEBUG_LEVEL_INFO, " RT priority : %ld\n", arguments.rtprio); 163 debugOutput(DEBUG_LEVEL_INFO, " Countdown : %ld\n", arguments.countdown); 164 debugOutput(DEBUG_LEVEL_INFO, " Period : %ld usec\n", arguments.period); 165 debugOutput(DEBUG_LEVEL_INFO, " CPU load : %ld%%\n", arguments.cpu_pct); 166 167 debugOutput(DEBUG_LEVEL_INFO, "Setting RT priority (%ld)...\n", arguments.rtprio); 165 168 set_realtime_priority(arguments.rtprio); 166 169 … … 187 190 int64_t usecs_late = toc - sleep_time; 188 191 if(usecs_late > 1000) { 189 debugWarning("late wakeup: % lldusecs\n", usecs_late);192 debugWarning("late wakeup: %"PRId64" usecs\n", usecs_late); 190 193 } 191 194 192 195 // try and detect lockup () 193 196 if(usecs_late > 100000) { 194 debugWarning("very late wakeup: % lldusecs\n", usecs_late);197 debugWarning("very late wakeup: %"PRId64" usecs\n", usecs_late); 195 198 // force exit, since this is a loop out of control 196 199 run=0; trunk/libffado/tests/test-bufferops.cpp
r1136 r1763 30 30 31 31 #include "libutil/SystemTimeSource.h" 32 #include "libutil/Time.h" 33 32 34 #include <inttypes.h> 33 35 … … 86 88 byteSwapToBus(buffer_1, nb_quadlets); 87 89 elapsed = Util::SystemTimeSource::getCurrentTimeAsUsecs() - start; 88 printMessage( " took % lluusec...\n", elapsed);90 printMessage( " took %"PRI_FFADO_MICROSECS_T"usec...\n", elapsed); 89 91 90 92 } … … 154 156 convertFromInt24AndLabelAsMBLA(buffer_1, nb_quadlets); 155 157 elapsed = Util::SystemTimeSource::getCurrentTimeAsUsecs() - start; 156 printMessage( " took % lluusec...\n", elapsed);158 printMessage( " took %"PRI_FFADO_MICROSECS_T"usec...\n", elapsed); 157 159 } 158 160 … … 236 238 convertFromFloatAndLabelAsMBLA(buffer_1, nb_quadlets); 237 239 elapsed = Util::SystemTimeSource::getCurrentTimeAsUsecs() - start; 238 printMessage( " took % lluusec...\n", elapsed);240 printMessage( " took %"PRI_FFADO_MICROSECS_T"usec...\n", elapsed); 239 241 } 240 242 trunk/libffado/tests/test-dice-eap.cpp
r1717 r1763 271 271 e = NULL; 272 272 eap.unlockControl(); 273 274 int cnt = 0;275 273 276 274 while(run && arguments.counts != 0) { trunk/libffado/tests/test-ffado.cpp
r1498 r1763 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 llX %010llu XMT: 0x%010llX %010llu CTR: %010llu\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 trunk/libffado/tests/test-focusrite.cpp
r1535 r1763 183 183 } 184 184 if (!retval) { 185 debugError( " read from %16 llXfailed (id: %d)\n", addr, id);185 debugError( " read from %16"PRIX64" failed (id: %d)\n", addr, id); 186 186 } else { 187 187 value = CondSwapFromBus32(value); trunk/libffado/tests/test-ieee1394service.cpp
r1550 r1763 165 165 } 166 166 debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, 167 "(%p) Cycle timer: %011 llu(%03us %04ucy %04uticks)\n",167 "(%p) Cycle timer: %011"PRIu64" (%03us %04ucy %04uticks)\n", 168 168 this, ctr, 169 169 (unsigned int)TICKS_TO_SECS( ctr ), … … 171 171 (unsigned int)TICKS_TO_OFFSET( ctr ) ); 172 172 debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, 173 "(%p) from DLL: %011 llu(%03us %04ucy %04uticks)\n",173 "(%p) from DLL: %011"PRIu64" (%03us %04ucy %04uticks)\n", 174 174 this, ctr_dll, 175 175 (unsigned int)TICKS_TO_SECS( ctr_dll ), … … 200 200 } 201 201 debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, 202 "(%p) diff: %s%011 llu(%03us %04ucy %04uticks)\n", this,202 "(%p) diff: %s%011"PRIu64" (%03us %04ucy %04uticks)\n", this, 203 203 ((int64_t)abs_diff==diff?" ":"-"), abs_diff, (unsigned int)TICKS_TO_SECS( abs_diff ), 204 204 (unsigned int)TICKS_TO_CYCLES( abs_diff ), (unsigned int)TICKS_TO_OFFSET( abs_diff ) ); 205 205 if (abs_diff > DIFF_CONSIDERED_LARGE) { 206 debugWarning("(%p) Alert, large diff: % lld\n", this, diff);207 debugOutput ( DEBUG_LEVEL_NORMAL, 208 "(%p) Cycle timer: %011 llu(%03us %04ucy %04uticks)\n",206 debugWarning("(%p) Alert, large diff: %"PRId64"\n", this, diff); 207 debugOutput ( DEBUG_LEVEL_NORMAL, 208 "(%p) Cycle timer: %011"PRIu64" (%03us %04ucy %04uticks)\n", 209 209 this, ctr, 210 210 (unsigned int)TICKS_TO_SECS( ctr ), … … 212 212 (unsigned int)TICKS_TO_OFFSET( ctr ) ); 213 213 debugOutput ( DEBUG_LEVEL_NORMAL, 214 "(%p) from DLL: %011 llu(%03us %04ucy %04uticks)\n",214 "(%p) from DLL: %011"PRIu64" (%03us %04ucy %04uticks)\n", 215 215 this, ctr_dll, 216 216 (unsigned int)TICKS_TO_SECS( ctr_dll ), … … 221 221 diff = diffTicks(ctr, ctr_prev); 222 222 if (diff < 0) { 223 debugWarning("(%p) Alert, non-monotonic ctr (direct): % llu - %llu = %lld\n",223 debugWarning("(%p) Alert, non-monotonic ctr (direct): %"PRId64" - %"PRId64" = %"PRId64"\n", 224 224 this, ctr, ctr_prev, diff); 225 225 debugOutput ( DEBUG_LEVEL_NORMAL, 226 "(%p) Cycle timer now : %011 llu(%03us %04ucy %04uticks)\n",226 "(%p) Cycle timer now : %011"PRIu64" (%03us %04ucy %04uticks)\n", 227 227 this, ctr, 228 228 (unsigned int)TICKS_TO_SECS( ctr ), … … 230 230 (unsigned int)TICKS_TO_OFFSET( ctr ) ); 231 231 debugOutput ( DEBUG_LEVEL_NORMAL, 232 "(%p) Cycle timer prev: %011 llu(%03us %04ucy %04uticks)\n",232 "(%p) Cycle timer prev: %011"PRIu64" (%03us %04ucy %04uticks)\n", 233 233 this, ctr_prev, 234 234 (unsigned int)TICKS_TO_SECS( ctr_prev ), … … 238 238 diff = diffTicks(ctr_dll, ctr_dll_prev); 239 239 if (diff < 0) { 240 debugWarning("(%p) Alert, non-monotonic ctr (dll): % llu - %llu = %lld\n",240 debugWarning("(%p) Alert, non-monotonic ctr (dll): %"PRId64" - %"PRId64" = %"PRId64"\n", 241 241 this, ctr_dll, ctr_dll_prev, diff); 242 242 debugOutput ( DEBUG_LEVEL_NORMAL, 243 "(%p) Cycle timer now : %011 llu(%03us %04ucy %04uticks)\n",243 "(%p) Cycle timer now : %011"PRIu64" (%03us %04ucy %04uticks)\n", 244 244 this, ctr_dll, 245 245 (unsigned int)TICKS_TO_SECS( ctr_dll ), … … 247 247 (unsigned int)TICKS_TO_OFFSET( ctr_dll ) ); 248 248 debugOutput ( DEBUG_LEVEL_NORMAL, 249 "(%p) Cycle timer prev: %011 llu(%03us %04ucy %04uticks)\n",249 "(%p) Cycle timer prev: %011"PRIu64" (%03us %04ucy %04uticks)\n", 250 250 this, ctr_dll_prev, 251 251 (unsigned int)TICKS_TO_SECS( ctr_dll_prev ), … … 268 268 (unsigned int)CYCLE_TIMER_GET_OFFSET( tmp_orig ) ); 269 269 debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, 270 "(%p) TICKS: %011 llu(%03us %04ucy %04uticks)\n",270 "(%p) TICKS: %011"PRIu32" (%03us %04ucy %04uticks)\n", 271 271 this, tmp_ticks, 272 272 (unsigned int)TICKS_TO_SECS( tmp_ticks ), trunk/libffado/tests/test-scs.cpp
r1595 r1763 325 325 virtual void operator() (byte_t *buff, size_t len) { 326 326 if (m_ready) { 327 debugOutput(DEBUG_LEVEL_NORMAL, "got message len % d\n", len);327 debugOutput(DEBUG_LEVEL_NORMAL, "got message len %zd\n", len); 328 328 329 329 for (size_t s=0; s < len; s++) { trunk/libffado/tests/test-timestampedbuffer.cpp
r1146 r1763 346 346 347 347 if (timestamp != ts_head) { 348 debugError(" cycle %4u error: %011 llu != %011llu\n",349 timestamp, ts_head);350 348 debugError(" cycle %4u error: %011"PRIu64" != %011"PRIu64"\n", 349 cycle, timestamp, ts_head); 350 pass=false; 351 351 } 352 352 … … 418 418 } 419 419 420 debugOutput(DEBUG_LEVEL_NORMAL, "Simulating cycle %d @ time=%011llu, diff=%lld\n",cycle,time,diff); 421 422 if(diff>0) { 420 debugOutput(DEBUG_LEVEL_NORMAL, 421 "Simulating cycle %d @ time=%011"PRIu64", diff=%"PRId64"\n", 422 cycle, time, diff); 423 424 if(diff > 0) { 423 425 ffado_timestamp_t ts_head_tmp, ts_tail_tmp; 424 426 uint64_t ts_head, ts_tail; … … 434 436 ts_tail=(uint64_t)ts_tail_tmp; 435 437 debugOutput(DEBUG_LEVEL_NORMAL, 436 " TS after write: HEAD: %011 llu, FC=%04u\n",438 " TS after write: HEAD: %011"PRIu64", FC=%04u\n", 437 439 ts_head,fc_head); 438 440 debugOutput(DEBUG_LEVEL_NORMAL, 439 " TAIL: %011 llu, FC=%04u\n",441 " TAIL: %011"PRIu64", FC=%04u\n", 440 442 ts_tail,fc_tail); 441 443 … … 449 451 ts_tail=(uint64_t)ts_tail_tmp; 450 452 debugOutput(DEBUG_LEVEL_NORMAL, 451 " TS after write: HEAD: %011 llu, FC=%04u\n",453 " TS after write: HEAD: %011"PRIu64", FC=%04u\n", 452 454 ts_head,fc_head); 453 455 debugOutput(DEBUG_LEVEL_NORMAL, 454 " TAIL: %011 llu, FC=%04u\n",456 " TAIL: %011"PRIu64", FC=%04u\n", 455 457 ts_tail,fc_tail); 456 458 … … 523 525 } 524 526 525 debugOutput(DEBUG_LEVEL_NORMAL, "Simulating cycle %d @ time=%011llu, diff=%lld\n",cycle,time,diff); 527 debugOutput(DEBUG_LEVEL_NORMAL, 528 "Simulating cycle %d @ time=%011"PRIu64", diff=%"PRId64"\n", 529 cycle, time, diff); 526 530 527 531 if(diff>0) { … … 539 543 ts_tail=(uint64_t)ts_tail_tmp; 540 544 debugOutput(DEBUG_LEVEL_NORMAL, 541 " TS after write: HEAD: %011 llu, FC=%04u\n",545 " TS after write: HEAD: %011"PRIu64", FC=%04u\n", 542 546 ts_head,fc_head); 543 547 debugOutput(DEBUG_LEVEL_NORMAL, 544 " TAIL: %011 llu, FC=%04u\n",548 " TAIL: %011"PRIu64", FC=%04u\n", 545 549 ts_tail,fc_tail); 546 550 … … 557 561 ts_tail=(uint64_t)ts_tail_tmp; 558 562 debugOutput(DEBUG_LEVEL_NORMAL, 559 " TS after read: HEAD: %011 llu, FC=%04u\n",563 " TS after read: HEAD: %011"PRIu64", FC=%04u\n", 560 564 ts_head,fc_head); 561 565 debugOutput(DEBUG_LEVEL_NORMAL, 562 " TAIL: %011 llu, FC=%04u\n",566 " TAIL: %011"PRIu64", FC=%04u\n", 563 567 ts_tail,fc_tail); 564 568 }