Changeset 2104 for trunk/libffado

Show
Ignore:
Timestamp:
03/31/12 04:35:39 (12 years ago)
Author:
jwoithe
Message:

Allow the FFADO API reported at runtime to be downgraded to the pre-setbuffersize version (8). This will permit newer FFADO snapshots to be run on a system with a jack which predates the setbuffersize API version (9). The resulting FFADO will continue to work if jack is subsequently upgraded, but dynamic setbuffersize support will require FFADO be recompiled.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/SConstruct

    r2089 r2104  
    7878    BoolVariable( "PEDANTIC", "Enable -Werror and more pedantic options during compile.", False ), 
    7979    ( "COMPILE_FLAGS", "Add additional flags to the environment.\nOnly meant for distributors and gentoo-users who want to over-optimize their built.\n Using this is not supported by the ffado-devs!" ), 
     80    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'), ignorecase=2), 
    8081 
    8182    ) 
     
    159160    return ret 
    160161 
     162def CheckPKG(context, name): 
     163    context.Message( 'Checking for %s... ' % name ) 
     164    ret = context.TryAction('pkg-config --exists \'%s\'' % name)[0] 
     165    context.Result( ret ) 
     166    return ret 
     167 
    161168tests = { 
    162169    "ConfigGuess" : ConfigGuess, 
     
    164171    "CheckForPyModule": CheckForPyModule, 
    165172    "CompilerCheck" : CompilerCheck, 
     173    "CheckPKG" : CheckPKG, 
    166174} 
    167175tests.update( env['PKGCONFIG_TESTS'] ) 
     
    217225    if not env['SERIALIZE_USE_EXPAT']: 
    218226        pkgs['libxml++-2.6'] = '2.13.0' 
     227 
     228    # Provide a way for users to compile newer libffado which will work  
     229    # against older jack installations which will not accept the new API 
     230    # version reported at runtime. 
     231    good_jack1 = conf.CheckPKG('jack < 1.9.0') and conf.CheckPKG('jack >= 0.122.0') 
     232    good_jack2 = conf.CheckPKG('jack >= 1.9.9') 
     233    if env['ENABLE_SETBUFFERSIZE_API_VER'] == 'auto': 
     234        if not(good_jack1 or good_jack2): 
     235            FFADO_API_VERSION="8" 
     236            print """ 
     237Installed jack does not support FFADO setbuffersize API: will report earlier 
     238API version at runtime 
     239""" 
     240        else: 
     241            print "Installed jack supports FFADO setbuffersize API" 
     242    elif env['ENABLE_SETBUFFERSIZE_API_VER'] == 'true': 
     243        if (not(good_jack1) and not(good_jack2)): 
     244            print """ 
     245SetBufferSize API version is enabled but no suitable version of jack has been 
     246found.  The resulting FFADO would cause your jackd to abort with "incompatible 
     247FFADO version".  Please upgrade to jack1 >=0.122.0 or jack2 >=1.9.9, or set 
     248ENABLE_SETBUFFERSIZE_API_VER to "auto" or "false". 
     249""" 
     250            # Although it's not strictly an error, in almost every case that  
     251            # this occurs the user will want to know about it and fix the 
     252            # problem, so we exit so they're guaranteed of seeing the above 
     253            # message. 
     254            Exit( 1 ) 
     255        else: 
     256            print "Will reporting SetBufferSize API at runtime" 
     257    else: 
     258        FFADO_API_VERSION="8" 
     259        print "Will not report SetBufferSize API at runtime" 
    219260 
    220261    for pkg in pkgs: