Changeset 529

Show
Ignore:
Timestamp:
08/20/07 13:27:46 (16 years ago)
Author:
wagi
Message:

- saveCache and loadFromCache interface added to IAvDevice
- current implenetation of saveCache and loadFromCache moved to bebob
- config parser added for loading vendor and model ids from a file instead hardcoded (not finished yet)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/bebob/bebob_avdevice.cpp

    r516 r529  
    4040#include <iostream> 
    4141#include <sstream> 
     42#include <unistd.h> 
     43#include <sys/stat.h> 
    4244 
    4345namespace BeBoB { 
     
    133135    unsigned int vendorId = configRom.getNodeVendorId(); 
    134136    unsigned int modelId = configRom.getModelId(); 
     137 
     138    ConfigParser configParser( "/home/wagi/src/libffado/src/bebob/ffado_driver_bebob.txt" ); 
    135139 
    136140    for ( unsigned int i = 0; 
     
    815819 
    816820int 
    817 AvDevice::getConfigurationIdSampleRate( Ieee1394Service& ieee1394Service, int nodeId
    818 { 
    819     ExtendedStreamFormatCmd extStreamFormatCmd( ieee1394Service ); 
     821AvDevice::getConfigurationIdSampleRate(
     822{ 
     823    ExtendedStreamFormatCmd extStreamFormatCmd( *m_p1394Service ); 
    820824    UnitPlugAddress unitPlugAddress( UnitPlugAddress::ePT_PCR, 
    821                                      nodeId ); 
     825                                     m_nodeId ); 
    822826    extStreamFormatCmd.setPlugAddress( PlugAddress( PlugAddress::ePD_Input, 
    823827                                                    PlugAddress::ePAM_Unit, 
    824828                                                    unitPlugAddress ) ); 
    825829 
    826     extStreamFormatCmd.setNodeId( nodeId ); 
     830    extStreamFormatCmd.setNodeId( m_nodeId ); 
    827831    extStreamFormatCmd.setCommandType( AVCCommand::eCT_Status ); 
    828832    extStreamFormatCmd.setVerbose( true ); 
     
    849853 
    850854int 
    851 AvDevice::getConfigurationIdNumberOfChannel( Ieee1394Service& ieee1394Service, 
    852                                              int nodeId, 
    853                                              PlugAddress::EPlugDirection ePlugDirection ) 
    854 
    855     ExtendedPlugInfoCmd extPlugInfoCmd( ieee1394Service ); 
     855AvDevice::getConfigurationIdNumberOfChannel( PlugAddress::EPlugDirection ePlugDirection ) 
     856
     857    ExtendedPlugInfoCmd extPlugInfoCmd( *m_p1394Service ); 
    856858    UnitPlugAddress unitPlugAddress( UnitPlugAddress::ePT_PCR, 
    857                                      nodeId ); 
     859                                     m_nodeId ); 
    858860    extPlugInfoCmd.setPlugAddress( PlugAddress( ePlugDirection, 
    859861                                                PlugAddress::ePAM_Unit, 
    860862                                                unitPlugAddress ) ); 
    861     extPlugInfoCmd.setNodeId( nodeId ); 
     863    extPlugInfoCmd.setNodeId( m_nodeId ); 
    862864    extPlugInfoCmd.setCommandType( AVCCommand::eCT_Status ); 
    863865    extPlugInfoCmd.setVerbose( true ); 
     
    886888 
    887889int 
    888 AvDevice::getConfigurationIdSyncMode( Ieee1394Service& ieee1394Service, 
    889                                       int nodeId ) 
    890 
    891     SignalSourceCmd signalSourceCmd( ieee1394Service ); 
     890AvDevice::getConfigurationIdSyncMode() 
     891
     892    SignalSourceCmd signalSourceCmd( *m_p1394Service ); 
    892893    SignalUnitAddress signalUnitAddr; 
    893894    signalUnitAddr.m_plugId = 0x01; 
    894895    signalSourceCmd.setSignalDestination( signalUnitAddr ); 
    895     signalSourceCmd.setNodeId( nodeId ); 
     896    signalSourceCmd.setNodeId( m_nodeId ); 
    896897    signalSourceCmd.setSubunitType( AVCCommand::eST_Unit  ); 
    897898    signalSourceCmd.setSubunitId( 0xff ); 
     
    923924 
    924925int 
    925 AvDevice::getConfigurationId( Ieee1394Service& ieee1394Service, int nodeId
     926AvDevice::getConfigurationId(
    926927{ 
    927928    // create a unique configuration id. 
    928929    int id = 0; 
    929     id = getConfigurationIdSampleRate( ieee1394Service, nodeId ); 
    930     id |= ( getConfigurationIdNumberOfChannel( ieee1394Service, nodeId, PlugAddress::ePD_Input ) 
    931             + getConfigurationIdNumberOfChannel( ieee1394Service, nodeId, PlugAddress::ePD_Output ) ) << 8; 
    932     id |= getConfigurationIdSyncMode( ieee1394Service, nodeId ) << 16; 
     930    id = getConfigurationIdSampleRate(); 
     931    id |= ( getConfigurationIdNumberOfChannel( PlugAddress::ePD_Input ) 
     932            + getConfigurationIdNumberOfChannel( PlugAddress::ePD_Output ) ) << 8; 
     933    id |= getConfigurationIdSyncMode() << 16; 
    933934 
    934935    return id; 
     
    14891490AvDevice::serializeSyncInfoVector( Glib::ustring basePath, 
    14901491                                   Util::IOSerialize& ser, 
    1491                                    const SyncInfoVector& vec ) 
     1492                                   const SyncInfoVector& vec ) const 
    14921493{ 
    14931494    bool result = true; 
     
    15161517AvDevice::deserializeSyncInfoVector( Glib::ustring basePath, 
    15171518                                     Util::IODeserialize& deser, 
    1518                                      AvDevice& avDevice, 
    15191519                                     SyncInfoVector& vec ) 
    15201520{ 
     
    15401540        if ( result ) { 
    15411541            SyncInfo syncInfo; 
    1542             syncInfo.m_source = avDevice.getPlugManager().getPlug( sourceId ); 
    1543             syncInfo.m_destination = avDevice.getPlugManager().getPlug( destinationId ); 
     1542            syncInfo.m_source = m_pPlugManager->getPlug( sourceId ); 
     1543            syncInfo.m_destination = m_pPlugManager->getPlug( destinationId ); 
    15441544            syncInfo.m_description = description; 
    15451545 
     
    15981598    result &= serializeOptions( basePath + "Options", ser ); 
    15991599 
    1600 //    result &= ser.write( basePath + "m_id", id ); 
     1600    // result &= ser.write( basePath + "m_id", id ); 
    16011601 
    16021602    return result; 
    16031603} 
    16041604 
    1605 AvDevice* 
     1605bool 
    16061606AvDevice::deserialize( Glib::ustring basePath, 
    1607                        Util::IODeserialize& deser, 
    1608                        Ieee1394Service& ieee1394Service ) 
    1609 
    1610     ConfigRom *configRom = 
    1611         ConfigRom::deserialize( basePath + "m_pConfigRom/", deser, ieee1394Service ); 
    1612  
    1613     if ( !configRom ) { 
    1614         return NULL; 
    1615     } 
    1616  
    1617     AvDevice* pDev = new AvDevice( 
    1618         std::auto_ptr<ConfigRom>(configRom), 
    1619         ieee1394Service, configRom->getNodeId()); 
    1620  
    1621     if ( pDev ) { 
    1622         bool result; 
    1623         result  = deser.read( basePath + "m_verboseLevel", pDev->m_verboseLevel ); 
    1624  
    1625         if (pDev->m_pPlugManager) delete pDev->m_pPlugManager; 
    1626         pDev->m_pPlugManager = AvPlugManager::deserialize( basePath + "AvPlug", deser, *pDev ); 
    1627         if ( !pDev->m_pPlugManager ) { 
    1628             delete pDev; 
    1629             return 0; 
    1630         } 
    1631         result &= deserializeAvPlugUpdateConnections( basePath + "AvPlug", deser, pDev->m_pcrPlugs ); 
    1632         result &= deserializeAvPlugUpdateConnections( basePath + "AvPlug", deser, pDev->m_externalPlugs ); 
    1633         result &= deserializeVector<AvPlugConnection>( basePath + "PlugConnnection", deser, *pDev, pDev->m_plugConnections ); 
    1634         result &= deserializeVector<AvDeviceSubunit>( basePath + "Subunit",  deser, *pDev, pDev->m_subunits ); 
    1635         result &= deserializeSyncInfoVector( basePath + "SyncInfo", deser, *pDev, pDev->m_syncInfos ); 
    1636  
    1637         unsigned int i; 
    1638         result &= deser.read( basePath + "m_activeSyncInfo", i ); 
    1639  
    1640         if ( result ) { 
    1641             if ( i < pDev->m_syncInfos.size() ) { 
    1642                 pDev->m_activeSyncInfo = &pDev->m_syncInfos[i]; 
    1643             } 
    1644         } 
    1645  
    1646         result &= deserializeOptions( basePath + "Options", deser, *pDev ); 
    1647     } 
    1648  
    1649     return pDev; 
     1607                       Util::IODeserialize& deser ) 
     1608
     1609    bool result; 
     1610    result  = deser.read( basePath + "m_verboseLevel", m_verboseLevel ); 
     1611 
     1612    delete m_pPlugManager; 
     1613    m_pPlugManager = AvPlugManager::deserialize( basePath + "AvPlug", deser, *this ); 
     1614    if ( !m_pPlugManager ) { 
     1615        return false; 
     1616    } 
     1617    result &= deserializeAvPlugUpdateConnections( basePath + "AvPlug", deser, m_pcrPlugs ); 
     1618    result &= deserializeAvPlugUpdateConnections( basePath + "AvPlug", deser, m_externalPlugs ); 
     1619    result &= deserializeVector<AvPlugConnection>( basePath + "PlugConnnection", deser, *this, m_plugConnections ); 
     1620    result &= deserializeVector<AvDeviceSubunit>( basePath + "Subunit",  deser, *this, m_subunits ); 
     1621    result &= deserializeSyncInfoVector( basePath + "SyncInfo", deser, m_syncInfos ); 
     1622 
     1623    unsigned int i; 
     1624    result &= deser.read( basePath + "m_activeSyncInfo", i ); 
     1625 
     1626    if ( result ) { 
     1627        if ( i < m_syncInfos.size() ) { 
     1628            m_activeSyncInfo = &m_syncInfos[i]; 
     1629        } 
     1630    } 
     1631 
     1632    result &= deserializeOptions( basePath + "Options", deser, *this ); 
     1633 
     1634    return result; 
     1635
     1636 
     1637 
     1638Glib::ustring 
     1639AvDevice::getCachePath() 
     1640
     1641    Glib::ustring cachePath; 
     1642    char* pCachePath; 
     1643    if ( asprintf( &pCachePath, "%s/cache/libffado/",  CACHEDIR ) < 0 ) { 
     1644        debugError( "Could not create path string for cache pool (trying '/var/cache/libffado' instead)\n" ); 
     1645        cachePath == "/var/cache/libffado/"; 
     1646    } else { 
     1647        cachePath = pCachePath; 
     1648        free( pCachePath ); 
     1649    } 
     1650    return cachePath; 
     1651
     1652 
     1653bool 
     1654AvDevice::loadFromCache() 
     1655
     1656    Glib::ustring sDevicePath = getCachePath() + m_pConfigRom->getGuidString(); 
     1657 
     1658    char* configId; 
     1659    asprintf(&configId, "%08x", getConfigurationId() ); 
     1660    if ( !configId ) { 
     1661        debugError( "could not create id string\n" ); 
     1662        return false; 
     1663    } 
     1664 
     1665    Glib::ustring sFileName = sDevicePath + "/" + configId + ".xml"; 
     1666    free( configId ); 
     1667    debugOutput( DEBUG_LEVEL_NORMAL, "filename %s\n", sFileName.c_str() ); 
     1668 
     1669    Util::XMLDeserialize deser( sFileName, m_verboseLevel ); 
     1670 
     1671    bool result = deserialize( "", deser ); 
     1672    if ( result ) { 
     1673        debugOutput( DEBUG_LEVEL_NORMAL, "could create valid bebob driver from %s\n", 
     1674                     sFileName.c_str() ); 
     1675    } 
     1676 
     1677    return result; 
     1678
     1679 
     1680bool 
     1681AvDevice::saveCache() 
     1682
     1683    // the path looks like this: 
     1684    // PATH_TO_CACHE + GUID + CONFIGURATION_ID 
     1685 
     1686    Glib::ustring sDevicePath = getCachePath() + m_pConfigRom->getGuidString(); 
     1687    struct stat buf; 
     1688    if ( stat( sDevicePath.c_str(), &buf ) == 0 ) { 
     1689        if ( !S_ISDIR( buf.st_mode ) ) { 
     1690            debugError( "\"%s\" is not a directory\n",  sDevicePath.c_str() ); 
     1691            return false; 
     1692        } 
     1693    } else { 
     1694        if (  mkdir( sDevicePath.c_str(), S_IRWXU | S_IRWXG ) != 0 ) { 
     1695            debugError( "Could not create \"%s\" directory\n", sDevicePath.c_str() ); 
     1696            return false; 
     1697        } 
     1698    } 
     1699 
     1700    char* configId; 
     1701    asprintf(&configId, "%08x", BeBoB::AvDevice::getConfigurationId() ); 
     1702    if ( !configId ) { 
     1703        debugError( "Could not create id string\n" ); 
     1704        return false; 
     1705    } 
     1706    Glib::ustring sFileName = sDevicePath + "/" + configId + ".xml"; 
     1707    free( configId ); 
     1708    debugOutput( DEBUG_LEVEL_NORMAL, "filename %s\n", sFileName.c_str() ); 
     1709 
     1710    Util::XMLSerialize ser( sFileName ); 
     1711    return serialize( "", ser ); 
    16501712} 
    16511713 
  • trunk/libffado/src/bebob/bebob_avdevice.h

    r516 r529  
    3131#include "libavc/avc_extended_cmd_generic.h" 
    3232 
     33#include "bebob/bebob_configparser.h" 
    3334#include "bebob/bebob_avplug.h" 
    3435#include "bebob/bebob_avdevice_subunit.h" 
     
    5253namespace BeBoB { 
    5354 
    54 struct VendorModelEntry { 
    55     unsigned int vendor_id; 
    56     unsigned int model_id; 
    57     char *vendor_name; 
    58     char *model_name; 
    59 }; 
    60  
    6155class AvDevice : public IAvDevice { 
    6256public: 
     
    6963 
    7064    static bool probe( ConfigRom& configRom ); 
    71     static int getConfigurationId( Ieee1394Service& ieee1394Service, int nodeId ); 
     65    virtual bool loadFromCache(); 
     66    virtual bool saveCache(); 
    7267    virtual bool discover(); 
    7368 
     
    118113    bool setActiveSync( const SyncInfo& syncInfo ); 
    119114 
    120     bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const; 
    121     static AvDevice* deserialize( Glib::ustring basePath, 
    122                                   Util::IODeserialize& deser, 
    123                   Ieee1394Service& ieee1394Service ); 
    124115    AvDeviceSubunitAudio* getAudioSubunit( subunit_id_t subunitId ) 
    125116        { return dynamic_cast<AvDeviceSubunitAudio*>( 
     
    167158                                           std::string syncDescription ); 
    168159 
    169     static bool serializeSyncInfoVector( Glib::ustring basePath, 
    170                                          Util::IOSerialize& ser, 
    171                                          const SyncInfoVector& vec ); 
    172     static bool deserializeSyncInfoVector( Glib::ustring basePath, 
    173                                            Util::IODeserialize& deser, 
    174                                            AvDevice& avDevice, 
    175                                            SyncInfoVector& vec ); 
    176     static int getConfigurationIdSampleRate( Ieee1394Service& ieee1394service, int nodeId ); 
    177     static int getConfigurationIdNumberOfChannel( Ieee1394Service& ieee1394service,  
    178                                                   int nodeId, 
    179                                                   PlugAddress::EPlugDirection ePlugDirection ); 
    180     static int getConfigurationIdSyncMode( Ieee1394Service& ieee1394service, 
    181                                            int nodeId ); 
     160 
     161    bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const; 
     162    bool deserialize( Glib::ustring basePath, 
     163                      Util::IODeserialize& deser ); 
     164    bool serializeSyncInfoVector( Glib::ustring basePath, 
     165                                  Util::IOSerialize& ser, 
     166                                  const SyncInfoVector& vec ) const; 
     167    bool deserializeSyncInfoVector( Glib::ustring basePath, 
     168                                    Util::IODeserialize& deser, 
     169                                    SyncInfoVector& vec ); 
     170    int getConfigurationIdSampleRate(); 
     171    int getConfigurationIdNumberOfChannel( PlugAddress::EPlugDirection ePlugDirection ); 
     172    int getConfigurationIdSyncMode(); 
     173    int getConfigurationId(); 
     174 
     175    Glib::ustring getCachePath(); 
    182176 
    183177protected: 
     
    189183    SyncInfoVector            m_syncInfos; 
    190184    SyncInfo*                 m_activeSyncInfo; 
    191     struct VendorModelEntry*  m_model; 
     185    VendorModelEntry*         m_model; 
    192186    GenericMixer*             m_Mixer; 
    193187 
  • trunk/libffado/src/devicemanager.cpp

    r525 r529  
    6363#include <iostream> 
    6464#include <sstream> 
    65 #include <unistd.h> 
    66 #include <sys/stat.h> 
    6765 
    6866using namespace std; 
     
    224222            } 
    225223 
    226             bool isFromCache = false; 
    227             IAvDevice* avDevice = loadFromCache( *configRom ); 
    228             if ( avDevice ) { 
    229                 debugOutput( DEBUG_LEVEL_VERBOSE, "could load from cache\n" ); 
    230                 isFromCache = true; 
    231             } else { 
    232                 avDevice = getDriverForDevice( configRom, nodeId ); 
    233             } 
    234  
     224            IAvDevice*avDevice = getDriverForDevice( configRom, nodeId ); 
    235225            if ( avDevice ) { 
    236226                debugOutput( DEBUG_LEVEL_NORMAL, 
     
    238228                             nodeId ); 
    239229 
    240                 avDevice->setVerboseLevel( m_verboseLevel ); 
    241  
    242                 if ( !isFromCache ) { 
    243                     if ( !avDevice->discover() ) { 
    244                         debugError( "could not discover device\n" ); 
    245                         delete avDevice; 
    246                         continue; 
    247                     } 
     230                bool isFromCache = false; 
     231                if ( avDevice->loadFromCache() ) { 
     232                    debugOutput( DEBUG_LEVEL_VERBOSE, "could load from cache\n" ); 
     233                    isFromCache = true; 
     234                } else if ( avDevice->discover() ) { 
     235                    debugOutput( DEBUG_LEVEL_VERBOSE, "discovering successful\n" ); 
     236                    avDevice->setVerboseLevel( m_verboseLevel ); 
     237                } else { 
     238                    debugError( "could not discover device\n" ); 
     239                    delete avDevice; 
     240                    continue; 
    248241                } 
    249242 
     
    267260                } 
    268261 
    269                 if ( !isFromCache ) { 
    270                     if ( !saveCache( avDevice ) ) { 
    271                         debugWarning( "Could not create cached version of AVC model\n" ); 
    272                     } 
     262                if ( !isFromCache && !avDevice->saveCache() ) { 
     263                    debugOutput( DEBUG_LEVEL_VERBOSE, "No cached version of AVC model created\n" ); 
    273264                } 
    274265 
     
    499490    return true; 
    500491} 
    501  
    502 bool 
    503 DeviceManager::buildCache() 
    504 { 
    505     bool result = true; 
    506     for ( IAvDeviceVectorIterator it = m_avDevices.begin(); 
    507           it != m_avDevices.end(); 
    508           ++it ) 
    509     { 
    510         IAvDevice* pAvDevice = *it; 
    511         result &= saveCache( pAvDevice ); 
    512     } 
    513  
    514     return result; 
    515 } 
    516  
    517 Glib::ustring 
    518 DeviceManager::getCachePath() 
    519 { 
    520     Glib::ustring cachePath; 
    521     char* pCachePath; 
    522     if ( asprintf( &pCachePath, "%s/cache/libffado/",  CACHEDIR ) < 0 ) { 
    523         debugError( "Could not create path string for cache pool (trying '/var/cache/libffado' instead)\n" ); 
    524         cachePath == "/var/cache/libffado/"; 
    525     } else { 
    526         cachePath = pCachePath; 
    527         free( pCachePath ); 
    528     } 
    529     return cachePath; 
    530 } 
    531  
    532 bool 
    533 DeviceManager::saveCache( IAvDevice* pAvDevice ) 
    534 { 
    535     // so far only BeBoB based devices needed a cache for speed up. 
    536     BeBoB::AvDevice* pBeBoBDevice = reinterpret_cast<BeBoB::AvDevice*>( pAvDevice ); 
    537     if ( !pBeBoBDevice ) { 
    538         return true; 
    539     } 
    540     // FIXME: the above test doesn't have the desired effect - MOTU devices 
    541     // are still allowed to proceed.  Therefore for the moment include a 
    542     // further check. 
    543     // If the device isn't a BeBoB device we can't assume it will accept AVC 
    544     // commands (for example, trying to send AVC commands to a MOTU via 
    545     // libiec61883 gives an endless stream of "send oops" messages).  
    546     // Therefore only proceed if the device is a known BeBoB device. 
    547     if (!BeBoB::AvDevice::probe(pAvDevice->getConfigRom())) { 
    548         return true; 
    549     } 
    550  
    551     // the path looks like this: 
    552     // PATH_TO_CACHE + GUID + CONFIGURATION_ID 
    553  
    554     Glib::ustring sDevicePath = getCachePath() + pAvDevice->getConfigRom().getGuidString(); 
    555     struct stat buf; 
    556     if ( stat( sDevicePath.c_str(), &buf ) == 0 ) { 
    557         if ( !S_ISDIR( buf.st_mode ) ) { 
    558             debugError( "\"%s\" is not a directory\n",  sDevicePath.c_str() ); 
    559             return false; 
    560         } 
    561     } else { 
    562         if (  mkdir( sDevicePath.c_str(), S_IRWXU | S_IRWXG ) != 0 ) { 
    563             debugError( "Could not create \"%s\" directory\n", sDevicePath.c_str() ); 
    564             return false; 
    565         } 
    566     } 
    567  
    568     char* configId; 
    569     asprintf(&configId, "%08x", BeBoB::AvDevice::getConfigurationId( *m_1394Service, 
    570                                                                      pAvDevice->getNodeId() ) ); 
    571     if ( !configId ) { 
    572         debugError( "Could not create id string\n" ); 
    573         return false; 
    574     } 
    575     Glib::ustring sFileName = sDevicePath + "/" + configId + ".xml"; 
    576     free( configId ); 
    577     debugOutput( DEBUG_LEVEL_NORMAL, "filename %s\n", sFileName.c_str() ); 
    578  
    579     Util::XMLSerialize ser( sFileName ); 
    580     return pBeBoBDevice->serialize( "", ser ); 
    581 } 
    582  
    583 IAvDevice* 
    584 DeviceManager::loadFromCache( const ConfigRom& configRom ) 
    585 { 
    586     Glib::ustring sDevicePath = getCachePath() + configRom.getGuidString(); 
    587     char* configId; 
    588     // If the device isn't a BeBoB device we can't assume it will accept AVC 
    589     // commands (for example, trying to send AVC commands to a MOTU via 
    590     // libiec61883 gives an endless stream of "send oops" messages).  
    591     // Therefore only proceed if the device is a known BeBoB device. 
    592     if (!BeBoB::AvDevice::probe((ConfigRom&)configRom)) { 
    593         return false; 
    594     } 
    595     asprintf(&configId, "%08x", 
    596     BeBoB::AvDevice::getConfigurationId(*m_1394Service, 
    597     configRom.getNodeId()) ); 
    598     if ( !configId ) { 
    599         debugError( "could not create id string\n" ); 
    600         return false; 
    601     } 
    602     Glib::ustring sFileName = sDevicePath + "/" + configId + ".xml"; 
    603     free( configId ); 
    604     debugOutput( DEBUG_LEVEL_NORMAL, "filename %s\n", sFileName.c_str() ); 
    605  
    606     Util::XMLDeserialize deser( sFileName, m_verboseLevel ); 
    607  
    608     BeBoB::AvDevice* pBeBoBDevice = BeBoB::AvDevice::deserialize( "", 
    609                                                                   deser, 
    610                                                                   *m_1394Service ); 
    611     if ( pBeBoBDevice ) { 
    612         debugOutput( DEBUG_LEVEL_NORMAL, "could create valid bebob driver from %s\n", sFileName.c_str() ); 
    613         pBeBoBDevice->getConfigRom().setNodeId( configRom.getNodeId() ); 
    614     } 
    615  
    616     return pBeBoBDevice; 
    617 } 
    618  
  • trunk/libffado/src/devicemanager.h

    r516 r529  
    6969    unsigned int getAvDeviceCount(); 
    7070 
    71     bool buildCache(); 
    72     IAvDevice* loadFromCache( const ConfigRom& configRom ); 
    73  
    7471    Streaming::StreamProcessor *getSyncSource(); 
    7572 
     
    7875                                   int id ); 
    7976    IAvDevice* getSlaveDriver( std::auto_ptr<ConfigRom>( configRom ) ); 
    80  
    81  
    82     Glib::ustring getCachePath(); 
    83     bool saveCache( IAvDevice* pAvDevice ); 
    8477 
    8578protected: 
  • trunk/libffado/src/iavdevice.cpp

    r449 r529  
    6060 
    6161bool 
     62IAvDevice::loadFromCache() 
     63{ 
     64    return false; 
     65} 
     66 
     67bool 
     68IAvDevice::saveCache() 
     69{ 
     70    return false; 
     71} 
     72 
     73bool 
    6274IAvDevice::setId( unsigned int id) 
    6375{ 
     
    6880    debugOutput( DEBUG_LEVEL_VERBOSE, "Set id to %s...\n", idstr.str().c_str()); 
    6981 
    70      
     82 
    7183    retval=setOption("id",idstr.str()); 
    7284    if (retval) { 
  • trunk/libffado/src/iavdevice.h

    r516 r529  
    5656    /// Returns the ConfigRom object of the device node. 
    5757    ConfigRom& getConfigRom() const; 
     58 
     59    /** 
     60     * @brief Called by DeviceManager to load device model from cache. 
     61     * 
     62     * This function is called before discover in order to speed up 
     63     * system initializing. 
     64     * 
     65     * @returns true if device was cached and successfully loaded from cache 
     66     */ 
     67    virtual bool loadFromCache(); 
     68 
     69    /** 
     70     * @brief Called by DeviceManager to allow device driver to save a cache version 
     71     * of the current configuration. 
     72     * 
     73     * @returns true if caching was successful. False doesn't mean an error just, 
     74     * the driver was unable to store the configuration 
     75     */ 
     76    virtual bool saveCache(); 
    5877 
    5978    /** 
  • trunk/libffado/src/Makefile.am

    r517 r529  
    5151        devicemanager.h fbtypes.h iavdevice.h threads.h bebob/bebob_avdevice.h \ 
    5252        bebob/bebob_avdevice_subunit.h bebob/bebob_avplug.h bebob/bebob_dl_bcd.h bebob/bebob_dl_codes.h \ 
    53         bebob/bebob_dl_mgr.h bebob/bebob_functionblock.h bounce/bounce_avdevice.h bounce/bounce_slave_avdevice.h
     53        bebob/bebob_dl_mgr.h bebob/bebob_functionblock.h bounce/bounce_avdevice.h bounce/bounce_slave_avdevice.h bebob/bebob_configparser.h
    5454        bebob/GenericMixer.h \ 
    5555        maudio/maudio_avdevice.h motu/motu_avdevice.h rme/rme_avdevice.h \ 
     
    136136            bebob/bebob_dl_mgr.cpp \ 
    137137            bebob/bebob_functionblock.cpp \ 
     138            bebob/bebob_configparser.cpp \ 
    138139            bebob/GenericMixer.cpp \ 
    139140            maudio/maudio_avdevice.cpp