Changeset 2771

Show
Ignore:
Timestamp:
03/03/18 22:12:18 (7 months ago)
Author:
jwoithe
Message:

Merge r2722 through r2770 from trunk into 2.4.x branch.

This will form the basis of FFADO 2.4.1.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.4.x/libffado/deb/SConscript

    r2450 r2771  
    2323 
    2424# from: http://www.qandr.org/quentin/writings/debscons.html 
    25 import os, shutil, sys 
     25import os 
     26 
    2627Import('env') # exported by parent SConstruct 
    2728 
     
    4243    # Now we specify the files to be included in the .deb 
    4344    # Where they should go, and where they should be copied from. 
    44     # If you have a lot of files, you may wish to generate this  
     45    # If you have a lot of files, you may wish to generate this 
    4546    # list in some other way. 
    4647    ("usr/lib/libffado.so",             "#src/libffado.so"), 
     
    124125        DEBNAME, installed_size, DEBMAINT, DEBARCH, DEBVERSION, 
    125126        DEBDEPENDS, DEBDESC) 
    126     f = open(str(target[0]), 'w') 
    127     f.write(control_info) 
    128     f.close() 
     127    with open(str(target[0]), 'w') as f: 
     128        f.write(control_info) 
    129129 
    130130# We can generate the control file by calling make_control 
     
    133133# And we can generate the .deb file by calling dpkg-deb 
    134134env.Command(debpkg, DEBCONTROLFILE, 
    135        "dpkg-deb -b %s %s" % ("deb/%s" % DEBNAME, "$TARGET")) 
     135            "dpkg-deb -b %s %s" % ("deb/%s" % DEBNAME, "$TARGET")) 
  • branches/2.4.x/libffado/doc/reference.doxygen.in

    r1753 r2771  
    569569# with spaces. 
    570570 
    571 INPUT                  = $top_srcdir/src \ 
    572                          $top_srcdir/doc \ 
    573                          $top_srcdir/libffado 
     571INPUT                  = $DOXYGEN_INPUT 
    574572 
    575573# This tag can be used to specify the character encoding of the source files 
  • branches/2.4.x/libffado/doc/SConscript

    r1185 r2771  
    55env = env.Clone() 
    66 
     7# At this point BUILD_DOC is either 'all' or 'user' 
     8doxygen_dir_list = [env["top_srcdir"] + "/libffado"] 
     9if env["BUILD_DOC"] == 'all': 
     10    doxygen_dir_list += [env["top_srcdir"] + "/src", 
     11                         env["top_srcdir"] + "/doc"] 
     12env["DOXYGEN_INPUT"] = " ".join(doxygen_dir_list) 
     13 
    714env.ScanReplace( "reference.doxygen.in" ) 
    815 
    916env.Doxygen( "reference.doxygen" ) 
    10  
  • branches/2.4.x/libffado/SConstruct

    r2720 r2771  
    2323# along with this program.  If not, see <http://www.gnu.org/licenses/>. 
    2424# 
     25from __future__ import print_function 
    2526 
    2627FFADO_API_VERSION = "9" 
    2728FFADO_VERSION="2.4.0" 
    2829 
    29 from subprocess import Popen, PIPE 
     30from subprocess import Popen, PIPE, check_output 
    3031import os 
    3132import re 
     33import sys 
    3234from string import Template 
    33 import imp 
    3435import distutils.sysconfig 
    3536 
    3637if not os.path.isdir( "cache" ): 
    37        os.makedirs( "cache" ) 
     38    os.makedirs( "cache" ) 
    3839 
    3940opts = Variables( "cache/options.cache" ) 
     
    5051    PathVariable( "INCLUDEDIR", "Overwrite the directory where headers are installed to.", "$PREFIX/include", PathVariable.PathAccept ), 
    5152    PathVariable( "SHAREDIR", "Overwrite the directory where misc shared files are installed to.", "$PREFIX/share/libffado", PathVariable.PathAccept ), 
     53    PathVariable( "LIBDATADIR", "Location for architecture-dependent data.", "$LIBDIR/libffado", PathVariable.PathAccept ), 
    5254    PathVariable( "MANDIR", "Overwrite the directory where manpages are installed", "$PREFIX/man", PathVariable.PathAccept ), 
    5355    PathVariable( "PYPKGDIR", "The directory where the python modules get installed.", 
     
    6971    BoolVariable( "ENABLE_ALL", "Enable/Disable support for all devices.", False ), 
    7072    BoolVariable( "SERIALIZE_USE_EXPAT", "Use libexpat for XML serialization.", False ), 
     73    EnumVariable( "BUILD_DOC", "Build API documentation", 'none', allowed_values=('all', 'user', 'none'), ignorecase=2), 
    7174    EnumVariable( "BUILD_MIXER", "Build the ffado-mixer", 'auto', allowed_values=('auto', 'true', 'false'), ignorecase=2), 
    7275    BoolVariable( "BUILD_TESTS", """\ 
     
    8386    ( "COMPILE_FLAGS", "Deprecated (use CFLAGS and CXXFLAGS with CUSTOM_ENV=True instead).  Add additional flags to the environment.\nOnly meant for distributors and gentoo-users who want to over-optimize their build.\n Using this is not supported by the ffado-devs!" ), 
    8487    EnumVariable( "ENABLE_SETBUFFERSIZE_API_VER", "Report API version at runtime which includes support for dynamic buffer resizing (requires recent jack).", 'auto', allowed_values=('auto', 'true', 'false', 'force'), ignorecase=2), 
     88    ("PYTHON_INTERPRETER", "Python interpreter to be used by FFADO installation.", "/usr/bin/python"), 
    8589 
    8690    ) 
     
    143147# make sure the necessary dirs exist 
    144148if not os.path.isdir( "cache" ): 
    145        os.makedirs( "cache" ) 
     149    os.makedirs( "cache" ) 
    146150if not os.path.isdir( 'cache/objects' ): 
    147151    os.makedirs( 'cache/objects' ) 
     
    153157def ConfigGuess( context ): 
    154158    context.Message( "Trying to find the system triple: " ) 
    155     ret = os.popen( "/bin/sh admin/config.guess" ).read()[:-1] 
     159    ret = check_output(("/bin/sh", "admin/config.guess")).rstrip() 
    156160    context.Result( ret ) 
    157     return ret 
     161    return ret.decode() 
    158162 
    159163def CheckForApp( context, app ): 
     
    165169def CheckForPyModule( context, module ): 
    166170    context.Message( "Checking for the python module '" + module + "' " ) 
    167     ret = context.TryAction( "python $SOURCE", "import %s" % module, ".py" ) 
     171    ret = context.TryAction( "$PYTHON_INTERPRETER $SOURCE", "import %s" % module, ".py" ) 
    168172    context.Result( ret[0] ) 
    169173    return ret[0] 
     
    216220version_re = re.compile(r'^(\d+)\.(\d+)\.(\d+)') 
    217221 
    218 def VersionInt(vers): 
    219     match = version_re.match(vers) 
    220     if not match: 
    221         return -1 
    222     (maj, min, patch) = match.group(1, 2, 3) 
    223     # For now allow "min" to run up to 65535.  "maj" and "patch" are  
    224     # restricted to 0-255. 
    225     return (int(maj) << 24) | (int(min) << 8) | int(patch) 
    226  
    227222def CheckJackdVer(): 
    228     # Suppress newline in python 2 and 3 
    229     sys.stdout.write('Checking jackd version...'
    230     sys.stdout.flush() 
    231     ret = Popen("which jackd >/dev/null 2>&1 && jackd --version | tail -n 1 | cut -d ' ' -f 3", shell=True, stdout=PIPE).stdout.read()[:-1].decode() 
    232     if (ret == "")
     223    print('Checking jackd version...', end='') 
     224    popen = Popen(("which", 'jackd'), stdout=PIPE, stderr=PIPE
     225    stdout, stderr = popen.communicate() 
     226    assert popen.returncode in (0, 1), "which returned a unexpected status" 
     227    if popen.returncode == 1
    233228        print("not installed") 
    234         return -1 
    235     else: 
    236         print(ret) 
    237     return VersionInt(ret) 
     229        return None 
     230    jackd = stdout.decode ().rstrip () 
     231    ret = check_output ((jackd, '--version')).decode() .rstrip () 
     232    ret = ret.split ('\n') [-1]; # Last line. 
     233    ret = ret.split () [2];      # Third field. 
     234    if not version_re.match (ret): 
     235        print("failed to parse version") 
     236        return None 
     237    print (ret) 
     238 
     239    # Trim off any "rc" (release candidate) components from the end of the 
     240    # version string 
     241    ret = ret.split ('rc')[0] 
     242    ret = ret.split ('.') 
     243    ret = map (int, ret) 
     244    return tuple (ret) 
    238245 
    239246if env['SERIALIZE_USE_EXPAT']: 
     
    284291            pkgs['libxml++-2.6'] = '2.13.0' 
    285292 
    286     # Provide a way for users to compile newer libffado which will work  
     293    # Provide a way for users to compile newer libffado which will work 
    287294    # against older jack installations which will not accept the new API 
    288295    # version reported at runtime. 
     
    293300    else: 
    294301        jackd_ver = CheckJackdVer() 
    295         if (jackd_ver != -1)
     302        if jackd_ver
    296303            # If jackd is unknown to pkg-config but is never-the-less 
    297304            # runnable, use the version number reported by it.  This means 
    298305            # users don't have to have jack development files present on 
    299306            # their system for this to work. 
    300             have_jack = (jackd_ver >= VersionInt('0.0.0')
    301             good_jack1 = (jackd_ver < VersionInt('1.9.0')) and (jackd_ver >= VersionInt('0.121.4')
    302             good_jack2 = (jackd_ver >= VersionInt('1.9.9')
     307            have_jack = jackd_ver >= (0, 0, 0
     308            good_jack1 = jackd_ver < (1, 9, 0) and jackd_ver >= (0, 121, 4
     309            good_jack2 = jackd_ver >= (1, 9, 9
    303310 
    304311    if env['ENABLE_SETBUFFERSIZE_API_VER'] == 'auto': 
    305312        if not(have_jack): 
    306313            print(""" 
    307 No Jack Audio Connection Kit (JACK) installed: assuming a FFADO  
     314No Jack Audio Connection Kit (JACK) installed: assuming a FFADO 
    308315setbuffersize-compatible version will be used. 
    309316""") 
     
    311318            FFADO_API_VERSION="8" 
    312319            print(""" 
    313 Installed Jack Audio Connection Kit (JACK) jack does not support FFADO  
    314 setbuffersize API: will report earlier API version at runtime.  Consider  
    315 upgrading to jack1 >=0.122.0 or jack2 >=1.9.9 at some point, and then  
     320Installed Jack Audio Connection Kit (JACK) jack does not support FFADO 
     321setbuffersize API: will report earlier API version at runtime.  Consider 
     322upgrading to jack1 >=0.122.0 or jack2 >=1.9.9 at some point, and then 
    316323recompile ffado to gain access to this added feature. 
    317324""") 
     
    321328        if (have_jack and not(good_jack1) and not(good_jack2)): 
    322329            print(""" 
    323 SetBufferSize API version is enabled but no suitable version of Jack Audio  
    324 Connection Kit (JACK) has been found.  The resulting FFADO would cause your  
    325 jackd to abort with "incompatible FFADO version".  Please upgrade to  
     330SetBufferSize API version is enabled but no suitable version of Jack Audio 
     331Connection Kit (JACK) has been found.  The resulting FFADO would cause your 
     332jackd to abort with "incompatible FFADO version".  Please upgrade to 
    326333jack1 >=0.122.0 or jack2 >=1.9.9, or set ENABLE_SETBUFFERSIZE_API_VER to "auto" 
    327334or "false". 
    328335""") 
    329             # Although it's not strictly an error, in almost every case that  
     336            # Although it's not strictly an error, in almost every case that 
    330337            # this occurs the user will want to know about it and fix the 
    331338            # problem, so we exit so they're guaranteed of seeing the above 
     
    358365        Exit( 1 ) 
    359366 
    360     # libxml++-2.6 requires a c++11 compiler as of version 2.39.1.  The  
     367    # libxml++-2.6 requires a c++11 compiler as of version 2.39.1.  The 
    361368    # gnu++11 standard seems to work both with these later libxml++ versions 
    362369    # and ffado itself, although a significant number of warnings are 
     
    396403# PyQT checks 
    397404if env['BUILD_MIXER'] != 'false': 
    398     have_dbus = (conf.CheckForApp( 'which pyuic4' ) and conf.CheckForPyModule( 'dbus.mainloop.qt' )) 
    399     have_pyqt4 = (conf.CheckForApp( 'which pyuic4' ) and conf.CheckForPyModule( 'PyQt4' )) 
    400     have_pyqt5 = (conf.CheckForApp( 'which pyuic5' ) and conf.CheckForPyModule( 'PyQt5' )) 
    401     if ((have_pyqt4 or have_pyqt5) and have_dbus): 
     405    if  (    conf.CheckForApp( 'which pyuic4' ) \ 
     406         and conf.CheckForPyModule( 'PyQt4' ) \ 
     407         and conf.CheckForPyModule( 'dbus.mainloop.qt' )) \ 
     408     or (    conf.CheckForApp( 'which pyuic5' ) \ 
     409         and conf.CheckForPyModule( 'PyQt5' ) \ 
     410         and conf.CheckForPyModule( 'dbus.mainloop.pyqt5' )): 
    402411        env['BUILD_MIXER'] = 'true' 
    403412    elif not env.GetOption('clean'): 
     
    405414            env['BUILD_MIXER'] = 'false' 
    406415            print(""" 
    407 The prerequisites ('pyuic4'/'pyuic5' and the python-modules 'dbus' and  
    408 'PyQt4'/'PyQt5', the packages could be named like dbus-python and PyQt) to  
     416The prerequisites ('pyuic4'/'pyuic5' and the python-modules 'dbus' and 
     417'PyQt4'/'PyQt5', the packages could be named like dbus-python and PyQt) to 
    409418build the mixer were not found. Therefore the qt mixer will not be installed.""") 
    410419        else: # env['BUILD_MIXER'] == 'true' 
    411420            print(""" 
    412 The prerequisites ('pyuic4'/'pyuic5' and the python-modules 'dbus' and  
    413 'PyQt4'/'PyQt5', the packages could be named like dbus-python and PyQt) to  
     421The prerequisites ('pyuic4'/'pyuic5' and the python-modules 'dbus' and 
     422'PyQt4'/'PyQt5', the packages could be named like dbus-python and PyQt) to 
    414423build the mixer were not found, but BUILD_MIXER was requested.""") 
    415424            Exit( 1 ) 
     
    516525env['INCLUDEDIR'] = Template( env['INCLUDEDIR'] ).safe_substitute( env ) 
    517526env['SHAREDIR'] = Template( env['SHAREDIR'] ).safe_substitute( env ) 
     527env['LIBDATADIR'] = Template( env['LIBDATADIR'] ).safe_substitute( env ) 
    518528env['UDEVDIR'] = Template( env['UDEVDIR'] ).safe_substitute( env ) 
     529env['PYTHON_INTERPRETER'] = Template( env['PYTHON_INTERPRETER'] ).safe_substitute( env ) 
    519530env['prefix'] = Template( env.destdir + env['PREFIX'] ).safe_substitute( env ) 
    520531env['bindir'] = Template( env.destdir + env['BINDIR'] ).safe_substitute( env ) 
     
    522533env['includedir'] = Template( env.destdir + env['INCLUDEDIR'] ).safe_substitute( env ) 
    523534env['sharedir'] = Template( env.destdir + env['SHAREDIR'] ).safe_substitute( env ) 
     535env['libdatadir'] = Template( env.destdir + env['LIBDATADIR'] ).safe_substitute( env ) 
    524536env['mandir'] = Template( env.destdir + env['MANDIR'] ).safe_substitute( env ) 
    525537env['pypkgdir'] = Template( env.destdir + env['PYPKGDIR'] ).safe_substitute( env ) 
    526538env['udevdir'] = Template( env.destdir + env['UDEVDIR'] ).safe_substitute( env ) 
    527539env['PYPKGDIR'] = Template( env['PYPKGDIR'] ).safe_substitute( env ) 
     540env['metainfodir'] = Template( env.destdir + "/usr/share/metainfo" ).safe_substitute( env ) 
    528541 
    529542env.Command( target=env['sharedir'], source="", action=Mkdir( env['sharedir'] ) ) 
     
    532545env.Alias( "install", env['includedir'] ) 
    533546env.Alias( "install", env['sharedir'] ) 
     547env.Alias( "install", env['libdatadir'] ) 
    534548env.Alias( "install", env['bindir'] ) 
    535549env.Alias( "install", env['mandir'] ) 
    536550if env['BUILD_MIXER'] == 'true': 
    537551    env.Alias( "install", env['pypkgdir'] ) 
     552    env.Alias( "install", env['metainfodir'] ) 
    538553 
    539554# 
     
    554569needs_fPIC = False 
    555570 
    556 #=== Begin Revised CXXFLAGS =========================================  
    557 def outputof(*cmd): 
    558     """Run a command without running a shell, return cmd's stdout 
    559     """ 
    560     p = Popen(cmd, stdout=PIPE) 
    561     return p.communicate()[0] 
    562  
     571#=== Begin Revised CXXFLAGS ========================================= 
    563572def cpuinfo_kv(): 
    564573    """generator which reads lines from Linux /proc/cpuinfo and splits them 
    565574    into key:value tokens and yields (key, value) tuple. 
    566575    """ 
    567     f = open('/proc/cpuinfo', 'r') 
    568     for line in f: 
     576    with open('/proc/cpuinfo', 'r') as f: 
     577      for line in f: 
    569578        line = line.strip() 
    570579        if line: 
    571580            k,v = line.split(':', 1) 
    572581            yield (k.strip(), v.strip()) 
    573     f.close() 
    574  
    575582 
    576583class CpuInfo (object): 
     
    689696    answer = None 
    690697 
    691     # If setting DIST_TARGET to i686 on a 64-bit CPU to facilitate  
     698    # If setting DIST_TARGET to i686 on a 64-bit CPU to facilitate 
    692699    # compilation of a multilib environment, force 32-bit. 
    693700    if env['DIST_TARGET'] == 'i686': 
     
    706713        # presumably if a person is running this script, they should have 
    707714        # a gcc toolchain installed... 
    708         x = outputof('objdump', '-Wi', real_exe
     715        x = check_output(('objdump', '-Wi', real_exe)).decode(
    709716        # should emit a line that looks like this: 
    710717        # /bin/mount:     file format elf32-i386 
     
    847854    print("Doing an optimized build...") 
    848855 
    849 env['REVISION'] = os.popen('svnversion .').read()[:-1] 
     856try: 
     857    env['REVISION'] = check_output(('svnversion', '.',)).decode().rstrip() 
     858except: 
     859    env['REVISION'] = '' 
     860 
    850861# This may be as simple as '89' or as complex as '4123:4184M'. 
    851862# We'll just use the last bit. 
    852863env['REVISION'] = env['REVISION'].split(':')[-1] 
    853864 
     865# Assume an unversioned directory indicates a release. 
     866if env['REVISION'].startswith ('Unversioned'): 
     867    env['REVISION'] = '' 
     868 
    854869# try to circumvent localized versions 
    855 if len(env['REVISION']) >= 5 and env['REVISION'][0:6] == 'export'
     870if env['REVISION'].startswith ('export')
    856871    env['REVISION'] = '' 
    857872 
    858873# avoid the 1.999.41- type of version for exported versions 
    859874if env['REVISION'] != '': 
    860        env['REVISIONSTRING'] = '-' + env['REVISION'] 
     875    env['REVISIONSTRING'] = '-' + env['REVISION'] 
    861876else: 
    862        env['REVISIONSTRING'] = '' 
     877    env['REVISIONSTRING'] = '' 
    863878 
    864879env['FFADO_API_VERSION'] = FFADO_API_VERSION 
     
    917932    if env['BUILD_TESTS']: 
    918933        Default( 'tests' ) 
     934    if env['BUILD_DOC'] != 'none': 
     935        Default( 'doc' ) 
     936 
     937env.Install( env['metainfodir'], "support/xdg/ffado-mixer.appdata.xml" ) 
    919938 
    920939# 
  • branches/2.4.x/libffado/src/bebob/bebob_dl_mgr.cpp

    r2707 r2771  
    540540        } 
    541541    } 
    542     printf( "download protocol successfuly completed\n" ); 
     542    printf( "download protocol successfully completed\n" ); 
    543543    return result; 
    544544} 
  • branches/2.4.x/libffado/src/ffadodevice.h

    r2691 r2771  
    141141     * @brief This is called by the DeviceManager to discover & configure the device 
    142142     * 
    143      * @return true if the device was discovered successful
     143     * @return true if the device was discovered successfull
    144144     */ 
    145145    virtual bool discover() = 0; 
  • branches/2.4.x/libffado/src/fireworks/fireworks_control.cpp

    r2393 r2771  
    774774        return m_ParentDevice.saveSession(); 
    775775    case eT_Identify: 
    776         debugOutput(DEBUG_LEVEL_VERBOSE, "indentify device\n"); 
     776        debugOutput(DEBUG_LEVEL_VERBOSE, "identify device\n"); 
    777777        { 
    778778            EfcIdentifyCmd cmd; 
  • branches/2.4.x/libffado/src/libavc/general/avc_unit.cpp

    r1997 r2771  
    175175 
    176176    if ( !enumerateSubUnits() ) { 
    177         debugError( "Could not enumarate sub units\n" ); 
     177        debugError( "Could not enumerate sub units\n" ); 
    178178        return false; 
    179179    } 
  • branches/2.4.x/libffado/src/libstreaming/StreamProcessorManager.cpp

    r2651 r2771  
    616616 
    617617    //STEP X: when we implement such a function, we can wait for a signal from the devices that they 
    618     //        have aquired lock 
     618    //        have acquired lock 
    619619    //debugOutput( DEBUG_LEVEL_VERBOSE, "Waiting for device(s) to indicate clock sync lock...\n"); 
    620620    //sleep(2); // FIXME: be smarter here 
  • branches/2.4.x/libffado/src/libutil/PosixThread.cpp

    r2164 r2771  
    223223    struct sched_param rtparam; 
    224224    int res; 
    225     debugOutput( DEBUG_LEVEL_VERBOSE, "(%s, %p) Aquire realtime, prio %d\n", m_id.c_str(), this, fPriority); 
     225    debugOutput( DEBUG_LEVEL_VERBOSE, "(%s, %p) Acquire realtime, prio %d\n", m_id.c_str(), this, fPriority); 
    226226 
    227227    if (!fThread) 
  • branches/2.4.x/libffado/src/libutil/Watchdog.cpp

    r2344 r2771  
    296296    if(m_realtime) { 
    297297        if(!m_CheckThread->AcquireRealTime(m_priority)) { 
    298             debugWarning("(%p) Could not aquire realtime priotiry for watchdog thread.\n", this); 
     298            debugWarning("(%p) Could not acquire realtime priotiry for watchdog thread.\n", this); 
    299299        } 
    300300    } 
  • branches/2.4.x/libffado/src/rme/fireface_flash.cpp

    r2651 r2771  
    609609    // It's suspected that neither of these are used by the device directly, 
    610610    // and that these elements are just a convenient place for computer 
    611     // control applications to store things. 
    612     for (out=0; out<30; out++) { 
     611    // control applications to store things.  FFADO does not make use 
     612    // of these.  nch is assumed to be <= RME_FF800_MAX_CHANNELS (28), 
     613    // the size of the output_faders[] array. 
     614    for (out=0; out<nch; out++) { 
    613615      dsettings->output_faders[out] = flashvol2fader(obuf[out]); 
    614616    } 
     
    689691    // comments in read_device_mixer_settings(). 
    690692    memset(obuf, 0, sizeof(obuf)); 
    691     for (out=0; out<30; out++) { 
     693    for (out=0; out<nch; out++) { 
    692694      obuf[out] = fader2flashvol(dsettings->output_faders[out]); 
    693695    } 
  • branches/2.4.x/libffado/src/rme/rme_avdevice.cpp

    r2693 r2771  
    4343#include <assert.h> 
    4444#include <unistd.h> 
    45 #include "libutil/ByteSwap.h" 
    4645 
    4746#include <iostream> 
     
    755754    err = hardware_init_streaming(dev_config->hardware_freq, iso_tx_channel) != 0; 
    756755    if (err) { 
    757         debugFatal("Could not intialise device streaming system\n"); 
     756        debugFatal("Could not initialise device streaming system\n"); 
    758757        return false; 
    759758    } 
  • branches/2.4.x/libffado/src/rme/rme_avdevice.h

    r2691 r2771  
    3232 
    3333#include "libutil/Configuration.h" 
     34#include "libutil/ByteSwap.h" 
    3435 
    3536#include "fireface_def.h" 
  • branches/2.4.x/libffado/src/SConscript

    r2718 r2771  
    3131 
    3232ffado_source = env.Split( '\ 
    33        devicemanager.cpp \ 
    34        ffado.cpp \ 
    35        ffadodevice.cpp \ 
    36        debugmodule/debugmodule.cpp \ 
    37        DeviceStringParser.cpp \ 
    38        libieee1394/ARMHandler.cpp \ 
    39        libieee1394/configrom.cpp \ 
    40        libieee1394/csr1212.c \ 
    41        libieee1394/CycleTimerHelper.cpp \ 
    42        libieee1394/ieee1394service.cpp \ 
    43        libieee1394/IEC61883.cpp \ 
    44        libieee1394/IsoHandlerManager.cpp \ 
    45        libstreaming/StreamProcessorManager.cpp \ 
    46        libstreaming/util/cip.c \ 
    47        libstreaming/generic/StreamProcessor.cpp \ 
    48        libstreaming/generic/Port.cpp \ 
    49        libstreaming/generic/PortManager.cpp \ 
    50        libutil/cmd_serialize.cpp \ 
    51        libutil/DelayLockedLoop.cpp \ 
    52        libutil/IpcRingBuffer.cpp \ 
    53        libutil/PacketBuffer.cpp \ 
    54        libutil/Configuration.cpp \ 
    55        libutil/OptionContainer.cpp \ 
    56        libutil/PosixMessageQueue.cpp \ 
    57        libutil/PosixSharedMemory.cpp \ 
    58        libutil/PosixMutex.cpp \ 
    59        libutil/PosixThread.cpp \ 
    60        libutil/ringbuffer.c \ 
    61        libutil/StreamStatistics.cpp \ 
    62        libutil/SystemTimeSource.cpp \ 
    63        libutil/TimestampedBuffer.cpp \ 
    64        libutil/Watchdog.cpp \ 
    65        libcontrol/Element.cpp \ 
    66        libcontrol/BasicElements.cpp \ 
    67        libcontrol/MatrixMixer.cpp \ 
    68        libcontrol/CrossbarRouter.cpp \ 
    69        libcontrol/ClockSelect.cpp \ 
    70        libcontrol/Nickname.cpp \ 
     33    devicemanager.cpp \ 
     34    ffado.cpp \ 
     35    ffadodevice.cpp \ 
     36    debugmodule/debugmodule.cpp \ 
     37    DeviceStringParser.cpp \ 
     38    libieee1394/ARMHandler.cpp \ 
     39    libieee1394/configrom.cpp \ 
     40    libieee1394/csr1212.c \ 
     41    libieee1394/CycleTimerHelper.cpp \ 
     42    libieee1394/ieee1394service.cpp \ 
     43    libieee1394/IEC61883.cpp \ 
     44    libieee1394/IsoHandlerManager.cpp \ 
     45    libstreaming/StreamProcessorManager.cpp \ 
     46    libstreaming/util/cip.c \ 
     47    libstreaming/generic/StreamProcessor.cpp \ 
     48    libstreaming/generic/Port.cpp \ 
     49    libstreaming/generic/PortManager.cpp \ 
     50    libutil/cmd_serialize.cpp \ 
     51    libutil/DelayLockedLoop.cpp \ 
     52    libutil/IpcRingBuffer.cpp \ 
     53    libutil/PacketBuffer.cpp \ 
     54    libutil/Configuration.cpp \ 
     55    libutil/OptionContainer.cpp \ 
     56    libutil/PosixMessageQueue.cpp \ 
     57    libutil/PosixSharedMemory.cpp \ 
     58    libutil/PosixMutex.cpp \ 
     59    libutil/PosixThread.cpp \ 
     60    libutil/ringbuffer.c \ 
     61    libutil/StreamStatistics.cpp \ 
     62    libutil/SystemTimeSource.cpp \ 
     63    libutil/TimestampedBuffer.cpp \ 
     64    libutil/Watchdog.cpp \ 
     65    libcontrol/Element.cpp \ 
     66    libcontrol/BasicElements.cpp \ 
     67    libcontrol/MatrixMixer.cpp \ 
     68    libcontrol/CrossbarRouter.cpp \ 
     69    libcontrol/ClockSelect.cpp \ 
     70    libcontrol/Nickname.cpp \ 
    7171') 
    7272 
    7373if env['SERIALIZE_USE_EXPAT']: 
    74        ffado_source.append('libutil/serialize_expat.cpp') 
    75        ffado_source.append('libutil/serialize_expat_xml.cpp') 
     74    ffado_source.append('libutil/serialize_expat.cpp') 
     75    ffado_source.append('libutil/serialize_expat_xml.cpp') 
    7676else: 
    77        ffado_source.append('libutil/serialize_libxml.cpp') 
     77    ffado_source.append('libutil/serialize_libxml.cpp') 
    7878 
    7979bebob_source = env.Split( '\ 
    80        bebob/bebob_avdevice.cpp \ 
    81        bebob/bebob_avdevice_subunit.cpp \ 
    82        bebob/bebob_avplug.cpp \ 
    83        bebob/bebob_dl_bcd.cpp \ 
    84        bebob/bebob_dl_codes.cpp \ 
    85        bebob/bebob_dl_mgr.cpp \ 
    86        bebob/bebob_functionblock.cpp \ 
    87        bebob/bebob_mixer.cpp \ 
    88        bebob/focusrite/focusrite_generic.cpp \ 
    89        bebob/focusrite/focusrite_saffire.cpp \ 
    90        bebob/focusrite/focusrite_saffirepro.cpp \ 
    91        bebob/focusrite/focusrite_cmd.cpp \ 
    92        bebob/terratec/terratec_device.cpp \ 
    93        bebob/terratec/terratec_cmd.cpp \ 
    94        bebob/edirol/edirol_fa101.cpp \ 
    95        bebob/edirol/edirol_fa66.cpp \ 
    96        bebob/esi/quatafire610.cpp \ 
    97        bebob/mackie/onyxmixer.cpp \ 
    98        bebob/yamaha/yamaha_cmd.cpp \ 
    99        bebob/yamaha/yamaha_avdevice.cpp \ 
    100        bebob/maudio/normal_avdevice.cpp \ 
    101        bebob/maudio/special_avdevice.cpp \ 
    102        bebob/maudio/special_mixer.cpp \ 
    103        bebob/presonus/firebox_avdevice.cpp \ 
    104        bebob/presonus/inspire1394_avdevice.cpp \ 
     80    bebob/bebob_avdevice.cpp \ 
     81    bebob/bebob_avdevice_subunit.cpp \ 
     82    bebob/bebob_avplug.cpp \ 
     83    bebob/bebob_dl_bcd.cpp \ 
     84    bebob/bebob_dl_codes.cpp \ 
     85    bebob/bebob_dl_mgr.cpp \ 
     86    bebob/bebob_functionblock.cpp \ 
     87    bebob/bebob_mixer.cpp \ 
     88    bebob/focusrite/focusrite_generic.cpp \ 
     89    bebob/focusrite/focusrite_saffire.cpp \ 
     90    bebob/focusrite/focusrite_saffirepro.cpp \ 
     91    bebob/focusrite/focusrite_cmd.cpp \ 
     92    bebob/terratec/terratec_device.cpp \ 
     93    bebob/terratec/terratec_cmd.cpp \ 
     94    bebob/edirol/edirol_fa101.cpp \ 
     95    bebob/edirol/edirol_fa66.cpp \ 
     96    bebob/esi/quatafire610.cpp \ 
     97    bebob/mackie/onyxmixer.cpp \ 
     98    bebob/yamaha/yamaha_cmd.cpp \ 
     99    bebob/yamaha/yamaha_avdevice.cpp \ 
     100    bebob/maudio/normal_avdevice.cpp \ 
     101    bebob/maudio/special_avdevice.cpp \ 
     102    bebob/maudio/special_mixer.cpp \ 
     103    bebob/presonus/firebox_avdevice.cpp \ 
     104    bebob/presonus/inspire1394_avdevice.cpp \ 
    105105' ) 
    106106 
    107107bebob_pkgdata = env.Split( '\ 
    108        bebob/maudio/refdesign.xml \ 
    109        bebob/maudio/fw410.xml \ 
    110        bebob/maudio/fwap.xml \ 
     108    bebob/maudio/refdesign.xml \ 
     109    bebob/maudio/fw410.xml \ 
     110    bebob/maudio/fwap.xml \ 
    111111' ) 
    112112 
    113113genericavc_source =  env.Split( '\ 
    114        genericavc/avc_avdevice.cpp \ 
    115        genericavc/stanton/scs.cpp \ 
     114    genericavc/avc_avdevice.cpp \ 
     115    genericavc/stanton/scs.cpp \ 
    116116' ) 
    117117 
    118118genericavc_pkgdata = env.Split( '\ 
    119 ' )     
     119' ) 
    120120 
    121121fireworks_source =  env.Split( '\ 
    122        fireworks/fireworks_device.cpp \ 
    123        fireworks/fireworks_control.cpp \ 
    124        fireworks/fireworks_firmware.cpp \ 
    125        fireworks/efc/efc_avc_cmd.cpp \ 
    126        fireworks/efc/efc_cmd.cpp \ 
    127        fireworks/efc/efc_cmds_hardware.cpp \ 
    128        fireworks/efc/efc_cmds_hardware_ctrl.cpp \ 
    129        fireworks/efc/efc_cmds_flash.cpp \ 
    130        fireworks/efc/efc_cmds_mixer.cpp \ 
    131        fireworks/efc/efc_cmds_monitor.cpp \ 
    132        fireworks/efc/efc_cmds_ioconfig.cpp \ 
    133        fireworks/fireworks_session_block.cpp \ 
    134        fireworks/audiofire/audiofire_device.cpp \ 
     122    fireworks/fireworks_device.cpp \ 
     123    fireworks/fireworks_control.cpp \ 
     124    fireworks/fireworks_firmware.cpp \ 
     125    fireworks/efc/efc_avc_cmd.cpp \ 
     126    fireworks/efc/efc_cmd.cpp \ 
     127    fireworks/efc/efc_cmds_hardware.cpp \ 
     128    fireworks/efc/efc_cmds_hardware_ctrl.cpp \ 
     129    fireworks/efc/efc_cmds_flash.cpp \ 
     130    fireworks/efc/efc_cmds_mixer.cpp \ 
     131    fireworks/efc/efc_cmds_monitor.cpp \ 
     132    fireworks/efc/efc_cmds_ioconfig.cpp \ 
     133    fireworks/fireworks_session_block.cpp \ 
     134    fireworks/audiofire/audiofire_device.cpp \ 
    135135' ) 
    136136 
     
    139139 
    140140oxford_source =  env.Split( '\ 
    141        oxford/oxford_device.cpp \ 
    142        libstreaming/amdtp-oxford/AmdtpOxfordReceiveStreamProcessor.cpp \ 
     141    oxford/oxford_device.cpp \ 
     142    libstreaming/amdtp-oxford/AmdtpOxfordReceiveStreamProcessor.cpp \ 
    143143' ) 
    144144 
    145145oxford_pkgdata = env.Split( '\ 
    146 ' )     
     146' ) 
    147147 
    148148motu_source = env.Split( '\ 
    149        motu/motu_avdevice.cpp \ 
    150        motu/motu_controls.cpp \ 
    151        motu/motu_mark3_controls.cpp \ 
    152        motu/motu_mixerdefs.cpp \ 
    153        motu/motu_mark3_mixerdefs.cpp \ 
    154        motu/motu_mixer.cpp \ 
    155        libstreaming/motu/MotuPort.cpp \ 
    156        libstreaming/motu/MotuPortInfo.cpp \ 
    157        libstreaming/motu/MotuReceiveStreamProcessor.cpp \ 
    158        libstreaming/motu/MotuTransmitStreamProcessor.cpp \ 
     149    motu/motu_avdevice.cpp \ 
     150    motu/motu_controls.cpp \ 
     151    motu/motu_mark3_controls.cpp \ 
     152    motu/motu_mixerdefs.cpp \ 
     153    motu/motu_mark3_mixerdefs.cpp \ 
     154    motu/motu_mixer.cpp \ 
     155    libstreaming/motu/MotuPort.cpp \ 
     156    libstreaming/motu/MotuPortInfo.cpp \ 
     157    libstreaming/motu/MotuReceiveStreamProcessor.cpp \ 
     158    libstreaming/motu/MotuTransmitStreamProcessor.cpp \ 
    159159' ) 
    160160 
    161161dice_source = env.Split( '\ 
    162        dice/dice_avdevice.cpp \ 
    163        dice/dice_firmware_loader.cpp \ 
    164        dice/dice_eap.cpp \ 
    165        dice/focusrite/focusrite_eap.cpp \ 
    166        dice/focusrite/saffire_pro40.cpp \ 
    167        dice/focusrite/saffire_pro26.cpp \ 
    168        dice/focusrite/saffire_pro24.cpp \ 
    169        dice/focusrite/saffire_pro14.cpp \ 
    170        dice/focusrite/saffire_56.cpp \ 
    171        dice/maudio/profire_2626.cpp \ 
    172        dice/presonus/firestudio_tube.cpp \ 
    173        dice/presonus/firestudio_project.cpp \ 
    174        dice/presonus/firestudio_mobile.cpp \ 
     162    dice/dice_avdevice.cpp \ 
     163    dice/dice_firmware_loader.cpp \ 
     164    dice/dice_eap.cpp \ 
     165    dice/focusrite/focusrite_eap.cpp \ 
     166    dice/focusrite/saffire_pro40.cpp \ 
     167    dice/focusrite/saffire_pro26.cpp \ 
     168    dice/focusrite/saffire_pro24.cpp \ 
     169    dice/focusrite/saffire_pro14.cpp \ 
     170    dice/focusrite/saffire_56.cpp \ 
     171    dice/maudio/profire_2626.cpp \ 
     172    dice/presonus/firestudio_tube.cpp \ 
     173    dice/presonus/firestudio_project.cpp \ 
     174    dice/presonus/firestudio_mobile.cpp \ 
    175175' ) 
    176176 
    177177bounce_source = env.Split( '\ 
    178        bounce/bounce_avdevice.cpp \ 
    179        bounce/bounce_slave_avdevice.cpp \ 
     178    bounce/bounce_avdevice.cpp \ 
     179    bounce/bounce_slave_avdevice.cpp \ 
    180180' ) 
    181181 
    182182metric_halo_source = env.Split( '\ 
    183        metrichalo/mh_avdevice.cpp \ 
     183    metrichalo/mh_avdevice.cpp \ 
    184184' ) 
    185185 
    186186rme_source = env.Split( '\ 
    187        rme/rme_shm.cpp \ 
    188        rme/rme_avdevice.cpp \ 
    189        rme/rme_avdevice_settings.cpp \ 
    190        rme/fireface_flash.cpp \ 
    191        rme/fireface_hw.cpp \ 
    192        rme/fireface_settings_ctrls.cpp \ 
    193        libstreaming/rme/RmePort.cpp \ 
    194        libstreaming/rme/RmePortInfo.cpp \ 
    195        libstreaming/rme/RmeReceiveStreamProcessor.cpp \ 
    196        libstreaming/rme/RmeTransmitStreamProcessor.cpp \ 
     187    rme/rme_shm.cpp \ 
     188    rme/rme_avdevice.cpp \ 
     189    rme/rme_avdevice_settings.cpp \ 
     190    rme/fireface_flash.cpp \ 
     191    rme/fireface_hw.cpp \ 
     192    rme/fireface_settings_ctrls.cpp \ 
     193    libstreaming/rme/RmePort.cpp \ 
     194    libstreaming/rme/RmePortInfo.cpp \ 
     195    libstreaming/rme/RmeReceiveStreamProcessor.cpp \ 
     196    libstreaming/rme/RmeTransmitStreamProcessor.cpp \ 
    197197' ) 
    198198 
    199199digidesign_source = env.Split( '\ 
    200        digidesign/digidesign_avdevice.cpp \ 
    201        libstreaming/digidesign/DigidesignPort.cpp \ 
    202        libstreaming/digidesign/DigidesignPortInfo.cpp \ 
    203        libstreaming/digidesign/DigidesignReceiveStreamProcessor.cpp \ 
    204        libstreaming/digidesign/DigidesignTransmitStreamProcessor.cpp \ 
     200    digidesign/digidesign_avdevice.cpp \ 
     201    libstreaming/digidesign/DigidesignPort.cpp \ 
     202    libstreaming/digidesign/DigidesignPortInfo.cpp \ 
     203    libstreaming/digidesign/DigidesignReceiveStreamProcessor.cpp \ 
     204    libstreaming/digidesign/DigidesignTransmitStreamProcessor.cpp \ 
    205205' ) 
    206206 
    207207amdtp_source = env.Split( '\ 
    208        libstreaming/amdtp/AmdtpPort.cpp \ 
    209        libstreaming/amdtp/AmdtpPortInfo.cpp \ 
    210        libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp \ 
    211        libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp \ 
     208    libstreaming/amdtp/AmdtpPort.cpp \ 
     209    libstreaming/amdtp/AmdtpPortInfo.cpp \ 
     210    libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp \ 
     211    libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp \ 
    212212' ) 
    213213 
    214214libavc_source = env.Split( '\ 
    215        libavc/streamformat/avc_extended_stream_format.cpp \ 
    216        libavc/musicsubunit/avc_descriptor_music.cpp \ 
    217        libavc/musicsubunit/avc_musicsubunit.cpp \ 
    218        libavc/audiosubunit/avc_audiosubunit.cpp \ 
    219        libavc/audiosubunit/avc_descriptor_audio.cpp \ 
    220        libavc/audiosubunit/avc_function_block.cpp \ 
    221        libavc/descriptors/avc_descriptor_cmd.cpp \ 
    222        libavc/descriptors/avc_descriptor.cpp \ 
    223        libavc/general/avc_extended_subunit_info.cpp \ 
    224        libavc/general/avc_unit_info.cpp \ 
    225        libavc/general/avc_generic.cpp \ 
    226        libavc/general/avc_subunit_info.cpp \ 
    227        libavc/general/avc_connect.cpp \ 
    228        libavc/general/avc_signal_format.cpp \ 
    229        libavc/general/avc_extended_cmd_generic.cpp \ 
    230        libavc/general/avc_extended_plug_info.cpp \ 
    231        libavc/general/avc_plug_info.cpp \ 
    232        libavc/general/avc_unit.cpp \ 
    233        libavc/general/avc_subunit.cpp \ 
    234        libavc/general/avc_plug.cpp \ 
    235        libavc/general/avc_vendor_dependent_cmd.cpp \ 
    236        libavc/avc_definitions.cpp \ 
    237        libavc/ccm/avc_signal_source.cpp \ 
     215    libavc/streamformat/avc_extended_stream_format.cpp \ 
     216    libavc/musicsubunit/avc_descriptor_music.cpp \ 
     217    libavc/musicsubunit/avc_musicsubunit.cpp \ 
     218    libavc/audiosubunit/avc_audiosubunit.cpp \ 
     219    libavc/audiosubunit/avc_descriptor_audio.cpp \ 
     220    libavc/audiosubunit/avc_function_block.cpp \ 
     221    libavc/descriptors/avc_descriptor_cmd.cpp \ 
     222    libavc/descriptors/avc_descriptor.cpp \ 
     223    libavc/general/avc_extended_subunit_info.cpp \ 
     224    libavc/general/avc_unit_info.cpp \ 
     225    libavc/general/avc_generic.cpp \ 
     226    libavc/general/avc_subunit_info.cpp \ 
     227    libavc/general/avc_connect.cpp \ 
     228    libavc/general/avc_signal_format.cpp \ 
     229    libavc/general/avc_extended_cmd_generic.cpp \ 
     230    libavc/general/avc_extended_plug_info.cpp \ 
     231    libavc/general/avc_plug_info.cpp \ 
     232    libavc/general/avc_unit.cpp \ 
     233    libavc/general/avc_subunit.cpp \ 
     234    libavc/general/avc_plug.cpp \ 
     235    libavc/general/avc_vendor_dependent_cmd.cpp \ 
     236    libavc/avc_definitions.cpp \ 
     237    libavc/ccm/avc_signal_source.cpp \ 
    238238' ) 
    239239 
     
    241241pkgdata = [] 
    242242if env['ENABLE_BEBOB']: 
    243        env['ENABLE_GENERICAVC'] = True 
    244        libenv.MergeFlags( "-DENABLE_BEBOB" ) 
    245        source += bebob_source 
    246        pkgdata += bebob_pkgdata 
     243    env['ENABLE_GENERICAVC'] = True 
     244    libenv.MergeFlags( "-DENABLE_BEBOB" ) 
     245    source += bebob_source 
     246    pkgdata += bebob_pkgdata 
    247247if env['ENABLE_FIREWORKS']: 
    248        env['ENABLE_GENERICAVC'] = True 
    249        libenv.MergeFlags( "-DENABLE_FIREWORKS" ) 
    250        source += fireworks_source 
    251        pkgdata += fireworks_pkgdata 
     248    env['ENABLE_GENERICAVC'] = True 
     249    libenv.MergeFlags( "-DENABLE_FIREWORKS" ) 
     250    source += fireworks_source 
     251    pkgdata += fireworks_pkgdata 
    252252if env['ENABLE_OXFORD']: 
    253        env['ENABLE_GENERICAVC'] = True 
    254        libenv.MergeFlags( "-DENABLE_OXFORD" ) 
    255        source += oxford_source 
    256        pkgdata += oxford_pkgdata 
     253    env['ENABLE_GENERICAVC'] = True 
     254    libenv.MergeFlags( "-DENABLE_OXFORD" ) 
     255    source += oxford_source 
     256    pkgdata += oxford_pkgdata 
    257257if env['ENABLE_MOTU']: 
    258        libenv.MergeFlags( "-DENABLE_MOTU" ) 
    259        source += motu_source 
     258    libenv.MergeFlags( "-DENABLE_MOTU" ) 
     259    source += motu_source 
    260260if env['ENABLE_DICE']: 
    261        env['ENABLE_GENERICAVC'] = True 
    262        libenv.MergeFlags( "-DENABLE_DICE" ) 
    263        source += dice_source 
     261    env['ENABLE_GENERICAVC'] = True 
     262    libenv.MergeFlags( "-DENABLE_DICE" ) 
     263    source += dice_source 
    264264if env['ENABLE_METRIC_HALO']: 
    265        libenv.MergeFlags( "-DENABLE_METRIC_HALO" ) 
    266        source += metric_halo_source 
     265    libenv.MergeFlags( "-DENABLE_METRIC_HALO" ) 
     266    source += metric_halo_source 
    267267if env['ENABLE_RME']: 
    268        libenv.MergeFlags( "-DENABLE_RME" ) 
    269        source += rme_source 
     268    libenv.MergeFlags( "-DENABLE_RME" ) 
     269    source += rme_source 
    270270if env['ENABLE_DIGIDESIGN']: 
    271        libenv.MergeFlags( "-DENABLE_DIGIDESIGN" ) 
    272        source += digidesign_source 
     271    libenv.MergeFlags( "-DENABLE_DIGIDESIGN" ) 
     272    source += digidesign_source 
    273273if env['ENABLE_BOUNCE']: 
    274        env['ENABLE_GENERICAVC'] = True 
    275        libenv.MergeFlags( "-DENABLE_BOUNCE" ) 
    276        source += bounce_source 
     274    env['ENABLE_GENERICAVC'] = True 
     275    libenv.MergeFlags( "-DENABLE_BOUNCE" ) 
     276    source += bounce_source 
    277277 
    278278if env['ENABLE_GENERICAVC']: 
    279        libenv.MergeFlags( "-DENABLE_GENERICAVC" ) 
    280        source += libavc_source 
    281        source += amdtp_source 
    282        source += genericavc_source 
    283        pkgdata += genericavc_pkgdata 
     279    libenv.MergeFlags( "-DENABLE_GENERICAVC" ) 
     280    source += libavc_source 
     281    source += amdtp_source 
     282    source += genericavc_source 
     283    pkgdata += genericavc_pkgdata 
    284284 
    285285if not env.GetOption( "clean" ): 
    286        libenv.MergeFlags( "-lrt -lpthread" ) 
    287        libenv.MergeFlags( env['LIBRAW1394_FLAGS'].decode() ) 
    288        libenv.MergeFlags( env['LIBIEC61883_FLAGS'].decode() ) 
    289        libenv.MergeFlags( env['LIBCONFIG_FLAGS'].decode() ) 
    290        if not env['SERIALIZE_USE_EXPAT']: 
    291             if 'LIBXML30_FLAGS' in env : 
    292                libenv.MergeFlags( env['LIBXML30_FLAGS'].decode() ) 
    293             if not('LIBXML30_FLAGS' in env) : 
    294                libenv.MergeFlags( env['LIBXML26_FLAGS'].decode() ) 
    295        else: 
    296                libenv.PrependUnique( LIBS=["expat"] ) 
    297                libenv.MergeFlags( "-DSERIALIZE_USE_EXPAT" ) 
    298        if env['REQUIRE_LIBAVC']: 
    299                libenv.MergeFlags( env['LIBAVC1394_FLAGS'].decode() ) 
     286    libenv.MergeFlags( "-lrt -lpthread" ) 
     287    libenv.MergeFlags( env['LIBRAW1394_FLAGS'].decode() ) 
     288    libenv.MergeFlags( env['LIBIEC61883_FLAGS'].decode() ) 
     289    libenv.MergeFlags( env['LIBCONFIG_FLAGS'].decode() ) 
     290    if not env['SERIALIZE_USE_EXPAT']: 
     291        if 'LIBXML30_FLAGS' in env : 
     292            libenv.MergeFlags( env['LIBXML30_FLAGS'].decode() ) 
     293        if not('LIBXML30_FLAGS' in env) : 
     294            libenv.MergeFlags( env['LIBXML26_FLAGS'].decode() ) 
     295    else: 
     296        libenv.PrependUnique( LIBS=["expat"] ) 
     297        libenv.MergeFlags( "-DSERIALIZE_USE_EXPAT" ) 
     298    if env['REQUIRE_LIBAVC']: 
     299        libenv.MergeFlags( env['LIBAVC1394_FLAGS'].decode() ) 
    300300 
    301301libname_versioned = "libffado.so.%s" % libenv['VERSION'] 
     
    327327# 
    328328for data in pkgdata: 
    329        libenv.Install( "$sharedir", data ) 
     329    libenv.Install( "$sharedir", data ) 
    330330 
    331331# 
     
    337337 
    338338apps = { \ 
    339        "test-debugmodule" : "debugmodule/test_debugmodule.cpp", \ 
    340        "test-dll" : "libutil/test-dll.cpp", \ 
    341        "test-unittests-util" : "libutil/unittests.cpp", \ 
    342        "test-cyclecalc" : "libieee1394/test-cyclecalc.cpp", \ 
     339    "test-debugmodule" : "debugmodule/test_debugmodule.cpp", \ 
     340    "test-dll" : "libutil/test-dll.cpp", \ 
     341    "test-unittests-util" : "libutil/unittests.cpp", \ 
     342    "test-cyclecalc" : "libieee1394/test-cyclecalc.cpp", \ 
    343343} 
    344344 
     
    346346 
    347347for app in apps.keys(): 
    348         env2.Program( target=app, source = env.Split( apps[app] ) ) 
    349         if app.find( "test" ) == -1: 
    350                 env2.Install( "$bindir", app ) 
    351  
     348    env2.Program( target=app, source = env.Split( apps[app] ) ) 
     349    if app.find( "test" ) == -1: 
     350        env2.Install( "$bindir", app ) 
  • branches/2.4.x/libffado/support/mixer-qt4/ffado-mixer.in

    r2125 r2771  
    1 #!/usr/bin/python 
     1#!$PYTHON_INTERPRETER 
    22# 
    33# Copyright (C) 2005-2008 by Pieter Palmers 
  • branches/2.4.x/libffado/support/mixer-qt4/ffado/ffadowindow.py

    • Property svn:executable deleted
    r2701 r2771  
    1 #!/usr/bin/python 
    2 # 
    31# Copyright (C) 2005-2008 by Pieter Palmers 
    42#               2007-2009 by Arnold Krille 
     
    2321# 
    2422 
     23import ctypes 
     24import datetime 
    2525import os 
    2626 
     
    9393 
    9494            if (ffado_python3 and (self.style().objectName().lower() == theme.lower()) or 
    95                     not(ffado_python3) and (self.style().objectName().toLower() == theme.toLower())): 
     95                    not(ffado_python3) and (self.style().objectName().toLower() == theme.toLower() if ffado_pyqt_version == 4 else 
     96                                            self.style().objectName().lower() == theme.lower())): 
    9697                self.menuTheme[theme].setDisabled(True) 
    9798                self.menuTheme[theme].setChecked(True) 
     
    175176<h1>ffado.org</h1> 
    176177 
     178<p>{ffado_version}</p> 
     179 
    177180<p>FFADO is the new approach to have firewire audio on linux.</p> 
    178181 
    179 <p>&copy; 2006-2014 by the FFADO developers<br />ffado is licensed under the GPLv3, for the full license text see <a href="http://www.gnu.org/licenses/">www.gnu.org/licenses</a> or the LICENSE.* files shipped with ffado.</p> 
     182        <p>&copy; 2006-2018 by the FFADO developers<br />ffado is licensed under the GPLv3, for the full license text see <a href="http://www.gnu.org/licenses/">www.gnu.org/licenses</a> or the LICENSE.* files shipped with ffado.</p> 
    180183 
    181184<p>FFADO developers are:<ul> 
     
    192195<li>Jano Svitok 
    193196</ul> 
    194 """ ) 
    195  
     197        """.format(ffado_version=get_ffado_version(), thisyear=datetime.datetime.now().year)) 
     198 
     199def get_ffado_version(): 
     200    try: 
     201        # call the C function ffado_get_version() to figure out the version 
     202        lib = ctypes.cdll.LoadLibrary('libffado.so') 
     203        func = ctypes.CFUNCTYPE(ctypes.c_char_p) 
     204        ffado_get_version = func(('ffado_get_version', lib)) 
     205        return ffado_get_version() 
     206    except: 
     207        return "libffado" 
    196208 
    197209def get_lock(process_name): 
     
    253265 
    254266    log = logging.getLogger('main') 
     267    log.debug("Using %s with Qt: %s PyQt: %s" % (get_ffado_version(), QtCore.QT_VERSION_STR, QtCore.PYQT_VERSION_STR)) 
    255268 
    256269    app = QApplication(args) 
  • branches/2.4.x/libffado/support/mixer-qt4/ffado/logginghandler.py

    r2694 r2771  
    2929 
    3030class QStatusLogger( QObject, logging.Handler ): 
    31     log = pyqtSignal(QString, int, name='log') 
     31    log = pyqtSignal(QString if ffado_pyqt_version == 4 else str, int, name='log') 
    3232    def __init__( self, parent, statusbar, level=logging.NOTSET ): 
    3333        QObject.__init__( self, parent ) 
  • branches/2.4.x/libffado/support/mixer-qt4/ffado/mixer/audiofire.py

    r2694 r2771  
    144144        sender = self.sender() 
    145145        state = a0 
    146        # 0/2/3 is available but GUI set 0/1/2 
     146        # 0/2/3 is available but GUI set 0/1/2 
    147147        if a0 > 0: 
    148148            state += 1 
    149149        log.debug("set %s to %d" % ( 
    150150            self.DigIfaceControls[sender][0], state)) 
    151        self.hw.setDiscrete(self.DigIfaceControls[sender][0], state) 
     151        self.hw.setDiscrete(self.DigIfaceControls[sender][0], state) 
    152152 
    153153    def updatePlbkRouteControl(self, src): 
  • branches/2.4.x/libffado/support/mixer-qt4/ffado/mixer/phase88control.py

    r2694 r2771  
    8282        } 
    8383         
    84        # gain control 
    85        for ctl, params in self.VolumeControls.items(): 
    86                path    = params[0] 
    87                idx     = params[1] 
     84        # gain control 
     85        for ctl, params in self.VolumeControls.items(): 
     86                path    = params[0] 
     87                idx     = params[1] 
    8888                dbmeter = params[5] 
    89                  
    90                #db = self.hw.getContignuous(path, idx) 
    91                #vol = self.db2vol(db) 
     89                 
     90                #db = self.hw.getContignuous(path, idx) 
     91                #vol = self.db2vol(db) 
    9292                vol = self.hw.getContignuous(path, idx) 
    9393                print("%s ch %d volume is %d" % (path, idx, vol)) 
     
    9595                dbmeter.setText(self.vol2dbstr(vol)) 
    9696                self.VolumeControls[ctl][6] = vol 
    97                  
    98                pair    = params[2] 
    99                pidx    = params[3] 
    100                link    = params[4] 
    101                  
    102 #              pdb = self.hw.getContignuous(path, pidx) 
    103 #              pvol = self.db2vol(db) 
    104                pvol = self.hw.getContignuous(path, pidx) 
     97                 
     98                pair    = params[2] 
     99                pidx    = params[3] 
     100                link    = params[4] 
     101                 
     102#               pdb = self.hw.getContignuous(path, pidx) 
     103#               pvol = self.db2vol(db) 
     104                pvol = self.hw.getContignuous(path, pidx) 
    105105 
    106                if pvol == vol: 
    107                        link.setChecked(True) 
    108                  
     106                if pvol == vol: 
     107                        link.setChecked(True) 
     108                 
    109109                ctl.valueChanged.connect(self.updateVolume) 
    110110 
    111        # selector controls 
    112        for ctl, param in self.SelectorControls.items(): 
    113                state = self.hw.getDiscrete(param) 
    114                ctl.setCurrentIndex(state) 
    115                  
     111        # selector controls 
     112        for ctl, param in self.SelectorControls.items(): 
     113                state = self.hw.getDiscrete(param) 
     114                ctl.setCurrentIndex(state) 
     115                 
    116116                ctl.activated.connect(self.updateSelector) 
    117117 
    118        # mute controls 
    119        for ctl, param in self.MuteControls.items(): 
     118        # mute controls 
     119        for ctl, param in self.MuteControls.items(): 
    120120                ctl.toggled.connect(self.muteVolume) 
    121121 
     
    123123    # helper functions  
    124124    def muteVolume(self, state): 
    125         sender   = self.sender() 
     125        sender    = self.sender() 
    126126        volctl    = self.MuteControls[sender][0] 
    127         path     = self.VolumeControls[volctl][0] 
    128         idx      = self.VolumeControls[volctl][1] 
    129         pair     = self.VolumeControls[volctl][2] 
    130         pidx     = self.VolumeControls[volctl][3] 
    131         link     = self.VolumeControls[volctl][4] 
     127        path      = self.VolumeControls[volctl][0] 
     128        idx       = self.VolumeControls[volctl][1] 
     129        pair      = self.VolumeControls[volctl][2] 
     130        pidx      = self.VolumeControls[volctl][3] 
     131        link      = self.VolumeControls[volctl][4] 
    132132        savedvol  = self.VolumeControls[volctl][6] 
    133133        psavedvol = self.VolumeControls[pair][6] 
     
    147147 
    148148    def updateVolume(self, vol): 
    149         sender = self.sender() 
    150         path   = self.VolumeControls[sender][0] 
    151         idx    = self.VolumeControls[sender][1] 
    152         pair   = self.VolumeControls[sender][2] 
    153         pidx   = self.VolumeControls[sender][3] 
    154         link   = self.VolumeControls[sender][4] 
     149        sender  = self.sender() 
     150        path    = self.VolumeControls[sender][0] 
     151        idx     = self.VolumeControls[sender][1] 
     152        pair    = self.VolumeControls[sender][2] 
     153        pidx    = self.VolumeControls[sender][3] 
     154        link    = self.VolumeControls[sender][4] 
    155155        dbmeter = self.VolumeControls[sender][5] 
    156156 
     
    165165 
    166166    def updateSelector(self, state): 
    167         sender = self.sender() 
    168         path   = self.SelectorControls[sender] 
     167        sender  = self.sender() 
     168        path    = self.SelectorControls[sender] 
    169169        self.hw.setDiscrete(path, state) 
    170170#       if path == '/Mixer/Selector_7' 
     
    176176 
    177177    def vol2dbstr(self, vol): 
    178        vol = vol + 25600 
     178        vol = vol + 25600 
    179179        if vol == 0 : 
    180180            return "- "+u"\u221E"+" dB" 
  • branches/2.4.x/libffado/support/mixer-qt4/ffado/panelmanager.py

    r2702 r2771  
    3939import sys 
    4040import time 
     41import importlib 
    4142 
    4243import logging 
     
    303304        # Specific (or dummy) mixer widgets get loaded in the following 
    304305        # 
     306        found = False 
    305307        if 'mixer' in dev and dev['mixer'] != None: 
    306308            mixerapp = dev['mixer'] 
    307             global mixerwidget 
    308             exec( """ 
    309 try: 
    310     import ffado.mixer.%s 
    311     globals()["mixerwidget"] = ffado.mixer.%s.%s( w ) 
    312     found = True 
    313 except ImportError: 
    314     log.debug("bypassdbus set, %s module not available: ignored") 
    315     found = False 
    316 """ % (mixerapp.lower(), mixerapp.lower(), mixerapp, mixerapp.lower()) ) 
    317         else: 
    318             found = False 
     309            try: 
     310                mixer_module = importlib.import_module("ffado.mixer.%s" % mixerapp.lower()) 
     311                mixerwidget = getattr(mixer_module, mixerapp)(w) 
     312                found = True 
     313            except ImportError: 
     314                log.debug("bypassdbus set, %s module not available: ignored" % mixerapp.lower()) 
    319315 
    320316        if not found: 
     
    379375        # Extract the action data and store as a dbus.String type so  
    380376        # it is usable as a key into self.panels[]. 
    381         panel_key = dbus.String(action.data().toString()
     377        panel_key = dbus.String(action.data().toString() if ffado_pyqt_version == 4 else action.data()
    382378        self.tabs.setCurrentIndex(self.tabs.indexOf(self.panels[panel_key])) 
    383379 
     
    516512        # file saving 
    517513        savefilename = QFileDialog.getSaveFileName(self, 'Save File', os.getenv('HOME')) 
     514        if isinstance(savefilename, tuple): # newer PyQt5 
     515            savefilename = savefilename[0] 
    518516        try: 
    519517          f = open(savefilename, 'w') 
     
    527525    def readSettings(self): 
    528526        readfilename = QFileDialog.getOpenFileName(self, 'Open File', os.getenv('HOME')) 
     527        if isinstance(readfilename, tuple): # newer PyQt5 
     528            readfilename = readfilename[0] 
    529529        try: 
    530530          f = open(readfilename, 'r') 
  • branches/2.4.x/libffado/support/mixer-qt4/ffado/widgets/crossbarrouter.py

    r2694 r2771  
    9999        else: 
    100100            self.combo.setCurrentIndex(0) 
    101         self.combo.activated.connect(self.comboCurrentChanged) 
     101        self.combo.activated[str].connect(self.comboCurrentChanged) 
    102102 
    103103 
     
    169169        self.timer.timeout.connect(self.updateLevels) 
    170170 
    171         self.vubtn.setChecked(self.settings.value("crossbarrouter/runvu", False).toBool()) 
     171        if ffado_pyqt_version == 4: 
     172            self.vubtn.setChecked(self.settings.value("crossbarrouter/runvu", False).toBool()) 
     173        else: 
     174            self.vubtn.setChecked(self.settings.value("crossbarrouter/runvu", False) == u'true') 
    172175 
    173176    def __del__(self): 
     
    192195        for peak in peakvalues: 
    193196            #log.debug("peak = [%s,%s]" % (str(peak[0]),str(peak[1]))) 
    194             if peak[0] >= 0: 
     197            if peak[1] >= 0: 
    195198                self.switchers[peak[0]].peakValue(peak[1]) 
    196199 
  • branches/2.4.x/libffado/support/mixer-qt4/ffado/widgets/matrixmixer.py

    r2699 r2771  
    201201    def mousePressEvent(self, ev): 
    202202        if ev.buttons() & Qt.LeftButton: 
    203             self.pos = ev.posF() 
     203            self.pos = ev.posF() if ffado_pyqt_version == 4 else ev.localPos() 
    204204            self.tmpvalue = self.value() 
    205205            ev.accept() 
     
    208208    def mouseMoveEvent(self, ev): 
    209209        if hasattr(self, "tmpvalue") and self.pos is not QtCore.QPointF(0, 0): 
    210             newpos = ev.posF() 
     210            newpos = ev.posF() if ffado_pyqt_version == 4 else ev.localPos() 
    211211            change = newpos.y() - self.pos.y() 
    212212            #log.debug("MixerNode.mouseReleaseEvent() change %s" % (str(change))) 
     
    216216    def mouseReleaseEvent(self, ev): 
    217217        if hasattr(self, "tmpvalue") and self.pos is not QtCore.QPointF(0, 0): 
    218             newpos = ev.posF() 
     218            newpos = ev.posF() if ffado_pyqt_version == 4 else ev.localPos() 
    219219            change = newpos.y() - self.pos.y() 
    220220            #log.debug("MixerNode.mouseReleaseEvent() change %s" % (str(change))) 
     
    258258            symb_inf = u"\u221E" 
    259259            text = "-" + symb_inf + " dB" 
    260         if ffado_python3
     260        if ffado_python3 or ffado_pyqt_version == 5
    261261            # Python3 uses native python UTF strings rather than QString. 
    262262            # This therefore appears to be the correct way to display this 
     
    264264            p.drawText(rect, Qt.AlignCenter, text) 
    265265        else: 
    266             p.drawText(rect, Qt.AlignCenter, QtCore.QString.fromUtf8(text)) 
     266            p.drawText(rect, Qt.AlignCenter, QString.fromUtf8(text)) 
    267267        if (self.inv_action!=None and self.inv_action.isChecked()): 
    268             if ffado_python3
     268            if ffado_python3 or ffado_pyqt_version == 5
    269269                # Refer to the comment about about Python UTF8 strings. 
    270270                p.drawText(rect, Qt.AlignLeft|Qt.AlignTop, " ϕ") 
    271271            else: 
    272                 p.drawText(rect, Qt.AlignLeft|Qt.AlignTop, QtCore.QString.fromUtf8(" ϕ")) 
     272                p.drawText(rect, Qt.AlignLeft|Qt.AlignTop, QString.fromUtf8(" ϕ")) 
    273273 
    274274    def internalValueChanged(self, value): 
     
    513513 
    514514    def updateValues(self, n): 
    515         nbitems = len(n)/
     515        nbitems = len(n) //
    516516        for i in range(nbitems): 
    517517            n_0 = n[3*i]     
     
    952952 
    953953    def updateValues(self, n): 
    954         nbitems = len(n)/
     954        nbitems = len(n) //
    955955        for j in range(nbitems): 
    956956            n_0 = n[3*j]     
     
    14071407        # Update value needed for "per Out" view 
    14081408        #log.debug("Update per Output( %s )" % str(n)) 
    1409         nbitems = len(n)/
     1409        nbitems = len(n) //
    14101410        if (self.rule == "Columns_are_inputs"): 
    14111411           n_t = n 
     
    14211421        # Update value needed for matrix view 
    14221422        #log.debug("Update Matrix( %s )" % str(n)) 
    1423         nbitems = len(n)/
     1423        nbitems = len(n) //
    14241424        if (((self.rule == "Columns_are_inputs") and not self.transpose) or ((self.rule != "Columns_are_inputs") and self.transpose)): 
    14251425            n_t = () 
     
    15131513                return False 
    15141514            n = int(readMixerString[idx+2]) 
    1515             if n > self.perOut.nbOut/2: 
     1515            if n > self.perOut.nbOut // 2: 
    15161516                log.debug("Incoherent number of stereo channels") 
    15171517                return False 
  • branches/2.4.x/libffado/support/tools/ffado-diag.1

    r2089 r2771  
    1 .TH FFADO-DIAG 1 27-Mar-2012 "ffado-diag" 
     1.TH FFADO\-DIAG 1 27\-Mar\-2012 "ffado\-diag" 
    22.SH NAME 
    3 ffado-diag \- print system diagnostic information related to FFADO. 
     3ffado\-diag \- print system diagnostic information related to FFADO. 
     4\" 
    45.SH SYNOPSIS 
    5 .BI "ffado-diag" 
    6 .sp 
     6.BR ffado\-diag [\| \-\-static \||\| \-V \||\| \-\-version \||\| \-\-usage \|] 
     7\" 
    78.SH DESCRIPTION 
    8 .B ffado-diag 
     9.B ffado\-diag 
    910prints out an extensive collection of diagnostic information about the 
    1011computer it is run on.  Information included is the FFADO version number, 
     
    1213interface card, interrupt usage, and so on.  This is useful for developers 
    1314to know when giving support via the FFADO mailing lists.  For anything other 
    14 than trivial issues, the output of  
    15 .B 
    16 ffado-diag 
     15than trivial issues, the output of 
     16.B ffado\-diag 
    1717will be one of the first things asked fro when debugging a problem. 
    18 .SH "OPTIONS" 
    19 .B 
    20 ffado-diag 
    21 does not presently have any command line options. 
     18\" 
     19.SH OPTIONS 
     20.BR \-V ", " \-\-version 
     21Display version information. 
     22.B \-\-usage 
     23Print a short usage message and exit. 
     24.B \-\-static 
     25Only display executable paths and libraries. 
  • branches/2.4.x/libffado/support/tools/ffado-diag.in

    r2698 r2771  
    1 #!/usr/bin/python 
    2 
    3  
    4 
    5 # Copyright (C) 2008 Pieter Palmers 
    6 #               2009-2010 Arnold Krille 
    7 
     1#!$PYTHON_INTERPRETER 
     2# Dollar variables are preprocessed by SConscript at build time. 
     3version_info = "FFADO diagnostic utility $VERSION$REVISIONSTRING" 
     4copyright_info = """ 
     5(C) 2008 Pieter Palmers 
     6    2009-2010 Arnold Krille 
     7    2018 Nicolas Boulenguez, Jonathan Woithe 
     8""" 
     9static_info = "$LIBDATADIR/static_info.txt" 
    810# This program is free software: you can redistribute it and/or modify 
    911# it under the terms of the GNU General Public License as published by 
    1012# the Free Software Foundation, version 3 of the License. 
    11 
     13 
    1214# This program is distributed in the hope that it will be useful, 
    1315# but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1416# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1517# GNU General Public License for more details. 
    16 
     18 
    1719# You should have received a copy of the GNU General Public License 
    1820# along with this program.  If not, see <http://www.gnu.org/licenses/>. 
    19 
    20  
    21 
     21 
    2222# Test for common FFADO problems 
    23 
    24  
     23 
     24import glob 
     25import os.path 
     26import re 
     27import subprocess 
    2528import sys 
    2629 
    27 # Add the path of the installed dependent files 
    28 sys.path.insert(0, "$PYTHONDIR" ) 
    29  
    30 from listirqinfo import IRQ,SoftIRQ,IRQInfo 
    31 from helpstrings import HelpStrings 
    32 from ffado_diag_helpers import * 
    33  
    34 ## message strings 
    35 FFADODIAG_VERSION = "$VERSION$REVISIONSTRING" 
    36  
    37 welcome_msg = """ 
    38  
    39 FFADO diagnostic utility """ + FFADODIAG_VERSION + """ 
    40 ============================ 
    41 (C) 2008 Pieter Palmers 
    42     2009-2010 Arnold Krille 
    43  
    44 """ 
    45  
    46 help_msg = """ 
    47 Usage: ffado-diag [verboselevel] 
    48  
    49   verboselevel : verbosity level. (optional) 
    50  
    51 """ 
    52  
    53 ## main program 
    54 if __name__== '__main__': 
    55  
    56     print welcome_msg 
    57  
    58     num_args = len(sys.argv) 
    59     if num_args not in [1,2]: 
    60         print help 
    61         sys.exit(0) 
    62  
    63     if num_args == 2: 
    64         loglevel = eval(sys.argv[1]) 
    65         if loglevel == 1: 
    66             logging.getLogger('diag').setLevel(logging.INFO) 
    67         elif loglevel == 2: 
    68             logging.getLogger('diag').setLevel(logging.DEBUG) 
    69  
    70     print "=== CHECK ===" 
    71     print " Base system..." 
    72      
    73     # check kernel 
    74     kernel_version = get_kernel_version() 
    75     print "  kernel version............ " + str(kernel_version) 
    76     kernel_is_preempt = get_kernel_preempt() 
    77     print "    Preempt (low latency)... " + str(kernel_is_preempt) 
    78     # Hint: The main parts of the rt patches are in mainline-kernels nowadays. Performance with stock kernels is sufficient... 
    79     kernel_is_rt_patched = get_kernel_rt_patched() 
    80     print "    RT patched.............. " + str(kernel_is_rt_patched) 
    81  
    82     # check modules 
    83     oldstack_present = check_1394oldstack_present() 
    84     oldstack_loaded = check_1394oldstack_loaded() 
    85     oldstack_active = check_1394oldstack_active() 
    86     oldstack_statically_linked = not check_1394oldstack_loaded() and check_1394oldstack_linked() 
    87     newstack_present = check_1394newstack_present() 
    88     newstack_loaded = check_1394newstack_loaded() 
    89     newstack_active = check_1394newstack_active() 
    90     newstack_statically_linked = not check_1394newstack_loaded() and check_1394newstack_linked() 
    91      
    92     print "  old 1394 stack present.... " + str(oldstack_present) 
    93     print "  old 1394 stack loaded..... " + str(oldstack_loaded) 
    94     print "  old 1394 stack active..... " + str(oldstack_active) 
    95     print "  new 1394 stack present.... " + str(newstack_present) 
    96     print "  new 1394 stack loaded..... " + str(newstack_loaded) 
    97     print "  new 1394 stack active..... " + str(newstack_active) 
    98      
    99     # check /dev/raw1394 node presence 
    100     devnode_present = check_1394oldstack_devnode_present() 
    101     print "  /dev/raw1394 node present. " + str(devnode_present) 
    102     if devnode_present: 
    103         # check /dev/raw1394 access permissions 
    104         devnode_permissions = check_1394oldstack_devnode_permissions() 
    105         print "  /dev/raw1394 permissions.. " + str(devnode_permissions) 
     30# Prefer reproducible output with few non-ASCII characters. 
     31os.environ ["LC_ALL"] = "C" 
     32 
     33# Consistent formatting. 
     34def show_pair (key, value): 
     35    # rstrip () for convenience, but do not assume that value is a string. 
     36    print ("{:25} {}".format (key, value).rstrip ()) 
     37def indent (lines): 
     38    print ("  {}".format (lines.rstrip ().replace ("\n", "\n  "))) 
     39 
     40# Convenient shortcuts. 
     41def stdout (*args): 
     42    return subprocess.check_output (args).decode ("utf8") 
     43 
     44def which (command): 
     45    popen = subprocess.Popen (("which", command), stdout=subprocess.PIPE, 
     46                              stderr=subprocess.PIPE) 
     47    stdout, stderr = popen.communicate () 
     48    if popen.returncode == 0: 
     49        return stdout.decode ("utf8").rstrip () 
     50    elif popen.returncode == 1: 
     51        return None 
    10652    else: 
    107         devnode_permissions = None 
    108  
    109     if newstack_active: 
    110         # check permissions 
    111         newstack_permissions = get_juju_permissions() 
    112         print "  /dev/fw* permissions:" 
    113         print newstack_permissions 
    114  
    115     print "  User IDs:" 
    116     print get_user_ids() 
    117  
    118  
    119     # check libraries 
    120     print " Prerequisites (dynamic at run-time)..." 
    121     print "   gcc ............... %s" % get_version_first_line('gcc --version') 
    122     print "   g++ ............... %s" % get_version_first_line('g++ --version') 
    123     print "   PyQt4 (by pyuic4) . %s" % get_version_first_line('pyuic4 --version') 
    124     print "   PyQt5 (by pyuic5) . %s" % get_version_first_line('pyuic5 --version') 
    125     print "   jackd ............. %s" % get_version_first_line('jackd --version') 
    126     print "     path ............ %s" % get_command_path('jackd') 
    127     print "     flags ........... %s" % get_package_flags("jack") 
    128     print "   libraw1394 ........ %s" % get_package_version("libraw1394") 
    129     print "     flags ........... %s" % get_package_flags("libraw1394") 
    130     print "   libavc1394 ........ %s" % get_package_version("libavc1394") 
    131     print "     flags ........... %s" % get_package_flags("libavc1394") 
    132     print "   libiec61883 ....... %s" % get_package_version("libiec61883") 
    133     print "     flags ........... %s" % get_package_flags("libiec61883") 
    134     print "   libxml++-2.6 ...... %s" % get_package_version("libxml++-2.6") 
    135     print "     flags ........... %s" % get_package_flags("libxml++-2.6") 
    136     print "   dbus-1 ............ %s" % get_package_version("dbus-1") 
    137     print "     flags ........... %s" % get_package_flags("dbus-1") 
    138     print " Prerequisites (static at compile-time)..." 
    139     f = open( "$PYTHONDIR/static_info.txt", "r" ) 
     53        print (stderr) 
     54        sys.exit (1) 
     55 
     56# Parse command line. 
     57usage = """Usage: ffado-diag [--static | -V | --version | --usage] 
     58  --static       Only display executable paths and libraries. 
     59  -V, --version  Display version information. 
     60  --usage        Print a short usage message and exit.""" 
     61if len (sys.argv) == 1: 
     62    static_option = False 
     63elif len (sys.argv) == 2: 
     64    if sys.argv [1] == "--static": 
     65        static_option = True 
     66    elif sys.argv [1] in ("-V", "--version"): 
     67        print (version_info) 
     68        sys.exit (0) 
     69    elif sys.argv [1] == "--usage": 
     70        print (usage) 
     71        sys.exit (0) 
     72    else: 
     73        print (usage) 
     74        sys.exit (1) 
     75else: 
     76    print (usage) 
     77    sys.exit (1) 
     78 
     79if not(static_option): 
     80    print (version_info) 
     81    print (copyright_info) 
     82 
     83for command in ("gcc", "g++", "pyuic4", "pyuic5"): 
     84    path = which (command) 
     85    show_pair (command, path) 
     86    if path: 
     87        version = stdout (path, "--version") 
     88        show_pair ('', version [:version.find ("\n")]) 
     89 
     90# jackd --version exits with a non-zero status (tested with jackd 1.9.10). 
     91path = which ("jackd") 
     92show_pair ("jackd", path) 
     93if path: 
     94    popen = subprocess.Popen ((path, "--version"), stdout=subprocess.PIPE) 
     95    version, _ = popen.communicate () 
     96    version = version.decode ("utf8") 
     97    show_pair ('', version [:version.find ("\n")]) 
     98 
     99pkg_config = which ("pkg-config") 
     100show_pair ("pkg-config", pkg_config) 
     101 
     102if pkg_config: 
     103    for lib in ("jack", "libraw1394", "libavc1394", "libiec61883", "libxml++-2.6", "dbus-1"): 
     104        if subprocess.call ((pkg_config, "--exists", lib)): 
     105            show_pair (lib, "not found") 
     106        else: 
     107            show_pair (lib, stdout (pkg_config, "--modversion", lib)) 
     108            show_pair ('',  stdout (pkg_config, "--cflags", "--libs", lib)) 
     109 
     110# If the "static" command line argument has been given, stop here. 
     111# Else, attempt to display static_info.txt and go on. 
     112if static_option: 
     113    sys.exit (0) 
     114 
     115print ('') 
     116show_pair ("Build time info", static_info) 
     117try: 
     118    with open (static_info, "r" ) as f: 
     119        for line in f: 
     120            indent (line) 
     121except: 
     122    indent ("Failed to read build time info.") 
     123 
     124print ('') 
     125kernel_version = stdout ("uname", "-r").rstrip () 
     126show_pair ("kernel version", kernel_version) 
     127 
     128uname_v = stdout ("uname", "-v") 
     129show_pair ("Preempt (low latency)", " PREEMPT " in uname_v and not " RT " in uname_v) 
     130show_pair ("RT patched", "PREEMPT RT" in uname_v) 
     131# Hint: 
     132# The main parts of the rt patches are in mainline-kernels nowadays. 
     133# Performance with stock kernels is sufficient... 
     134 
     135fw_devices = glob.glob ("/dev/fw*") 
     136show_pair ("/dev/fw*", fw_devices) 
     137if fw_devices: 
     138    indent (stdout (*(["ls", "-lh"] + fw_devices))) 
     139 
     140show_pair ("User IDs", stdout ("id")) 
     141 
     142show_pair ("uname -a", stdout ("uname", "-a")) 
     143 
     144lspci = which ("lspci") 
     145if not lspci and os.path.exists ("/sbin/lspci"): 
     146    lspci = "/sbin/lspci" 
     147show_pair ("lspci", lspci) 
     148if lspci: 
     149    for m in re.findall ("^([^ ]*).*1394.*", stdout (lspci), re.MULTILINE): 
     150        indent (stdout (lspci, "-vv", "-nn", "-s", m)) 
     151 
     152lscpu = which ("lscpu") 
     153show_pair ("lscpu", lscpu) 
     154if lscpu: 
     155    indent (stdout (lscpu)) 
     156else: 
     157    print ("/proc/cpuinfo") 
     158    with open ("/proc/cpuinfo") as f: 
     159        for l in f: 
     160            indent (l) 
     161 
     162###################################################################### 
     163class IRQ: 
     164    def __init__(self, number): 
     165        self.number              = number 
     166        self.pid                 = "" 
     167        self.scheduling_class    = "" 
     168        self.scheduling_priority = "" 
     169        self.drivers             = "" 
     170        self.cpu_counts          = "" 
     171    def description (self): 
     172        return "IRQ{:>4} PID{:>5} count{:>18} Sched{:>4} priority{:>4} drivers {}"\ 
     173            .format (self.number, self.pid, self.cpu_counts, self.scheduling_class, 
     174                     self.scheduling_priority, self.drivers) 
     175 
     176class SoftIRQ: 
     177    def __init__(self, pid, scheduling_class, scheduling_priority, fullname): 
     178        self.pid                 = pid 
     179        self.fullname            = fullname 
     180        self.scheduling_class    = scheduling_class 
     181        self.scheduling_priority = scheduling_priority 
     182    def name (self): 
     183        return "{}-{}".format (self.fullname, self.pid) 
     184    def description (self): 
     185        return "SoftIRQ{:>12} PID{:>6} Sched{:>4} priority{:>4}) name softirq-{}"\ 
     186            .format (self.name (), self.pid, self.scheduling_class, 
     187                     self.scheduling_priority, self.fullname) 
     188 
     189# get PID info 
     190outtext = stdout ("ps", "-eLo", "pid,cmd,class,rtprio") 
     191 
     192softIRQs = {} 
     193for m in re.findall (r"^([0-9]+) +\[softirq-(.*)\] +([A-Z]+) +([-0-9]+)", outtext, re.MULTILINE): 
     194    irq = SoftIRQ (pid                 = m.group (1), 
     195                   fullname            = m.group (2), 
     196                   scheduling_class    = m.group (3), 
     197                   scheduling_priority = m.group (4)) 
     198    softIRQs [irq.name ()] = irq 
     199 
     200IRQs = {} 
     201for m in re.findall (r"^([0-9]+) +\[IRQ-([0-9]+)\] +([A-Z]{2}) +([-0-9]+)", outtext, re.MULTILINE): 
     202    irq = IRQ (number = int (m.group (2))) 
     203    IRQs [irq.number] = irq 
     204    irq.pid = m.group (1) 
     205    irq.scheduling_class    = m.group (3) 
     206    irq.scheduling_priority = m.group (4) 
     207 
     208# get irq info 
     209regex_irq = re.compile (r"^ *([0-9]+): *((?:[0-9]+ +)+)(.*)$") 
     210with open ("/proc/interrupts") as f: 
    140211    for line in f: 
    141         line = line[:-1] 
    142         if line is not "\n" and line.startswith("  "): 
    143             print line 
    144     f.close() 
    145  
    146     # libraw 
    147  
    148     print " uname -a..."  
    149     print "   " + run_command("uname -a") 
    150      
    151     print " Hardware..." 
    152     # check host controller 
    153     print "   Host controllers:" 
    154     list_host_controllers() 
    155     print "   CPU info:" 
    156     if len(run_command("which lscpu")) > 0: 
    157         print run_command("lscpu") 
    158     else: 
    159         print run_command("cat /proc/cpuinfo") 
    160  
    161     print " Configuration..." 
    162     # check RT settings 
    163      
    164     # check IRQ settings  
    165     print "  IRQ information" 
    166     info = IRQInfo() 
    167  
    168     info.load() 
    169     print str(info) 
    170  
    171     print "" 
    172     print "=== REPORT ===" 
    173      
    174     help = HelpStrings() 
    175      
    176     # do the interpretation of the tests 
    177     print "FireWire kernel drivers:" 
    178     if (oldstack_loaded or oldstack_statically_linked) and \ 
    179        (newstack_loaded or newstack_statically_linked): 
    180         help.show('MODULES_BOTH_STACKS_LOADED') 
    181         sys.exit(-1) 
    182     elif newstack_loaded or newstack_statically_linked: 
    183         help.show('MODULES_NEW_STACK_LOADED') 
    184         sys.exit(-1) 
    185     elif oldstack_statically_linked: 
    186         print "[PASS] Kernel drivers statically linked into the kernel." 
    187     elif not oldstack_present: 
    188         help.show('MODULES_OLD_STACK_NOT_INSTALLED') 
    189         sys.exit(-1) 
    190     elif not oldstack_loaded: 
    191         help.show('MODULES_OLD_STACK_NOT_LOADED') 
    192         sys.exit(-1) 
    193     else: 
    194         print "[PASS] Kernel modules present and correctly loaded." 
    195  
    196     if not devnode_present: 
    197         help.show('DEVNODE_OLD_STACK_NOT_PRESENT') 
    198         sys.exit(-1) 
    199     else: 
    200         if not devnode_permissions: 
    201             help.show('DEVNODE_OLD_STACK_NO_PERMISSION') 
    202             sys.exit(-1) 
    203         else: 
    204             print "[PASS] /dev/raw1394 node present and accessible." 
    205      
    206      
    207      
     212        m = regex_irq.search (line) 
     213        if m: 
     214            irq_number = int (m.group(1)) 
     215            if irq_number in IRQs: 
     216                irq = IRQs [irq_number] 
     217            else: 
     218                irq = IRQ (number = irq_number) 
     219                IRQs [irq_number] = irq 
     220            irq.cpu_counts = ",".join (m.group (2).split ()) 
     221            irq.drivers    = ",".join (m.group (3).split ()) 
     222 
     223print ("\nHardware interrupts") 
     224for _, irq in sorted (IRQs.items ()): 
     225    indent (irq.description ()) 
     226print ("\nSoftware interrupts") 
     227for _, irq in sorted (softIRQs.items ()): 
     228    indent (irq.description ()) 
     229print ('') 
     230 
     231###################################################################### 
     232 
     233def module_loaded (module_name, procfile): 
     234    with open (procfile) as f: 
     235        for l in f: 
     236            if module_name in l or module_name.replace ("-", "_") in l: 
     237                return True 
     238    return False 
     239 
     240module_dir = "/lib/modules/" + kernel_version 
     241show_pair ("module directory", module_dir) 
     242 
     243class Stack: 
     244    def __init__ (self, modules, main_module): 
     245        self.present = True 
     246        self.loaded  = True 
     247        for module_name in modules: 
     248            if module_name in stdout ("find", module_dir, "-name", module_name + ".ko"): 
     249                indent (module_name + " present") 
     250            else: 
     251                indent (module_name + " not present") 
     252                self.present = False 
     253 
     254            if module_loaded (module_name, "/proc/modules"): 
     255                indent (module_name + " loaded") 
     256            else: 
     257                indent (module_name + " not loaded") 
     258                self.loaded  = False 
     259 
     260        self.active = self.loaded and module_loaded (main_module, "/proc/interrupts") 
     261        show_pair ("stack active", self.active) 
     262 
     263        self.statically_linked = not self.loaded and os.access ("/sys/module/" + main_module, os.F_OK) 
     264        show_pair ("statically linked", self.statically_linked) 
     265 
     266print ("Old 1394 stack") 
     267oldstack = Stack (("ieee1394", "ohci1394", "raw1394"), "ohci1394") 
     268 
     269print ("New 1394 stack") 
     270newstack = Stack (("firewire-core", "firewire-ohci"), "firewire-ohci") 
     271 
     272print ("Kernel support:") 
     273if (oldstack.loaded or oldstack.statically_linked) and \ 
     274   (newstack.loaded or newstack.statically_linked): 
     275    indent ("""Both old and new FireWire kernel modules are loaded, your system 
     276configuration is bogus.""") 
     277    sys.exit (1) 
     278elif newstack.loaded or newstack.statically_linked: 
     279    indent ("""The new FireWire kernel stack is loaded. 
     280If running a kernel earlier than 2.6.37 and problems are experienced, either 
     281try with the old Firewire kernel stack or upgrade to a newer kernel 
     282(preferrably 2.6.37 or later).""") 
     283    sys.exit (1) 
     284elif oldstack.statically_linked: 
     285    indent ("[PASS] Kernel drivers statically linked into the kernel.") 
     286elif not oldstack.present: 
     287    indent ("""FireWire kernel module(s) not found. 
     288Please ensure that the raw1394 module is loaded.""") 
     289    sys.exit (1) 
     290elif not oldstack.loaded: 
     291    indent ("""FireWire kernel stack not present. 
     292 Please compile the kernel with FireWire support.""") 
     293    sys.exit (1) 
     294else: 
     295    indent ("[PASS] Kernel modules present and correctly loaded.") 
     296 
     297###################################################################### 
     298print ("/dev/raw1394 devices:") 
     299 
     300if not os.path.exists ("/dev/raw1394"): 
     301    indent ("""/dev/raw1394 device node not present. 
     302Please fix your udev configuration or add it as a static node.""") 
     303    sys.exit (1) 
     304 
     305try: 
     306    with open ("/dev/raw1394", "w"): 
     307        pass 
     308except: 
     309    indent ("""Not enough permissions to access /dev/raw1394 device. 
     310Please fix your udev configuration, the node permissions or 
     311the user/group permissions.""") 
     312    sys.exit (1) 
     313 
     314indent ("[PASS] /dev/raw1394 node present and accessible.") 
  • branches/2.4.x/libffado/support/tools/ffado-sandbox-install.py

    r2680 r2771  
    1919 
    2020# 
    21 # A script to install FFADO in a 'sandbox', i.e. without changing the  
     21# A script to install FFADO in a 'sandbox', i.e. without changing the 
    2222# system installation. 
    2323# 
    24 import os 
     24 
     25import os.path 
     26import shutil 
     27import subprocess 
     28 
     29try: 
     30    raw_input                   # Error in python3. 
     31except: 
     32    raw_input = input 
    2533 
    2634FFADOSBI_VERSION = '0.1' 
     
    6472                        continue 
    6573                else: 
    66                     os.system('rm -Rf "%s"' % ret_dir) 
     74                    shutil.rmtree (ret_dir) 
    6775                    os.makedirs(ret_dir) 
    6876                    break 
     
    7078 
    7179def fetch_source(build_dir, source_descriptor, target): 
    72     logfile = "%s/%s.log" % (build_dir, target) 
    73     os.system('echo "" > %s' % logfile) 
     80  logfile = "%s/%s.log" % (build_dir, target) 
     81  with open (logfile, 'w') as log: 
    7482 
    7583    if source_descriptor[1] == 'svn': 
     
    7785        cwd = os.getcwd() 
    7886        os.chdir(build_dir) 
    79         retval = os.system('svn co "%s" "%s" >> %s' % (source_descriptor[2], target, logfile)) 
     87        retval = subprocess.call (('svn', 'co', source_descriptor[2], target), 
     88                                  stdout=log) 
    8089        os.chdir(cwd) 
    8190        if retval: 
     
    95104        os.chdir(build_dir) 
    96105        print( " extracting tarball..." ) 
    97         retval = os.system('tar -zxf "%s" > %s' % (tmp_file, logfile)
     106        retval = subprocess.call (('tar', '-zxf', tmp_file), stdout=log
    98107        if retval: 
    99108            print( "  Failed to extract the source tarball. Inspect %s for details." % logfile ) 
     
    101110            return False 
    102111        if source_descriptor[3]: 
    103             retval = os.system('mv "%s" "%s"' % (source_descriptor[3], target)) 
    104             if retval: 
     112            try: 
     113                os.rename (source_descriptor[3], target) 
     114            except: 
    105115                print( "  Failed to move the extracted tarball" ) 
    106116                os.chdir(cwd) 
     
    146156================= 
    147157 
    148 The sandbox directory is the directory where all built files are  
     158The sandbox directory is the directory where all built files are 
    149159installed into. It should be writable by your user, and will 
    150160contain the evaluation binaries if this tool is successful. If 
     
    214224    ffado_version = raw_input("Please select a FFADO version: ") 
    215225    try: 
    216         ffado_version_int = eval(ffado_version) 
     226        ffado_version_int = int (ffado_version) 
    217227        if ffado_version_int not in [0, 1, 2]: 
    218228            raise 
     
    244254    jack_version = raw_input("Please select a jack version: ") 
    245255    try: 
    246         jack_version_int = eval(jack_version) 
     256        jack_version_int = int (jack_version) 
    247257        if jack_version_int not in [0, 1, 2]: 
    248258            raise 
     
    287297 
    288298ffado_log = "%s/ffadobuild.log" % build_dir 
    289 ffado_scons_options = "-j2" # TODO: interactive config of the build 
    290 os.system('echo "" > %s' % ffado_log)  
    291  
    292 # configure FFADO 
    293 os.chdir("%s/libffado/" % build_dir) 
    294 print( "Building FFADO..." ) 
    295 print( " Compiling..." ) 
    296 retval = os.system('scons PREFIX="%s" %s >> %s' % (sandbox_dir, ffado_scons_options, ffado_log)) 
    297 if retval
    298     print( """ ) 
     299ffado_scons_options = ("-j2",) # TODO: interactive config of the build 
     300with open (ffado_log, 'w') as log: 
     301 
     302    # configure FFADO 
     303    os.chdir("%s/libffado/" % build_dir) 
     304    print( "Building FFADO..." ) 
     305    print( " Compiling..." ) 
     306    if subprocess.call (('scons', 'PREFIX="' + sandbox_dir + '"') + ffado_scons_options, 
     307                        stdout=log)
     308       print( """ ) 
    299309Failed to configure/build FFADO. Most likely this is due to uninstalled dependencies. 
    300310Check %s for details. 
    301311""" % ffado_log 
    302     exit(-1) 
    303  
    304 # install FFADO 
    305 print( " Installing into %s..." % sandbox_dir ) 
    306 retval = os.system('scons install >> %s' % (ffado_log)) 
    307 if retval: 
    308     print( "Failed to install FFADO. Check %s for details." % ffado_log ) 
    309     exit(-1) 
     312        exit(-1) 
     313 
     314    # install FFADO 
     315    print( " Installing into %s..." % sandbox_dir ) 
     316    if subprocess.check_output (('scons', 'install'), stdout=log): 
     317        print( "Failed to install FFADO. Check %s for details." % ffado_log ) 
     318        exit(-1) 
    310319 
    311320# configure JACK 
    312321os.chdir("%s/jack/" % build_dir) 
    313322jack_log = "%s/jackbuild.log" % build_dir 
    314 os.system('echo "" > %s' % jack_log)  
    315  
    316 print( "Building Jack..." ) 
    317 if use_jack_version[1] == 'svn': 
    318     print( " Initializing build system..." ) 
    319     retval = os.system('./autogen.sh >> %s' % jack_log
    320     if retval
    321         print( """ ) 
     323with open (jack_log, 'w') as log: 
     324    log.write ('\n') 
     325 
     326    print( "Building Jack..." ) 
     327    if use_jack_version[1] == 'svn': 
     328        print( " Initializing build system..."
     329        if subprocess.check_output (('./autogen.sh',), stdout=log)
     330            print( """ ) 
    322331Failed to initialize the jack build system. Most likely this is due to uninstalled dependencies. 
    323332Check %s for details. 
    324333""" % jack_log 
    325         exit(-1) 
    326  
    327 print( " Configuring build..." ) 
    328 retval = os.system('./configure --prefix="%s" >> %s' % (sandbox_dir, jack_log)) 
    329 if retval
    330     print( """ ) 
     334            exit(-1) 
     335 
     336        print( " Configuring build..." ) 
     337        if subprocess.check_output (('./configure', '--prefix="' + sandbox_dir + '"'), 
     338                                    stdout=log)
     339            print( """ ) 
    331340Failed to configure the jack build. Most likely this is due to uninstalled dependencies. 
    332341Check %s for details. 
    333342""" % jack_log 
    334     exit(-1) 
    335  
    336 # build and install jack 
    337 print( " Compiling..." ) 
    338 retval = os.system('make >> %s' % (jack_log)) 
    339 if retval: 
    340     print( "Failed to build jack. Check %s for details." % jack_log ) 
    341     exit(-1) 
    342  
    343 print( " Installing into %s..." % sandbox_dir ) 
    344 retval = os.system('make install >> %s' % (jack_log)) 
    345 if retval: 
    346     print( "Failed to install jack. Check %s for details." % jack_log ) 
    347     exit(-1) 
     343            exit(-1) 
     344 
     345        # build and install jack 
     346        print( " Compiling..." ) 
     347        if subprocess.check_output (('make',), stdout=log): 
     348            print( "Failed to build jack. Check %s for details." % jack_log ) 
     349            exit(-1) 
     350 
     351        print( " Installing into %s..." % sandbox_dir ) 
     352        if subprocess.check_output (('make', 'install'), stdout=log): 
     353            print( "Failed to install jack. Check %s for details." % jack_log ) 
     354            exit(-1) 
    348355 
    349356# write the bashrc file 
     
    364371sandbox_rc_file = "%s/ffado.rc" % sandbox_dir 
    365372try: 
    366     fid = open(sandbox_rc_file, "w") 
    367     fid.write(sandbox_bashrc) 
    368     fid.close() 
     373    with open (sandbox_rc_file, "w") as fid: 
     374        fid.write(sandbox_bashrc) 
    369375except: 
    370376    print( "Could not write the sandbox rc file." ) 
  • branches/2.4.x/libffado/support/tools/SConscript

    r2718 r2771  
    3333e.MergeFlags( "-I#/ -I#/src -L%ssrc -lffado" % env['build_base'] ) 
    3434if not e.GetOption( "clean" ): 
    35         if not env['SERIALIZE_USE_EXPAT']: 
    36             if 'LIBXML30_FLAGS' in env : 
    37                e.MergeFlags( env['LIBXML30_FLAGS'].decode() ) 
    38             if not('LIBXML30_FLAGS' in env) : 
    39                 e.MergeFlags( env['LIBXML26_FLAGS'].decode() ) 
    40         else: 
    41                 e.PrependUnique( LIBS=["expat"] ) 
     35    if not env['SERIALIZE_USE_EXPAT']: 
     36        if 'LIBXML30_FLAGS' in env : 
     37            e.MergeFlags( env['LIBXML30_FLAGS'].decode() ) 
     38        if not('LIBXML30_FLAGS' in env) : 
     39            e.MergeFlags( env['LIBXML26_FLAGS'].decode() ) 
     40    else: 
     41        e.PrependUnique( LIBS=["expat"] ) 
    4242 
    43 
    44 # For the the ffado-diag tools 
    45 e['PYTHONDIR'] = Template( os.path.join( e['SHAREDIR'], 'python' ) ).safe_substitute( e ) 
    46 # For the installation of the stuff 
    47 e['pythondir'] = Template( os.path.join( e['sharedir'], 'python' ) ).safe_substitute( e ) 
    48  
    49 e.Command( "static_info.txt", "#/SConstruct", "python support/tools/ffado-diag-static > $TARGET" ) 
     43e.Command( "static_info.txt", "ffado-diag", "support/tools/ffado-diag --static > $TARGET" ) 
    5044 
    5145e.ScanReplace( "ffado-diag.in" ) 
    5246 
    5347e.Install( "$bindir", "ffado-diag" ) 
    54 e.Install( "$pythondir", "helpstrings.py" ) 
    55 e.Install( "$pythondir", "listirqinfo.py" ) 
    56 e.Install( "$pythondir", "static_info.txt" ) 
    57 e.Install( "$pythondir", "ffado_diag_helpers.py" ) 
     48e.Install( "$libdatadir", "static_info.txt" ) 
    5849 
    5950if env['ENABLE_DICE']: 
    60         e.Program( target = "ffado-set-nickname", source = "ffado-set-nickname.cpp" ) 
    61         e.Install( "$bindir", "ffado-set-nickname" ) 
     51    e.Program( target = "ffado-set-nickname", source = "ffado-set-nickname.cpp" ) 
     52    e.Install( "$bindir", "ffado-set-nickname" ) 
    6253 
    6354# Install manpages in section 1 
  • branches/2.4.x/libffado/support/xdg/ffado.org-ffadomixer.desktop

    r2627 r2771  
    1313Type=Application 
    1414Categories=Mixer;Audio;AudioVideo;HardwareSettings;Qt; 
     15Keywords=Firewire;Sound Interface; 
  • branches/2.4.x/libffado/tests/SConscript

    r2718 r2771  
    2929 
    3030if not env.GetOption( "clean" ): 
    31        env.MergeFlags( "-lpthread" ) 
    32        env.MergeFlags( env['LIBIEC61883_FLAGS'].decode() ) 
    33        env.MergeFlags( env['LIBRAW1394_FLAGS'].decode() ) 
    34        if not env['SERIALIZE_USE_EXPAT']: 
    35             if 'LIBXML30_FLAGS' in env : 
    36                env.MergeFlags( env['LIBXML30_FLAGS'].decode() ) 
    37             if not('LIBXML30_FLAGS' in env) : 
    38                env.MergeFlags( env['LIBXML26_FLAGS'].decode() ) 
    39        else: 
    40                env.PrependUnique( LIBS=["expat"] ) 
     31    env.MergeFlags( "-lpthread" ) 
     32    env.MergeFlags( env['LIBIEC61883_FLAGS'].decode() ) 
     33    env.MergeFlags( env['LIBRAW1394_FLAGS'].decode() ) 
     34    if not env['SERIALIZE_USE_EXPAT']: 
     35        if 'LIBXML30_FLAGS' in env : 
     36             env.MergeFlags( env['LIBXML30_FLAGS'].decode() ) 
     37        if not('LIBXML30_FLAGS' in env) : 
     38             env.MergeFlags( env['LIBXML26_FLAGS'].decode() ) 
     39    else: 
     40        env.PrependUnique( LIBS=["expat"] ) 
    4141 
    4242static_env = env.Clone() 
     
    4747# 
    4848apps = { 
    49        "ffado-test" : "test-ffado.cpp", 
    50        "test-fw410" : "test-fw410.cpp", 
    51        #"test-extplugcmd" : "test-extplugcmd.cpp", 
    52        #"test-mixer" : "test-mixer.cpp", 
    53        "test-timestampedbuffer" : "test-timestampedbuffer.cpp", 
    54        "test-ieee1394service" : "test-ieee1394service.cpp", 
    55        "test-streamdump" : "test-streamdump.cpp", 
    56        "test-bufferops" : "test-bufferops.cpp", 
    57        "test-watchdog" : "test-watchdog.cpp", 
    58        "test-messagequeue" : "test-messagequeue.cpp", 
    59        "test-shm" : "test-shm.cpp", 
    60        "test-ipcringbuffer" : "test-ipcringbuffer.cpp", 
    61        "test-devicestringparser" : "test-devicestringparser.cpp", 
    62        "dumpiso_mod" : "dumpiso_mod.cpp", 
    63        "scan-devreg" : "scan-devreg.cpp", 
    64        "test-cycle-time" : "test-cycle-time.c" 
     49        "ffado-test" : "test-ffado.cpp", 
     50        "test-fw410" : "test-fw410.cpp", 
     51        #"test-extplugcmd" : "test-extplugcmd.cpp", 
     52        #"test-mixer" : "test-mixer.cpp", 
     53        "test-timestampedbuffer" : "test-timestampedbuffer.cpp", 
     54        "test-ieee1394service" : "test-ieee1394service.cpp", 
     55        "test-streamdump" : "test-streamdump.cpp", 
     56        "test-bufferops" : "test-bufferops.cpp", 
     57        "test-watchdog" : "test-watchdog.cpp", 
     58        "test-messagequeue" : "test-messagequeue.cpp", 
     59        "test-shm" : "test-shm.cpp", 
     60        "test-ipcringbuffer" : "test-ipcringbuffer.cpp", 
     61        "test-devicestringparser" : "test-devicestringparser.cpp", 
     62        "dumpiso_mod" : "dumpiso_mod.cpp", 
     63        "scan-devreg" : "scan-devreg.cpp", 
     64        "test-cycle-time" : "test-cycle-time.c" 
    6565} 
    6666 
    6767if env['ENABLE_BEBOB']: 
    68        apps.update( { "test-focusrite" : "test-focusrite.cpp" } ) 
     68    apps.update( { "test-focusrite" : "test-focusrite.cpp" } ) 
    6969if env['ENABLE_GENERICAVC']: 
    70        if 'ALSA_FLAGS' in env and env["ALSA_FLAGS"]: 
    71                env.MergeFlags( env["ALSA_FLAGS"].decode() ) 
    72                apps.update( { "test-scs" : "test-scs.cpp" } ) 
    73        apps.update( { "test-volume" : "test-volume.cpp" } ) 
    74        apps.update( { "test-enhanced-mixer" : "test-enhanced-mixer.cpp" } ) 
    75        # MB: utility to unmute M-Audio Ozonic 
    76        apps.update( { "unmute-ozonic" : "unmute-ozonic.cpp" } ) 
    77        apps.update( { "test-avccmd" : "test-avccmd.cpp" } ) 
     70    if 'ALSA_FLAGS' in env and env["ALSA_FLAGS"]: 
     71        env.MergeFlags( env["ALSA_FLAGS"].decode() ) 
     72        apps.update( { "test-scs" : "test-scs.cpp" } ) 
     73    apps.update( { "test-volume" : "test-volume.cpp" } ) 
     74    apps.update( { "test-enhanced-mixer" : "test-enhanced-mixer.cpp" } ) 
     75    # MB: utility to unmute M-Audio Ozonic 
     76    apps.update( { "unmute-ozonic" : "unmute-ozonic.cpp" } ) 
     77    apps.update( { "test-avccmd" : "test-avccmd.cpp" } ) 
    7878if env['ENABLE_FIREWORKS']: 
    79        apps.update( { "test-echomixer" : "test-echomixer.cpp" } ) 
     79    apps.update( { "test-echomixer" : "test-echomixer.cpp" } ) 
    8080if env['ENABLE_DICE']: 
    81        apps.update( { "test-dice-eap" : "test-dice-eap.cpp" } ) 
    82        apps.update( { "set-default-router-config-dice-eap" : "set-default-router-config-dice-eap.cpp" } ) 
     81    apps.update( { "test-dice-eap" : "test-dice-eap.cpp" } ) 
     82    apps.update( { "set-default-router-config-dice-eap" : "set-default-router-config-dice-eap.cpp" } ) 
    8383 
    8484for app in apps.keys(): 
    85        env.Program( target=app, source = env.Split( apps[app] ) ) 
    86        env.Install( "$bindir", app ) 
     85    env.Program( target=app, source = env.Split( apps[app] ) ) 
     86    env.Install( "$bindir", app ) 
    8787 
    8888env.SConscript( dirs=["streaming", "systemtests"], exports="env" ) 
  • branches/2.4.x/libffado/tests/streaming/SConscript

    r1498 r2771  
    3232 
    3333apps = { 
    34        "ffado-test-streaming" : "teststreaming3.cpp", 
    35        "ffado-test-streaming-ipc" : "teststreaming-ipc.cpp", 
    36        "ffado-test-streaming-ipcclient" : "test-ipcclient.cpp", 
     34        "ffado-test-streaming" : "teststreaming3.cpp", 
     35        "ffado-test-streaming-ipc" : "teststreaming-ipc.cpp", 
     36        "ffado-test-streaming-ipcclient" : "test-ipcclient.cpp", 
    3737} 
    3838 
    3939for app in apps.keys(): 
    40         env.Program( target=app, source = env.Split( apps[app] ) ) 
    41         env.Install( "$bindir", app ) 
    42  
     40    env.Program( target=app, source = env.Split( apps[app] ) ) 
     41    env.Install( "$bindir", app ) 
  • branches/2.4.x/libffado/tests/systemtests/SConscript

    r2718 r2771  
    3131 
    3232if not env.GetOption( "clean" ): 
    33        env.MergeFlags( env['LIBRAW1394_FLAGS'].decode() ) 
    34        env.MergeFlags( "-lrt -lpthread" ) 
     33    env.MergeFlags( env['LIBRAW1394_FLAGS'].decode() ) 
     34    env.MergeFlags( "-lrt -lpthread" ) 
    3535 
    3636static_env = env.Clone() 
     
    4141# 
    4242apps = { 
    43        "ffado-test-isorecv" : ["test-isorecv-1.cpp", "realtimetools.cpp"], 
    44        "ffado-test-isoxmit" : ["test-isoxmit-1.cpp", "realtimetools.cpp"], 
    45        "test-sysload" : ["test-sysload.cpp", "realtimetools.cpp"], 
    46        "gen-loadpulses" : ["gen-loadpulses.cpp", "realtimetools.cpp"], 
    47        "test-clock_nanosleep" : ["test-clock_nanosleep.cpp", "realtimetools.cpp"], 
     43        "ffado-test-isorecv" : ["test-isorecv-1.cpp", "realtimetools.cpp"], 
     44        "ffado-test-isoxmit" : ["test-isoxmit-1.cpp", "realtimetools.cpp"], 
     45        "test-sysload" : ["test-sysload.cpp", "realtimetools.cpp"], 
     46        "gen-loadpulses" : ["gen-loadpulses.cpp", "realtimetools.cpp"], 
     47        "test-clock_nanosleep" : ["test-clock_nanosleep.cpp", "realtimetools.cpp"], 
    4848} 
    4949 
    5050for app in apps.keys(): 
    51         env.Program( target=app, source = env.Split( apps[app] ) ) 
    52         env.Install( "$bindir", app ) 
    53  
     51    env.Program( target=app, source = env.Split( apps[app] ) ) 
     52    env.Install( "$bindir", app ) 
  • branches/2.4.x/libffado/tests/test-mixer.cpp

    r969 r2771  
    2929#include "libieee1394/ieee1394service.h" 
    3030#include <string.h> 
     31#include <cerrno.h> 
    3132 
    3233DECLARE_GLOBAL_DEBUG_MODULE; 
     
    228229    } 
    229230 
    230     int errno = 0; 
     231    errno = 0; 
    231232    char* tail; 
    232233    int port = strtol( argv[1], &tail, 0 ); 
  • branches/2.4.x/libffado/tests/test-pan.cpp

    r1340 r2771  
    2727 
    2828#include "libieee1394/ieee1394service.h" 
     29#include <cerrno> 
    2930 
    3031const bool bVerbose = false; 
     
    132133    } 
    133134 
    134     int errno = 0; 
     135    errno = 0; 
    135136    char* tail; 
    136137    int node_id = strtol( argv[1], &tail, 0 ); 
  • branches/2.4.x/libffado/version.h.in

    r1254 r2771  
    1313 
    1414/* Define to the full name and version of this package. */ 
    15 #define PACKAGE_STRING "$PACKAGE $VERSION-$REVISION
     15#define PACKAGE_STRING "$PACKAGE $VERSION$REVISIONSTRING
    1616 
    1717/* Define to the one symbol short name of this package. */ 
     
    1919 
    2020/* Define to the version of this package. */ 
    21 #define PACKAGE_VERSION "$VERSION-$REVISION
     21#define PACKAGE_VERSION "$VERSION$REVISIONSTRING
    2222 
    2323/* Define to the version of the cace. */ 
    24 #define CACHE_VERSION "$VERSION-$REVISION
     24#define CACHE_VERSION "$VERSION$REVISIONSTRING
    2525 
    2626/* Define to the api version */