Show
Ignore:
Timestamp:
08/22/07 10:15:34 (17 years ago)
Author:
ppalmers
Message:

Merge echoaudio branch into trunk.

This adds support for the Echo Audiofire devices to FFADO. Possibly also other devices working with the Apple Class Driver will work with this code. It is not fully complete yet, but the main rework is
done.

First of all the IAvDevice class/interface is renamed to FFADODevice, in order to separate the AV/C code from the FFADO API code. A device supported by FFADO implements a FFADODevice.

The BeBoB device has been split up into three groups:
- libavc/* : all code and commands that are specified by AV/C specs. Note that a lot of the code that used to be in BeBoB::AvDevice? now resides in AVC::Unit
- genericavc/* : a FFADODevice that uses AV/C descriptors & commands for discovery and config
- bebob/* : the bebob FFADODevice that inherits from GenericAVC::AvDevice? but that uses BridgeCo? commands for discovery

Everything has been moved as high as possible in the class hierarchy. If necessary, a subclass that uses device specific commands is introduced (e.g. BeBoB::Plug inherits from AVC::Plug and uses the
BridgeCo? extended plug info command to discover it's properties).

There are some other fixes along the way that have been done too.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libavc/general/avc_plug.cpp

    r548 r554  
    16631663    // FIXME: The derived class should be creating these, such that discover() can become pure virtual 
    16641664 
     1665    if ( !deser.isExisting( basePath + "m_subunitType" ) ) { 
     1666        return 0; 
     1667    } 
    16651668    Plug* pPlug = new Plug; 
    16661669    if ( !pPlug ) { 
     
    22212224                               Unit& unit ) 
    22222225{ 
     2226    if ( !deser.isExisting( basePath + "m_srcPlug" ) ) { 
     2227        return 0; 
     2228    } 
    22232229    PlugConnection* pConnection = new PlugConnection; 
    22242230    if ( !pConnection ) { 
  • trunk/libffado/src/libavc/general/avc_subunit.cpp

    r524 r554  
    242242    bool result; 
    243243    ESubunitType sbType; 
     244 
     245    if ( !deser.isExisting( basePath + "m_sbType" ) ) { 
     246        return 0; 
     247    } 
     248 
    244249    result  = deser.read( basePath + "m_sbType", sbType ); 
    245250 
  • trunk/libffado/src/libavc/general/avc_unit.cpp

    r548 r554  
    603603    } 
    604604 
    605     PlugVector digitalPCRInputPlugs = getPlugsByType( m_externalPlugs, 
     605    PlugVector digitalExternalInputPlugs = getPlugsByType( m_externalPlugs, 
    606606                                                    Plug::eAPD_Input, 
    607607                                                    Plug::eAPT_Digital ); 
     608    if ( !digitalExternalInputPlugs.size() ) { 
     609        debugOutput( DEBUG_LEVEL_VERBOSE, "No external digital input plugs found\n" ); 
     610 
     611    } 
     612     
     613    PlugVector syncExternalInputPlugs = getPlugsByType( m_externalPlugs, 
     614                                                    Plug::eAPD_Input, 
     615                                                    Plug::eAPT_Sync ); 
     616    if ( !syncExternalInputPlugs.size() ) { 
     617        debugOutput( DEBUG_LEVEL_VERBOSE, "No external sync input plugs found\n" ); 
     618 
     619    } 
    608620 
    609621    PlugVector syncMSUInputPlugs = m_pPlugManager->getPlugsByType( 
     
    639651    debugOutput( DEBUG_LEVEL_VERBOSE, "PCR Iso Output Plugs:\n" ); 
    640652    showPlugs( isoPCROutputPlugs ); 
    641     debugOutput( DEBUG_LEVEL_VERBOSE, "PCR digital Input Plugs:\n" ); 
    642     showPlugs( digitalPCRInputPlugs ); 
     653    debugOutput( DEBUG_LEVEL_VERBOSE, "External digital Input Plugs:\n" ); 
     654    showPlugs( digitalExternalInputPlugs ); 
     655    debugOutput( DEBUG_LEVEL_VERBOSE, "External sync Input Plugs:\n" ); 
     656    showPlugs( syncExternalInputPlugs ); 
    643657    debugOutput( DEBUG_LEVEL_VERBOSE, "MSU Sync Input Plugs:\n" ); 
    644658    showPlugs( syncMSUInputPlugs ); 
     
    670684                                      "Internal (CSP)" ); 
    671685 
    672     // Check all external PCR digital input to MSU input connections 
     686    // Check all external digital input to MSU input connections 
    673687    // -> SPDIF/ADAT sync 
    674     checkSyncConnectionsAndAddToList( digitalPCRInputPlugs, 
     688    checkSyncConnectionsAndAddToList( digitalExternalInputPlugs, 
     689                                      syncMSUInputPlugs, 
     690                                      "Digital Input Sync" ); 
     691 
     692    // Check all external sync input to MSU input connections 
     693    // -> SPDIF/ADAT sync 
     694    checkSyncConnectionsAndAddToList( syncExternalInputPlugs, 
    675695                                      syncMSUInputPlugs, 
    676696                                      "Digital Input Sync" ); 
     
    835855Unit::deserializeSyncInfoVector( Glib::ustring basePath, 
    836856                                     Util::IODeserialize& deser, 
    837                                      Unit& unit, 
    838857                                     SyncInfoVector& vec ) 
    839858{ 
     
    849868        Glib::ustring description; 
    850869 
    851         result  = deser.read( strstrm.str() + "m_source", sourceId ); 
    852         result &= deser.read( strstrm.str() + "m_destination", destinationId ); 
    853         result &= deser.read( strstrm.str() + "m_description", description ); 
     870        if ( deser.isExisting( strstrm.str() + "m_source" ) ) { 
     871            result  = deser.read( strstrm.str() + "m_source", sourceId ); 
     872            result &= deser.read( strstrm.str() + "m_destination", destinationId ); 
     873            result &= deser.read( strstrm.str() + "m_description", description ); 
     874        } else { 
     875            result = false; 
     876        } 
    854877 
    855878        if ( result ) { 
    856879            SyncInfo syncInfo; 
    857             syncInfo.m_source = unit.getPlugManager().getPlug( sourceId ); 
    858             syncInfo.m_destination = unit.getPlugManager().getPlug( destinationId ); 
     880            syncInfo.m_source = m_pPlugManager->getPlug( sourceId ); 
     881            syncInfo.m_destination = m_pPlugManager->getPlug( destinationId ); 
    859882            syncInfo.m_description = description; 
    860883 
     
    895918    result &= serializeVector( basePath + "PlugConnection", ser, m_plugConnections ); 
    896919    result &= serializeVector( basePath + "Subunit", ser, m_subunits ); 
    897     result &= serializeSyncInfoVector( basePath + "SyncInfo", ser, m_syncInfos ); 
     920#warning this fails after the echoaudio merge 
     921//     result &= serializeSyncInfoVector( basePath + "SyncInfo", ser, m_syncInfos ); 
    898922     
    899923    int i = 0; 
     
    915939bool 
    916940Unit::deserialize( Glib::ustring basePath, 
    917                    Unit* pDev, 
    918941                   Util::IODeserialize& deser, 
    919942                   Ieee1394Service& ieee1394Service ) 
     
    925948    setDebugLevel( verboseLevel ); 
    926949     
    927     if (pDev->m_pPlugManager) delete pDev->m_pPlugManager; 
    928     pDev->m_pPlugManager = PlugManager::deserialize( basePath + "Plug", deser, *pDev ); 
    929     if ( !pDev->m_pPlugManager ) { 
     950    if (m_pPlugManager) delete m_pPlugManager; 
     951    m_pPlugManager = PlugManager::deserialize( basePath + "Plug", deser, *this ); 
     952    if ( !m_pPlugManager ) { 
    930953        return false; 
    931954    } 
    932955     
    933     result &= deserializePlugUpdateConnections( basePath + "Plug", deser, pDev->m_pcrPlugs ); 
    934     result &= deserializePlugUpdateConnections( basePath + "Plug", deser, pDev->m_externalPlugs ); 
    935     result &= deserializeVector<PlugConnection>( basePath + "PlugConnnection", deser, *pDev, pDev->m_plugConnections ); 
    936     result &= deserializeVector<Subunit>( basePath + "Subunit",  deser, *pDev, pDev->m_subunits ); 
    937     result &= deserializeSyncInfoVector( basePath + "SyncInfo", deser, *pDev, pDev->m_syncInfos ); 
     956    result &= deserializePlugUpdateConnections( basePath + "Plug", deser, m_pcrPlugs ); 
     957    result &= deserializePlugUpdateConnections( basePath + "Plug", deser, m_externalPlugs ); 
     958    result &= deserializeVector<PlugConnection>( basePath + "PlugConnnection", deser, *this, m_plugConnections ); 
     959    result &= deserializeVector<Subunit>( basePath + "Subunit",  deser, *this, m_subunits ); 
     960    result &= deserializeSyncInfoVector( basePath + "SyncInfo", deser, m_syncInfos ); 
     961 
    938962 
    939963    unsigned int i; 
     
    941965 
    942966    if ( result ) { 
    943         if ( i < pDev->m_syncInfos.size() ) { 
    944             pDev->m_activeSyncInfo = &pDev->m_syncInfos[i]; 
     967        if ( i < m_syncInfos.size() ) { 
     968            m_activeSyncInfo = &m_syncInfos[i]; 
    945969        } 
    946970    } 
  • trunk/libffado/src/libavc/general/avc_unit.h

    r548 r554  
    9494 
    9595    bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const; 
    96     static bool deserialize( Glib::ustring basePath, Unit*
     96    bool deserialize( Glib::ustring basePath
    9797                                 Util::IODeserialize& deser, 
    9898                                 Ieee1394Service& ieee1394Service ); 
     
    151151 
    152152 
    153     static bool serializeSyncInfoVector( Glib::ustring basePath, 
     153    bool serializeSyncInfoVector( Glib::ustring basePath, 
    154154                                         Util::IOSerialize& ser, 
    155155                                         const SyncInfoVector& vec ); 
    156     static bool deserializeSyncInfoVector( Glib::ustring basePath, 
     156    bool deserializeSyncInfoVector( Glib::ustring basePath, 
    157157                                           Util::IODeserialize& deser, 
    158                                            Unit& avDevice, 
    159158                                           SyncInfoVector& vec ); 
    160159protected: