Changeset 1763

Show
Ignore:
Timestamp:
12/19/09 08:12:53 (11 years ago)
Author:
ppalmers
Message:

Merged revisions 1536,1541,1544-1546,1549,1554-1562,1571,1579-1581,1618,1632,1634-1635,1661,1677-1679,1703-1704,1715,1720-1723,1743-1745,1755 via svnmerge from
svn+ssh://ffadosvn@ffado.org/ffado/branches/libffado-2.0

Also fix remaining format string warnings.

Files:

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
  • trunk/libffado/config.h.in

    r1673 r1763  
    117117// more robust. It should be noted though that shifting the transfer 
    118118// 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 
    120121#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 
    121126 
    122127// causes the waitForPeriod() call to wait until sufficient 
  • trunk/libffado/SConstruct

    r1747 r1763  
    2424# 
    2525 
    26 FFADO_API_VERSION="8" 
     26FFADO_API_VERSION = "8" 
    2727FFADO_VERSION="2.999.0" 
    2828 
     
    3333import distutils.sysconfig 
    3434 
    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_base 
    41 else: 
    42         build_base='' 
    43  
    4435if not os.path.isdir( "cache" ): 
    4536        os.makedirs( "cache" ) 
    4637 
    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", "") 
     38opts = Options( "cache/options.cache" ) 
    5239 
    5340opts.AddOptions( 
     
    138125 
    139126# make sure the necessary dirs exist 
    140 if not os.path.isdir( "cache/" + build_base ): 
    141     os.makedirs( "cache/" + build_base
     127if not os.path.isdir( "cache" ): 
     128       os.makedirs( "cache"
    142129if not os.path.isdir( 'cache/objects' ): 
    143130    os.makedirs( 'cache/objects' ) 
     
    145132CacheDir( 'cache/objects' ) 
    146133 
    147 opts.Save( 'cache/' + build_base + "options.cache", env ) 
     134opts.Save( 'cache/options.cache', env ) 
    148135 
    149136def ConfigGuess( context ): 
     
    200187conf = Configure( env, 
    201188    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' ) 
    204191 
    205192if env['SERIALIZE_USE_EXPAT']: 
     
    365352    env['BUILD_STATIC_LIB'] = True 
    366353 
    367 if build_base: 
    368     env['build_base']="#/"+build_base 
    369 else: 
    370     env['build_base']="#/" 
     354env['build_base']="#/" 
    371355 
    372356# 
     
    529513    env['REVISION'] = '' 
    530514 
    531 env['FFADO_API_VERSION']=FFADO_API_VERSION 
     515# avoid the 1.999.41- type of version for exported versions 
     516if env['REVISION'] != '': 
     517        env['REVISIONSTRING'] = '-' + env['REVISION'] 
     518else: 
     519        env['REVISIONSTRING'] = '' 
     520 
     521env['FFADO_API_VERSION'] = FFADO_API_VERSION 
    532522 
    533523env['PACKAGE'] = "libffado" 
     
    557547# ensure that the config.h is updated 
    558548env.Depends( "config.h", "SConstruct" ) 
    559 env.Depends( "config.h", 'cache/' + build_base + "options.cache"
     549env.Depends( "config.h", 'cache/options.cache'
    560550 
    561551# update version.h whenever the version or SVN revision changes 
     
    573563    subdirs.append('tests') 
    574564 
    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" ) 
     565env.SConscript( dirs=subdirs, exports="env" ) 
    583566 
    584567if 'debian' in COMMAND_LINE_TARGETS: 
  • trunk/libffado/src/bebob/bebob_avdevice.cpp

    r1543 r1763  
    724724 
    725725    char* configId; 
    726     asprintf(&configId, "%016llx", getConfigurationId() ); 
     726    asprintf(&configId, "%016"PRIx64"", getConfigurationId() ); 
    727727    if ( !configId ) { 
    728728        debugError( "could not create id string\n" ); 
     
    800800    // come up with an unique file name for the current settings 
    801801    char* configId; 
    802     asprintf(&configId, "%016llx", BeBoB::Device::getConfigurationId() ); 
     802    asprintf(&configId, "%016"PRIx64"", BeBoB::Device::getConfigurationId() ); 
    803803    if ( !configId ) { 
    804804        debugError( "Could not create id string\n" ); 
  • trunk/libffado/src/bebob/bebob_avplug.cpp

    r1245 r1763  
    583583        { 
    584584            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", 
    586586                        infoType->m_plugOutput->m_nrOfOutputPlugs, 
    587587                        infoType->m_plugOutput->m_outputPlugAddresses.size()); 
  • trunk/libffado/src/bebob/bebob_dl_bcd.cpp

    r864 r1763  
    154154    bytes_read = fread( &m_bcd_version, 1, sizeof( fb_quadlet_t ), m_file ); 
    155155    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", 
    157157                    sizeof( fb_quadlet_t ), 
    158158                    BCDFileVersionOffset ); 
     
    245245    size_t bytes_read = std::fread( q, 1, sizeof( *q ), m_file ); 
    246246    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", 
    248248                    sizeof( *q ),  addr ); 
    249249        return false; 
     
    263263    size_t bytes_read = std::fread( o, 1, sizeof( *o ), m_file ); 
    264264    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", 
    266266                    sizeof( *o ), addr ); 
    267267        return false; 
     
    281281    size_t bytes_read = std::fread( b, 1, len, m_file ); 
    282282    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", 
    284284                    len, addr ); 
    285285        return false; 
  • trunk/libffado/src/bebob/bebob_dl_mgr.cpp

    r1336 r1763  
    165165 
    166166    return false; 
     167} 
     168 
     169std::string 
     170BeBoB::BootloaderManager::getSoftwareDate() 
     171{ 
     172    return makeDate( m_cachedInfoRegs.m_softwareDate ); 
     173} 
     174 
     175std::string 
     176BeBoB::BootloaderManager::getSoftwareTime() 
     177{ 
     178    return makeDate( m_cachedInfoRegs.m_softwareTime ); 
    167179} 
    168180 
  • trunk/libffado/src/bebob/bebob_dl_mgr.h

    r932 r1763  
    6767        bool setStartBootloader( bool bStartBootloader ) 
    6868            { m_bStartBootloader = bStartBootloader; return true; } 
     69 
     70        int getSoftwareVersion() {return m_cachedInfoRegs.m_softwareVersion;}; 
     71        std::string getSoftwareDate(); 
     72        std::string getSoftwareTime(); 
     73 
    6974        protected: 
    7075        enum EObjectType { 
  • trunk/libffado/src/bebob/focusrite/focusrite_generic.cpp

    r1543 r1763  
    5858FocusriteDevice::setSpecificValue(uint32_t id, uint32_t v) 
    5959{ 
    60     debugOutput(DEBUG_LEVEL_VERBOSE, "Writing parameter address space id 0x%08lX (%u), data: 0x%08lX\n", 
     60    debugOutput(DEBUG_LEVEL_VERBOSE, "Writing parameter address space id 0x%08X (%u), data: 0x%08X\n", 
    6161        id, id, v); 
    6262    bool use_avc = false; 
     
    6969    if(m_cmd_time_interval && (m_earliest_next_cmd_time > now)) { 
    7070        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 ); 
    7272        Util::SystemTimeSource::SleepUsecRelative(wait); 
    7373    } 
     
    9494    if(m_cmd_time_interval && (m_earliest_next_cmd_time > now)) { 
    9595        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 ); 
    9797        Util::SystemTimeSource::SleepUsecRelative(wait); 
    9898    } 
     
    105105        retval = getSpecificValueARM(id, v); 
    106106    } 
    107     debugOutput(DEBUG_LEVEL_VERBOSE,"Read parameter address space id 0x%08lX (%u): %08lX\n", id, id, *v); 
     107    debugOutput(DEBUG_LEVEL_VERBOSE,"Read parameter address space id 0x%08X (%u): %08X\n", id, id, *v); 
    108108    return retval; 
    109109} 
     
    161161FocusriteDevice::setSpecificValueARM(uint32_t id, uint32_t v) 
    162162{ 
    163     fb_quadlet_t data=v; 
    164     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing parameter address space id 0x%08lX (%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", 
    165165        id, id, data); 
    166166 
     
    169169 
    170170    if(!get1394Service().write_quadlet( nodeId, addr, CondSwapToBus32(data) ) ) { 
    171         debugError("Could not write to node 0x%04X addr 0x%012X\n", nodeId, addr); 
     171        debugError("Could not write to node 0x%04X addr 0x%012"PRIX64"\n", nodeId, addr); 
    172172        return false; 
    173173    } 
     
    179179{ 
    180180    fb_quadlet_t result; 
    181     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading parameter address space id 0x%08lX\n", id); 
     181    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading parameter address space id 0x%08X\n", id); 
    182182 
    183183    fb_nodeaddr_t addr = FR_PARAM_SPACE_START + (id * 4); 
     
    185185 
    186186    if(!get1394Service().read_quadlet( nodeId, addr, &result ) ) { 
    187         debugError("Could not read from node 0x%04llX addr 0x%012llX\n", nodeId, addr); 
    188         return false; 
    189     } 
    190  
    191     result=CondSwapFromBus32(result); 
    192     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Read result: 0x%08llX\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); 
    193193 
    194194    *v = result; 
     
    385385RegisterControl::setValue(uint64_t addr, uint64_t v) 
    386386{ 
    387     debugOutput(DEBUG_LEVEL_VERBOSE, "setValue for addr %llu to %llu\n", 
     387    debugOutput(DEBUG_LEVEL_VERBOSE, "setValue for addr %"PRIu64" to %"PRIu64"\n", 
    388388                                     addr, v); 
    389389 
     
    403403        return 0; 
    404404    } else { 
    405         debugOutput(DEBUG_LEVEL_VERBOSE, "getValue for %llu = %lu\n",  
     405        debugOutput(DEBUG_LEVEL_VERBOSE, "getValue for %"PRIu64" = %u\n",  
    406406                                         addr, val); 
    407407        return val; 
     
    576576    struct sCellInfo c = m_CellInfo.at(row).at(col); 
    577577 
    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",  
    579579                                     c.address, row, col, val, v); 
    580580 
     
    597597        return 0; 
    598598    } 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",  
    600600                                         c.address, row, col, val); 
    601601        return val; 
  • trunk/libffado/src/bebob/focusrite/focusrite_saffire.cpp

    r1617 r1763  
    4848    if(config.getValueForDeviceSetting(getConfigRom().getNodeVendorId(), getConfigRom().getModelId(), "cmd_interval_time", delaytime)) { 
    4949        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", 
    5151                     m_cmd_time_interval ); 
    5252    } else { 
    5353        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", 
    5555                     m_cmd_time_interval ); 
    5656    } 
  • trunk/libffado/src/bebob/focusrite/focusrite_saffirepro.cpp

    r1617 r1763  
    423423        return; 
    424424    } 
    425     debugOutput(DEBUG_LEVEL_VERBOSE, "SYNC_CONFIG field value: %08lX\n", sync ); 
     425    debugOutput(DEBUG_LEVEL_VERBOSE, "SYNC_CONFIG field value: %08X\n", sync ); 
    426426 
    427427    switch(sync & FR_SAFFIREPRO_CMD_ID_SYNC_CONFIG_MASK) { 
    428428        default: 
    429             debugWarning( "Unexpected SYNC_CONFIG field value: %08lX\n", sync ); 
     429            debugWarning( "Unexpected SYNC_CONFIG field value: %08X\n", sync ); 
    430430        case FR_SAFFIREPRO_CMD_SYNC_CONFIG_INTERNAL: 
    431431            m_internal_clocksource.active=true; 
     
    466466            break; 
    467467        default: 
    468             debugWarning( "Unexpected SYNC_CONFIG_STATE field value: %08lX\n", sync ); 
     468            debugWarning( "Unexpected SYNC_CONFIG_STATE field value: %08X\n", sync ); 
    469469    } 
    470470} 
     
    772772                break; 
    773773            } 
    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); 
    775775        } 
    776776 
     
    872872    } 
    873873 
    874     debugOutput( DEBUG_LEVEL_VERBOSE, 
    875                      "getCount32: %08lX\n", v ); 
     874    debugOutput( DEBUG_LEVEL_VERBOSE, "getCount32: %08X\n", v ); 
    876875    return v; 
    877876} 
  • trunk/libffado/src/bebob/terratec/terratec_device.cpp

    r1543 r1763  
    2323 
    2424#include "terratec_device.h" 
     25#include "src/bebob/bebob_dl_mgr.h" 
     26#include "src/bebob/bebob_dl_bcd.h" 
    2527 
    2628namespace BeBoB { 
     
    4547    BeBoB::Device::showDevice(); 
    4648} 
    47 /*                'externalsync': ['/Mixer/Selector_8', self.comboExtSync],  
    48                 'syncsource':   ['/Mixer/Selector_9', self.comboSyncSource], */ 
     49 
     50bool 
     51Phase88Device::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 
    4962void 
    5063Phase88Device::updateClockSources() { 
  • trunk/libffado/src/bebob/terratec/terratec_device.h

    r1543 r1763  
    3737    virtual ~Phase88Device(); 
    3838 
     39    virtual bool discover(); 
     40 
    3941    virtual void showDevice(); 
    4042 
  • trunk/libffado/src/debugmodule/debugmodule.cpp

    r1713 r1763  
    185185    int chars_written=0; 
    186186    int retval=0; 
    187     retval = snprintf(msg, MB_BUFFERSIZE, "%011llu: %s (%s)[%4d] %s: ",  
     187    retval = snprintf(msg, MB_BUFFERSIZE, "%011"PRIu64": %s (%s)[%4u] %s: ",  
    188188                      ts_usec, getPreSequence( level ), 
    189189                      fname,  line,  function ); 
  • trunk/libffado/src/debugmodule/debugmodule.h

    r1568 r1763  
    302302    void printShort( debug_level_t level, 
    303303                     const char* format, 
    304                      ... ) const; 
     304                     ... ) const 
     305#ifdef __GNUC__ 
     306            __attribute__((format(printf, 3, 4))) 
     307#endif 
     308            ; 
    305309 
    306310    void print( debug_level_t level, 
     
    309313                unsigned int  line, 
    310314                const char*   format, 
    311                 ... ) const; 
     315                ... ) const 
     316#ifdef __GNUC__ 
     317            __attribute__((format(printf, 6, 7))) 
     318#endif 
     319            ; 
    312320 
    313321    bool setLevel( debug_level_t level ) 
  • trunk/libffado/src/devicemanager.cpp

    r1543 r1763  
    120120    { 
    121121        if (!deleteElement(*it)) { 
    122             debugWarning("failed to remove AvDevice from Control::Container\n"); 
     122            debugWarning("failed to remove Device from Control::Container\n"); 
    123123        } 
    124124        delete *it; 
     
    439439                // the device has disappeared, remove it from the control tree 
    440440                if (!deleteElement(*it)) { 
    441                     debugWarning("failed to remove AvDevice from Control::Container\n"); 
     441                    debugWarning("failed to remove Device from Control::Container\n"); 
    442442                } 
    443443                // delete the device 
     
    455455        { 
    456456            if (!deleteElement(*it)) { 
    457                 debugWarning("failed to remove AvDevice from Control::Container\n"); 
     457                debugWarning("failed to remove Device from Control::Container\n"); 
    458458            } 
    459459            delete *it; 
     
    542542        { 
    543543            if (!deleteElement(*it2)) { 
    544                 debugWarning("failed to remove AvDevice from Control::Container\n"); 
     544                debugWarning("failed to remove Device from Control::Container\n"); 
    545545            } 
    546546            delete *it2; 
     
    652652 
    653653                    if (!addElement(avDevice)) { 
    654                         debugWarning("failed to add AvDevice to Control::Container\n"); 
     654                        debugWarning("failed to add Device to Control::Container\n"); 
    655655                    } 
    656656 
     
    670670        // a device id always corresponds to the same device 
    671671        sort(m_avDevices.begin(), m_avDevices.end(), FFADODevice::compareGUID); 
     672 
    672673        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; 
    673709        for ( FFADODeviceVectorIterator it = m_avDevices.begin(); 
    674710            it != m_avDevices.end(); 
     
    710746        { 
    711747            if (!deleteElement(*it)) { 
    712                 debugWarning("failed to remove AvDevice from Control::Container\n"); 
     748                debugWarning("failed to remove Device from Control::Container\n"); 
    713749            } 
    714750            delete *it; 
     
    827863 
    828864bool 
     865DeviceManager::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 
     901bool 
    829902DeviceManager::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 
     951bool 
     952DeviceManager::resetStreaming() { 
     953    return true; 
     954} 
     955 
     956bool 
     957DeviceManager::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 
     980bool 
     981DeviceManager::stopStreaming() 
     982{ 
     983    bool result = true; 
     984    m_processorManager->stop(); 
     985 
    830986    // create the connections for all devices 
    831987    // iterate over the found devices 
     
    835991        ++it ) 
    836992    { 
    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); 
    899994    } 
    900995    return result; 
  • trunk/libffado/src/devicemanager.h

    r1336 r1763  
    9090    bool prepareStreaming(); 
    9191    bool finishStreaming(); 
     92    bool startStreamingOnDevice(FFADODevice *device); 
    9293    bool startStreaming(); 
     94    bool stopStreamingOnDevice(FFADODevice *device); 
    9395    bool stopStreaming(); 
    9496    bool resetStreaming(); 
  • trunk/libffado/src/DeviceStringParser.cpp

    r1147 r1763  
    160160DeviceStringParser::DeviceString::match(ConfigRom& configRom) 
    161161{ 
    162     debugOutput(DEBUG_LEVEL_VERBOSE, "match %p\n", &configRom); 
     162    debugOutput(DEBUG_LEVEL_VERBOSE, "match %p (%s)\n", &configRom, configRom.getGuidString().c_str()); 
    163163    bool match; 
    164164    switch(m_Type) { 
     
    172172                match &= ((configRom.getNodeId() & 0x3F) == m_node); 
    173173            } 
     174            if(match) { 
     175                debugOutput(DEBUG_LEVEL_VERBOSE, "(eBusNode) device matches device string %s\n", m_String.c_str()); 
     176            } 
    174177            return match; 
    175178        case eGUID: 
    176179            //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; 
    178185        case eInvalid: 
    179186        default: 
    180             debugOutput(DEBUG_LEVEL_VERBOSE, "no match %p\n", &configRom); 
     187            debugError("invalid DeviceString type (%d)\n", m_Type); 
    181188            return false; 
    182189    } 
     
    196203        case eGUID: 
    197204            retval = m_guid && (m_guid == x.m_guid); 
    198             debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "eGUID 0x%016X == 0x%016X? %d\n", 
     205            debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "eGUID 0x%016"PRIX64" == 0x%016"PRIX64"? %d\n", 
    199206                        m_guid, x.m_guid, retval); 
    200207            return retval; 
     
    218225        case eGUID: 
    219226            debugOutput(DEBUG_LEVEL_INFO, "type: eGUID\n"); 
    220             debugOutput(DEBUG_LEVEL_INFO, " GUID: %016LLX\n", m_guid); 
     227            debugOutput(DEBUG_LEVEL_INFO, " GUID: %016"PRIX64"\n", m_guid); 
    221228            break; 
    222229        case eInvalid: 
     
    282289DeviceStringParser::match(ConfigRom& c) 
    283290{ 
     291    return matchPosition(c) != -1; 
     292} 
     293 
     294int 
     295DeviceStringParser::matchPosition(ConfigRom& c) 
     296{ 
     297    int pos = 0; 
    284298    for ( DeviceStringVectorIterator it = m_DeviceStrings.begin(); 
    285299      it != m_DeviceStrings.end(); 
     
    287301    { 
    288302        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 
    294310bool 
    295311DeviceStringParser::addDeviceString(DeviceString *o) 
     
    370386} 
    371387 
    372  
    373388void 
    374389DeviceStringParser::show() 
  • trunk/libffado/src/DeviceStringParser.h

    r1568 r1763  
    7575 
    7676    bool match(ConfigRom &); 
     77    int matchPosition(ConfigRom& c); 
    7778 
    7879    bool parseString(std::string s); 
  • trunk/libffado/src/dice/dice_avdevice.cpp

    r1727 r1763  
    376376    readGlobalReg(DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, &clock_caps); 
    377377    uint16_t clocks_supported = (clock_caps >> 16) & 0xFFFF; 
    378     debugOutput(DEBUG_LEVEL_VERBOSE," Clock caps: 0x%08X, supported=0x%04X\n", 
     378    debugOutput(DEBUG_LEVEL_VERBOSE," Clock caps: 0x%08"PRIX32", supported=0x%04X\n", 
    379379                                    clock_caps, clocks_supported); 
    380380 
     
    382382    readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &clock_select); 
    383383    byte_t clock_selected = (clock_select) & 0xFF; 
    384     debugOutput(DEBUG_LEVEL_VERBOSE," Clock select: 0x%08X, selected=0x%04X\n", 
     384    debugOutput(DEBUG_LEVEL_VERBOSE," Clock select: 0x%08"PRIX32", selected=0x%04X\n", 
    385385                                    clock_select, clock_selected); 
    386386    quadlet_t extended_status; 
     
    389389    uint16_t clock_status = (extended_status) & 0xFFFF; 
    390390    uint16_t clock_slipping = (extended_status >> 16) & 0xFFFF; 
    391     debugOutput(DEBUG_LEVEL_VERBOSE," Clock status: 0x%08X, status=0x%04X, slip=0x%04X\n", 
     391    debugOutput(DEBUG_LEVEL_VERBOSE," Clock status: 0x%08"PRIX32", status=0x%04X, slip=0x%04X\n", 
    392392                                    extended_status, clock_status, clock_slipping); 
    393393    #endif 
     
    540540    readGlobalReg(DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, &clock_caps); 
    541541    uint16_t clocks_supported = (clock_caps >> 16) & 0xFFFF; 
    542     debugOutput(DEBUG_LEVEL_VERBOSE," Clock caps: 0x%08X, supported=0x%04X\n", 
     542    debugOutput(DEBUG_LEVEL_VERBOSE," Clock caps: 0x%08"PRIX32", supported=0x%04X\n", 
    543543                                    clock_caps, clocks_supported); 
    544544 
     
    546546    readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &clock_select); 
    547547    byte_t id = (clock_select) & 0xFF; 
    548     debugOutput(DEBUG_LEVEL_VERBOSE," Clock select: 0x%08X, selected=0x%04X\n", 
     548    debugOutput(DEBUG_LEVEL_VERBOSE," Clock select: 0x%08"PRIX32", selected=0x%04X\n", 
    549549                                    clock_select, id); 
    550550    quadlet_t extended_status; 
     
    553553    uint16_t clock_status = (extended_status) & 0xFFFF; 
    554554    uint16_t clock_slipping = (extended_status >> 16) & 0xFFFF; 
    555     debugOutput(DEBUG_LEVEL_VERBOSE," Clock status: 0x%08X, status=0x%04X, slip=0x%04X\n", 
     555    debugOutput(DEBUG_LEVEL_VERBOSE," Clock status: 0x%08"PRIX32", status=0x%04X, slip=0x%04X\n", 
    556556                                    extended_status, clock_status, clock_slipping); 
    557557    #endif 
     
    610610 
    611611    readGlobalRegBlock(DICE_REGISTER_GLOBAL_OWNER, reinterpret_cast<fb_quadlet_t *>(&tmp_octlet), sizeof(fb_octlet_t)); 
    612     debugOutput(DEBUG_LEVEL_VERBOSE,"  Owner            : 0x%016X\n",tmp_octlet); 
     612    debugOutput(DEBUG_LEVEL_VERBOSE,"  Owner            : 0x%016"PRIX64"\n",tmp_octlet); 
    613613 
    614614    readGlobalReg(DICE_REGISTER_GLOBAL_NOTIFICATION, &tmp_quadlet); 
    615     debugOutput(DEBUG_LEVEL_VERBOSE,"  Notification     : 0x%08X\n",tmp_quadlet); 
     615    debugOutput(DEBUG_LEVEL_VERBOSE,"  Notification     : 0x%08"PRIX32"\n",tmp_quadlet); 
    616616 
    617617    readGlobalReg(DICE_REGISTER_GLOBAL_NOTIFICATION, &tmp_quadlet); 
     
    631631 
    632632    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); 
    634634 
    635635    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); 
    637637 
    638638    readGlobalRegBlock(DICE_REGISTER_GLOBAL_VERSION, reinterpret_cast<fb_quadlet_t *>(&tmp_quadlet), sizeof(fb_quadlet_t)); 
    639     debugOutput(DEBUG_LEVEL_NORMAL,"  Version          : 0x%08X\n", tmp_quadlet); 
     639    debugOutput(DEBUG_LEVEL_NORMAL,"  Version          : 0x%08"PRIX32"\n", tmp_quadlet); 
    640640     
    641641    readGlobalReg(DICE_REGISTER_GLOBAL_VERSION, &tmp_quadlet); 
    642     debugOutput(DEBUG_LEVEL_NORMAL,"  Version          : 0x%08X (%u.%u.%u.%u)\n", 
     642    debugOutput(DEBUG_LEVEL_NORMAL,"  Version          : 0x%08"PRIX32" (%u.%u.%u.%u)\n", 
    643643        tmp_quadlet, 
    644644        DICE_DRIVER_SPEC_VERSION_NUMBER_GET_A(tmp_quadlet), 
     
    649649 
    650650    readGlobalReg(DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, &tmp_quadlet); 
    651     debugOutput(DEBUG_LEVEL_VERBOSE,"  Clock caps       : 0x%08X\n",tmp_quadlet); 
     651    debugOutput(DEBUG_LEVEL_VERBOSE,"  Clock caps       : 0x%08"PRIX32"\n", tmp_quadlet); 
    652652 
    653653    diceNameVector names=getClockSourceNameString(); 
     
    677677 
    678678        readTxReg(i, DICE_REGISTER_TX_AC3_CAPABILITIES_BASE, &tmp_quadlet); 
    679         debugOutput(DEBUG_LEVEL_VERBOSE,"   AC3 caps          : 0x%08X\n", tmp_quadlet); 
     679        debugOutput(DEBUG_LEVEL_VERBOSE,"   AC3 caps          : 0x%08"PRIX32"\n", tmp_quadlet); 
    680680        readTxReg(i, DICE_REGISTER_TX_AC3_ENABLE_BASE, &tmp_quadlet); 
    681         debugOutput(DEBUG_LEVEL_VERBOSE,"   AC3 enable        : 0x%08X\n", tmp_quadlet); 
     681        debugOutput(DEBUG_LEVEL_VERBOSE,"   AC3 enable        : 0x%08"PRIX32"\n", tmp_quadlet); 
    682682 
    683683        diceNameVector channel_names=getTxNameString(i); 
     
    707707 
    708708        readTxReg(i, DICE_REGISTER_RX_AC3_CAPABILITIES_BASE, &tmp_quadlet); 
    709         debugOutput(DEBUG_LEVEL_VERBOSE,"   AC3 caps          : 0x%08X\n", tmp_quadlet); 
     709        debugOutput(DEBUG_LEVEL_VERBOSE,"   AC3 caps          : 0x%08"PRIX32"\n", tmp_quadlet); 
    710710        readTxReg(i, DICE_REGISTER_RX_AC3_ENABLE_BASE, &tmp_quadlet); 
    711         debugOutput(DEBUG_LEVEL_VERBOSE,"   AC3 enable        : 0x%08X\n", tmp_quadlet); 
     711        debugOutput(DEBUG_LEVEL_VERBOSE,"   AC3 enable        : 0x%08"PRIX32"\n", tmp_quadlet); 
    712712 
    713713        diceNameVector channel_names=getRxNameString(i); 
     
    11321132     
    11331133        if (result != DICE_OWNER_NO_OWNER) { 
    1134             debugWarning("Could not register ourselves as device owner, unexpected register value: 0x%016llX\n", result); 
     1134            debugWarning("Could not register ourselves as device owner, unexpected register value: 0x%016"PRIX64"\n", result); 
    11351135            return false; 
    11361136        } 
     
    12601260            } 
    12611261            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); 
    12631265            p->setChannel(isochannel); 
    12641266        } else { 
     
    12661268            int isochannel = allocateIsoChannel(p->getMaxPacketSize()); 
    12671269            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); 
    12691271                return false; 
    12701272            } 
    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); 
    12721276            p->setChannel(isochannel); 
    12731277     
     
    12811285            } 
    12821286            if(reg_isoch != 0xFFFFFFFFUL) { 
    1283                 debugError("ISO_CHANNEL register != 0xFFFFFFFF (=0x%08X) for ATX %d\n", reg_isoch, n); 
     1287                debugError("ISO_CHANNEL register != 0xFFFFFFFF (=0x%08"PRIX32") for ATX %d\n", reg_isoch, n); 
    12841288                p->setChannel(-1); 
    12851289                deallocateIsoChannel(isochannel); 
     
    13111315            } 
    13121316            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); 
    13141318            p->setChannel(isochannel); 
    13151319        } else { 
     
    13201324                return false; 
    13211325            } 
    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); 
    13231327            p->setChannel(isochannel); 
    13241328     
     
    13321336            } 
    13331337            if(reg_isoch != 0xFFFFFFFFUL) { 
    1334                 debugError("ISO_CHANNEL register != 0xFFFFFFFF (=0x%08X) for ARX %d\n", reg_isoch, n); 
     1338                debugError("ISO_CHANNEL register != 0xFFFFFFFF (=0x%08"PRIX32") for ARX %d\n", reg_isoch, n); 
    13351339                p->setChannel(-1); 
    13361340                deallocateIsoChannel(isochannel); 
     
    13811385            } 
    13821386            if(reg_isoch != isochannel) { 
    1383                 debugError("ISO_CHANNEL register != 0x%08X (=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); 
    13841388                return false; 
    13851389            } 
     
    14171421            } 
    14181422            if(reg_isoch != isochannel) { 
    1419                 debugError("ISO_CHANNEL register != 0x%08X (=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); 
    14201424                return false; 
    14211425            } 
     
    17341738bool 
    17351739Device::readReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 
    1736     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX\n", offset); 
     1740    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08"PRIX64"\n", offset); 
    17371741 
    17381742    if(offset >= DICE_INVALID_OFFSET) { 
    1739         debugError("invalid offset: 0x%016llX\n", offset); 
     1743        debugError("invalid offset: 0x%016"PRIX64"\n", offset); 
    17401744        return false; 
    17411745    } 
     
    17451749 
    17461750    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); 
    17481752        return false; 
    17491753    } 
     
    17511755    *result = CondSwapFromBus32(*result); 
    17521756 
    1753     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Read result: 0x%08X\n", *result); 
     1757    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Read result: 0x%08"PRIX32"\n", *result); 
    17541758 
    17551759    return true; 
     
    17581762bool 
    17591763Device::writeReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 
    1760     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, data: 0x%08X\n", 
     1764    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08"PRIX64", data: 0x%08"PRIX32"\n", 
    17611765        offset, data); 
    17621766 
    17631767    if(offset >= DICE_INVALID_OFFSET) { 
    1764         debugError("invalid offset: 0x%016llX\n", offset); 
     1768        debugError("invalid offset: 0x%012"PRIX64"\n", offset); 
    17651769        return false; 
    17661770    } 
     
    17701774 
    17711775    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); 
    17731777        return false; 
    17741778    } 
     
    17781782bool 
    17791783Device::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); 
    17821787    const int blocksize_quads = 512/4; 
    17831788 
    17841789    if(offset >= DICE_INVALID_OFFSET) { 
    1785         debugError("invalid offset: 0x%016llX\n", offset); 
     1790        debugError("invalid offset: 0x%012"PRIX64"\n", offset); 
    17861791        return false; 
    17871792    } 
     
    17961801        fb_quadlet_t *curr_data = data + quads_done; 
    17971802        int quads_todo = length_quads - quads_done; 
    1798         debugOutput(DEBUG_LEVEL_VERBOSE, "reading addr: 0x%016llX, %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); 
    17991804         
    18001805        if (quads_todo > blocksize_quads) { 
     
    18091814 
    18101815        if(!get1394Service().read( nodeId, curr_addr, quads_todo, curr_data ) ) { 
    1811             debugError("Could not read %d quadlets from node 0x%04X addr 0x%012llX\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); 
    18121817            return false; 
    18131818        } 
     
    18211826bool 
    18221827Device::writeRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    1823     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, length: %u\n", 
     1828    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08"PRIX64", length: %zd\n", 
    18241829        offset, length); 
    18251830    const int blocksize_quads = 512/4; 
    18261831 
    18271832    if(offset >= DICE_INVALID_OFFSET) { 
    1828         debugError("invalid offset: 0x%016llX\n", offset); 
     1833        debugError("invalid offset: 0x%012"PRIX64"\n", offset); 
    18291834        return false; 
    18301835    } 
     
    18531858 
    18541859        if(!get1394Service().write( nodeId, addr, quads_todo, curr_data ) ) { 
    1855             debugError("Could not write %d quadlets to node 0x%04X addr 0x%012llX\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); 
    18561861            return false; 
    18571862        } 
     
    18641869bool 
    18651870Device::readGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 
    1866     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register offset 0x%04llX\n", offset); 
     1871    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register offset 0x%04"PRIX64"\n", offset); 
    18671872 
    18681873    fb_nodeaddr_t offset_gl = globalOffsetGen(offset, sizeof(fb_quadlet_t)); 
     
    18721877bool 
    18731878Device::writeGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 
    1874     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register offset 0x%08llX, data: 0x%08X\n", 
     1879    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register offset 0x%08"PRIX64", data: 0x%08"PRIX32"\n", 
    18751880        offset, data); 
    18761881 
     
    18811886bool 
    18821887Device::readGlobalRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    1883     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register block offset 0x%04llX, length %u bytes\n", 
     1888    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register block offset 0x%04"PRIX64", length %zd bytes\n", 
    18841889        offset, length); 
    18851890 
     
    18901895bool 
    18911896Device::writeGlobalRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    1892     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register block offset 0x%04llX, length %u bytes\n", 
     1897    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register block offset 0x%04"PRIX64", length: %zd bytes\n", 
    18931898        offset, length); 
    18941899 
     
    19081913    // out-of-range check 
    19091914    if(offset+length > m_global_reg_offset+m_global_reg_size) { 
    1910         debugError("register offset+length too large: 0x%0llX\n", offset + length); 
     1915        debugError("register offset+length too large: 0x%04"PRIX64"\n", offset + length); 
    19111916        return DICE_INVALID_OFFSET; 
    19121917    } 
     
    19171922bool 
    19181923Device::readTxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) { 
    1919     debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Reading tx %d register offset 0x%04llX\n", i, offset); 
     1924    debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Reading tx %d register offset 0x%04"PRIX64"\n", i, offset); 
    19201925 
    19211926    fb_nodeaddr_t offset_tx = txOffsetGen(i, offset, sizeof(fb_quadlet_t)); 
     
    19251930bool 
    19261931Device::writeTxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t data) { 
    1927     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing tx %d register offset 0x%08llX, data: 0x%08X\n", 
     1932    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing tx %d register offset 0x%08"PRIX64", data: 0x%08"PRIX32"\n", 
    19281933        i, offset, data); 
    19291934 
     
    19341939bool 
    19351940Device::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%04llX, length %u bytes\n", 
     1941    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04"PRIX64", length: %zd bytes\n", 
    19371942        offset, length); 
    19381943 
     
    19431948bool 
    19441949Device::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%04llX, length %u bytes\n", 
     1950    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04"PRIX64", length: %zd bytes\n", 
    19461951        offset, length); 
    19471952 
     
    19751980    // out-of-range check 
    19761981    if(offset_tx + length > m_tx_reg_offset+4+m_tx_reg_size*m_nb_tx) { 
    1977         debugError("register offset+length too large: 0x%0llX\n", offset_tx + length); 
     1982        debugError("register offset+length too large: 0x%04"PRIX64"\n", offset_tx + length); 
    19781983        return DICE_INVALID_OFFSET; 
    19791984    } 
     
    19841989bool 
    19851990Device::readRxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) { 
    1986     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx %d register offset 0x%04llX\n", i, offset); 
     1991    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx %d register offset 0x%04"PRIX64"\n", i, offset); 
    19871992 
    19881993    fb_nodeaddr_t offset_rx=rxOffsetGen(i, offset, sizeof(fb_quadlet_t)); 
     
    19921997bool 
    19931998Device::writeRxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t data) { 
    1994     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register offset 0x%08llX, data: 0x%08X\n", 
     1999    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register offset 0x%08"PRIX64", data: 0x%08"PRIX32"\n", 
    19952000        offset, data); 
    19962001 
     
    20012006bool 
    20022007Device::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%04llX, length %u bytes\n", 
     2008    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04"PRIX64", length: %zd bytes\n", 
    20042009        offset, length); 
    20052010 
     
    20102015bool 
    20112016Device::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%04llX, length %u bytes\n", 
     2017    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04"PRIX64", length: %zd bytes\n", 
    20132018        offset, length); 
    20142019 
     
    20422047    // out-of-range check 
    20432048    if(offset_rx + length > m_rx_reg_offset+4+m_rx_reg_size*m_nb_rx) { 
    2044         debugError("register offset+length too large: 0x%0llX\n", offset_rx + length); 
     2049        debugError("register offset+length too large: 0x%04"PRIX64"\n", offset_rx + length); 
    20452050        return DICE_INVALID_OFFSET; 
    20462051    } 
  • trunk/libffado/src/dice/dice_eap.cpp

    r1742 r1763  
    676676    // out-of-range check 
    677677    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); 
    679679        return DICE_INVALID_OFFSET; 
    680680    } 
     
    827827        m_input_route_map[i] = rcfg->getRouteForDestination(dest, ch); 
    828828 
    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, 
    830830                                          srcBlockToString(m_input_route_map[i].src), 
    831831                                          m_input_route_map[i].srcChannel); 
     
    19781978        return false; 
    19791979    } 
    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); 
    19811981 
    19821982    if(m_tx_configs) { 
     
    20702070Device::EAP::StreamConfig::showConfigBlock(struct ConfigBlock &b) 
    20712071{ 
    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); 
    20732073    debugOutput(DEBUG_LEVEL_VERBOSE, " AC3 Map       : 0x%08X\n", b.ac3_map); 
    20742074    diceNameVector channel_names  = getNamesForBlock(b); 
  • trunk/libffado/src/fbtypes.h

    r1336 r1763  
    2525#define FBTYPES_H 
    2626 
     27#ifndef __STDC_FORMAT_MACROS 
     28#define __STDC_FORMAT_MACROS 
     29#endif 
     30#include <inttypes.h> 
     31 
    2732#include <libraw1394/raw1394.h> 
    2833 
     
    3540typedef nodeaddr_t  fb_nodeaddr_t; 
    3641 
     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 
    3746class DeviceManager; 
    3847 
  • trunk/libffado/src/fireworks/efc/efc_cmds_flash.cpp

    r1136 r1763  
    6868    EfcCmd::showEfcCmd(); 
    6969    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); 
    7171} 
    7272 
     
    120120    EfcCmd::showEfcCmd(); 
    121121    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); 
    124124    debugOutput(DEBUG_LEVEL_NORMAL, " Data              : \n"); 
    125125    for (unsigned int i=0; i < m_nb_quadlets; i++) { 
     
    174174    EfcCmd::showEfcCmd(); 
    175175    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); 
    178178    debugOutput(DEBUG_LEVEL_NORMAL, " Data              : \n"); 
    179179    for (unsigned int i=0; i < m_nb_quadlets; i++) { 
     
    292292    EfcCmd::showEfcCmd(); 
    293293    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); 
    295295} 
    296296 
  • trunk/libffado/src/fireworks/efc/efc_cmds_hardware.cpp

    r1135 r1763  
    127127    debugOutput(DEBUG_LEVEL_NORMAL, "EFC HW CAPS info:\n"); 
    128128    debugOutput(DEBUG_LEVEL_NORMAL, " Flags   : 0x%08X\n", m_flags); 
    129     debugOutput(DEBUG_LEVEL_NORMAL, " GUID    : %016llX\n", m_guid); 
     129    debugOutput(DEBUG_LEVEL_NORMAL, " GUID    : %016"PRIX64"\n", m_guid); 
    130130    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); 
    132132    debugOutput(DEBUG_LEVEL_NORMAL, " Vendor  : %s\n", m_vendor_name); 
    133133    debugOutput(DEBUG_LEVEL_NORMAL, " Model   : %s\n", m_model_name); 
     
    232232    debugOutput(DEBUG_LEVEL_NORMAL, " # Output Meters : %d\n", m_nb_output_meters); 
    233233    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]); 
    235235    } 
    236236     
    237237    debugOutput(DEBUG_LEVEL_NORMAL, " # Input Meters  : %d\n", m_nb_input_meters); 
    238238    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]); 
    240240    } 
    241241} 
  • trunk/libffado/src/fireworks/efc/efc_cmds_hardware_ctrl.cpp

    r1336 r1763  
    7373    EfcCmd::showEfcCmd(); 
    7474    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); 
    7878} 
    7979 
     
    124124    EfcCmd::showEfcCmd(); 
    125125    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); 
    129129} 
    130130 
  • trunk/libffado/src/fireworks/efc/efc_cmds_ioconfig.cpp

    r1336 r1763  
    162162                                    (m_type==eCT_Get?"GET":"SET"), 
    163163                                    eIOConfigRegisterToString(m_reg)); 
    164     debugOutput(DEBUG_LEVEL_NORMAL, " Value       : %lu\n", m_value); 
     164    debugOutput(DEBUG_LEVEL_NORMAL, " Value       : %u\n", m_value); 
    165165} 
    166166 
  • trunk/libffado/src/fireworks/efc/efc_cmds_mixer.cpp

    r1136 r1763  
    245245                                    eMixerTargetToString(m_target), 
    246246                                    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); 
    249249} 
    250250 
  • trunk/libffado/src/fireworks/efc/efc_cmds_monitor.cpp

    r1136 r1763  
    150150                                    (m_type==eCT_Get?"GET":"SET"), 
    151151                                    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); 
    155155} 
    156156 
  • trunk/libffado/src/fireworks/fireworks_control.cpp

    r1336 r1763  
    321321            break; 
    322322        } 
    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",  
    324324                                            m_Slave->m_channel, val, m_Slave->m_value); 
    325325        return true; 
     
    339339            return 0.0; 
    340340        } 
    341         debugOutput(DEBUG_LEVEL_VERBOSE, "getValue for channel %d = %lf\n",  
     341        debugOutput(DEBUG_LEVEL_VERBOSE, "getValue for channel %d = %u\n",  
    342342                                            m_Slave->m_channel, m_Slave->m_value); 
    343343        return m_Slave->m_value; 
     
    451451        } 
    452452 
    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",  
    454454                                            m_Slave->m_channel, val, old_reg, reg); 
    455455        return true; 
     
    583583            return 0; 
    584584        } 
    585         debugOutput(DEBUG_LEVEL_VERBOSE, "setValue to %ld \n", val); 
     585        debugOutput(DEBUG_LEVEL_VERBOSE, "setValue to %d \n", val); 
    586586        return true; 
    587587    } else { 
  • trunk/libffado/src/fireworks/fireworks_device.cpp

    r1543 r1763  
    4343 
    4444#define ECHO_FLASH_ERASE_TIMEOUT_MILLISECS 2000 
     45#define FIREWORKS_MIN_FIRMWARE_VERSION 0x04080000 
    4546 
    4647#include <sstream> 
     
    136137    // get the info from the EFC 
    137138    if ( !discoverUsingEFC() ) { 
    138         debugError( "Could not discover using EFC\n" ); 
    139139        return false; 
    140140    } 
     
    161161    if (!doEfcOverAVC(m_HwInfo)) { 
    162162        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                    ); 
    163176        return false; 
    164177    } 
     
    547560Device::clockIdToClockSource(uint32_t clockid) { 
    548561    ClockSource s; 
    549     debugOutput(DEBUG_LEVEL_VERBOSE, "clock id: %lu\n", clockid); 
     562    debugOutput(DEBUG_LEVEL_VERBOSE, "clock id: %u\n", clockid); 
    550563 
    551564    // the polled values are used to detect 
     
    611624        return EFC_CMD_HW_CLOCK_UNSPECIFIED; 
    612625    } 
    613     debugOutput(DEBUG_LEVEL_VERBOSE, "Active clock: 0x%08lX\n",gccmd.m_clock); 
     626    debugOutput(DEBUG_LEVEL_VERBOSE, "Active clock: 0x%08X\n",gccmd.m_clock); 
    614627    gccmd.showEfcCmd(); 
    615628 
     
    624637        return false; 
    625638    } 
    626     debugOutput(DEBUG_LEVEL_VERBOSE, "Set clock: 0x%08lX\n", id); 
     639    debugOutput(DEBUG_LEVEL_VERBOSE, "Set clock: 0x%08X\n", id); 
    627640 
    628641    EfcSetClockCmd sccmd; 
  • trunk/libffado/src/fireworks/fireworks_firmware.cpp

    r1336 r1763  
    172172    unsigned int version_minor = (m_version & 0x00FF0000) >> 16; 
    173173    unsigned int version_build = (m_version & 0x0000FFFF); 
    174     debugOutput(DEBUG_LEVEL_NORMAL, " Address Offset       : 0x%08lX\n", m_flash_offset_address); 
    175     debugOutput(DEBUG_LEVEL_NORMAL, " Length (Quadlets)    : 0x%08lX\n", m_length_quads); 
    176     debugOutput(DEBUG_LEVEL_NORMAL, " CRC 32               : 0x%08lX\n", m_CRC32); 
    177     debugOutput(DEBUG_LEVEL_NORMAL, " Checksum             : 0x%08lX\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); 
    178178    debugOutput(DEBUG_LEVEL_NORMAL, " Firmware version     : %02u.%02u.%02u (0x%08X)\n",  
    179179                                    version_major, version_minor, version_build, m_version); 
    180180    debugOutput(DEBUG_LEVEL_NORMAL, " Append CRC           : %s\n", (m_append_crc?"Yes":"No")); 
    181     debugOutput(DEBUG_LEVEL_NORMAL, " Footprint (Quadlets) : 0x%08lX\n", m_footprint_quads); 
     181    debugOutput(DEBUG_LEVEL_NORMAL, " Footprint (Quadlets) : 0x%08X\n", m_footprint_quads); 
    182182    #endif 
    183183} 
     
    298298        } 
    299299         
    300         debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "   Header %02d: %08lX\n",  
     300        debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "   Header %02d: %08X\n",  
    301301                    i, m_header[i]); 
    302302    } 
     
    337337        } 
    338338         
    339         debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "   Data %02d: %08lX\n",  
     339        debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "   Data %02d: %08X\n",  
    340340                    i, m_data[i]); 
    341341    } 
  • trunk/libffado/src/fireworks/fireworks_session_block.cpp

    r1336 r1763  
    255255 
    256256    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); 
    258258    } 
    259259 
  • trunk/libffado/src/genericavc/stanton/scs.cpp

    r1550 r1763  
    6969    // read the current value present in the register, i.e. read-ping 
    7070    if(!readRegBlock(addr, (quadlet_t *)cmdBuffer, 1) ) { 
    71         debugError("Could not read from addr 0x%012llX\n",  addr); 
     71        debugError("Could not read from addr 0x%012"PRIX64"\n",  addr); 
    7272    } else { 
    7373        int version = cmdBuffer[0] & 0xFFFF; 
     
    8484    // execute the command 
    8585    if(!writeRegBlock(addr, (quadlet_t *)cmdBuffer, 1)) { 
    86         debugError("Could not write to addr 0x%012llX\n",  addr); 
     86        debugError("Could not write to addr 0x%012"PRIX64"\n",  addr); 
    8787    } else { 
    8888        debugOutput(DEBUG_LEVEL_VERBOSE, "Write Ping succeeded\n"); 
     
    126126    // execute the command 
    127127    if(!writeRegBlock(addr, (quadlet_t *)cmdBuffer, 2)) { 
    128         debugError("Could not write to addr 0x%012llX\n", addr); 
     128        debugError("Could not write to addr 0x%012"PRIX64"\n", addr); 
    129129        return false; 
    130130    } 
     
    140140    // execute the command 
    141141    if(!writeRegBlock(addr, (quadlet_t *)cmdBuffer, 2)) { 
    142         debugError("Could not write to addr 0x%012llX\n", addr); 
     142        debugError("Could not write to addr 0x%012"PRIX64"\n", addr); 
    143143        return false; 
    144144    } 
     
    149149bool 
    150150ScsDevice::writeHSS1394Message(enum eMessageType message_type, byte_t* buffer, size_t len) { 
    151     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing message type: %02X, length: %u bytes\n", 
     151    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing message type: %02X, length: %zd bytes\n", 
    152152        message_type, len); 
    153153    size_t len_quadlets = len/4 + 1; 
     
    169169    // execute the command 
    170170    if(!writeRegBlock(addr, (quadlet_t *)cmdBuffer, len_quadlets)) { 
    171         debugError("Could not write to addr 0x%012llX\n", addr); 
     171        debugError("Could not write to addr 0x%012"PRIX64"\n", addr); 
    172172        return false; 
    173173    } 
     
    177177bool 
    178178ScsDevice::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%016llX, length %u quadlets, to %p\n", 
     179    debugOutput(DEBUG_LEVEL_VERBOSE,"Reading register 0x%016"PRIX64", length %zd quadlets, to %p\n", 
    180180        addr, length_quads, data); 
    181181 
     
    187187        int quads_todo = length_quads - quads_done; 
    188188        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); 
    190190            quads_todo = blocksize_quads; 
    191191        } 
     
    196196        #endif 
    197197 
    198         debugOutput(DEBUG_LEVEL_VERBOSE, "reading addr: 0x%016llX, %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); 
    199199        if(!get1394Service().read( nodeId, curr_addr, quads_todo, curr_data ) ) { 
    200             debugError("Could not read %d quadlets from node 0x%04X addr 0x%012llX\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); 
    201201            return false; 
    202202        } 
     
    210210bool 
    211211ScsDevice::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); 
    214215 
    215216    fb_quadlet_t data_out[length_quads]; 
     
    224225        int quads_todo = length_quads - quads_done; 
    225226        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); 
    227228            quads_todo = blocksize_quads; 
    228229        } 
     
    233234        #endif 
    234235 
    235         debugOutput(DEBUG_LEVEL_VERBOSE, "writing addr: 0x%016llX, %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); 
    236237        if(!get1394Service().write( nodeId, addr, quads_todo, curr_data ) ) { 
    237             debugError("Could not write %d quadlets to node 0x%04X addr 0x%012llX\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); 
    238239            return false; 
    239240        } 
  • trunk/libffado/src/libavc/audiosubunit/avc_descriptor_audio.h

    r1538 r1763  
    4343class Ieee1394Service; 
    4444 
     45// forward declarations 
     46namespace Util { 
     47    namespace Cmd { 
     48        class IOSSerialize; 
     49        class IISDeserialize; 
     50    } 
     51} 
     52 
    4553namespace AVC { 
    46  
    47  
    48 class Util::Cmd::IOSSerialize; 
    49 class Util::Cmd::IISDeserialize; 
    5054 
    5155class AVCAudioClusterInformation 
  • trunk/libffado/src/libavc/descriptors/avc_descriptor.cpp

    r1254 r1763  
    249249        // copy the payload 
    250250         
    251         if (bytes_read+readDescCmd.m_data_length>m_descriptor_length) { 
     251        if (bytes_read + readDescCmd.m_data_length > m_descriptor_length) { 
    252252            debugWarning("Device returned too much data, truncating\n"); 
    253253            readDescCmd.m_data_length=m_descriptor_length-bytes_read; 
    254254        } 
    255255         
    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); 
    257259         
    258260        memcpy(m_data+bytes_read,readDescCmd.m_data, readDescCmd.m_data_length); 
  • trunk/libffado/src/libavc/descriptors/avc_descriptor_cmd.cpp

    r1234 r1763  
    120120        break; 
    121121    default: 
    122         debugError("Can't handle command type %s\n", getCommandType()); 
     122        debugError("Can't handle command type %d\n", getCommandType()); 
    123123        return false; 
    124124    } 
  • trunk/libffado/src/libavc/general/avc_plug.cpp

    r1568 r1763  
    14231423        case eAPD_Output: 
    14241424            return string("Output"); 
    1425         default: 
    1426         case eAPT_Unknown: 
    1427             return string("Unknown"); 
    14281425    } 
    14291426} 
  • trunk/libffado/src/libcontrol/Element.cpp

    r1630 r1763  
    327327{ 
    328328    Util::MutexLockHelper lock(getLock()); 
    329     debugOutput( DEBUG_LEVEL_NORMAL, "Container %s (%d Elements)\n", 
     329    debugOutput( DEBUG_LEVEL_NORMAL, "Container %s (%zd Elements)\n", 
    330330        getName().c_str(), m_Children.size()); 
    331331 
  • trunk/libffado/src/libieee1394/ARMHandler.cpp

    r1550 r1763  
    123123    debugOutput(DEBUG_LEVEL_VERBOSE, "  tlabel: 0x%02X, tcode: 0x%02X, extended tcode: 0x%02X\n", 
    124124        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", 
    126126        arm_req->generation); 
    127     debugOutput(DEBUG_LEVEL_VERBOSE, "  buffer length: %lu\n", 
     127    debugOutput(DEBUG_LEVEL_VERBOSE, "  buffer length: %u\n", 
    128128        arm_req->buffer_length); 
    129129    printBufferBytes(DEBUG_LEVEL_VERBOSE, arm_req->buffer_length, arm_req->buffer); 
  • trunk/libffado/src/libieee1394/configrom.cpp

    r1336 r1763  
    486486{ 
    487487    debugOutput( DEBUG_LEVEL_VERBOSE,  
    488                  "Checking for updated node id for device with GUID 0x%016llX...\n", 
     488                 "Checking for updated node id for device with GUID 0x%016"PRIX64"...\n", 
    489489                 getGuid()); 
    490490 
     
    517517 
    518518        debugOutput( DEBUG_LEVEL_VERBOSE, 
    519                         " Node has GUID 0x%016llX\n", 
     519                        " Node has GUID 0x%016"PRIX64"\n", 
    520520                        guid); 
    521521 
     
    524524            if ( nodeId != getNodeId() ) { 
    525525                debugOutput( DEBUG_LEVEL_VERBOSE, 
    526                              "Device with GUID 0x%016llX changed node id " 
     526                             "Device with GUID 0x%016"PRIX64" changed node id " 
    527527                             "from %d to %d\n", 
    528528                             getGuid(), 
     
    532532            } else { 
    533533                debugOutput( DEBUG_LEVEL_VERBOSE, 
    534                              "Device with GUID 0x%016llX kept node id %d\n", 
     534                             "Device with GUID 0x%016"PRIX64" kept node id %d\n", 
    535535                             getGuid(), 
    536536                             getNodeId()); 
     
    549549 
    550550    debugOutput( DEBUG_LEVEL_VERBOSE, 
    551                  "Device with GUID 0x%016llX could not be found on " 
     551                 "Device with GUID 0x%016"PRIX64" could not be found on " 
    552552                 "the bus anymore (removed?)\n", 
    553553                 getGuid() ); 
     
    562562    debugOutput(DEBUG_LEVEL_NORMAL, "Config ROM\n" ); 
    563563    debugOutput(DEBUG_LEVEL_NORMAL, "\tCurrent Node Id:\t%d\n",       getNodeId() ); 
    564     debugOutput(DEBUG_LEVEL_NORMAL, "\tGUID:\t\t\t0x%016llX\n",       getGuid()); 
     564    debugOutput(DEBUG_LEVEL_NORMAL, "\tGUID:\t\t\t0x%016"PRIX64"\n",       getGuid()); 
    565565    debugOutput(DEBUG_LEVEL_NORMAL, "\tVendor Name:\t\t%s\n",         getVendorName().c_str() ); 
    566566    debugOutput(DEBUG_LEVEL_NORMAL, "\tModel Name:\t\t%s\n",          getModelName().c_str() ); 
     
    583583    printMessage("Config ROM\n" ); 
    584584    printMessage("\tCurrent Node Id:\t%d\n",       getNodeId() ); 
    585     printMessage("\tGUID:\t\t\t0x%016llX\n",       getGuid()); 
     585    printMessage("\tGUID:\t\t\t0x%016"PRIX64"\n",       getGuid()); 
    586586    printMessage("\tVendor Name:\t\t%s\n",         getVendorName().c_str() ); 
    587587    printMessage("\tModel Name:\t\t%s\n",          getModelName().c_str() ); 
  • trunk/libffado/src/libieee1394/cycletimer.h

    r1531 r1763  
    9595#ifdef DEBUG 
    9696        if (x >= TICKS_PER_SECOND * 128L) { 
    97             debugWarning("insufficient wrapping: %llu\n",x); 
     97            debugWarning("insufficient wrapping: %"PRIu64"\n",x); 
    9898        } 
    9999#endif 
     
    118118#ifdef DEBUG 
    119119        if (x < 0) { 
    120             debugWarning("insufficient wrapping: %lld\n",x); 
     120            debugWarning("insufficient wrapping: %"PRId64"\n",x); 
    121121        } 
    122122#endif 
     
    145145#ifdef DEBUG 
    146146        if (x >= (int64_t)(TICKS_PER_SECOND * 128L)) { 
    147             debugWarning("insufficient wrapping (max): %llu\n",x); 
     147            debugWarning("insufficient wrapping (max): %"PRIu64"\n",x); 
    148148        } 
    149149        if (x < 0) { 
    150             debugWarning("insufficient wrapping (min): %lld\n",x); 
     150            debugWarning("insufficient wrapping (min): %"PRId64"\n",x); 
    151151        } 
    152152#endif 
     
    249249    if(diff > max || diff < -max) { 
    250250        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); 
    252252         
    253253    } 
     
    302302    uint64_t timestamp; 
    303303 
    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", 
    305305                       syt_timestamp, rcv_cycle, ctr_now); 
    306306 
     
    313313    int diff_cycles = diffCycles(cc_cycles, rcv_cycle); 
    314314    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", 
    316316                        rcv_cycle, cc_cycles, diff_cycles); 
    317317    } 
     
    351351    } else { 
    352352        debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    353                            "Detected wraparound: %d + %d = %d\n", 
     353                           "Detected wraparound: %u + %"PRId64" = %"PRId64"\n", 
    354354                           rcv_cycle, delta_cycles, new_cycles); 
    355355 
     
    372372        if(( TICKS_TO_CYCLE_TIMER(timestamp) & 0xFFFF) != syt_timestamp) { 
    373373            debugWarning("back-converted timestamp not equal to SYT\n"); 
    374             debugWarning("TS=%011llu TSC=%08lX SYT=%04X\n", 
     374            debugWarning("TS=%011"PRIu64" TSC=%08"PRIX64" SYT=%04"PRIX64"\n", 
    375375                  timestamp, TICKS_TO_CYCLE_TIMER(timestamp), syt_timestamp); 
    376376        } 
     
    391391    uint64_t timestamp; 
    392392 
    393     debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, "SYT=%04llX RCV_CTR=%08X\n", 
     393    debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, "SYT=%04"PRIX64" RCV_CTR=%08X\n", 
    394394                       syt_timestamp, rcv_ctr); 
    395395 
     
    433433        if(( TICKS_TO_CYCLE_TIMER(timestamp) & 0xFFFF) != syt_timestamp) { 
    434434            debugWarning("back-converted timestamp not equal to SYT\n"); 
    435             debugWarning("TS=%011llu TSC=%08lX SYT=%04X\n", 
     435            debugWarning("TS=%011"PRIu64" TSC=%08"PRIX64" SYT=%04"PRIX64"\n", 
    436436                  timestamp, TICKS_TO_CYCLE_TIMER(timestamp), syt_timestamp); 
    437437        } 
     
    457457    uint64_t timestamp; 
    458458 
    459     debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, "SYT=%08llX CY=%04X CTR=%08llX\n", 
     459    debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, "SYT=%08"PRIX64" CY=%04X CTR=%08"PRIX64"\n", 
    460460                       syt_timestamp, xmt_cycle, ctr_now); 
    461461 
     
    467467    int diff_cycles = diffCycles(xmt_cycle, cc_cycles); 
    468468    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", 
    470470                        xmt_cycle, cc_cycles, diff_cycles); 
    471471    } 
     
    505505    } else { 
    506506        debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    507                            "Detected wraparound: %d + %d = %d\n", 
     507                           "Detected wraparound: %u + %"PRId64" = %"PRId64"\n", 
    508508                           xmt_cycle, delta_cycles, new_cycles); 
    509509 
     
    526526        if(( TICKS_TO_CYCLE_TIMER(timestamp) & 0xFFFF) != syt_timestamp) { 
    527527            debugWarning("back-converted timestamp not equal to SYT\n"); 
    528             debugWarning("TS=%011llu TSC=%08lX SYT=%04X\n", 
     528            debugWarning("TS=%011"PRIu64" TSC=%08"PRIX64" SYT=%04"PRIX64"\n", 
    529529                  timestamp, TICKS_TO_CYCLE_TIMER(timestamp), syt_timestamp); 
    530530        } 
  • trunk/libffado/src/libieee1394/CycleTimerHelper.cpp

    r1531 r1763  
    164164                        m_cycle_timer_prev, maxtries2); 
    165165        } 
    166         debugOutput( DEBUG_LEVEL_VERBOSE, " read : CTR: %11lu, local: %17llu\n", 
     166        debugOutput( DEBUG_LEVEL_VERBOSE, " read : CTR: %11u, local: %17"PRIu64"\n", 
    167167                            m_cycle_timer_prev, local_time); 
    168168        debugOutput(DEBUG_LEVEL_VERBOSE, 
    169                            "  ctr   : 0x%08X %11llu (%03us %04ucy %04uticks)\n", 
     169                           "  ctr   : 0x%08X %11"PRIu64" (%03us %04ucy %04uticks)\n", 
    170170                           (uint32_t)m_cycle_timer_prev, (uint64_t)CYCLE_TIMER_TO_TICKS(m_cycle_timer_prev), 
    171171                           (unsigned int)CYCLE_TIMER_GET_SECS( m_cycle_timer_prev ), 
     
    291291    cycle_timer_ticks = CYCLE_TIMER_TO_TICKS(cycle_timer); 
    292292 
    293     debugOutputExtreme( DEBUG_LEVEL_VERY_VERBOSE, " read : CTR: %11lu, local: %17llu\n", 
     293    debugOutputExtreme( DEBUG_LEVEL_VERY_VERBOSE, " read : CTR: %11u, local: %17"PRIu64"\n", 
    294294                        cycle_timer, local_time); 
    295295    debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    296                        "  ctr   : 0x%08X %11llu (%03us %04ucy %04uticks)\n", 
     296                       "  ctr   : 0x%08X %11"PRIu64" (%03us %04ucy %04uticks)\n", 
    297297                       (uint32_t)cycle_timer, (uint64_t)cycle_timer_ticks, 
    298298                       (unsigned int)TICKS_TO_SECS( (uint64_t)cycle_timer_ticks ), 
     
    310310                bw_abs, bw_rel); 
    311311    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", 
    313313                m_usecs_per_update, m_ticks_per_update, m_dll_e2); 
    314314    debugOutput(DEBUG_LEVEL_VERBOSE, 
     
    351351        ffado_microsecs_t now = Util::SystemTimeSource::getCurrentTimeAsUsecs(); 
    352352        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", 
    354354                    this, m_sleep_until, m_next_time_usecs, now, sleep_time); 
    355355        #endif 
     
    390390        if(not_good) { 
    391391            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",  
    393393                        this, err_ticks, 1*TICKS_PER_CYCLE, ntries, expected_ticks); 
    394394            // 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); 
    396396        } 
    397397 
     
    409409    // // simulate a random scheduling delay between (0-10ms) 
    410410    // 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); 
    412412 
    413413    if(m_unhandled_busreset) { 
     
    419419    } 
    420420 
    421     debugOutputExtreme( DEBUG_LEVEL_ULTRA_VERBOSE, " read : CTR: %11lu, local: %17llu\n", 
     421    debugOutputExtreme( DEBUG_LEVEL_ULTRA_VERBOSE, " read : CTR: %11u, local: %17"PRIu64"\n", 
    422422                        cycle_timer, local_time); 
    423423    debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 
    424                        "  ctr   : 0x%08X %11llu (%03us %04ucy %04uticks)\n", 
     424                       "  ctr   : 0x%08X %11"PRIu64" (%03us %04ucy %04uticks)\n", 
    425425                       (uint32_t)cycle_timer, (uint64_t)cycle_timer_ticks, 
    426426                       (unsigned int)TICKS_TO_SECS( (uint64_t)cycle_timer_ticks ), 
     
    436436    } else if (diff_ticks > m_ticks_per_update * 20) { 
    437437        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", 
    439439                    diff_ticks, (float)(m_ticks_per_update * 20)); 
    440440        if(!initDLL()) { 
     
    462462            diff_ticks_corr = diff_ticks - ticks_late; 
    463463            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", 
    465465                               diff_ticks_corr, diff_ticks, ticks_late); 
    466466        } else { 
     
    473473        // makes no sense if not running realtime 
    474474        if(m_realtime && usecs_late > 1000) { 
    475             debugOutput(DEBUG_LEVEL_VERBOSE, "Rather late wakeup: %lld usecs\n", usecs_late); 
     475            debugOutput(DEBUG_LEVEL_VERBOSE, "Rather late wakeup: %"PRId64" usecs\n", usecs_late); 
    476476        } 
    477477        #endif 
     
    526526 
    527527        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", 
    529529                           m_current_time_usecs, m_next_time_usecs, usecs_late, ticks_late); 
    530530        debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    531                            " ticks: current: %f next: %f diff=%lld\n", 
     531                           " ticks: current: %f next: %f diff=%"PRId64"\n", 
    532532                           m_current_time_ticks, m_next_time_ticks, diff_ticks); 
    533533        debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    534                            " ticks: current: %011llu (%03us %04ucy %04uticks)\n", 
     534                           " ticks: current: %011"PRIu64" (%03us %04ucy %04uticks)\n", 
    535535                           (uint64_t)m_current_time_ticks, 
    536536                           (unsigned int)TICKS_TO_SECS( (uint64_t)m_current_time_ticks ), 
     
    538538                           (unsigned int)TICKS_TO_OFFSET( (uint64_t)m_current_time_ticks ) ); 
    539539        debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    540                            " ticks: next   : %011llu (%03us %04ucy %04uticks)\n", 
     540                           " ticks: next   : %011"PRIu64" (%03us %04ucy %04uticks)\n", 
    541541                           (uint64_t)m_next_time_ticks, 
    542542                           (unsigned int)TICKS_TO_SECS( (uint64_t)m_next_time_ticks ), 
     
    545545 
    546546        debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    547                            " state: local: %11llu, dll_e2: %f, rate: %f\n", 
     547                           " state: local: %11"PRIu64", dll_e2: %f, rate: %f\n", 
    548548                           local_time, m_dll_e2, getRate()); 
    549549    } 
     
    589589    } 
    590590    int32_t ctr_diff = cycle_timer_ticks-dll_time; 
    591     debugOutput(DEBUG_LEVEL_ULTRA_VERBOSE, "(%p) CTR DIFF: HW %010llu - DLL %010lu = %010ld (%s)\n",  
     591    debugOutput(DEBUG_LEVEL_ULTRA_VERBOSE, "(%p) CTR DIFF: HW %010"PRIu64" - DLL %010u = %010d (%s)\n",  
    592592                this, cycle_timer_ticks, dll_time, ctr_diff, (ctr_diff>0?"lag":"lead")); 
    593593#endif 
     
    625625    if (y_step_in_ticks_int > 0) { 
    626626        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",  
    628628                    y_step_in_ticks_int, time_diff, my_vars.rate, retval);*/ 
    629629    } else { 
     
    631631 
    632632        // 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",  
    634634                    y_step_in_ticks_int, time_diff, my_vars.rate, retval);*/ 
    635635    } 
     
    792792        if (diffTicks(cycle_timer_ticks, m_cycle_timer_ticks_prev) < 0) { 
    793793            debugOutput( DEBUG_LEVEL_VERY_VERBOSE, 
    794                         "non-monotonic CTR (try %02d): %llu -> %llu\n", 
     794                        "non-monotonic CTR (try %02d): %"PRIu64" -> %"PRIu64"\n", 
    795795                        maxtries, m_cycle_timer_ticks_prev, cycle_timer_ticks); 
    796796            debugOutput( DEBUG_LEVEL_VERY_VERBOSE, 
     
    798798                        m_cycle_timer_prev, *cycle_timer); 
    799799            debugOutput( DEBUG_LEVEL_VERY_VERBOSE, 
    800                         " current: %011llu (%03us %04ucy %04uticks)\n", 
     800                        " current: %011"PRIu64" (%03us %04ucy %04uticks)\n", 
    801801                        cycle_timer_ticks, 
    802802                        (unsigned int)TICKS_TO_SECS( cycle_timer_ticks ), 
     
    804804                        (unsigned int)TICKS_TO_OFFSET( cycle_timer_ticks ) ); 
    805805            debugOutput( DEBUG_LEVEL_VERY_VERBOSE, 
    806                         " prev   : %011llu (%03us %04ucy %04uticks)\n", 
     806                        " prev   : %011"PRIu64" (%03us %04ucy %04uticks)\n", 
    807807                        m_cycle_timer_ticks_prev, 
    808808                        (unsigned int)TICKS_TO_SECS( m_cycle_timer_ticks_prev ), 
  • trunk/libffado/src/libieee1394/ieee1394service.cpp

    r1660 r1763  
    5757    , m_armHelperRealtime( NULL ) 
    5858    , m_handle( 0 ) 
    59     , m_handle_lock( new Util::PosixMutex("SRCVHND") ) 
     59    , m_handle_lock( new Util::PosixMutex("SRVCHND") ) 
    6060    , m_util_handle( 0 ) 
    6161    , m_port( -1 ) 
     
    8585    , m_armHelperRealtime( NULL ) 
    8686    , m_handle( 0 ) 
    87     , m_handle_lock( new Util::PosixMutex("SRCVHND") ) 
     87    , m_handle_lock( new Util::PosixMutex("SRVCHND") ) 
    8888    , m_util_handle( 0 ) 
    8989    , m_port( -1 ) 
     
    122122          ++it ) 
    123123    { 
    124         debugOutput(DEBUG_LEVEL_VERBOSE, "Unregistering ARM handler for 0x%016llX\n", (*it)->getStart()); 
     124        debugOutput(DEBUG_LEVEL_VERBOSE, "Unregistering ARM handler for 0x%016"PRIX64"\n", (*it)->getStart()); 
    125125        if(m_armHelperNormal) { 
    126126            int err = raw1394_arm_unregister(m_armHelperNormal->get1394Handle(), (*it)->getStart()); 
    127127            if (err) { 
    128                 debugError(" Failed to unregister ARM handler for 0x%016llX\n", (*it)->getStart()); 
     128                debugError(" Failed to unregister ARM handler for 0x%016"PRIX64"\n", (*it)->getStart()); 
    129129                debugError(" Error: %s\n", strerror(errno)); 
    130130            } 
     
    557557        #ifdef DEBUG 
    558558        debugOutput(DEBUG_LEVEL_VERY_VERBOSE, 
    559             "read: node 0x%hX, addr = 0x%016llX, length = %u\n", 
     559            "read: node 0x%hX, addr = 0x%016"PRIX64", length = %zd\n", 
    560560            nodeId, addr, length); 
    561561        printBuffer( DEBUG_LEVEL_VERY_VERBOSE, length, buffer ); 
     
    566566        #ifdef DEBUG 
    567567        debugOutput(DEBUG_LEVEL_VERBOSE, 
    568                     "raw1394_read failed: node 0x%hX, addr = 0x%016llX, length = %u\n", 
     568                    "raw1394_read failed: node 0x%hX, addr = 0x%016"PRIX64", length = %zd\n", 
    569569                    nodeId, addr, length); 
    570570        #endif 
     
    612612 
    613613    #ifdef DEBUG 
    614     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"write: node 0x%hX, addr = 0x%016llX, length = %d\n", 
     614    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"write: node 0x%hX, addr = 0x%016"PRIX64", length = %zd\n", 
    615615                nodeId, addr, length); 
    616616    printBuffer( DEBUG_LEVEL_VERY_VERBOSE, length, data ); 
     
    649649    } 
    650650    #ifdef DEBUG 
    651     debugOutput(DEBUG_LEVEL_VERBOSE,"lockCompareSwap64: node 0x%X, addr = 0x%016llX\n", 
     651    debugOutput(DEBUG_LEVEL_VERBOSE,"lockCompareSwap64: node 0x%X, addr = 0x%016"PRIX64"\n", 
    652652                nodeId, addr); 
    653     debugOutput(DEBUG_LEVEL_VERBOSE,"  if (*(addr)==0x%016llX) *(addr)=0x%016llX\n", 
     653    debugOutput(DEBUG_LEVEL_VERBOSE,"  if (*(addr)==0x%016"PRIX64") *(addr)=0x%016"PRIX64"\n", 
    654654                compare_value, swap_value); 
    655655    fb_octlet_t buffer; 
     
    657657        debugWarning("Could not read register\n"); 
    658658    } else { 
    659         debugOutput(DEBUG_LEVEL_VERBOSE,"before = 0x%016llX\n", buffer); 
     659        debugOutput(DEBUG_LEVEL_VERBOSE,"before = 0x%016"PRIX64"\n", buffer); 
    660660    } 
    661661    #endif 
     
    681681        debugWarning("Could not read register\n"); 
    682682    } else { 
    683         debugOutput(DEBUG_LEVEL_VERBOSE,"after = 0x%016llX\n", buffer); 
     683        debugOutput(DEBUG_LEVEL_VERBOSE,"after = 0x%016"PRIX64"\n", buffer); 
    684684    } 
    685685    #endif 
     
    831831    } 
    832832 
     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 
     845out: 
    833846    // stop listening for FCP responses 
    834847    err = raw1394_stop_fcp_listen(m_handle); 
     
    836849        debugOutput(DEBUG_LEVEL_VERBOSE, "could not stop FCP listen (err=%d, errno=%d)\n", err, errno); 
    837850        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 
    854853    m_fcp_block.status = eFS_Empty; 
    855854    return retval; 
     
    876875    fb_quadlet_t *data_quads = (fb_quadlet_t *)data; 
    877876    #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", 
    879878                nodeid, response, length); 
    880879    printBuffer(DEBUG_LEVEL_VERY_VERBOSE, (length+3)/4, data_quads ); 
     
    906905            } else if(FCP_MASK_SUBUNIT_AND_OPCODE(first_quadlet)  
    907906                      != FCP_MASK_SUBUNIT_AND_OPCODE(CondSwapFromBus32(m_fcp_block.request[0]))) { 
    908                 debugOutput(DEBUG_LEVEL_VERBOSE, "FCP response not for this request: %08lX != %08lX\n", 
     907                debugOutput(DEBUG_LEVEL_VERBOSE, "FCP response not for this request: %08X != %08X\n", 
    909908                             FCP_MASK_SUBUNIT_AND_OPCODE(first_quadlet), 
    910909                             FCP_MASK_SUBUNIT_AND_OPCODE(CondSwapFromBus32(m_fcp_block.request[0]))); 
     
    970969        return 0; 
    971970    } 
    972     debugOutput(DEBUG_LEVEL_VERBOSE, " READ HI: 0x%08lX\n", split_timeout_hi); 
     971    debugOutput(DEBUG_LEVEL_VERBOSE, " READ HI: 0x%08X\n", split_timeout_hi); 
    973972 
    974973    if(!readNoLock( 0xffc0 | nodeId, CSR_REGISTER_BASE + CSR_SPLIT_TIMEOUT_LO, 1, 
     
    977976        return 0; 
    978977    } 
    979     debugOutput(DEBUG_LEVEL_VERBOSE, " READ LO: 0x%08lX\n", split_timeout_low); 
     978    debugOutput(DEBUG_LEVEL_VERBOSE, " READ LO: 0x%08X\n", split_timeout_low); 
    980979 
    981980    split_timeout_hi = CondSwapFromBus32(split_timeout_hi); 
     
    10731072 
    10741073bool 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()); 
    10771077 
    10781078    // FIXME: note that this will result in the ARM handlers not running in a realtime context 
     
    10831083                                   h->getClientTransactions()); 
    10841084    if (err) { 
    1085         debugError("Failed to register ARM handler for 0x%016llX\n", h->getStart()); 
     1085        debugError("Failed to register ARM handler for 0x%016"PRIX64"\n", h->getStart()); 
    10861086        debugError(" Error: %s\n", strerror(errno)); 
    10871087        return false; 
     
    10921092 
    10931093bool Ieee1394Service::unregisterARMHandler( ARMHandler *h ) { 
    1094     debugOutput(DEBUG_LEVEL_VERBOSE, "Unregistering ARM handler (%p) for 0x%016llX\n", 
     1094    debugOutput(DEBUG_LEVEL_VERBOSE, "Unregistering ARM handler (%p) for 0x%016"PRIX64"\n", 
    10951095        h, h->getStart()); 
    10961096 
     
    11231123 */ 
    11241124nodeaddr_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); 
    11271128 
    11281129    int cnt=0; 
     
    11351136 
    11361137        if (err) { 
    1137             debugOutput(DEBUG_LEVEL_VERBOSE, " -> cannot use 0x%016llX\n", start); 
     1138            debugOutput(DEBUG_LEVEL_VERBOSE, " -> cannot use 0x%016"PRIX64"\n", start); 
    11381139            debugError("    Error: %s\n", strerror(errno)); 
    11391140            start += step; 
    11401141        } else { 
    1141             debugOutput(DEBUG_LEVEL_VERBOSE, " -> use 0x%016llX\n", start); 
     1142            debugOutput(DEBUG_LEVEL_VERBOSE, " -> use 0x%016"PRIX64"\n", start); 
    11421143            err = raw1394_arm_unregister(m_handle, start); 
    11431144            if (err) { 
     
    11881189            raw1394_arm_response_t arm_resp = arm_req_resp->response; 
    11891190 
    1190             debugOutput(DEBUG_LEVEL_VERBOSE,"ARM handler for address 0x%016llX called\n", 
     1191            debugOutput(DEBUG_LEVEL_VERBOSE,"ARM handler for address 0x%016"PRIX64" called\n", 
    11911192                (*it)->getStart()); 
    11921193            debugOutput(DEBUG_LEVEL_VERBOSE," request type   : 0x%02X\n", request_type); 
     
    15831584    debugOutput( DEBUG_LEVEL_VERBOSE, " CycleTimerHelper: %p, IsoManager: %p, WatchDog: %p\n", 
    15841585                 m_pCTRHelper, m_pIsoManager, m_pWatchdog ); 
    1585     debugOutput( DEBUG_LEVEL_VERBOSE, " Time: %011llu (%03us %04ucy %04uticks)\n", 
     1586    debugOutput( DEBUG_LEVEL_VERBOSE, " Time: %011"PRIu64" (%03us %04ucy %04uticks)\n", 
    15861587                ctr, 
    15871588                (unsigned int)TICKS_TO_SECS( ctr ), 
  • trunk/libffado/src/libieee1394/IsoHandler.cpp

    r1731 r1763  
    261261 
    262262    // wake ourselves up 
    263     raw1394_wake_up(m_handle); 
     263    if(m_handle) raw1394_wake_up(m_handle); 
    264264} 
    265265 
     
    396396    if((pkt_ctr & ~0x0FFFL) != pkt_ctr_ref) { 
    397397        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); 
    401405    } 
    402406    #endif 
     
    475479        if(((pkt_ctr & ~0x0FFFL) != pkt_ctr_ref) && (m_packets > m_buf_packets)) { 
    476480            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); 
    480488        } 
    481489        #endif 
  • trunk/libffado/src/libieee1394/IsoHandlerManager.cpp

    r1731 r1763  
    114114 
    115115        if (!h->handleBusReset()) { 
    116             debugWarning("Failed to handle busreset on %p\n"); 
     116            debugWarning("Failed to handle busreset on %p\n", h); 
    117117            retval = false; 
    118118        } 
     
    261261 
    262262        if(no_one_to_poll) { 
    263             debugOutput(DEBUG_LEVEL_ULTRA_VERBOSE, 
     263            debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 
    264264                        "(%p, %s) No one to poll, waiting for something to happen\n", 
    265265                        this, (m_handlerType == IsoHandler::eHT_Transmit? "Transmit": "Receive")); 
     
    325325 
    326326        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", 
    328328                           this, (m_handlerType == IsoHandler::eHT_Transmit? "Transmit": "Receive"),  
    329329                           i, measured_diff_ticks, max_diff_ticks, ctr_at_poll_return, last_packet_seen); 
    330330        if(measured_diff_ticks > max_diff_ticks) { 
    331             debugFatal("(%p, %s) Handler died: now: %08lX, last: %08lX, diff: %lld (max: %lld)\n", 
     331            debugFatal("(%p, %s) Handler died: now: %08X, last: %08X, diff: %"PRId64" (max: %"PRId64")\n", 
    332332                       this, (m_handlerType == IsoHandler::eHT_Transmit? "Transmit": "Receive"), 
    333333                       ctr_at_poll_return, last_packet_seen, measured_diff_ticks, max_diff_ticks); 
     
    410410            debugError("(%p) sem_timedwait error (result=%d errno=EINVAL)\n",  
    411411                        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); 
    414415            return eAR_Error; 
    415416        } else { 
    416417            debugError("(%p) sem_timedwait error (result=%d errno=%d)\n",  
    417418                        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); 
    420422            return eAR_Error; 
    421423        } 
     
    885887 
    886888    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", 
    888890                                      m_StreamProcessors.size(), m_IsoHandlers.size()); 
    889891    return true; 
  • trunk/libffado/src/libieee1394/test-cyclecalc.cpp

    r1047 r1763  
    5252                          (unsigned int)CYCLE_TIMER_GET_OFFSET(now_ctr)); 
    5353 
    54     debugOutput(DEBUG_LEVEL_VERBOSE,"NOW              : %011llu (%03us %04uc %04ut)\n", 
     54    debugOutput(DEBUG_LEVEL_VERBOSE,"NOW              : %011"PRIu64" (%03us %04uc %04ut)\n", 
    5555                          now, 
    5656                          (unsigned int)TICKS_TO_SECS(now), 
     
    6868    #endif 
    6969 
    70     debugOutput(DEBUG_LEVEL_VERBOSE,"CALC_TS          : %011llu (%03us %04uc %04ut)\n", 
     70    debugOutput(DEBUG_LEVEL_VERBOSE,"CALC_TS          : %011"PRIu64" (%03us %04uc %04ut)\n", 
    7171                          calc_ts, 
    7272                          (unsigned int)TICKS_TO_SECS(calc_ts), 
  • trunk/libffado/src/libstreaming/amdtp-oxford/AmdtpOxfordReceiveStreamProcessor.cpp

    r1535 r1763  
    190190            m_dll_e2 += m_dll_c * err; 
    191191 
    192             debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Generated TSP: %16llu %lld %d %d\n",  
     192            debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Generated TSP: %16"PRIu64" %"PRId64" %"PRId32" %"PRId64"\n",  
    193193                                             m_next_packet_timestamp, m_next_packet_timestamp-m_last_timestamp, 
    194194                                             frames_in_tempbuffer,  ((length / sizeof (quadlet_t)) - 2) / m_dimension); 
  • trunk/libffado/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp

    r1531 r1763  
    148148    if(isRunning()) { 
    149149        debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    150                            "STMP: %lluticks | syt_interval=%d, tpf=%f\n", 
     150                           "STMP: %"PRIu64"ticks | syt_interval=%d, tpf=%f\n", 
    151151                           m_last_timestamp, m_syt_interval, getTicksPerFrame()); 
    152152/*        debugOutput(DEBUG_LEVEL_NORMAL, 
    153                            "STMP: %12llu ticks | delta_t: %5lld | bufferfill: %5d\n", 
     153                           "STMP: %12"PRIu64" ticks | delta_t: %5"PRId64" | bufferfill: %5d\n", 
    154154                           m_last_timestamp, now_t-last_t, m_data_buffer->getBufferFill());*/ 
    155155    } 
     
    378378                    sample_int |= 0x01000000; // flag that there is a midi event present 
    379379                    *buffer = sample_int; 
     380                    debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "(%p) MIDI [%d]: %08X\n", this, i, sample_int); 
    380381                } else if(IEC61883_AM824_HAS_LABEL(sample_int, IEC61883_AM824_LABEL_MIDI_2X) 
    381382                       || IEC61883_AM824_HAS_LABEL(sample_int, IEC61883_AM824_LABEL_MIDI_3X) ) { 
  • trunk/libffado/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.h

    r1535 r1763  
    2929 */ 
    3030 
    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" 
    5532 
    5633namespace Streaming { 
  • trunk/libffado/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp

    r1531 r1763  
    9696 
    9797    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) ); 
    9999    // check whether the packet buffer has packets for us to send. 
    100100    // the base timestamp is the one of the next sample in the buffer 
     
    142142        { 
    143143            debugOutput( DEBUG_LEVEL_NORMAL, 
    144                          "Insufficient frames (P): N=%02d, CY=%04u, 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),  
    146146                         transmit_at_cycle, cycles_until_transmit ); 
    147147            // we are too late 
     
    154154 
    155155            debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 
    156                                "Insufficient frames (NP): N=%02d, CY=%04u, 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), 
    158158                               transmit_at_cycle, cycles_until_transmit, now_cycle ); 
    159159            #endif 
     
    201201            // we are too late 
    202202            debugOutput(DEBUG_LEVEL_VERBOSE, 
    203                         "Too late: CY=%04u, 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), 
    205205                        transmit_at_cycle, cycles_until_transmit, 
    206206                        presentation_time, (unsigned int)TICKS_TO_CYCLES(presentation_time) ); 
     
    230230            // for timestamp tracing 
    231231            debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    232                                "XMIT PKT: TSP= %011llu (%04u) (%04u) (%04u)\n", 
     232                               "XMIT PKT: TSP= %011"PRIu64" (%04u) (%04u) (%04u)\n", 
    233233                               presentation_time, 
    234234                               (unsigned int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), 
     
    240240        { 
    241241            debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    242                                "Too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011llu (%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), 
    244244                               transmit_at_cycle, cycles_until_transmit, 
    245245                               transmit_at_time, (unsigned int)TICKS_TO_CYCLES(transmit_at_time), 
     
    249249            { 
    250250                debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    251                                    "Way too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011llu (%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), 
    253253                                   transmit_at_cycle, cycles_until_transmit, 
    254254                                   transmit_at_time, (unsigned int)TICKS_TO_CYCLES(transmit_at_time), 
     
    269269    if (m_data_buffer->readFrames(m_syt_interval, (char *)(data + 8))) 
    270270    { 
    271         debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    272                            "XMIT DATA: TSP= %011llu (%04u)\n", 
     271        debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 
     272                           "XMIT DATA: TSP= %011"PRIu64" (%04u)\n", 
    273273                           m_last_timestamp, 
    274274                           (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 
    275291        return eCRV_OK; 
    276292    } 
     
    286302    struct iec61883_packet *packet = ( struct iec61883_packet * ) data; 
    287303    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, 
    290306                       (unsigned int)TICKS_TO_CYCLES(m_last_timestamp)); 
    291307 
     
    323339    struct iec61883_packet *packet = ( struct iec61883_packet * ) data; 
    324340    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, 
    327343                       (unsigned int)TICKS_TO_CYCLES(m_last_timestamp) ); 
    328344    packet->sid = m_local_node_id; 
     
    10361052                    *target_event = CondSwapToBus32(tmpval); 
    10371053 
    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 ); 
    10421058                } else { 
    10431059                    // can't send a byte, either because there is no byte, 
  • trunk/libffado/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.h

    r1531 r1763  
    3030#include "config.h" 
    3131 
    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" 
    5633 
    5734namespace Streaming { 
  • trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp

    r1535 r1763  
    7777    , m_ticks_per_frame( 0 ) 
    7878    , m_dll_bandwidth_hz ( STREAMPROCESSOR_DLL_BW_HZ ) 
    79     , m_sync_delay_frames( 0 ) 
     79    , m_extra_buffer_frames( 0 ) 
    8080    , m_in_xrun( false ) 
    8181{ 
     
    130130    m_in_xrun = true; 
    131131    SIGNAL_ACTIVITY_ALL; 
    132 } 
    133  
    134 uint64_t StreamProcessor::getTimeNow() { 
    135     return m_1394service.getCycleTimerTicks(); 
    136132} 
    137133 
     
    172168 * Buffer management and manipulation          * 
    173169 ***********************************************/ 
     170void 
     171StreamProcessor::getBufferHeadTimestamp(ffado_timestamp_t *ts, signed int *fc) 
     172{ 
     173    m_data_buffer->getBufferHeadTimestamp(ts, fc); 
     174} 
     175 
     176void 
     177StreamProcessor::getBufferTailTimestamp(ffado_timestamp_t *ts, signed int *fc) 
     178{ 
     179    m_data_buffer->getBufferTailTimestamp(ts, fc); 
     180} 
     181 
     182void StreamProcessor::setBufferTailTimestamp(ffado_timestamp_t new_timestamp) 
     183{ 
     184    m_data_buffer->setBufferTailTimestamp(new_timestamp); 
     185} 
     186 
     187void 
     188StreamProcessor::setBufferHeadTimestamp(ffado_timestamp_t new_timestamp) 
     189{ 
     190    m_data_buffer->setBufferHeadTimestamp(new_timestamp); 
     191} 
    174192 
    175193int StreamProcessor::getBufferFill() { 
     
    177195} 
    178196 
    179 int64_t 
    180 StreamProcessor::getTimeUntilNextPeriodSignalUsecs() 
    181 { 
    182     uint64_t time_at_period=getTimeAtPeriod(); 
    183  
    184     // we delay the period signal with the sync delay 
    185     // this makes that the period signals lag a little compared to reality 
    186     // ISO buffering causes the packets to be received at max 
    187     // m_handler->getWakeupInterval() later than the time they were received. 
    188     // hence their payload is available this amount of time later. However, the 
    189     // period boundary is predicted based upon earlier samples, and therefore can 
    190     // pass before these packets are processed. Adding this extra term makes that 
    191     // the period boundary is signalled later 
    192     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 period 
    197     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_next 
    201         ); 
    202  
    203     // now convert to usecs 
    204     // don't use the mapping function because it only works 
    205     // for absolute times, not the relative time we are 
    206     // using here (which can also be negative). 
    207     return (int64_t)(((float)until_next) / TICKS_PER_USEC); 
    208 } 
    209  
    210197void 
    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; 
     198StreamProcessor::setExtraBufferFrames(unsigned int frames) { 
     199    debugOutput(DEBUG_LEVEL_VERBOSE, "Setting extra buffer to %d frames\n", frames); 
     200    m_extra_buffer_frames = frames; 
    224201} 
    225202 
    226203unsigned 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()); 
     204StreamProcessor::getExtraBufferFrames() { 
     205    return m_extra_buffer_frames; 
    234206} 
    235207 
    236208uint64_t 
    237 StreamProcessor::getTimeAtPeriodUsecs() 
    238 
    239     return (uint64_t)((float)getTimeAtPeriod() * TICKS_PER_USEC); 
    240 
    241  
    242 uint64_t 
    243 StreamProcessor::getTimeAtPeriod()  
     209StreamProcessor::getTimeAtPeriod() 
    244210{ 
    245211    if (getType() == ePT_Receive) { 
     
    412378        if (m_last_timestamp > 0 && m_last_timestamp2 > 0) { 
    413379            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); 
    415381            double tsp_diff_d = tsp_diff; 
    416382            double fs_syt = 1.0/tsp_diff_d; 
     
    433399                if(diff-ticks_per_packet > 50 || diff-ticks_per_packet < -50) { 
    434400                    debugOutput(DEBUG_LEVEL_VERBOSE, 
    435                                 "cy %04u 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, 
    437403                                m_last_timestamp, diff, ticks_per_packet); 
    438404                    // !!!HACK!!! FIXME: this is the result of a failure in wrapping/unwrapping somewhere 
     
    444410                    diff = diffTicks(last_timestamp_fixed, m_last_timestamp2); 
    445411                    if(diff-ticks_per_packet < 50 && diff-ticks_per_packet > -50) { 
    446                         debugWarning("cy %04u 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, 
    448414                                    m_last_timestamp, diff, ticks_per_packet); 
    449415                        debugWarning("HACK: fixed by adding one second of ticks. This is a bug being run-time fixed.\n"); 
     
    454420                        diff = diffTicks(last_timestamp_fixed, m_last_timestamp2); 
    455421                        if(diff-ticks_per_packet < 50 && diff-ticks_per_packet > -50) { 
    456                             debugWarning("cy %04u 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, 
    458424                                        m_last_timestamp, diff, ticks_per_packet); 
    459425                            debugWarning("HACK: fixed by subtracing one second of ticks. This is a bug being run-time fixed.\n"); 
     
    463429                } 
    464430                debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    465                                 "%04u %011llu %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), 
    467433                                m_last_timestamp2, m_last_timestamp,  
    468434                                diff, ticks_per_packet); 
     
    471437 
    472438        debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    473                           "RECV: CY=%04u TS=%011llu\n", 
    474                           CYCLE_TIMER_GET_CYCLES(pkt_ctr), 
     439                          "RECV: CY=%04u TS=%011"PRIu64"\n", 
     440                          (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr), 
    475441                          m_last_timestamp); 
    476442 
     
    640606        if (result == eCRV_Packet) { 
    641607            debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    642                                "XMIT SILENT: CY=%04u TS=%011llu\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); 
    644610 
    645611            // assumed not to xrun 
     
    691657        if (result == eCRV_Packet || result == eCRV_Defer) { 
    692658            debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 
    693                                "XMIT: CY=%04u TS=%011llu\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); 
    695661 
    696662            // valid packet timestamp 
     
    728694            if (m_last_timestamp > 0 && m_last_timestamp2 > 0) { 
    729695                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); 
    731697                double tsp_diff_d = tsp_diff; 
    732698                double fs_syt = 1.0/tsp_diff_d; 
     
    737703                debugOutputExtreme(DEBUG_LEVEL_VERBOSE, "Nom fs: %12f, Instantanous fs: %12f, diff: %12f (%12f)\n", 
    738704                           fs_nom, fs_syt, fs_diff, fs_diff_norm); 
    739 //                 debugOutput(DEBUG_LEVEL_VERBOSE, "Diff fs: %12f, m_last_timestamp: %011llu, m_last_timestamp2: %011llu\n", 
     705//                 debugOutput(DEBUG_LEVEL_VERBOSE, "Diff fs: %12f, m_last_timestamp: %011"PRIu64", m_last_timestamp2: %011"PRIu64"\n", 
    740706//                            fs_diff, m_last_timestamp, m_last_timestamp2); 
    741707                if (fs_diff_norm > 0.01 || fs_diff_norm < -0.01) { 
     
    750716                if(diff-ticks_per_packet > 50 || diff-ticks_per_packet < -50) { 
    751717                    debugOutput(DEBUG_LEVEL_VERBOSE, 
    752                                 "cy %04d, rather large TSP difference TS=%011llu => 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, 
    754720                                m_last_timestamp, diff, ticks_per_packet); 
    755721                } 
    756722                debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 
    757                                 "%04d %011llu %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, 
    759725                                m_last_timestamp, diff, ticks_per_packet); 
    760726            } 
     
    791757            goto send_empty_packet; 
    792758        } 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)); 
    794760            if(m_state != m_next_state) { 
    795761                debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state from %s to %s\n", 
     
    826792    debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 
    827793                       "XMIT EMPTY: CY=%04u\n", 
    828                        CYCLE_TIMER_GET_CYCLES(pkt_ctr)); 
     794                       (int)CYCLE_TIMER_GET_CYCLES(pkt_ctr)); 
    829795 
    830796    generateEmptyPacketHeader(data, length, tag, sy, pkt_ctr); 
     
    843809    bool result; 
    844810    debugOutputExtreme( DEBUG_LEVEL_VERBOSE, 
    845                         "(%p, %s) getFrames(%d, %11llu)\n", 
     811                        "(%p, %s) getFrames(%d, %11"PRIu64")\n", 
    846812                        this, getTypeString(), nbframes, ts); 
    847813    assert( getType() == ePT_Receive ); 
     
    874840    lag_frames = (((float)lag_ticks) / srate); 
    875841    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", 
    877843                       this, lag_ticks, lag_frames, srate, ts, ts_expected, fc); 
    878844    if (lag_frames >= 1.0) { 
    879845        // 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", 
    881847                      this, lag_ticks, lag_frames, srate, ts, ts_expected, fc); 
    882848    } else if (lag_frames <= -1.0) { 
    883849        // 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", 
    885851                      this, lag_ticks, lag_frames, srate, ts, ts_expected, fc); 
    886852    } 
     
    896862{ 
    897863    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", 
    899865                       this, nbframes, ts); 
    900866    // dry run on this side means that we put silence in all enabled ports 
     
    907873{ 
    908874    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); 
    910876    result = m_data_buffer->dropFrames(nbframes); 
    911877    SIGNAL_ACTIVITY_ISO_RECV; 
     
    917883    bool result; 
    918884    debugOutputExtreme( DEBUG_LEVEL_VERBOSE, 
    919                         "(%p, %s) putFrames(%d, %11llu)\n", 
     885                        "(%p, %s) putFrames(%d, %11"PRIu64")\n", 
    920886                        this, getTypeString(), nbframes, ts); 
    921887    assert( getType() == ePT_Transmit ); 
     
    930896{ 
    931897    debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 
    932                        "StreamProcessor::putFramesWet(%d, %llu)\n", 
     898                       "StreamProcessor::putFramesWet(%d, %"PRIu64")\n", 
    933899                       nbframes, ts); 
    934900    // transfer the data 
    935901    m_data_buffer->blockProcessWriteFrames(nbframes, ts); 
    936902    debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 
    937                        " New timestamp: %llu\n", ts); 
     903                       " New timestamp: %"PRIu64"\n", ts); 
    938904    return true; // FIXME: what about failure? 
    939905} 
     
    943909{ 
    944910    debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 
    945                        "StreamProcessor::putFramesDry(%d, %llu)\n", 
     911                       "StreamProcessor::putFramesDry(%d, %"PRIu64")\n", 
    946912                       nbframes, ts); 
    947913    // do nothing 
     
    953919{ 
    954920    debugOutput(DEBUG_LEVEL_VERY_VERBOSE, 
    955                        "StreamProcessor::putSilenceFrames(%d, %llu)\n", 
     921                       "StreamProcessor::putSilenceFrames(%d, %"PRIu64")\n", 
    956922                       nbframes, ts); 
    957923 
     
    11041070    // make the scratch buffer one period of frames long 
    11051071    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); 
    11071073    if(m_scratch_buffer) delete[] m_scratch_buffer; 
    11081074    m_scratch_buffer = new byte_t[m_scratch_buffer_size_bytes]; 
     
    11931159    #ifdef DEBUG 
    11941160    uint64_t now = m_1394service.getCycleTimerTicks(); 
    1195     debugOutput(DEBUG_LEVEL_VERBOSE,"  Now                   : %011llu (%03us %04uc %04ut)\n", 
     1161    debugOutput(DEBUG_LEVEL_VERBOSE,"  Now                   : %011"PRIu64" (%03us %04uc %04ut)\n", 
    11961162                          now, 
    11971163                          (unsigned int)TICKS_TO_SECS(now), 
    11981164                          (unsigned int)TICKS_TO_CYCLES(now), 
    11991165                          (unsigned int)TICKS_TO_OFFSET(now)); 
    1200     debugOutput(DEBUG_LEVEL_VERBOSE,"  Start at              : %011llu (%03us %04uc %04ut)\n", 
     1166    debugOutput(DEBUG_LEVEL_VERBOSE,"  Start at              : %011"PRIu64" (%03us %04uc %04ut)\n", 
    12011167                          tx, 
    12021168                          (unsigned int)TICKS_TO_SECS(tx), 
     
    12391205    #ifdef DEBUG 
    12401206    uint64_t now = m_1394service.getCycleTimerTicks(); 
    1241     debugOutput(DEBUG_LEVEL_VERBOSE,"  Now                   : %011llu (%03us %04uc %04ut)\n", 
     1207    debugOutput(DEBUG_LEVEL_VERBOSE,"  Now                   : %011"PRIu64" (%03us %04uc %04ut)\n", 
    12421208                          now, 
    12431209                          (unsigned int)TICKS_TO_SECS(now), 
    12441210                          (unsigned int)TICKS_TO_CYCLES(now), 
    12451211                          (unsigned int)TICKS_TO_OFFSET(now)); 
    1246     debugOutput(DEBUG_LEVEL_VERBOSE,"  Start at              : %011llu (%03us %04uc %04ut)\n", 
     1212    debugOutput(DEBUG_LEVEL_VERBOSE,"  Start at              : %011"PRIu64" (%03us %04uc %04ut)\n", 
    12471213                          tx, 
    12481214                          (unsigned int)TICKS_TO_SECS(tx), 
     
    12631229    #ifdef DEBUG 
    12641230    uint64_t now = m_1394service.getCycleTimerTicks(); 
    1265     debugOutput(DEBUG_LEVEL_VERBOSE,"  Now                   : %011llu (%03us %04uc %04ut)\n", 
     1231    debugOutput(DEBUG_LEVEL_VERBOSE,"  Now                   : %011"PRIu64" (%03us %04uc %04ut)\n", 
    12661232                          now, 
    12671233                          (unsigned int)TICKS_TO_SECS(now), 
    12681234                          (unsigned int)TICKS_TO_CYCLES(now), 
    12691235                          (unsigned int)TICKS_TO_OFFSET(now)); 
    1270     debugOutput(DEBUG_LEVEL_VERBOSE,"  Stop at              : %011llu (%03us %04uc %04ut)\n", 
     1236    debugOutput(DEBUG_LEVEL_VERBOSE,"  Stop at              : %011"PRIu64" (%03us %04uc %04ut)\n", 
    12711237                          tx, 
    12721238                          (unsigned int)TICKS_TO_SECS(tx), 
     
    12881254    #ifdef DEBUG 
    12891255    uint64_t now = m_1394service.getCycleTimerTicks(); 
    1290     debugOutput(DEBUG_LEVEL_VERBOSE,"  Now                   : %011llu (%03us %04uc %04ut)\n", 
     1256    debugOutput(DEBUG_LEVEL_VERBOSE,"  Now                   : %011"PRIu64" (%03us %04uc %04ut)\n", 
    12911257                          now, 
    12921258                          (unsigned int)TICKS_TO_SECS(now), 
    12931259                          (unsigned int)TICKS_TO_CYCLES(now), 
    12941260                          (unsigned int)TICKS_TO_OFFSET(now)); 
    1295     debugOutput(DEBUG_LEVEL_VERBOSE,"  Stop at              : %011llu (%03us %04uc %04ut)\n", 
     1261    debugOutput(DEBUG_LEVEL_VERBOSE,"  Stop at              : %011"PRIu64" (%03us %04uc %04ut)\n", 
    12961262                          tx, 
    12971263                          (unsigned int)TICKS_TO_SECS(tx), 
     
    13841350StreamProcessor::doStop() 
    13851351{ 
     1352    assert(m_data_buffer); 
     1353 
    13861354    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 
    13881358 
    13891359    debugOutput(DEBUG_LEVEL_VERBOSE, "Enter from state: %s\n", ePSToString(m_state)); 
     
    13921362    switch(m_state) { 
    13931363        case ePS_Created: 
    1394             assert(m_data_buffer); 
    1395  
    13961364            // prepare the framerate estimate 
    13971365            ticks_per_frame = (TICKS_PER_SECOND*1.0) / ((float)m_StreamProcessorManager.getNominalRate()); 
     
    13991367            m_local_node_id= m_1394service.getLocalNodeId() & 0x3f; 
    14001368            m_correct_last_timestamp = false; 
    1401  
     1369         
    14021370            debugOutput(DEBUG_LEVEL_VERBOSE, "Initializing remote ticks/frame to %f\n", ticks_per_frame); 
    1403  
     1371         
    14041372            // initialize internal buffer 
    14051373            result &= m_data_buffer->setBufferSize(ringbuffer_size_frames); 
    1406  
     1374         
    14071375            result &= m_data_buffer->setEventSize( getEventSize() ); 
    14081376            result &= m_data_buffer->setEventsPerFrame( getEventsPerFrame() ); 
     
    14131381            } 
    14141382            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); 
    14161384            result &= m_data_buffer->setBandwidth(STREAMPROCESSOR_DLL_FAST_BW_HZ / (double)TICKS_PER_SECOND); 
    14171385            result &= m_data_buffer->prepare(); // FIXME: the name 
     
    14191387            debugOutput(DEBUG_LEVEL_VERBOSE, "DLL info: nominal tpf: %f, update period: %d, bandwidth: %e 1/ticks (%e Hz)\n",  
    14201388                        m_data_buffer->getNominalRate(), m_data_buffer->getUpdatePeriod(), m_data_buffer->getBandwidth(), m_data_buffer->getBandwidth() * TICKS_PER_SECOND); 
    1421  
    14221389            break; 
    14231390        case ePS_DryRunning: 
     
    14321399    } 
    14331400 
    1434     result &= m_data_buffer->clearBuffer(); // FIXME: don't like the reset() name 
     1401    // clear all data 
     1402    result &= m_data_buffer->clearBuffer(); 
    14351403    // make the buffer transparent 
    14361404    m_data_buffer->setTransparent(true); 
     
    15491517{ 
    15501518    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 
    15521524    switch(m_state) { 
    15531525        case ePS_DryRunning: 
     
    15561528            // be picked up by the packet iterator 
    15571529 
    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"); 
    15601534                return false; 
    15611535            } 
     1536 
    15621537            if (getType() == ePT_Transmit) { 
    15631538                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); 
    15711543                // prefill the buffer 
    15721544                if(!transferSilence(ringbuffer_size_frames)) { 
     
    19291901    } 
    19301902    uint64_t now = m_1394service.getCycleTimerTicks(); 
    1931     debugOutputShort( DEBUG_LEVEL_NORMAL, "  Now                   : %011llu (%03us %04uc %04ut)\n", 
     1903    debugOutputShort( DEBUG_LEVEL_NORMAL, "  Now                   : %011"PRIu64" (%03us %04uc %04ut)\n", 
    19321904                        now, 
    19331905                        (unsigned int)TICKS_TO_SECS(now), 
     
    19481920                                          24576000.0/m_StreamProcessorManager.getSyncSource().m_data_buffer->getRate(), 
    19491921                                          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)); 
    19541922    #endif 
    19551923    m_data_buffer->dumpInfo(); 
  • trunk/libffado/src/libstreaming/generic/StreamProcessor.h

    r1531 r1763  
    298298//--- data buffering and accounting 
    299299public: 
    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 ); 
    309305protected: 
    310306    Util::TimestampedBuffer *m_data_buffer; 
     
    332328 
    333329        /** 
    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 
    350335         * boundary. This is assumed to be the point at which the buffer transfer should 
    351336         * take place, meaning that it can be used as a reference timestamp for transmitting 
    352337         * StreamProcessors 
    353338         * 
    354          * \return the time in usecs 
    355          */ 
    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          * 
    363339         * @return the time in internal units 
    364340         */ 
    365341        uint64_t getTimeAtPeriod(); 
    366342 
    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(); 
    385356 
    386357        /** 
     
    453424        float m_ticks_per_frame; 
    454425        float m_dll_bandwidth_hz; 
    455         unsigned int m_sync_delay_frames; 
     426        unsigned int m_extra_buffer_frames; 
    456427    private: 
    457428        bool m_in_xrun; 
  • trunk/libffado/src/libstreaming/motu/MotuReceiveStreamProcessor.cpp

    r1498 r1763  
    187187    #ifdef DEBUG 
    188188    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", 
    190190            m_last_timestamp, getTicksPerFrame()); 
    191191    } 
  • trunk/libffado/src/libstreaming/motu/MotuTransmitStreamProcessor.cpp

    r1498 r1763  
    207207            // we are too late 
    208208            debugOutput(DEBUG_LEVEL_VERBOSE, 
    209                         "Too late: CY=%04u, TC=%04u, CUT=%04d, TSP=%011llu (%04u)\n", 
     209                        "Too late: CY=%04u, TC=%04u, CUT=%04d, TSP=%011"PRIu64" (%04u)\n", 
    210210                        cycle, 
    211211                        transmit_at_cycle, cycles_until_transmit, 
     
    242242        { 
    243243            debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, 
    244                         "Too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011llu (%04u), TSP=%011llu (%04u)\n", 
     244                        "Too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011"PRIu64" (%04u), TSP=%011"PRIu64" (%04u)\n", 
    245245                        cycle, 
    246246                        transmit_at_cycle, cycles_until_transmit, 
     
    251251            { 
    252252                debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, 
    253                             "Way too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011llu (%04u), TSP=%011llu (%04u)\n", 
     253                            "Way too early: CY=%04u, TC=%04u, CUT=%04d, TST=%011"PRIu64" (%04u), TSP=%011"PRIu64" (%04u)\n", 
    254254                            cycle, 
    255255                            transmit_at_cycle, cycles_until_transmit, 
     
    330330    uint32_t pkt_ctr ) 
    331331{ 
    332     debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, "XMIT EMPTY: CY=%04u, 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,  
    334334                ( unsigned int ) TICKS_TO_CYCLES ( m_last_timestamp ) ); 
    335335 
     
    359359    unsigned int cycle = CYCLE_TIMER_GET_CYCLES(pkt_ctr); 
    360360 
    361     debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "XMIT SILENT: CY=%04u, TSP=%011llu (%04u)\n", 
     361    debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "XMIT SILENT: CY=%04u, TSP=%011"PRIu64" (%04u)\n", 
    362362                 cycle, m_last_timestamp, 
    363363                 ( unsigned int ) TICKS_TO_CYCLES ( m_last_timestamp ) ); 
  • trunk/libffado/src/libstreaming/StreamProcessorManager.cpp

    r1531 r1763  
    5353    , m_nb_buffers( 0 ) 
    5454    , m_period( 0 ) 
     55    , m_sync_delay( 0 ) 
    5556    , m_audio_datatype( eADT_Float ) 
    5657    , m_nominal_framerate ( 0 ) 
     
    7778    , m_nb_buffers(nb_buffers) 
    7879    , m_period(period) 
     80    , m_sync_delay( 0 ) 
    7981    , m_audio_datatype( eADT_Float ) 
    8082    , m_nominal_framerate ( framerate ) 
     
    191193            debugError("(%p) sem_[timed]wait error (result=%d errno=EINVAL)\n",  
    192194                        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); 
    195198            return eAR_Error; 
    196199        } else { 
    197200            debugError("(%p) sem_[timed]wait error (result=%d errno=%d)\n",  
    198201                        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); 
    201205            return eAR_Error; 
    202206        } 
     
    472476    // get the options 
    473477    int signal_delay_ticks = STREAMPROCESSORMANAGER_SIGNAL_DELAY_TICKS; 
     478    int xmit_prebuffer_frames = STREAMPROCESSORMANAGER_XMIT_PREBUFFER_FRAMES; 
    474479    int sync_wait_time_msec = STREAMPROCESSORMANAGER_SYNC_WAIT_TIME_MSEC; 
    475480    int cycles_for_startup = STREAMPROCESSORMANAGER_CYCLES_FOR_STARTUP; 
     
    478483    Util::Configuration &config = m_parent.getConfiguration(); 
    479484    config.getValueForSetting("streaming.spm.signal_delay_ticks", signal_delay_ticks); 
     485    config.getValueForSetting("streaming.spm.xmit_prebuffer_frames", xmit_prebuffer_frames); 
    480486    config.getValueForSetting("streaming.spm.sync_wait_time_msec", sync_wait_time_msec); 
    481487    config.getValueForSetting("streaming.spm.cycles_for_startup", cycles_for_startup); 
     
    514520    // at which the buffer is transfer()'ed. This makes things somewhat 
    515521    // 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; 
    528523 
    529524    //STEP X: when we implement such a function, we can wait for a signal from the devices that they 
     
    540535    nb_sync_runs /= getPeriodSize(); 
    541536 
    542     int64_t time_till_next_period; 
    543537    while(nb_sync_runs--) { // or while not sync-ed? 
    544538        // 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 
    551556    } 
    552557 
     
    564569    debugOutput( DEBUG_LEVEL_VERBOSE, " sync source frame rate: %f fps (%f tpf)\n", syncrate, tpf); 
    565570 
    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  
    574571    // we now should have decent sync info on the sync source 
    575572    // determine a point in time where the system should start 
    576573    // figure out where we are now 
    577574    uint64_t time_of_first_sample = m_SyncSource->getTimeAtPeriod(); 
    578     debugOutput( DEBUG_LEVEL_VERBOSE, " sync at TS=%011llu (%03us %04uc %04ut)...\n",  
     575    debugOutput( DEBUG_LEVEL_VERBOSE, " sync at TS=%011"PRIu64" (%03us %04uc %04ut)...\n",  
    579576        time_of_first_sample, 
    580577        (unsigned int)TICKS_TO_SECS(time_of_first_sample), 
     
    593590    time_of_first_sample = addTicks(time_of_first_sample, 
    594591                                    time_for_startup_ticks); 
    595     debugOutput( DEBUG_LEVEL_VERBOSE, "  add %d frames (%011llu ticks)...\n",  
     592    debugOutput( DEBUG_LEVEL_VERBOSE, "  add %d frames (%011"PRIu64" ticks)...\n",  
    596593        time_for_startup_frames, time_for_startup_ticks); 
    597594 
    598     debugOutput( DEBUG_LEVEL_VERBOSE, "  => first sample at TS=%011llu (%03us %04uc %04ut)...\n",  
     595    debugOutput( DEBUG_LEVEL_VERBOSE, "  => first sample at TS=%011"PRIu64" (%03us %04uc %04ut)...\n",  
    599596        time_of_first_sample, 
    600597        (unsigned int)TICKS_TO_SECS(time_of_first_sample), 
     
    609606    uint64_t time_to_start_recv = substractTicks(time_of_first_sample, 
    610607                                                 prestart_cycles_for_recv * TICKS_PER_CYCLE); 
    611     debugOutput( DEBUG_LEVEL_VERBOSE, "  => xmit starts at  TS=%011llu (%03us %04uc %04ut)...\n",  
     608    debugOutput( DEBUG_LEVEL_VERBOSE, "  => xmit starts at  TS=%011"PRIu64" (%03us %04uc %04ut)...\n",  
    612609        time_to_start_xmit, 
    613610        (unsigned int)TICKS_TO_SECS(time_to_start_xmit), 
    614611        (unsigned int)TICKS_TO_CYCLES(time_to_start_xmit), 
    615612        (unsigned int)TICKS_TO_OFFSET(time_to_start_xmit)); 
    616     debugOutput( DEBUG_LEVEL_VERBOSE, "  => recv starts at  TS=%011llu (%03us %04uc %04ut)...\n",  
     613    debugOutput( DEBUG_LEVEL_VERBOSE, "  => recv starts at  TS=%011"PRIu64" (%03us %04uc %04ut)...\n",  
    617614        time_to_start_recv, 
    618615        (unsigned int)TICKS_TO_SECS(time_to_start_recv), 
    619616        (unsigned int)TICKS_TO_CYCLES(time_to_start_recv), 
    620617        (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    } 
    621651 
    622652    // at this point the buffer head timestamp of the transmit buffers can be set 
     
    625655          it != m_TransmitProcessors.end(); 
    626656          ++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 
    627661        (*it)->setBufferHeadTimestamp(time_of_first_sample); 
    628662        ffado_timestamp_t ts; 
    629663        signed int fc; 
    630664        (*it)->getBufferHeadTimestamp ( &ts, &fc ); 
    631         debugOutput( DEBUG_LEVEL_VERBOSE, " transmit buffer tail %010lld => head TS %010lld, fc=%d...\n", 
     665        debugOutput( DEBUG_LEVEL_VERBOSE, " transmit buffer tail %010"PRId64" => head TS %010"PRIu64", fc=%d...\n", 
    632666                    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); 
    633683    } 
    634684 
     
    643693    } 
    644694    if(!m_SyncSource->scheduleStartRunning(time_to_start_sync)) { 
    645         debugError("m_SyncSource->scheduleStartRunning(%11llu) failed\n", time_to_start_sync); 
     695        debugError("m_SyncSource->scheduleStartRunning(%11"PRIu64") failed\n", time_to_start_sync); 
    646696        return false; 
    647697    } 
     
    653703        if(*it != m_SyncSource) { 
    654704            if(!(*it)->scheduleStartRunning(time_to_start_recv)) { 
    655                 debugError("%p->scheduleStartRunning(%11llu) failed\n", *it, time_to_start_recv); 
     705                debugError("%p->scheduleStartRunning(%11"PRIu64") failed\n", *it, time_to_start_recv); 
    656706                return false; 
    657707            } 
     
    663713        if(*it != m_SyncSource) { 
    664714            if(!(*it)->scheduleStartRunning(time_to_start_xmit)) { 
    665                 debugError("%p->scheduleStartRunning(%11llu) failed\n", *it, time_to_start_xmit); 
     715                debugError("%p->scheduleStartRunning(%11"PRIu64") failed\n", *it, time_to_start_xmit); 
    666716                return false; 
    667717            } 
     
    696746    #endif 
    697747 
    698     debugOutput( DEBUG_LEVEL_VERBOSE, "  initial time of transfer %010lld, rate %f...\n", 
     748    debugOutput( DEBUG_LEVEL_VERBOSE, "  initial time of transfer %010"PRId64", rate %f...\n", 
    699749                m_time_of_transfer, rate); 
    700750 
    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); 
    705754 
    706755    // then use this information to initialize the xmit handlers 
     
    709758    //  to the period transfer time instant plus what's nb_buffers - 1 
    710759    //  in ticks. This due to the fact that we (should) have received one period 
    711     //  worth of ticks at t=m_time_of_transfer 
     760    //  worth of ticks at t = m_time_of_transfer 
    712761    //  hence one period of frames should also have been transmitted, which means 
    713762    //  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 
    714764    //  that allows us to calculate the tail timestamp for the buffer. 
    715765 
    716766    int64_t transmit_tail_timestamp = addTicks(m_time_of_transfer, delay_in_ticks); 
    717     debugOutput( DEBUG_LEVEL_VERBOSE, "  preset transmit tail TS %010lld, rate %f...\n", 
     767    debugOutput( DEBUG_LEVEL_VERBOSE, "  preset transmit tail TS %010"PRId64", rate %f...\n", 
    718768                transmit_tail_timestamp, rate); 
    719769 
     
    726776        signed int fc; 
    727777        (*it)->getBufferHeadTimestamp ( &ts, &fc ); 
    728         debugOutput( DEBUG_LEVEL_VERBOSE, "   => transmit head TS %010lld, fc=%d...\n", 
     778        debugOutput( DEBUG_LEVEL_VERBOSE, "   => transmit head TS %010"PRId64", fc=%d...\n", 
    729779                    (uint64_t)ts, fc); 
    730780    } 
     
    783833                StreamProcessor *s = m_ReceiveProcessors.at(i); 
    784834                diff = diffTicks(m_SyncSource->getTimeAtPeriod(), s->getTimeAtPeriod()); 
    785                 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "  offset between SyncSP %p and SP %p is %lld ticks...\n",  
     835                debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "  offset between SyncSP %p and SP %p is %"PRId64" ticks...\n",  
    786836                    m_SyncSource, s, diff); 
    787837                if ( nb_sync_runs == periods_per_align_try ) { 
     
    805855            diff_between_streams[i] /= periods_per_align_try; 
    806856            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 %lld ticks, %d frames...\n",  
     857            debugOutput( DEBUG_LEVEL_VERBOSE, "   avg offset between SyncSP %p and SP %p is %"PRId64" ticks, %d frames...\n",  
    808858                m_SyncSource, s, diff_between_streams[i], diff_between_streams_frames[i]); 
    809859 
     
    10781128                        m_SyncSource->getBufferFill()); 
    10791129    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
    10811131    uint64_t pred_system_time_at_xfer = m_SyncSource->getParent().get1394Service().getSystemTimeForCycleTimerTicks(ticks_at_period_margin); 
    10821132 
    10831133    #ifdef DEBUG 
    10841134    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 ); 
    10861137    #endif 
    10871138 
     
    10911142    #ifdef DEBUG 
    10921143    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 ); 
    10941145    #endif 
    10951146 
    10961147    // 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 
    10971175 
    10981176    #if STREAMPROCESSORMANAGER_ALLOW_DELAYED_PERIOD_SIGNAL 
     
    11941272    // so 50 ticks = 10%, which is a rather large jitter value. 
    11951273    if(diff-ticks_per_period > 50 || diff-ticks_per_period < -50) { 
    1196         debugOutput(DEBUG_LEVEL_VERBOSE, "rather large TSP difference TS=%011llu => 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", 
    11971275                                            m_time_of_transfer2, m_time_of_transfer, diff, ticks_per_period); 
    11981276    } 
     
    12011279 
    12021280    debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 
    1203                         "transfer period %d at %llu ticks...\n", 
     1281                        "transfer period %d at %"PRIu64" ticks...\n", 
    12041282                        m_nbperiods, m_time_of_transfer); 
    12051283 
    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 
    12131285    int rcv_bf=0, xmt_bf=0; 
    12141286    for ( StreamProcessorVectorIterator it = m_ReceiveProcessors.begin(); 
     
    12231295    } 
    12241296    debugOutputExtreme( DEBUG_LEVEL_VERY_VERBOSE,  
    1225                         "XF at %011llu ticks, RBF=%d, XBF=%d, SUM=%d...\n", 
     1297                        "XF at %011"PRIu64" ticks, RBF=%d, XBF=%d, SUM=%d...\n", 
    12261298                        m_time_of_transfer, rcv_bf, xmt_bf, rcv_bf+xmt_bf); 
    12271299 
     
    12551327        } 
    12561328    } 
    1257 #endif 
     1329    #endif 
    12581330    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 
    12591340    // now we can signal the client that we are (should be) ready 
    12601341    return !xrun_occurred; 
     
    12871368    if(m_SyncSource == NULL) return false; 
    12881369    debugOutputExtreme( DEBUG_LEVEL_VERY_VERBOSE, 
    1289         "transfer(%d) at TS=%011llu (%03us %04uc %04ut)...\n",  
     1370        "transfer(%d) at TS=%011"PRIu64" (%03us %04uc %04ut)...\n",  
    12901371        t, m_time_of_transfer, 
    12911372        (unsigned int)TICKS_TO_SECS(m_time_of_transfer), 
     
    13011382                ++it ) { 
    13021383            if(!(*it)->getFrames(m_period, m_time_of_transfer)) { 
    1303                     debugWarning("could not getFrames(%u, %11llu) from stream processor (%p)\n", 
     1384                    debugWarning("could not getFrames(%u, %11"PRIu64") from stream processor (%p)\n", 
    13041385                            m_period, m_time_of_transfer,*it); 
    13051386                retval &= false; // buffer underrun 
     
    13101391        //        1394 time 
    13111392        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 transmitted 
    1315         // one ringbuffer size after it has been received 
    1316  
    1317         // we also add one syncdelay as a safety margin, since that's the amount of time we can get 
    1318         // postponed. 
    1319         int syncdelay = m_SyncSource->getSyncDelay(); 
    1320         int64_t transmit_timestamp = addTicks(m_time_of_transfer, one_ringbuffer_in_ticks + syncdelay); 
    13211393 
    13221394        for ( StreamProcessorVectorIterator it = m_TransmitProcessors.begin(); 
    13231395                it != m_TransmitProcessors.end(); 
    13241396                ++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 
    13271406            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", 
    13291408                        m_period, transmit_timestamp, *it); 
    13301409                retval &= false; // buffer underrun 
     
    13671446    if(m_SyncSource == NULL) return false; 
    13681447    debugOutput( DEBUG_LEVEL_VERY_VERBOSE, 
    1369         "transferSilence(%d) at TS=%011llu (%03us %04uc %04ut)...\n",  
     1448        "transferSilence(%d) at TS=%011"PRIu64" (%03us %04uc %04ut)...\n",  
    13701449        t, m_time_of_transfer, 
    13711450        (unsigned int)TICKS_TO_SECS(m_time_of_transfer), 
     
    13811460                ++it ) { 
    13821461            if(!(*it)->dropFrames(m_period, m_time_of_transfer)) { 
    1383                     debugWarning("could not dropFrames(%u, %11llu) from stream processor (%p)\n", 
     1462                    debugWarning("could not dropFrames(%u, %11"PRIu64") from stream processor (%p)\n", 
    13841463                            m_period, m_time_of_transfer,*it); 
    13851464                retval &= false; // buffer underrun 
     
    13901469        //        1394 time 
    13911470        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 transmitted 
    1395         // one ringbuffer size after it has been received 
    1396         // we also add one syncdelay as a safety margin, since that's the amount of time we can get 
    1397         // postponed. 
    1398         int syncdelay = m_SyncSource->getSyncDelay(); 
    1399         int64_t transmit_timestamp = addTicks(m_time_of_transfer, one_ringbuffer_in_ticks + syncdelay); 
    14001471 
    14011472        for ( StreamProcessorVectorIterator it = m_TransmitProcessors.begin(); 
    14021473                it != m_TransmitProcessors.end(); 
    14031474                ++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 
    14061484            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", 
    14081486                        m_period, transmit_timestamp, *it); 
    14091487                retval &= false; // buffer underrun 
     
    15781656        #ifdef DEBUG 
    15791657        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()); 
    15811659            return NULL; 
    15821660        } 
     
    15861664        #ifdef DEBUG 
    15871665        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()); 
    15891667            return NULL; 
    15901668        } 
  • trunk/libffado/src/libstreaming/StreamProcessorManager.h

    r1531 r1763  
    190190    unsigned int m_nb_buffers; 
    191191    unsigned int m_period; 
     192    unsigned int m_sync_delay; 
    192193    enum eADT_AudioDataType m_audio_datatype; 
    193194    unsigned int m_nominal_framerate; 
  • trunk/libffado/src/libutil/Configuration.cpp

    r1568 r1763  
    182182            int32_t i = s; 
    183183            debugOutput(DEBUG_LEVEL_NORMAL, 
    184                         "  %s%s = %ld (0x%08lX)\n", 
     184                        "  %s%s = %d (0x%08X)\n", 
    185185                        prefix.c_str(), s.getName(), i, i); 
    186186        } 
     
    190190            int64_t i = s; 
    191191            debugOutput(DEBUG_LEVEL_NORMAL, 
    192                         "  %s%s = %lld (0x%016llX)\n", 
     192                        "  %s%s = %"PRId64" (0x%016"PRIX64")\n", 
    193193                        prefix.c_str(), s.getName(), i, i); 
    194194        } 
     
    259259        if(t == Setting::TypeInt64) { 
    260260            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); 
    262262            return true; 
    263263        } else { 
  • trunk/libffado/src/libutil/PosixThread.cpp

    r1550 r1763  
    149149        if (res) { 
    150150            debugError("Cannot create realtime thread (%d: %s)\n", res, strerror(res)); 
    151             debugError(" priority: %d %s\n", fPriority); 
     151            debugError(" priority: %d\n", fPriority); 
    152152            return -1; 
    153153        } 
     
    172172{ 
    173173    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); 
    175175        void* status; 
    176176        pthread_cancel(fThread); 
     
    178178        pthread_join(fThread, &status); 
    179179        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); 
    181181        return 0; 
    182182    } else { 
     
    188188{ 
    189189    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); 
    191191        void* status; 
    192192        fRunning = false; // Request for the thread to stop 
     
    195195        fThread = NULL; 
    196196        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); 
    198198        return 0; 
    199199    } else { 
  • trunk/libffado/src/libutil/serialize_expat.cpp

    r1254 r1763  
    117117            Xml::Node& n = pNode->add( Xml::Node(tokens[tokens.size() - 1].c_str(), NULL) ); 
    118118            char* valstr; 
    119             asprintf( &valstr, "%lld", value ); 
     119            asprintf( &valstr, "%"PRId64"", value ); 
    120120            n.set_child_text( valstr ); 
    121121            free( valstr ); 
  • trunk/libffado/src/libutil/serialize_libxml.cpp

    r1568 r1763  
    8989 
    9090{ 
    91     debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "write %s = %d\n", 
     91    debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "write %s = %lld\n", 
    9292                 strMemberName.c_str(), value ); 
    9393 
     
    266266            value = strtoll( pElement->get_child_text()->get_content().c_str(), 
    267267                             &tail, 0 ); 
    268             debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "found %s = %d\n", 
     268            debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "found %s = %lld\n", 
    269269                         strMemberName.c_str(), value ); 
    270270            return true; 
  • trunk/libffado/src/libutil/StreamStatistics.cpp

    r864 r1763  
    5555void StreamStatistics::dumpInfo() { 
    5656    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", 
    5858                      m_name.c_str(), m_min, m_average, m_max, m_count, m_sum); 
    5959    debugOutputShort( DEBUG_LEVEL_VERBOSE, "    Signal stats\n"); 
  • trunk/libffado/src/libutil/SystemTimeSource.cpp

    r1165 r1763  
    5555    ts.tv_nsec = (wake_at_usec % (1000000LL)) * 1000LL; 
    5656    debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 
    57                 "clock_nanosleep until %lld sec, %lld nanosec\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); 
    5959    int err = clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &ts, NULL); 
    6060    if(err) { 
  • trunk/libffado/src/libutil/Time.h

    r864 r1763  
    2525#define __Time__ 
    2626 
     27#ifndef __STDC_FORMAT_MACROS 
     28#define __STDC_FORMAT_MACROS 
     29#endif 
    2730#include <inttypes.h> 
    2831 
     
    3437 */ 
    3538typedef uint64_t ffado_microsecs_t; 
     39#define PRI_FFADO_MICROSECS_T PRIu64 
    3640 
    3741static inline void SleepRelativeUsec(ffado_microsecs_t usec) { 
  • trunk/libffado/src/libutil/TimestampedBuffer.cpp

    r1531 r1763  
    383383    m_current_rate = m_nominal_rate; 
    384384 
    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"); 
    388387        return false; 
    389388    } 
     
    408407    m_buffer_tail_timestamp = TIMESTAMP_MAX + 1.0; 
    409408    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 */ 
     417bool 
     418TimestampedBuffer::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; 
    410441 
    411442    return true; 
     
    474505        if (written < write_size) 
    475506        { 
    476             debugWarning("ringbuffer full, %u, %u\n", write_size, written); 
     507            debugWarning("ringbuffer full, %u, %zd\n", write_size, written); 
    477508            return false; 
    478509        } 
     
    503534    if (written < write_size) 
    504535    { 
    505         debugWarning("ringbuffer full, request: %u, actual: %u\n", write_size, written); 
     536        debugWarning("ringbuffer full, request: %u, actual: %zd\n", write_size, written); 
    506537        return false; 
    507538    } 
     
    614645 
    615646        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", 
    617648                       this, ffado_ringbuffer_read_space(m_event_buffer), bytes2write); 
    618649            debugShowBackLog(); 
  • trunk/libffado/src/libutil/TimestampedBuffer.h

    r1531 r1763  
    152152        void dumpInfo(); 
    153153        void setVerboseLevel ( int l ) {setDebugLevel ( l );}; 
     154 
     155        bool resizeBuffer(unsigned int size); 
    154156 
    155157    private: 
  • trunk/libffado/src/motu/motu_avdevice.cpp

    r1605 r1763  
    2626 
    2727#include "motu/motu_avdevice.h" 
     28#include "motu/motu_mixerdefs.h" 
     29#include "motu/motu_mark3_mixerdefs.h" 
    2830 
    2931#include "devicemanager.h" 
     
    6769    {FW_VENDORID_MOTU, 0, 0x00000005, 0x000001f2, MOTU_MODEL_896HD, "MOTU", "896HD"}, 
    6870    {FW_VENDORID_MOTU, 0, 0x00000015, 0x000001f2, MOTU_MODEL_828mk3, "MOTU", "828Mk3"}, 
     71    {FW_VENDORID_MOTU, 0, 0x00000019, 0x000001f2, MOTU_MODEL_ULTRALITEmk3, "MOTU", "UltraLineMk3"}, 
    6972}; 
    7073 
     
    202205const PortEntry Ports_ULTRALITE[] = 
    203206{ 
    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}, 
    206209    {"Mix-L", MOTU_PA_IN | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 10}, 
    207210    {"Mix-R", MOTU_PA_IN | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 13}, 
     
    218221    {"Phones-L", MOTU_PA_OUT | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY, 10}, 
    219222    {"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}, 
    220225    {"Padding1", MOTU_PA_IN | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY|MOTU_PA_PADDING, 46}, 
    221226    {"Padding2", MOTU_PA_IN | MOTU_PA_RATE_ANY|MOTU_PA_OPTICAL_ANY|MOTU_PA_PADDING, 49}, 
     
    306311}; 
    307312 
    308 // Mixer registers 
    309 const MatrixMixBus MixerBuses_Traveler[] = { 
    310     {"Mix 1", 0x4000, }, 
    311     {"Mix 2", 0x4100, }, 
    312     {"Mix 3", 0x4200, }, 
    313     {"Mix 4", 0x4300, }, 
     313const 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}, 
    314337}; 
    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); 
    541338 
    542339/* The order of DevicesProperty entries must match the numeric order of the 
     
    544341 */ 
    545342const 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 }, 
    554352}; 
    555353 
     
    584382 
    585383    destroyMixer(); 
    586 } 
    587  
    588 bool 
    589 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 supported 
    655     // 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 bool 
    827 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 container 
    834     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 mixers 
    841     result = buildMixerAudioControls(); 
    842  
    843     /* Now add some general device information controls.  These may yet 
    844      * 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 up 
    856         destroyMixer(); 
    857         return false; 
    858     } 
    859  
    860     // Special controls 
    861     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 here 
    869  
    870     if (!result) { 
    871         debugWarning("One or more device control elements could not be created\n"); 
    872         // clean up those that couldn't be created 
    873         destroyMixer(); 
    874         return false; 
    875     } 
    876     if (!addElement(m_ControlContainer)) { 
    877         debugWarning("Could not register controls to device\n"); 
    878         // clean up 
    879         destroyMixer(); 
    880         return false; 
    881     } 
    882  
    883     return true; 
    884 } 
    885  
    886  
    887 bool 
    888 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     } else 
    895     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 elements 
    900         m_MixerContainer->clearElements(true); 
    901         delete m_MixerContainer; 
    902         m_MixerContainer = NULL; 
    903     } 
    904  
    905     // remove control container 
    906     if (m_ControlContainer == NULL) { 
    907         debugOutput(DEBUG_LEVEL_VERBOSE, "no controls to destroy...\n"); 
    908     } else 
    909     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 elements 
    914         m_ControlContainer->clearElements(true); 
    915         delete m_ControlContainer; 
    916         m_ControlContainer = NULL; 
    917     } 
    918     return ret; 
    919384} 
    920385 
     
    1010475 * Retrieve the current sample rate from the MOTU device. 
    1011476 */ 
    1012     quadlet_t q = ReadRegister(MOTU_REG_CLK_CTRL)
     477    quadlet_t q = 0
    1013478    int rate = 0; 
    1014479 
     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); 
    1015491    switch (q & MOTU_RATE_BASE_MASK) { 
    1016492        case MOTU_RATE_BASE_44100: 
     
    1057533    if ( samplingFrequency > DevicesProperty[m_motu_model-1].MaxSampleRate ) 
    1058534       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 */ 
    1059575 
    1060576    reg = ReadRegister(MOTU_REG_CLK_CTRL); 
     
    1220736MotuDevice::clockIdToClockSource(unsigned int id) { 
    1221737    ClockSource s; 
     738    bool g1_model = (m_motu_model == MOTU_MODEL_828MkI); 
    1222739    s.id = id; 
    1223740 
     
    1235752            s.type = eCT_ADAT; 
    1236753            s.description = "ADAT optical"; 
     754            s.valid = s.active = s.locked = !g1_model; 
    1237755            break; 
    1238756        case MOTU_CLKSRC_SPDIF_TOSLINK: 
     
    1252770            s.type = eCT_WordClock; 
    1253771            s.description = "Wordclock"; 
     772            s.valid = s.active = s.locked = !g1_model; 
    1254773            break; 
    1255774        case MOTU_CLKSRC_ADAT_9PIN: 
     
    1260779            s.type = eCT_AES; 
    1261780            s.description = "AES/EBU"; 
     781            s.valid = s.active = s.locked = !g1_model; 
    1262782            break; 
    1263783        default: 
     
    15631083quadlet_t isoctrl = ReadRegister(MOTU_REG_ISOCTRL); 
    15641084 
     1085    if (m_motu_model == MOTU_MODEL_828MkI) { 
     1086        // The 828MkI device does this differently. 
     1087        // To be implemented 
     1088        return false; 
     1089    } 
     1090 
    15651091    // NOTE: this assumes that you have two streams 
    15661092    switch (i) { 
     
    16141140    // TODO: connection management: break connection 
    16151141    // 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    } 
    16161148 
    16171149    // NOTE: this assumes that you have two streams 
     
    16501182 
    16511183unsigned 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); 
    16561204 
    16571205    if (dir == MOTU_DIR_IN) 
     
    16621210 
    16631211signed int MotuDevice::setOpticalMode(unsigned int dir, unsigned int mode) { 
    1664     unsigned int reg = ReadRegister(MOTU_REG_ROUTE_PORT_CONF)
     1212    unsigned int reg
    16651213    unsigned int opt_ctrl = 0x0000002; 
    16661214 
     
    16701218    if (m_motu_model==MOTU_MODEL_896HD && mode==MOTU_OPTICAL_MODE_TOSLINK) 
    16711219        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); 
    16721238 
    16731239    // Set up the optical control register value according to the current 
  • trunk/libffado/src/motu/motu_avdevice.h

    r1531 r1763  
    3535 
    3636#include "motu_controls.h" 
     37#include "motu_mark3_controls.h" 
    3738 
    3839#define MOTU_BASE_ADDR               0xfffff0000000ULL 
     
    8889#define MOTU_REG_INPUT_GAIN_PHINV1 0x0c74 
    8990#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 
    90143 
    91144/* Port Active Flags (ports declaration) */ 
     
    122175 
    123176enum 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, 
    132186}; 
    133187 
     
    148202}; 
    149203 
     204// Structures used for pre-Mark3 device mixer definitions 
    150205struct MixerCtrl { 
    151206    const char *name, *label, *desc; 
     
    153208    unsigned int dev_register; 
    154209}; 
    155  
    156210struct MatrixMixBus { 
    157211    const char *name; 
    158212    unsigned int address; 
    159213}; 
    160  
    161214struct MatrixMixChannel { 
    162215    const char *name; 
     
    164217    unsigned int addr_ofs; 
    165218}; 
    166  
    167219struct MotuMixer { 
    168220    const MixerCtrl *mixer_ctrl; 
     
    174226}; 
    175227 
     228// Structures used for devices which use the "Mark3" mixer protocol 
     229struct MotuMark3Mixer { 
     230}; 
     231 
    176232struct DevicePropertyEntry { 
    177233    const PortEntry* port_entry; 
    178234    unsigned int n_port_entries; 
    179235    signed int MaxSampleRate; 
     236    // A device will set at most one of the *mixer fields 
    180237    const struct MotuMixer *mixer; 
     238    const struct MotuMark3Mixer *m3mixer; 
    181239    // Others features can be added here like MIDI port presence. 
    182240}; 
     241 
     242extern const DevicePropertyEntry DevicesProperty[]; 
    183243 
    184244/* Macro to calculate the size of an array */ 
     
    244304private: 
    245305    bool buildMixerAudioControls(void); 
     306    bool buildMark3MixerAudioControls(void); 
    246307    bool addPort(Streaming::StreamProcessor *s_processor, 
    247308        char *name, 
  • trunk/libffado/src/motu/motu_controls.cpp

    r1531 r1763  
    301301    if (v > 0x80) 
    302302      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", 
    304304      row, col, val, v); 
    305305    reg = getCellRegister(row,col); 
     
    331331    val = m_parent.ReadRegister(reg) & 0xff; 
    332332 
    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", 
    334334      row, col, val); 
    335335    return val; 
     
    353353      v = 0x80; 
    354354 
    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", 
    356356      row, col, val, v); 
    357357    reg = getCellRegister(row,col); 
     
    387387    val = ((val >> 8) & 0xff) - 0x40; 
    388388 
    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", 
    390390      row, col, val); 
    391391    return val; 
     
    414414    uint32_t v, reg; 
    415415 
    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", 
    417417      row, col, val, val==0?0:1); 
    418418    reg = getCellRegister(row,col); 
     
    460460    val = (val & m_value_mask) != 0; 
    461461 
    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", 
    463463      row, col, val); 
    464464    return val; 
  • trunk/libffado/src/motu/motu_controls.h

    r1742 r1763  
    2323 * 
    2424 */ 
     25 
     26/* DBus controls used with devices which utilise a pre-Mark3 mixer interface */ 
    2527 
    2628#include "debugmodule/debugmodule.h" 
  • trunk/libffado/src/motu/motu_mixerdefs.cpp

    r1579 r1763  
    254254}; 
    255255 
     256const MatrixMixBus MixerBuses_8pre[] = { 
     257    {"Mix 1", 0x4000, }, 
     258    {"Mix 2", 0x4100, }, 
     259    {"Mix 3", 0x4200, }, 
     260    {"Mix 4", 0x4300, }, 
     261}; 
     262 
     263const 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 
     282const 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 
    256296const MotuMixer Mixer_Traveler = MOTUMIXER( 
    257297    MixerCtrls_Traveler, MixerBuses_Traveler, MixerChannels_Traveler); 
     
    266306    MixerCtrls_896HD, MixerBuses_896HD, MixerChannels_896HD); 
    267307 
     308const MotuMixer Mixer_8pre = MOTUMIXER( 
     309    MixerCtrls_8pre, MixerBuses_8pre, MixerChannels_8pre); 
     310 
    268311} 
  • trunk/libffado/src/motu/motu_mixerdefs.h

    r1579 r1763  
    3838extern const MotuMixer Mixer_828Mk2; 
    3939extern const MotuMixer Mixer_896HD; 
     40extern const MotuMixer Mixer_8pre; 
    4041 
    4142} 
  • trunk/libffado/src/SConscript

    r1747 r1763  
    150150        motu/motu_avdevice.cpp \ 
    151151        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 \ 
    152156        libstreaming/motu/MotuPort.cpp \ 
    153157        libstreaming/motu/MotuPortInfo.cpp \ 
  • trunk/libffado/support/dbus/SConscript

    r1694 r1763  
    3939if not env.GetOption( "clean" ): 
    4040    env.MergeFlags( env["DBUS1_FLAGS"] ) 
     41    env.MergeFlags( env['LIBRAW1394_FLAGS'] ) 
    4142    if not env['SERIALIZE_USE_EXPAT']: 
    4243        env.MergeFlags( env['LIBXML26_FLAGS'] ) 
  • trunk/libffado/support/firmware/fireworks-downloader.cpp

    r1498 r1763  
    2323 */ 
    2424 
     25#include "fbtypes.h" 
    2526#include "downloader.h" 
    2627 
     
    214215 
    215216    if (node_id < 0) { 
    216         printMessage("Could not find device with GUID 0x%016llX\n", guid); 
     217        printMessage("Could not find device with GUID 0x%016"PRIX64"\n", guid); 
    217218        return -1; 
    218219    } 
  • trunk/libffado/support/mixer-qt4/ffado/mixer/motu.py

    r1691 r1763  
    628628            self.optical_out_mode.setEnabled(False) 
    629629 
    630         # The 896HD doesn't have optical SPDIF (aka Toslink) capability 
    631         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): 
    632632            self.optical_in_mode.removeItem(2) 
    633633            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"> 
    23 <comment>Copyright (C) 2005-2008 by Pieter Palmers 
    34         
     
    1819</comment> 
    1920 <class>Phase88ControlUI</class> 
    20  <widget class="QWidget" name="Phase88ControlUI"
    21   <property name="geometry"
     21 <widget class="QWidget" name="Phase88ControlUI"
     22  <property name="geometry"
    2223   <rect> 
    2324    <x>0</x> 
     
    2728   </rect> 
    2829  </property> 
    29   <property name="windowTitle"
     30  <property name="windowTitle"
    3031   <string>Terratec Phase 88 Control</string> 
    3132  </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"
    3637      <string>Mixer bus output:</string> 
    3738     </property> 
    38      <property name="wordWrap"
     39     <property name="wordWrap"
    3940      <bool>false</bool> 
    4041     </property> 
    4142    </widget> 
    4243   </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"
    4748       <string>S/PDIF Out</string> 
    4849      </property> 
    4950     </item> 
    5051     <item> 
    51       <property name="text"
     52      <property name="text"
    5253       <string>Line Out 1/2</string> 
    5354      </property> 
    5455     </item> 
    5556     <item> 
    56       <property name="text"
     57      <property name="text"
    5758       <string>Line Out 3/4</string> 
    5859      </property> 
    5960     </item> 
    6061     <item> 
    61       <property name="text"
     62      <property name="text"
    6263       <string>Line Out 5/6</string> 
    6364      </property> 
    6465     </item> 
    6566     <item> 
    66       <property name="text"
     67      <property name="text"
    6768       <string>Line Out 7/8</string> 
    6869      </property> 
    6970     </item> 
    7071     <item> 
    71       <property name="text"
     72      <property name="text"
    7273       <string>None</string> 
    7374      </property> 
     
    7576    </widget> 
    7677   </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"
    8081      <string>Hardware Mixer</string> 
    8182     </property> 
    82      <layout class="QHBoxLayout"
     83     <layout class="QHBoxLayout"
    8384      <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"
    8889           <string>1/2</string> 
    8990          </property> 
    90           <property name="wordWrap"
     91          <property name="wordWrap"
    9192           <bool>false</bool> 
    9293          </property> 
    9394         </widget> 
    9495        </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"
    9899           <string>3/4</string> 
    99100          </property> 
    100           <property name="wordWrap"
     101          <property name="wordWrap"
    101102           <bool>false</bool> 
    102103          </property> 
    103104         </widget> 
    104105        </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"
    108109           <string>5/6</string> 
    109110          </property> 
    110           <property name="wordWrap"
     111          <property name="wordWrap"
    111112           <bool>false</bool> 
    112113          </property> 
    113114         </widget> 
    114115        </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"
    118119           <string>7/8</string> 
    119120          </property> 
    120           <property name="wordWrap"
     121          <property name="wordWrap"
    121122           <bool>false</bool> 
    122123          </property> 
    123124         </widget> 
    124125        </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"
    128129           <string>S/PDIF</string> 
    129130          </property> 
    130           <property name="wordWrap"
     131          <property name="wordWrap"
    131132           <bool>false</bool> 
    132133          </property> 
    133134         </widget> 
    134135        </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"
    138139           <string>WavePlay</string> 
    139140          </property> 
    140           <property name="wordWrap"
     141          <property name="wordWrap"
    141142           <bool>false</bool> 
    142143          </property> 
    143144         </widget> 
    144145        </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"
    148149           <string>Master</string> 
    149150          </property> 
    150           <property name="wordWrap"
     151          <property name="wordWrap"
    151152           <bool>false</bool> 
    152153          </property> 
    153154         </widget> 
    154155        </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"
    159160            <horstretch>0</horstretch> 
    160161            <verstretch>0</verstretch> 
    161162           </sizepolicy> 
    162163          </property> 
    163           <property name="minimum"
     164          <property name="minimum"
    164165           <number>0</number> 
    165166          </property> 
    166           <property name="maximum"
     167          <property name="maximum"
    167168           <number>32767</number> 
    168169          </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"
    173174           <number>1000</number> 
    174175          </property> 
    175           <property name="orientation"
     176          <property name="orientation"
    176177           <enum>Qt::Vertical</enum> 
    177178          </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"
    187188            <horstretch>0</horstretch> 
    188189            <verstretch>0</verstretch> 
    189190           </sizepolicy> 
    190191          </property> 
    191           <property name="minimum"
     192          <property name="minimum"
    192193           <number>0</number> 
    193194          </property> 
    194           <property name="maximum"
     195          <property name="maximum"
    195196           <number>32767</number> 
    196197          </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"
    201202           <number>1000</number> 
    202203          </property> 
    203           <property name="orientation"
     204          <property name="orientation"
    204205           <enum>Qt::Vertical</enum> 
    205206          </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"
    215216            <horstretch>0</horstretch> 
    216217            <verstretch>0</verstretch> 
    217218           </sizepolicy> 
    218219          </property> 
    219           <property name="minimum"
     220          <property name="minimum"
    220221           <number>0</number> 
    221222          </property> 
    222           <property name="maximum"
     223          <property name="maximum"
    223224           <number>32767</number> 
    224225          </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"
    229230           <number>1000</number> 
    230231          </property> 
    231           <property name="orientation"
     232          <property name="orientation"
    232233           <enum>Qt::Vertical</enum> 
    233234          </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"
    243244            <horstretch>0</horstretch> 
    244245            <verstretch>0</verstretch> 
    245246           </sizepolicy> 
    246247          </property> 
    247           <property name="minimum"
     248          <property name="minimum"
    248249           <number>0</number> 
    249250          </property> 
    250           <property name="maximum"
     251          <property name="maximum"
    251252           <number>32767</number> 
    252253          </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"
    257258           <number>1000</number> 
    258259          </property> 
    259           <property name="orientation"
     260          <property name="orientation"
    260261           <enum>Qt::Vertical</enum> 
    261262          </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"
    271272            <horstretch>0</horstretch> 
    272273            <verstretch>0</verstretch> 
    273274           </sizepolicy> 
    274275          </property> 
    275           <property name="minimum"
     276          <property name="minimum"
    276277           <number>0</number> 
    277278          </property> 
    278           <property name="maximum"
     279          <property name="maximum"
    279280           <number>32767</number> 
    280281          </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"
    285286           <number>1000</number> 
    286287          </property> 
    287           <property name="orientation"
     288          <property name="orientation"
    288289           <enum>Qt::Vertical</enum> 
    289290          </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"
    299300            <horstretch>0</horstretch> 
    300301            <verstretch>0</verstretch> 
    301302           </sizepolicy> 
    302303          </property> 
    303           <property name="minimum"
     304          <property name="minimum"
    304305           <number>0</number> 
    305306          </property> 
    306           <property name="maximum"
     307          <property name="maximum"
    307308           <number>32767</number> 
    308309          </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"
    313314           <number>1000</number> 
    314315          </property> 
    315           <property name="orientation"
     316          <property name="orientation"
    316317           <enum>Qt::Vertical</enum> 
    317318          </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"
    327328            <horstretch>0</horstretch> 
    328329            <verstretch>0</verstretch> 
    329330           </sizepolicy> 
    330331          </property> 
    331           <property name="minimum"
     332          <property name="minimum"
    332333           <number>0</number> 
    333334          </property> 
    334           <property name="maximum"
     335          <property name="maximum"
    335336           <number>32767</number> 
    336337          </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"
    341342           <number>1000</number> 
    342343          </property> 
    343           <property name="orientation"
     344          <property name="orientation"
    344345           <enum>Qt::Vertical</enum> 
    345346          </property> 
    346           <property name="tickInterval"
     347          <property name="tickInterval"
    347348           <number>10000</number> 
    348349          </property> 
     
    354355    </widget> 
    355356   </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"
    359360      <string>Waveplay Channel Source</string> 
    360361     </property> 
    361      <property name="wordWrap"
     362     <property name="wordWrap"
    362363      <bool>false</bool> 
    363364     </property> 
    364365    </widget> 
    365366   </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"
    370371       <string>S/PDIF</string> 
    371372      </property> 
    372373     </item> 
    373374     <item> 
    374       <property name="text"
     375      <property name="text"
    375376       <string>CH 1/2</string> 
    376377      </property> 
    377378     </item> 
    378379     <item> 
    379       <property name="text"
     380      <property name="text"
    380381       <string>CH 3/4</string> 
    381382      </property> 
    382383     </item> 
    383384     <item> 
    384       <property name="text"
     385      <property name="text"
    385386       <string>CH5/6</string> 
    386387      </property> 
    387388     </item> 
    388389     <item> 
    389       <property name="text"
     390      <property name="text"
    390391       <string>CH7/8</string> 
    391392      </property> 
     
    393394    </widget> 
    394395   </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"
    398399      <string>In 7/8 Input Select</string> 
    399400     </property> 
    400      <property name="wordWrap"
     401     <property name="wordWrap"
    401402      <bool>false</bool> 
    402403     </property> 
    403404    </widget> 
    404405   </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"> 
    409415       <string>Front</string> 
    410416      </property> 
    411417     </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"> 
    422423      <string>Sync Source</string> 
    423424     </property> 
    424      <property name="wordWrap"
     425     <property name="wordWrap"
    425426      <bool>false</bool> 
    426427     </property> 
    427428    </widget> 
    428429   </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"
    433434       <string>Internal</string> 
    434435      </property> 
    435436     </item> 
    436437     <item> 
    437       <property name="text"
     438      <property name="text"
    438439       <string>External</string> 
    439440      </property> 
     
    441442    </widget> 
    442443   </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"
    446447      <string>External Sync Source</string> 
    447448     </property> 
    448      <property name="wordWrap"
     449     <property name="wordWrap"
    449450      <bool>false</bool> 
    450451     </property> 
    451452    </widget> 
    452453   </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"
    457458       <string>S/PDIF</string> 
    458459      </property> 
    459460     </item> 
    460461     <item> 
    461       <property name="text"
     462      <property name="text"
    462463       <string>WordClock</string> 
    463464      </property> 
     
    467468  </layout> 
    468469 </widget> 
    469  <layoutdefault spacing="6" margin="11" /> 
     470 <layoutdefault spacing="6" margin="11"/> 
    470471 <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> 
    471472 <resources/> 
     
    477478   <slot>switchOutAssign(int)</slot> 
    478479   <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"
    484485     <x>20</x> 
    485486     <y>20</y> 
     
    493494   <slot>switchFrontState(int)</slot> 
    494495   <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"
    500501     <x>20</x> 
    501502     <y>20</y> 
     
    509510   <slot>switchWaveInAssign(int)</slot> 
    510511   <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"
    516517     <x>20</x> 
    517518     <y>20</y> 
     
    525526   <slot>switchSyncSource(int)</slot> 
    526527   <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"
    532533     <x>20</x> 
    533534     <y>20</y> 
     
    541542   <slot>switchExtSyncSource(int)</slot> 
    542543   <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"
    548549     <x>20</x> 
    549550     <y>20</y> 
     
    557558   <slot>setVolume12(int)</slot> 
    558559   <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"
    564565     <x>20</x> 
    565566     <y>20</y> 
     
    573574   <slot>setVolume34(int)</slot> 
    574575   <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"
    580581     <x>20</x> 
    581582     <y>20</y> 
     
    589590   <slot>setVolume56(int)</slot> 
    590591   <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"
    596597     <x>20</x> 
    597598     <y>20</y> 
     
    605606   <slot>setVolume78(int)</slot> 
    606607   <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"
    612613     <x>20</x> 
    613614     <y>20</y> 
     
    621622   <slot>setVolumeMaster(int)</slot> 
    622623   <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"
    628629     <x>20</x> 
    629630     <y>20</y> 
     
    637638   <slot>setVolumeSPDIF(int)</slot> 
    638639   <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"
    644645     <x>20</x> 
    645646     <y>20</y> 
     
    653654   <slot>setVolumeWavePlay(int)</slot> 
    654655   <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"
    660661     <x>20</x> 
    661662     <y>20</y> 
  • trunk/libffado/support/mixer-qt4/ffado/mixer/saffire.py

    • Property svn:mergeinfo set
    r1691 r1763  
    104104    def initValues(self): 
    105105        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 
    107112 
    108113        # Saffire:        0x130e010001???? 
  • trunk/libffado/support/mixer-qt4/ffado/regdialog.py

    r1664 r1763  
     1# -*- coding: utf-8 -*- 
    12# 
    23# Copyright (C) 2005-2008 by Pieter Palmers 
     
    3435<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> 
    3536You 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> 
    3638<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> 
    3739In 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  
    195195 
    196196    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", 
    198198                 arguments.period, arguments.nb_buffers, 
    199199                 arguments.playback, 
  • trunk/libffado/tests/streaming/teststreaming-ipc.cpp

    r1254 r1763  
    287287    } 
    288288 
    289     debugOutput(DEBUG_LEVEL_NORMAL, "verbose level = %d\n", arguments.verbose); 
     289    debugOutput(DEBUG_LEVEL_NORMAL, "verbose level = %ld\n", arguments.verbose); 
    290290    setDebugLevel(arguments.verbose); 
    291291 
     
    308308 
    309309    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", 
    311311                 arguments.period, arguments.nb_buffers, 
    312312                 arguments.playback, 
     
    374374    printMessage("Device channel count: %d capture, %d playback\n", 
    375375                 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", 
    377377                 arguments.capture, arguments.playback); 
    378378 
    379379    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",  
    381381                   arguments.playback, nb_out_channels); 
    382382        return -1; 
    383383    } 
    384384    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",  
    386386                   arguments.capture, nb_in_channels); 
    387387        return -1; 
     
    460460    // enter the loop 
    461461    debugOutput(DEBUG_LEVEL_NORMAL, 
    462                 "Entering receive loop (IN: %d, OUT: %d)\n", 
     462                "Entering receive loop (IN: %ld, OUT: %ld)\n", 
    463463                arguments.capture, arguments.playback); 
    464464 
  • trunk/libffado/tests/streaming/teststreaming3.cpp

    r1568 r1763  
    262262    } 
    263263 
    264     debugOutput(DEBUG_LEVEL_NORMAL, "verbose level = %d\n", arguments.verbose); 
     264    debugOutput(DEBUG_LEVEL_NORMAL, "verbose level = %d\n", (int)arguments.verbose); 
    265265    setDebugLevel(arguments.verbose); 
    266266 
  • trunk/libffado/tests/systemtests/gen-loadpulses.cpp

    r1234 r1763  
    3333#include <argp.h> 
    3434 
     35#ifndef __STDC_FORMAT_MACROS 
     36#define __STDC_FORMAT_MACROS 
     37#endif 
    3538#include <inttypes.h> 
    3639 
     
    157160    debugOutput(DEBUG_LEVEL_INFO, "System Load pulse generator\n"); 
    158161    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); 
    165168    set_realtime_priority(arguments.rtprio); 
    166169 
     
    185188        int64_t usecs_late = toc - sleep_time; 
    186189        if(usecs_late > 1000) { 
    187             debugWarning("late wakeup: %lld usecs\n", usecs_late); 
     190            debugWarning("late wakeup: %"PRId64" usecs\n", usecs_late); 
    188191        } 
    189192 
    190193        // try and detect lockup () 
    191194        if(usecs_late > 100000) { 
    192             debugWarning("very late wakeup: %lld usecs\n", usecs_late); 
     195            debugWarning("very late wakeup: %"PRId64" usecs\n", usecs_late); 
    193196            // force exit, since this is a loop out of control 
    194197            run=0; 
  • trunk/libffado/tests/systemtests/test-clock_nanosleep.cpp

    r1079 r1763  
    2323 
    2424#include "debugmodule/debugmodule.h" 
     25#include "libutil/Time.h" 
    2526 
    2627// needed for clock_nanosleep 
     
    6970    ts.tv_nsec = (wake_at_usec % (1000000LL)) * 1000LL; 
    7071    debugOutput(DEBUG_LEVEL_VERBOSE, 
    71                 "clock_nanosleep until %lld sec, %lld nanosec\n", 
     72                "clock_nanosleep until %"PRId64" sec, %"PRId64" nanosec\n", 
    7273                (int64_t)ts.tv_sec, (int64_t)ts.tv_nsec); 
    7374    int err = clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &ts, NULL); 
     
    105106        wake_at += SLEEP_PERIOD_USECS; 
    106107         
    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()); 
    108111         
    109112        pthread_testcancel(); 
  • trunk/libffado/tests/systemtests/test-isorecv-1.cpp

    r1700 r1763  
    188188    } 
    189189 
    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); 
    191191    int ret = -1; 
    192192    do 
     
    226226    } 
    227227 
    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); 
    229229    set_realtime_priority(arguments.rtprio); 
    230230 
  • trunk/libffado/tests/systemtests/test-isoxmit-1.cpp

    r1700 r1763  
    233233    } 
    234234 
    235     debugOutput(DEBUG_LEVEL_NORMAL, "verbose level = %d\n", arguments.verbose); 
     235    debugOutput(DEBUG_LEVEL_NORMAL, "verbose level = %d\n", (int) arguments.verbose); 
    236236    setDebugLevel(arguments.verbose); 
    237237 
     
    244244    } 
    245245 
    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); 
    247247    int ret = -1; 
    248248    do 
     
    269269    raw1394_set_bus_reset_handler(handle, myResetHandler); 
    270270 
    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); 
    272272    set_realtime_priority(arguments.rtprio); 
    273273 
  • trunk/libffado/tests/systemtests/test-sysload.cpp

    r1234 r1763  
    3333#include <argp.h> 
    3434 
     35#ifndef __STDC_FORMAT_MACROS 
     36#define __STDC_FORMAT_MACROS 
     37#endif 
    3538#include <inttypes.h> 
    3639 
     
    157160    debugOutput(DEBUG_LEVEL_INFO, "Simple RT system loader\n"); 
    158161    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); 
    165168    set_realtime_priority(arguments.rtprio); 
    166169 
     
    187190        int64_t usecs_late = toc - sleep_time; 
    188191        if(usecs_late > 1000) { 
    189             debugWarning("late wakeup: %lld usecs\n", usecs_late); 
     192            debugWarning("late wakeup: %"PRId64" usecs\n", usecs_late); 
    190193        } 
    191194 
    192195        // try and detect lockup () 
    193196        if(usecs_late > 100000) { 
    194             debugWarning("very late wakeup: %lld usecs\n", usecs_late); 
     197            debugWarning("very late wakeup: %"PRId64" usecs\n", usecs_late); 
    195198            // force exit, since this is a loop out of control 
    196199            run=0; 
  • trunk/libffado/tests/test-bufferops.cpp

    r1136 r1763  
    3030 
    3131#include "libutil/SystemTimeSource.h" 
     32#include "libutil/Time.h" 
     33 
    3234#include <inttypes.h> 
    3335 
     
    8688        byteSwapToBus(buffer_1, nb_quadlets); 
    8789        elapsed = Util::SystemTimeSource::getCurrentTimeAsUsecs() - start; 
    88         printMessage( " took %lluusec...\n", elapsed); 
     90        printMessage( " took %"PRI_FFADO_MICROSECS_T"usec...\n", elapsed); 
    8991         
    9092    } 
     
    154156        convertFromInt24AndLabelAsMBLA(buffer_1, nb_quadlets); 
    155157        elapsed = Util::SystemTimeSource::getCurrentTimeAsUsecs() - start; 
    156         printMessage( " took %lluusec...\n", elapsed); 
     158        printMessage( " took %"PRI_FFADO_MICROSECS_T"usec...\n", elapsed); 
    157159    } 
    158160 
     
    236238        convertFromFloatAndLabelAsMBLA(buffer_1, nb_quadlets); 
    237239        elapsed = Util::SystemTimeSource::getCurrentTimeAsUsecs() - start; 
    238         printMessage( " took %lluusec...\n", elapsed); 
     240        printMessage( " took %"PRI_FFADO_MICROSECS_T"usec...\n", elapsed); 
    239241    } 
    240242 
  • trunk/libffado/tests/test-dice-eap.cpp

    r1717 r1763  
    271271    e = NULL; 
    272272    eap.unlockControl(); 
    273  
    274     int cnt = 0; 
    275273 
    276274    while(run && arguments.counts != 0) { 
  • trunk/libffado/tests/test-ffado.cpp

    r1498 r1763  
    351351 
    352352            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); 
    354354 
    355355            for(i=0;i<devices_on_bus;i++) { 
     
    443443        service.setVerboseLevel(arguments.verbose); 
    444444        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); 
    446446            return exitfunction(-1); 
    447447        } 
     
    455455         
    456456        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); 
    459459            return exitfunction(-1); 
    460460        } 
     
    466466        service.setVerboseLevel(arguments.verbose); 
    467467        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); 
    469469            return exitfunction(-1); 
    470470        } 
     
    478478        int usecs = service.getSplitTimeoutUsecs(nodeid); 
    479479        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); 
    486486 
    487487        return exitfunction(0); 
     
    511511        uint64_t result_rcv = sytRecvToFullTicks(syt_timestamp, rcv_cycle, ctr_now); 
    512512        uint64_t result_xmt = sytXmitToFullTicks(syt_timestamp, rcv_cycle, ctr_now); 
    513         printf("RCV: 0x%010llX %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", 
    514514               result_rcv, result_rcv, result_xmt, result_xmt, CYCLE_TIMER_TO_TICKS(ctr_now)); 
    515515 
  • trunk/libffado/tests/test-focusrite.cpp

    r1535 r1763  
    183183            } 
    184184            if (!retval) { 
    185                 debugError( " read from %16llX failed (id: %d)\n", addr, id); 
     185                debugError( " read from %16"PRIX64" failed (id: %d)\n", addr, id); 
    186186            } else { 
    187187                value = CondSwapFromBus32(value); 
  • trunk/libffado/tests/test-ieee1394service.cpp

    r1550 r1763  
    165165    } 
    166166    debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, 
    167                 "(%p) Cycle timer: %011llu (%03us %04ucy %04uticks)\n", 
     167                "(%p) Cycle timer: %011"PRIu64" (%03us %04ucy %04uticks)\n", 
    168168                this, ctr, 
    169169                (unsigned int)TICKS_TO_SECS( ctr ), 
     
    171171                (unsigned int)TICKS_TO_OFFSET( ctr ) ); 
    172172    debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, 
    173                 "(%p)    from DLL: %011llu (%03us %04ucy %04uticks)\n", 
     173                "(%p)    from DLL: %011"PRIu64" (%03us %04ucy %04uticks)\n", 
    174174                this, ctr_dll, 
    175175                (unsigned int)TICKS_TO_SECS( ctr_dll ), 
     
    200200    } 
    201201    debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, 
    202                 "(%p)       diff: %s%011llu (%03us %04ucy %04uticks)\n", this, 
     202                "(%p)       diff: %s%011"PRIu64" (%03us %04ucy %04uticks)\n", this, 
    203203                ((int64_t)abs_diff==diff?" ":"-"), abs_diff, (unsigned int)TICKS_TO_SECS( abs_diff ), 
    204204                (unsigned int)TICKS_TO_CYCLES( abs_diff ), (unsigned int)TICKS_TO_OFFSET( abs_diff ) ); 
    205205    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: %011llu (%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", 
    209209                    this, ctr, 
    210210                    (unsigned int)TICKS_TO_SECS( ctr ), 
     
    212212                    (unsigned int)TICKS_TO_OFFSET( ctr ) ); 
    213213        debugOutput ( DEBUG_LEVEL_NORMAL, 
    214                     "(%p)   from DLL: %011llu (%03us %04ucy %04uticks)\n", 
     214                    "(%p)   from DLL: %011"PRIu64" (%03us %04ucy %04uticks)\n", 
    215215                    this, ctr_dll, 
    216216                    (unsigned int)TICKS_TO_SECS( ctr_dll ), 
     
    221221    diff = diffTicks(ctr, ctr_prev); 
    222222    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", 
    224224                     this, ctr, ctr_prev, diff); 
    225225        debugOutput ( DEBUG_LEVEL_NORMAL, 
    226                     "(%p)  Cycle timer now : %011llu (%03us %04ucy %04uticks)\n", 
     226                    "(%p)  Cycle timer now : %011"PRIu64" (%03us %04ucy %04uticks)\n", 
    227227                    this, ctr, 
    228228                    (unsigned int)TICKS_TO_SECS( ctr ), 
     
    230230                    (unsigned int)TICKS_TO_OFFSET( ctr ) ); 
    231231        debugOutput ( DEBUG_LEVEL_NORMAL, 
    232                     "(%p)  Cycle timer prev: %011llu (%03us %04ucy %04uticks)\n", 
     232                    "(%p)  Cycle timer prev: %011"PRIu64" (%03us %04ucy %04uticks)\n", 
    233233                    this, ctr_prev, 
    234234                    (unsigned int)TICKS_TO_SECS( ctr_prev ), 
     
    238238    diff = diffTicks(ctr_dll, ctr_dll_prev); 
    239239    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", 
    241241                     this, ctr_dll, ctr_dll_prev, diff); 
    242242        debugOutput ( DEBUG_LEVEL_NORMAL, 
    243                     "(%p)  Cycle timer now : %011llu (%03us %04ucy %04uticks)\n", 
     243                    "(%p)  Cycle timer now : %011"PRIu64" (%03us %04ucy %04uticks)\n", 
    244244                    this, ctr_dll, 
    245245                    (unsigned int)TICKS_TO_SECS( ctr_dll ), 
     
    247247                    (unsigned int)TICKS_TO_OFFSET( ctr_dll ) ); 
    248248        debugOutput ( DEBUG_LEVEL_NORMAL, 
    249                     "(%p)  Cycle timer prev: %011llu (%03us %04ucy %04uticks)\n", 
     249                    "(%p)  Cycle timer prev: %011"PRIu64" (%03us %04ucy %04uticks)\n", 
    250250                    this, ctr_dll_prev, 
    251251                    (unsigned int)TICKS_TO_SECS( ctr_dll_prev ), 
     
    268268                    (unsigned int)CYCLE_TIMER_GET_OFFSET( tmp_orig ) ); 
    269269        debugOutput ( DEBUG_LEVEL_VERY_VERBOSE, 
    270                     "(%p) TICKS: %011llu (%03us %04ucy %04uticks)\n", 
     270                    "(%p) TICKS: %011"PRIu32" (%03us %04ucy %04uticks)\n", 
    271271                    this, tmp_ticks, 
    272272                    (unsigned int)TICKS_TO_SECS( tmp_ticks ), 
  • trunk/libffado/tests/test-scs.cpp

    r1595 r1763  
    325325        virtual void operator() (byte_t *buff, size_t len) { 
    326326            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); 
    328328     
    329329                for (size_t s=0; s < len; s++) { 
  • trunk/libffado/tests/test-timestampedbuffer.cpp

    r1146 r1763  
    346346 
    347347                if (timestamp != ts_head) { 
    348                     debugError(" cycle %4u error: %011llu != %011llu\n", 
    349                         timestamp, ts_head); 
    350                         pass=false; 
     348                    debugError(" cycle %4u error: %011"PRIu64" != %011"PRIu64"\n", 
     349                               cycle, timestamp, ts_head); 
     350                    pass=false; 
    351351                } 
    352352 
     
    418418            } 
    419419 
    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) { 
    423425                ffado_timestamp_t ts_head_tmp, ts_tail_tmp; 
    424426                uint64_t ts_head, ts_tail; 
     
    434436                ts_tail=(uint64_t)ts_tail_tmp; 
    435437                debugOutput(DEBUG_LEVEL_NORMAL, 
    436                         " TS after write: HEAD: %011llu, FC=%04u\n", 
     438                        " TS after write: HEAD: %011"PRIu64", FC=%04u\n", 
    437439                        ts_head,fc_head); 
    438440                debugOutput(DEBUG_LEVEL_NORMAL, 
    439                         "                 TAIL: %011llu, FC=%04u\n", 
     441                        "                 TAIL: %011"PRIu64", FC=%04u\n", 
    440442                        ts_tail,fc_tail); 
    441443 
     
    449451                ts_tail=(uint64_t)ts_tail_tmp; 
    450452                debugOutput(DEBUG_LEVEL_NORMAL, 
    451                         " TS after write: HEAD: %011llu, FC=%04u\n", 
     453                        " TS after write: HEAD: %011"PRIu64", FC=%04u\n", 
    452454                        ts_head,fc_head); 
    453455                debugOutput(DEBUG_LEVEL_NORMAL, 
    454                         "                 TAIL: %011llu, FC=%04u\n", 
     456                        "                 TAIL: %011"PRIu64", FC=%04u\n", 
    455457                        ts_tail,fc_tail); 
    456458 
     
    523525            } 
    524526 
    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); 
    526530 
    527531            if(diff>0) { 
     
    539543                ts_tail=(uint64_t)ts_tail_tmp; 
    540544                debugOutput(DEBUG_LEVEL_NORMAL, 
    541                         " TS after write: HEAD: %011llu, FC=%04u\n", 
     545                        " TS after write: HEAD: %011"PRIu64", FC=%04u\n", 
    542546                        ts_head,fc_head); 
    543547                debugOutput(DEBUG_LEVEL_NORMAL, 
    544                         "                 TAIL: %011llu, FC=%04u\n", 
     548                        "                 TAIL: %011"PRIu64", FC=%04u\n", 
    545549                        ts_tail,fc_tail); 
    546550 
     
    557561                    ts_tail=(uint64_t)ts_tail_tmp; 
    558562                    debugOutput(DEBUG_LEVEL_NORMAL, 
    559                             " TS after read: HEAD: %011llu, FC=%04u\n", 
     563                            " TS after read: HEAD: %011"PRIu64", FC=%04u\n", 
    560564                            ts_head,fc_head); 
    561565                    debugOutput(DEBUG_LEVEL_NORMAL, 
    562                             "                TAIL: %011llu, FC=%04u\n", 
     566                            "                TAIL: %011"PRIu64", FC=%04u\n", 
    563567                            ts_tail,fc_tail); 
    564568                }