Changeset 1543

Show
Ignore:
Timestamp:
04/25/09 10:14:57 (12 years ago)
Author:
ppalmers
Message:

- Clean up class names
- Change probe code for all devices (except MOTU) to use the config file based approach

Files:

Legend:

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

    r1535 r1543  
    288288    driver = 10; 
    289289    mixer = "MotuMixer"; 
     290}, 
     291{ 
     292    vendorid = 0x000a35; 
     293    modelid = 0x0001; 
     294    vendorname = "RME"; 
     295    modelname = "FireFace800"; 
     296    driver = 40; 
     297}, 
     298{ 
     299    vendorid = 0x000a35; 
     300    modelid = 0x0002; 
     301    vendorname = "RME"; 
     302    modelname = "FireFace400"; 
     303    driver = 40; 
     304}, 
     305{ 
     306    vendorid = 0x000166; 
     307    modelid = 0x0001; 
     308    vendorname = "TCAT"; 
     309    modelname = "DiceII EVM (1)"; 
     310    driver = 20; 
     311}, 
     312{ 
     313    vendorid = 0x000166; 
     314    modelid = 0x0002; 
     315    vendorname = "TCAT"; 
     316    modelname = "DiceII EVM (2)"; 
     317    driver = 20; 
     318}, 
     319{ 
     320    vendorid = 0x000166; 
     321    modelid = 0x0004; 
     322    vendorname = "TCAT"; 
     323    modelname = "DiceII EVM (4)"; 
     324    driver = 20; 
     325}, 
     326{ 
     327    vendorid = 0x000166; 
     328    modelid = 0x00000020; 
     329    vendorname = "TC Electronic"; 
     330    modelname = "Konnekt 24D"; 
     331    driver = 20; 
     332}, 
     333{ 
     334    vendorid = 0x000166; 
     335    modelid = 0x00000021; 
     336    vendorname = "TC Electronic"; 
     337    modelname = "Konnekt 8"; 
     338    driver = 20; 
     339}, 
     340{ 
     341    vendorid = 0x000166; 
     342    modelid = 0x00000023; 
     343    vendorname = "TC Electronic"; 
     344    modelname = "Konnekt Live"; 
     345    driver = 20; 
     346}, 
     347{ 
     348    vendorid = 0x000595; 
     349    modelid = 0x00000001; 
     350    vendorname = "Alesis"; 
     351    modelname = "io|14"; 
     352    driver = 20; 
     353}, 
     354{ 
     355    vendorid = 0x000595; 
     356    modelid = 0x00000000; 
     357    vendorname = "Alesis"; 
     358    modelname = "Multimix16 Firewire"; 
     359    driver = 20; 
     360}, 
     361{ 
     362    vendorid = 0x000595; 
     363    modelid = 0x00000000; 
     364    vendorname = "Alesis"; 
     365    modelname = "Multimix16 Firewire"; 
     366    driver = 20; 
     367}, 
     368{ 
     369    vendorid = 0x000a92; 
     370    modelid = 0x0000000b; 
     371    vendorname = "Presonus"; 
     372    modelname = "Firestudio Project"; 
     373    driver = 20; 
     374}, 
     375{ 
     376    vendorid = 0x00130e; 
     377    modelid = 0x00000005; 
     378    vendorname = "Focusrite"; 
     379    modelname = "Saffire PRO 40"; 
     380    driver = 20; 
     381}, 
     382{ 
     383    vendorid = 0x001C6A; 
     384    modelid = 0x00000001; 
     385    vendorname = "Weiss Engineering Ltd."; 
     386    modelname = "ADC 2"; 
     387    driver = 20; 
     388}, 
     389{ 
     390    vendorid = 0x001C6A; 
     391    modelid = 0x00000002; 
     392    vendorname = "Weiss Engineering Ltd."; 
     393    modelname = "Vesta"; 
     394    driver = 20; 
     395}, 
     396{ 
     397    vendorid = 0x001C6A; 
     398    modelid = 0x00000003; 
     399    vendorname = "Weiss Engineering Ltd."; 
     400    modelname = "Minerva"; 
     401    driver = 20; 
     402}, 
     403{ 
     404    vendorid = 0x001C6A; 
     405    modelid = 0x00000004; 
     406    vendorname = "Weiss Engineering Ltd."; 
     407    modelname = "AFI 1"; 
     408    driver = 20; 
    290409} 
    291410); 
  • trunk/libffado/SConstruct

    r1535 r1543  
    6060        PathOption( "INCLUDEDIR", "Overwrite the directory where headers are installed to.", "$PREFIX/include", PathOption.PathAccept ), 
    6161        PathOption( "SHAREDIR", "Overwrite the directory where misc shared files are installed to.", "$PREFIX/share/libffado", PathOption.PathAccept ), 
    62         BoolOption( "ENABLE_BEBOB", "Enable/Disable the bebob part.", True ), 
    63         BoolOption( "ENABLE_FIREWORKS", "Enable/Disable the ECHO Audio FireWorks AV/C part.", True ), 
    64         BoolOption( "ENABLE_OXFORD", "Enable/Disable support for the Oxford Semiconductor AV/C platform.", True ), 
    65         BoolOption( "ENABLE_MOTU", "Enable/Disable the MOTU part.", True ), 
    66         BoolOption( "ENABLE_DICE", "Enable/Disable the DICE part.", True ), 
    67         BoolOption( "ENABLE_METRIC_HALO", "Enable/Disable the Metric Halo part.", False ), 
    68         BoolOption( "ENABLE_RME", "Enable/Disable the RME part.", False ), 
    69         #BoolOption( "ENABLE_BOUNCE", "Enable/Disable the BOUNCE part.", False ), 
     62        BoolOption( "ENABLE_BEBOB", "Enable/Disable support for the BeBoB platform.", True ), 
     63        BoolOption( "ENABLE_FIREWORKS", "Enable/Disable support for the ECHO Audio FireWorks platform.", True ), 
     64        BoolOption( "ENABLE_OXFORD", "Enable/Disable support for the Oxford Semiconductor FW platform.", True ), 
     65        BoolOption( "ENABLE_MOTU", "Enable/Disable support for the MOTU platform.", True ), 
     66        BoolOption( "ENABLE_DICE", "Enable/Disable support for the TCAT DICE platform.", True ), 
     67        BoolOption( "ENABLE_METRIC_HALO", "Enable/Disable support for the Metric Halo platform.", False ), 
     68        BoolOption( "ENABLE_RME", "Enable/Disable support for the RME platform.", False ), 
     69        BoolOption( "ENABLE_MAUDIO", "Enable/Disable support for the M-Audio custom BeBoB devices.", False ), 
     70        BoolOption( "ENABLE_BOUNCE", "Enable/Disable the BOUNCE device.", False ), 
    7071        BoolOption( "ENABLE_GENERICAVC", """\ 
    7172Enable/Disable the the generic avc part (mainly used by apple). 
     
    204205        env['SERIALIZE_USE_EXPAT']=0 
    205206 
     207if env['ENABLE_BOUNCE'] or env['ENABLE_ALL']: 
     208        env['REQUIRE_LIBAVC']=1 
     209else: 
     210        env['REQUIRE_LIBAVC']=0 
     211 
    206212if not env.GetOption('clean'): 
    207213        # 
     
    230236                'dbus-1' : '1.0', 
    231237                } 
     238 
     239        if env['REQUIRE_LIBAVC']: 
     240                pkgs['libavc1394'] = '0.5.3' 
     241 
    232242        if not env['SERIALIZE_USE_EXPAT']: 
    233243                pkgs['libxml++-2.6'] = '2.13.0' 
     
    236246                name2 = pkg.replace("+","").replace(".","").replace("-","").upper() 
    237247                env['%s_FLAGS' % name2] = conf.GetPKGFlags( pkg, pkgs[pkg] ) 
     248                print '%s_FLAGS' % name2 
    238249                if env['%s_FLAGS'%name2] == 0: 
    239250                        allpresent &= 0 
     
    345356        env['ENABLE_RME'] = True 
    346357        env['ENABLE_BOUNCE'] = True 
    347  
    348 # HACK: when the bounce device gets fixed, remove this 
    349 env['ENABLE_BOUNCE'] = False 
     358        env['ENABLE_MAUDIO'] = True 
    350359 
    351360if env['ENABLE_BEBOB'] or env['ENABLE_DICE'] \ 
    352361   or env['ENABLE_BOUNCE'] or env['ENABLE_FIREWORKS'] \ 
    353    or env['ENABLE_OXFORD']
     362   or env['ENABLE_OXFORD'] or env['ENABLE_MAUDIO']
    354363        env['ENABLE_GENERICAVC'] = True 
    355364 
  • trunk/libffado/src/bebob/bebob_avdevice.cpp

    r1498 r1543  
    6060namespace BeBoB { 
    6161 
    62 AvDevice::AvDevice( DeviceManager& d, std::auto_ptr< ConfigRom >( configRom ) ) 
    63     : GenericAVC::AvDevice( d, configRom ) 
     62Device::Device( DeviceManager& d, std::auto_ptr< ConfigRom >( configRom ) ) 
     63    : GenericAVC::Device( d, configRom ) 
    6464    , m_last_discovery_config_id ( 0xFFFFFFFFFFFFFFFFLLU ) 
    6565    , m_Mixer ( 0 ) 
    6666{ 
    67     debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::AvDevice (NodeID %d)\n", 
     67    debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::Device (NodeID %d)\n", 
    6868                 getConfigRom().getNodeId() ); 
    6969} 
    7070 
    71 AvDevice::~AvDevice() 
     71Device::~Device() 
    7272{ 
    7373    destroyMixer(); 
     
    7575 
    7676bool 
    77 AvDevice::probe( Util::Configuration& c, ConfigRom& configRom, bool generic ) 
     77Device::probe( Util::Configuration& c, ConfigRom& configRom, bool generic ) 
    7878{ 
    7979    if(generic) { 
     
    121121 
    122122FFADODevice * 
    123 AvDevice::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
     123Device::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
    124124{ 
    125125    unsigned int vendorId = configRom->getNodeVendorId(); 
     
    138138                    return new Edirol::EdirolFa66Device(d, configRom); 
    139139                default: 
    140                     return new AvDevice(d, configRom); 
     140                    return new Device(d, configRom); 
    141141            } 
    142142        case FW_VENDORID_ESI: 
     
    150150                    return new Terratec::Phase88Device(d, configRom); 
    151151                default: // return a plain BeBoB device 
    152                     return new AvDevice(d, configRom); 
     152                    return new Device(d, configRom); 
    153153            } 
    154154        case FW_VENDORID_FOCUSRITE: 
     
    160160                    return new Focusrite::SaffireDevice(d, configRom); 
    161161                default: // return a plain BeBoB device 
    162                     return new AvDevice(d, configRom); 
     162                    return new Device(d, configRom); 
    163163           } 
    164164        default: 
    165             return new AvDevice(d, configRom); 
     165            return new Device(d, configRom); 
    166166    } 
    167167    return NULL; 
     
    172172      v.push_back(x); } 
    173173bool 
    174 AvDevice::discover() 
     174Device::discover() 
    175175{ 
    176176    unsigned int vendorId = getConfigRom().getNodeVendorId(); 
     
    214214 
    215215bool 
    216 AvDevice::buildMixer() 
     216Device::buildMixer() 
    217217{ 
    218218    debugOutput(DEBUG_LEVEL_VERBOSE, "Building a generic BeBoB mixer...\n"); 
     
    234234 
    235235bool 
    236 AvDevice::destroyMixer() 
     236Device::destroyMixer() 
    237237{ 
    238238    delete m_Mixer; 
     
    241241 
    242242bool 
    243 AvDevice::setSelectorFBValue(int id, int value) { 
     243Device::setSelectorFBValue(int id, int value) { 
    244244    FunctionBlockCmd fbCmd( get1394Service(), 
    245245                            FunctionBlockCmd::eFBT_Selector, 
     
    270270 
    271271int 
    272 AvDevice::getSelectorFBValue(int id) { 
     272Device::getSelectorFBValue(int id) { 
    273273 
    274274    FunctionBlockCmd fbCmd( get1394Service(), 
     
    300300 
    301301bool 
    302 AvDevice::setFeatureFBVolumeCurrent(int id, int channel, int v) { 
     302Device::setFeatureFBVolumeCurrent(int id, int channel, int v) { 
    303303 
    304304    FunctionBlockCmd fbCmd( get1394Service(), 
     
    334334 
    335335int 
    336 AvDevice::getFeatureFBVolumeValue(int id, int channel, FunctionBlockCmd::EControlAttribute controlAttribute)  
     336Device::getFeatureFBVolumeValue(int id, int channel, FunctionBlockCmd::EControlAttribute controlAttribute)  
    337337{ 
    338338    FunctionBlockCmd fbCmd( get1394Service(), 
     
    370370 
    371371int  
    372 AvDevice::getFeatureFBVolumeMinimum(int id, int channel) 
     372Device::getFeatureFBVolumeMinimum(int id, int channel) 
    373373{ 
    374374    return getFeatureFBVolumeValue(id, channel, AVC::FunctionBlockCmd::eCA_Minimum); 
     
    376376 
    377377int  
    378 AvDevice::getFeatureFBVolumeMaximum(int id, int channel) 
     378Device::getFeatureFBVolumeMaximum(int id, int channel) 
    379379{ 
    380380    return getFeatureFBVolumeValue(id, channel, AVC::FunctionBlockCmd::eCA_Maximum); 
     
    382382 
    383383int  
    384 AvDevice::getFeatureFBVolumeCurrent(int id, int channel) 
     384Device::getFeatureFBVolumeCurrent(int id, int channel) 
    385385{ 
    386386    return getFeatureFBVolumeValue(id, channel, AVC::FunctionBlockCmd::eCA_Current);    
     
    388388 
    389389bool 
    390 AvDevice::setFeatureFBLRBalanceCurrent(int id, int channel, int v) { 
     390Device::setFeatureFBLRBalanceCurrent(int id, int channel, int v) { 
    391391 
    392392    FunctionBlockCmd fbCmd( get1394Service(), 
     
    422422 
    423423int 
    424 AvDevice::getFeatureFBLRBalanceValue(int id, int channel, FunctionBlockCmd::EControlAttribute controlAttribute)  
     424Device::getFeatureFBLRBalanceValue(int id, int channel, FunctionBlockCmd::EControlAttribute controlAttribute)  
    425425{ 
    426426    FunctionBlockCmd fbCmd( get1394Service(), 
     
    458458 
    459459int  
    460 AvDevice::getFeatureFBLRBalanceMinimum(int id, int channel) 
     460Device::getFeatureFBLRBalanceMinimum(int id, int channel) 
    461461{ 
    462462    return getFeatureFBLRBalanceValue(id, channel, AVC::FunctionBlockCmd::eCA_Minimum); 
     
    464464 
    465465int  
    466 AvDevice::getFeatureFBLRBalanceMaximum(int id, int channel) 
     466Device::getFeatureFBLRBalanceMaximum(int id, int channel) 
    467467{ 
    468468    return getFeatureFBLRBalanceValue(id, channel, AVC::FunctionBlockCmd::eCA_Maximum); 
     
    470470 
    471471int  
    472 AvDevice::getFeatureFBLRBalanceCurrent(int id, int channel) 
     472Device::getFeatureFBLRBalanceCurrent(int id, int channel) 
    473473{ 
    474474    return getFeatureFBLRBalanceValue(id, channel, AVC::FunctionBlockCmd::eCA_Current);    
     
    476476 
    477477void 
    478 AvDevice::showDevice() 
     478Device::showDevice() 
    479479{ 
    480480    debugOutput(DEBUG_LEVEL_NORMAL, "Device is a BeBoB device\n"); 
    481     GenericAVC::AvDevice::showDevice(); 
     481    GenericAVC::Device::showDevice(); 
    482482    flushDebugOutput(); 
    483483} 
    484484 
    485485void 
    486 AvDevice::setVerboseLevel(int l) 
     486Device::setVerboseLevel(int l) 
    487487{ 
    488488    if (m_Mixer) m_Mixer->setVerboseLevel( l ); 
    489     GenericAVC::AvDevice::setVerboseLevel( l ); 
     489    GenericAVC::Device::setVerboseLevel( l ); 
    490490    debugOutput( DEBUG_LEVEL_VERBOSE, "Setting verbose level to %d...\n", l ); 
    491491} 
    492492 
    493493AVC::Subunit* 
    494 AvDevice::createSubunit(AVC::Unit& unit, 
     494Device::createSubunit(AVC::Unit& unit, 
    495495                        AVC::ESubunitType type, 
    496496                        AVC::subunit_t id ) 
     
    514514 
    515515AVC::Plug * 
    516 AvDevice::createPlug( AVC::Unit* unit, 
     516Device::createPlug( AVC::Unit* unit, 
    517517                      AVC::Subunit* subunit, 
    518518                      AVC::function_block_type_t functionBlockType, 
     
    537537 
    538538bool 
    539 AvDevice::propagatePlugInfo() { 
     539Device::propagatePlugInfo() { 
    540540    // we don't have to propagate since we discover things 
    541541    // another way 
     
    545545 
    546546uint8_t 
    547 AvDevice::getConfigurationIdSampleRate() 
     547Device::getConfigurationIdSampleRate() 
    548548{ 
    549549    ExtendedStreamFormatCmd extStreamFormatCmd( get1394Service() ); 
     
    578578 
    579579uint8_t 
    580 AvDevice::getConfigurationIdNumberOfChannel( PlugAddress::EPlugDirection ePlugDirection ) 
     580Device::getConfigurationIdNumberOfChannel( PlugAddress::EPlugDirection ePlugDirection ) 
    581581{ 
    582582    ExtendedPlugInfoCmd extPlugInfoCmd( get1394Service() ); 
     
    613613 
    614614uint16_t 
    615 AvDevice::getConfigurationIdSyncMode() 
     615Device::getConfigurationIdSyncMode() 
    616616{ 
    617617    SignalSourceCmd signalSourceCmd( get1394Service() ); 
     
    659659 
    660660bool 
    661 AvDevice::needsRediscovery() 
     661Device::needsRediscovery() 
    662662{ 
    663663    // require rediscovery if the config id differs from the one saved 
     
    667667 
    668668uint64_t 
    669 AvDevice::getConfigurationId() 
     669Device::getConfigurationId() 
    670670{ 
    671671    // create a unique configuration id. 
     
    679679 
    680680bool 
    681 AvDevice::serialize( std::string basePath, 
     681Device::serialize( std::string basePath, 
    682682                     Util::IOSerialize& ser ) const 
    683683{ 
    684684    bool result; 
    685     result  = GenericAVC::AvDevice::serialize( basePath, ser ); 
     685    result  = GenericAVC::Device::serialize( basePath, ser ); 
    686686    return result; 
    687687} 
    688688 
    689689bool 
    690 AvDevice::deserialize( std::string basePath, 
     690Device::deserialize( std::string basePath, 
    691691                       Util::IODeserialize& deser ) 
    692692{ 
    693693    bool result; 
    694     result  = GenericAVC::AvDevice::deserialize( basePath, deser ); 
     694    result  = GenericAVC::Device::deserialize( basePath, deser ); 
    695695    return result; 
    696696} 
    697697 
    698698std::string 
    699 AvDevice::getCachePath() 
     699Device::getCachePath() 
    700700{ 
    701701    std::string cachePath; 
     
    719719 
    720720bool 
    721 AvDevice::loadFromCache() 
     721Device::loadFromCache() 
    722722{ 
    723723    std::string sDevicePath = getCachePath() + getConfigRom().getGuidString(); 
     
    767767 
    768768bool 
    769 AvDevice::saveCache() 
     769Device::saveCache() 
    770770{ 
    771771    // the path looks like this: 
     
    800800    // come up with an unique file name for the current settings 
    801801    char* configId; 
    802     asprintf(&configId, "%016llx", BeBoB::AvDevice::getConfigurationId() ); 
     802    asprintf(&configId, "%016llx", BeBoB::Device::getConfigurationId() ); 
    803803    if ( !configId ) { 
    804804        debugError( "Could not create id string\n" ); 
  • trunk/libffado/src/bebob/bebob_avdevice.h

    r1498 r1543  
    2222 */ 
    2323 
    24 #ifndef BEBOB_AVDEVICE_H 
    25 #define BEBOB_AVDEVICE_H 
     24#ifndef BEBOB_DEVICE_H 
     25#define BEBOB_DEVICE_H 
    2626 
    2727#include <stdint.h> 
     
    5959namespace BeBoB { 
    6060 
    61 class AvDevice : public GenericAVC::AvDevice { 
     61class Device : public GenericAVC::Device { 
    6262public: 
    63     AvDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
    64     virtual ~AvDevice(); 
     63    Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
     64    virtual ~Device(); 
    6565 
    6666    static bool probe( Util::Configuration&, ConfigRom& configRom, bool generic = false ); 
  • trunk/libffado/src/bebob/bebob_mixer.cpp

    r1498 r1543  
    5656IMPL_DEBUG_MODULE( Mixer, Mixer, DEBUG_LEVEL_NORMAL ); 
    5757 
    58 Mixer::Mixer(AvDevice &d) 
     58Mixer::Mixer(Device &d) 
    5959    : Control::Container(&d) 
    6060    , m_device(d) 
  • trunk/libffado/src/bebob/bebob_mixer.h

    r1361 r1543  
    3333namespace BeBoB { 
    3434 
    35 class AvDevice; 
     35class Device; 
    3636class FunctionBlock; 
    3737class FunctionBlockFeature; 
     
    4343{ 
    4444public: 
    45     Mixer(AvDevice &d); 
     45    Mixer(Device &d); 
    4646    virtual ~Mixer(); 
    4747 
     
    6060    bool clearElements(); 
    6161 
    62     AvDevice& getParent() 
     62    Device& getParent() 
    6363        {return m_device;}; 
    6464 
    6565protected: 
    66     AvDevice&            m_device; 
     66    Device&            m_device; 
    6767protected: 
    6868    DECLARE_DEBUG_MODULE; 
  • trunk/libffado/src/bebob/edirol/edirol_fa101.cpp

    r1498 r1543  
    2929EdirolFa101Device::EdirolFa101Device( DeviceManager& d, 
    3030                                      std::auto_ptr<ConfigRom>( configRom )) 
    31     : BeBoB::AvDevice( d , configRom) 
     31    : BeBoB::Device( d , configRom) 
    3232{ 
    3333    debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::Edirol::EdirolFa101Device (NodeID %d)\n", 
     
    7070{ 
    7171    debugOutput(DEBUG_LEVEL_VERBOSE, "This is a BeBoB::EdirolFa101::EdirolFa101Device\n"); 
    72     BeBoB::AvDevice::showDevice(); 
     72    BeBoB::Device::showDevice(); 
    7373} 
    7474 
  • trunk/libffado/src/bebob/edirol/edirol_fa101.h

    r1199 r1543  
    3030namespace Edirol { 
    3131 
    32 class EdirolFa101Device : public BeBoB::AvDevice { 
     32class EdirolFa101Device : public BeBoB::Device { 
    3333public: 
    3434    EdirolFa101Device( DeviceManager& d, 
  • trunk/libffado/src/bebob/edirol/edirol_fa66.cpp

    r1199 r1543  
    2929EdirolFa66Device::EdirolFa66Device( DeviceManager& d, 
    3030                                      std::auto_ptr<ConfigRom>( configRom )) 
    31     : BeBoB::AvDevice( d , configRom) 
     31    : BeBoB::Device( d , configRom) 
    3232{ 
    3333    debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::Edirol::EdirolFa66Device (NodeID %d)\n", 
     
    6868{ 
    6969    debugOutput(DEBUG_LEVEL_VERBOSE, "This is a BeBoB::EdirolFa66::EdirolFa66Device\n"); 
    70     BeBoB::AvDevice::showDevice(); 
     70    BeBoB::Device::showDevice(); 
    7171} 
    7272 
  • trunk/libffado/src/bebob/edirol/edirol_fa66.h

    r1199 r1543  
    3030namespace Edirol { 
    3131 
    32 class EdirolFa66Device : public BeBoB::AvDevice { 
     32class EdirolFa66Device : public BeBoB::Device { 
    3333public: 
    3434    EdirolFa66Device( DeviceManager& d, 
  • trunk/libffado/src/bebob/esi/quatafire610.cpp

    r1066 r1543  
    3030 
    3131QuataFireDevice::QuataFireDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
    32     : BeBoB::AvDevice( d, configRom) 
     32    : BeBoB::Device( d, configRom) 
    3333{ 
    3434    m_fixed_clocksource.type = FFADODevice::eCT_Auto; 
     
    5151{ 
    5252    debugOutput(DEBUG_LEVEL_VERBOSE, "This is a BeBoB::ESI::QuataFireDevice\n"); 
    53     BeBoB::AvDevice::showDevice(); 
     53    BeBoB::Device::showDevice(); 
    5454} 
    5555 
  • trunk/libffado/src/bebob/esi/quatafire610.h

    r1066 r1543  
    3131namespace ESI { 
    3232 
    33 class QuataFireDevice : public BeBoB::AvDevice { 
     33class QuataFireDevice : public BeBoB::Device { 
    3434 
    3535public: 
  • trunk/libffado/src/bebob/focusrite/focusrite_generic.cpp

    r1531 r1543  
    3131 
    3232FocusriteDevice::FocusriteDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
    33     : BeBoB::AvDevice( d, configRom) 
     33    : BeBoB::Device( d, configRom) 
    3434    , m_cmd_time_interval( 0 ) 
    3535    , m_earliest_next_cmd_time( 0 ) 
     
    4444{ 
    4545    debugOutput(DEBUG_LEVEL_NORMAL, "This is a BeBoB::Focusrite::FocusriteDevice\n"); 
    46     BeBoB::AvDevice::showDevice(); 
     46    BeBoB::Device::showDevice(); 
    4747} 
    4848 
     
    5252    debugOutput( DEBUG_LEVEL_VERBOSE, "Setting verbose level to %d...\n", l ); 
    5353 
    54     BeBoB::AvDevice::setVerboseLevel(l); 
     54    BeBoB::Device::setVerboseLevel(l); 
    5555} 
    5656 
  • trunk/libffado/src/bebob/focusrite/focusrite_generic.h

    r1531 r1543  
    216216}; 
    217217 
    218 class FocusriteDevice : public BeBoB::AvDevice { 
     218class FocusriteDevice : public BeBoB::Device { 
    219219public: 
    220220    FocusriteDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
  • trunk/libffado/src/bebob/focusrite/focusrite_saffirepro.cpp

    r1498 r1543  
    546546{ 
    547547    // have the generic mechanism create a unique configuration id. 
    548     uint64_t id = BeBoB::AvDevice::getConfigurationId(); 
     548    uint64_t id = BeBoB::Device::getConfigurationId(); 
    549549 
    550550    // there are some parts that can be enabled/disabled and 
  • trunk/libffado/src/bebob/mackie/onyxmixer.cpp

    r1498 r1543  
    3030 
    3131OnyxMixerDevice::OnyxMixerDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
    32     : BeBoB::AvDevice( d, configRom) 
     32    : BeBoB::Device( d, configRom) 
    3333{ 
    3434    m_fixed_clocksource.type = FFADODevice::eCT_Internal; 
     
    5151{ 
    5252    debugOutput(DEBUG_LEVEL_VERBOSE, "This is a BeBoB::Mackie::OnyxMixerDevice\n"); 
    53     BeBoB::AvDevice::showDevice(); 
     53    BeBoB::Device::showDevice(); 
    5454} 
    5555 
  • trunk/libffado/src/bebob/mackie/onyxmixer.h

    r1210 r1543  
    3131namespace Mackie { 
    3232 
    33 class OnyxMixerDevice : public BeBoB::AvDevice { 
     33class OnyxMixerDevice : public BeBoB::Device { 
    3434 
    3535public: 
  • trunk/libffado/src/bebob/template/vendor_device.cpp

    r864 r1543  
    2929VendorDevice::VendorDevice( Ieee1394Service& ieee1394Service, 
    3030                            std::auto_ptr<ConfigRom>( configRom )) 
    31     : BeBoB::AvDevice( ieee1394Service, configRom) 
     31    : BeBoB::Device( ieee1394Service, configRom) 
    3232{ 
    3333    debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::__Vendor__::VendorDevice (NodeID %d)\n", 
     
    4343{ 
    4444    debugOutput(DEBUG_LEVEL_VERBOSE, "This is a BeBoB::__Vendor__::VendorDevice\n"); 
    45     BeBoB::AvDevice::showDevice(); 
     45    BeBoB::Device::showDevice(); 
    4646} 
    4747 
  • trunk/libffado/src/bebob/template/vendor_device.h

    r864 r1543  
    3232namespace __Vendor__ { 
    3333 
    34 class VendorDevice : public BeBoB::AvDevice { 
     34class VendorDevice : public BeBoB::Device { 
    3535public: 
    3636    VendorDevice( Ieee1394Service& ieee1394Service, 
  • trunk/libffado/src/bebob/terratec/terratec_device.cpp

    r1245 r1543  
    2828 
    2929Phase88Device::Phase88Device(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
    30     : BeBoB::AvDevice( d, configRom) 
     30    : BeBoB::Device( d, configRom) 
    3131{ 
    3232    debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::Terratec::Phase88Device (NodeID %d)\n", 
     
    4343{ 
    4444    debugOutput(DEBUG_LEVEL_NORMAL, "This is a BeBoB::Terratec::Phase88Device\n"); 
    45     BeBoB::AvDevice::showDevice(); 
     45    BeBoB::Device::showDevice(); 
    4646} 
    4747/*                'externalsync': ['/Mixer/Selector_8', self.comboExtSync],  
  • trunk/libffado/src/bebob/terratec/terratec_device.h

    r1245 r1543  
    3232namespace Terratec { 
    3333 
    34 class Phase88Device : public BeBoB::AvDevice { 
     34class Phase88Device : public BeBoB::Device { 
    3535public: 
    3636    Phase88Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
  • trunk/libffado/src/bounce/bounce_avdevice.cpp

    r1239 r1543  
    2828#include "libieee1394/ieee1394service.h" 
    2929 
    30 #include "libavc/general/avc_plug_info.h" 
    31 #include "libavc/general/avc_extended_plug_info.h" 
    32 #include "libavc/general/avc_subunit_info.h" 
    33 #include "libavc/streamformat/avc_extended_stream_format.h" 
    34 #include "libutil/cmd_serialize.h" 
    35 #include "libavc/avc_definitions.h" 
     30#include "libutil/Configuration.h" 
    3631 
    3732#include "debugmodule/debugmodule.h" 
     33 
     34#include "devicemanager.h" 
    3835 
    3936#include <iostream> 
     
    4643namespace Bounce { 
    4744 
    48 // to define the supported devices 
    49 static VendorModelEntry supportedDeviceList[] = 
    50 
    51     {FW_VENDORID_FFADO, 0x0B0001LU, 0x0B0001LU, "FFADO", "Bounce"}, 
    52 }; 
    53  
    54 BounceDevice::BounceDevice( Ieee1394Service& ieee1394Service, 
    55                             std::auto_ptr<ConfigRom>( configRom )) 
    56     : FFADODevice( ieee1394Service, configRom ) 
     45Device::Device( DeviceManager& d, std::auto_ptr< ConfigRom >( configRom ) ) 
     46    : FFADODevice( d, configRom ) 
    5747    , m_samplerate (44100) 
    58     , m_model( NULL ) 
    5948    , m_Notifier ( NULL ) 
    6049{ 
    61     debugOutput( DEBUG_LEVEL_VERBOSE, "Created Bounce::BounceDevice (NodeID %d)\n", 
     50    debugOutput( DEBUG_LEVEL_VERBOSE, "Created Bounce::Device (NodeID %d)\n", 
    6251                 getConfigRom().getNodeId() ); 
    6352    addOption(Util::OptionContainer::Option("snoopMode",false)); 
    6453} 
    6554 
    66 BounceDevice::~BounceDevice() 
    67 
    68  
    69 
    70  
    71 bool 
    72 BounceDevice::probe( ConfigRom& configRom, bool generic ) 
    73 
    74     if (generic) return false; 
    75  
    76     debugOutput( DEBUG_LEVEL_VERBOSE, "probing BounceDevice\n"); 
    77 //     unsigned int vendorId = configRom.getNodeVendorId(); 
    78     unsigned int modelId = configRom.getModelId(); 
    79     unsigned int unitSpecifierId = configRom.getUnitSpecifierId(); 
    80     debugOutput( DEBUG_LEVEL_VERBOSE, "modelId = 0x%08X, specid = 0x%08X\n", modelId, unitSpecifierId); 
    81  
    82     for ( unsigned int i = 0; 
    83           i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); 
    84           ++i ) 
    85     { 
    86         if ( 
    87 //             ( supportedDeviceList[i].vendor_id == vendorId ) 
    88              ( supportedDeviceList[i].model_id == modelId ) 
    89              && ( supportedDeviceList[i].unit_specifier_id == unitSpecifierId ) 
    90            ) 
    91         { 
    92             return true; 
    93         } 
    94     } 
    95  
     55Device::~Device() 
     56
     57 
     58
     59 
     60bool 
     61Device::probe( Util::Configuration& c, ConfigRom& configRom, bool generic ) 
     62
     63    if(generic) { 
     64        return false; 
     65    } else { 
     66        // check if device is in supported devices list 
     67        unsigned int vendorId = configRom.getNodeVendorId(); 
     68        unsigned int modelId = configRom.getModelId(); 
     69 
     70        Util::Configuration::VendorModelEntry vme = c.findDeviceVME( vendorId, modelId ); 
     71        return c.isValid(vme) && vme.driver == Util::Configuration::eD_Bounce; 
     72    } 
    9673    return false; 
    9774} 
    9875 
    9976FFADODevice * 
    100 BounceDevice::createDevice( Ieee1394Service& ieee1394Service, 
    101                             std::auto_ptr<ConfigRom>( configRom )) 
    102 
    103     return new BounceDevice(ieee1394Service, configRom ); 
    104 
    105  
    106 bool 
    107 BounceDevice::discover() 
    108 
    109     debugOutput( DEBUG_LEVEL_VERBOSE, "discovering BounceDevice (NodeID %d)\n", 
     77Device::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
     78
     79    return new Device(d, configRom ); 
     80
     81 
     82bool 
     83Device::discover() 
     84
     85    debugOutput( DEBUG_LEVEL_VERBOSE, "discovering Device (NodeID %d)\n", 
    11086                 getNodeId() ); 
    11187 
    112 //     unsigned int vendorId = m_pConfigRom->getNodeVendorId(); 
    113     unsigned int modelId = m_pConfigRom->getModelId(); 
    114     unsigned int unitSpecifierId = m_pConfigRom->getUnitSpecifierId(); 
    115  
    116     for ( unsigned int i = 0; 
    117           i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); 
    118           ++i ) 
    119     { 
    120         if ( //( supportedDeviceList[i].vendor_id == vendorId ) 
    121              ( supportedDeviceList[i].model_id == modelId ) 
    122              && ( supportedDeviceList[i].unit_specifier_id == unitSpecifierId ) 
    123            ) 
    124         { 
    125             m_model = &(supportedDeviceList[i]); 
    126         } 
    127     } 
    128  
    129     if (m_model != NULL) { 
     88    unsigned int vendorId = getConfigRom().getNodeVendorId(); 
     89    unsigned int modelId = getConfigRom().getModelId(); 
     90 
     91    Util::Configuration &c = getDeviceManager().getConfiguration(); 
     92    Util::Configuration::VendorModelEntry vme = c.findDeviceVME( vendorId, modelId ); 
     93 
     94    if (c.isValid(vme) && vme.driver == Util::Configuration::eD_Bounce) { 
    13095        debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", 
    131                 m_model->vendor_name, m_model->model_name); 
    132         return true; 
    133     } 
    134     return false; 
    135 
    136  
    137 int BounceDevice::getSamplingFrequency( ) { 
     96                     vme.vendor_name.c_str(), 
     97                     vme.model_name.c_str()); 
     98    } else { 
     99        debugWarning("Using generic Bounce support for unsupported device '%s %s'\n", 
     100                     getConfigRom().getVendorName().c_str(), getConfigRom().getModelName().c_str()); 
     101    } 
     102    return true; 
     103
     104 
     105int Device::getSamplingFrequency( ) { 
    138106    return m_samplerate; 
    139107} 
    140108 
    141 bool BounceDevice::setSamplingFrequency( int s ) { 
     109bool Device::setSamplingFrequency( int s ) { 
    142110    if (s) { 
    143111        m_samplerate=s; 
     
    147115 
    148116FFADODevice::ClockSourceVector 
    149 BounceDevice::getSupportedClockSources() { 
     117Device::getSupportedClockSources() { 
    150118    FFADODevice::ClockSourceVector r; 
    151119    return r; 
     
    153121 
    154122bool 
    155 BounceDevice::setActiveClockSource(ClockSource s) { 
     123Device::setActiveClockSource(ClockSource s) { 
    156124    return false; 
    157125} 
    158126 
    159127FFADODevice::ClockSource 
    160 BounceDevice::getActiveClockSource() { 
     128Device::getActiveClockSource() { 
    161129    ClockSource s; 
    162130    return s; 
    163131} 
    164132 
    165 int BounceDevice::getConfigurationId( ) { 
    166     return 0; 
    167 
    168  
    169  
    170 bool 
    171 BounceDevice::lock() { 
    172  
    173     return true; 
    174 
    175  
    176  
    177 bool 
    178 BounceDevice::unlock() { 
     133std::vector<int> 
     134Device::getSupportedSamplingFrequencies() 
     135
     136    std::vector<int> frequencies; 
     137    return frequencies; 
     138
     139 
     140 
     141bool 
     142Device::lock() { 
     143 
     144    return true; 
     145
     146 
     147 
     148bool 
     149Device::unlock() { 
    179150 
    180151    return true; 
     
    182153 
    183154void 
    184 BounceDevice::showDevice() 
    185 
     155Device::showDevice() 
     156
     157 
    186158    debugOutput(DEBUG_LEVEL_NORMAL, "\nI am the bouncedevice, the bouncedevice I am...\n" ); 
    187     debugOutput(DEBUG_LEVEL_NORMAL, "Vendor            :  %s\n", m_pConfigRom->getVendorName().c_str()); 
    188     debugOutput(DEBUG_LEVEL_NORMAL, "Model             :  %s\n", m_pConfigRom->getModelName().c_str()); 
    189     debugOutput(DEBUG_LEVEL_NORMAL, "Vendor Name       :  %s\n", m_model->vendor_name); 
    190     debugOutput(DEBUG_LEVEL_NORMAL, "Model Name        :  %s\n", m_model->model_name); 
     159    debugOutput(DEBUG_LEVEL_NORMAL, "Vendor            :  %s\n", getConfigRom().getVendorName().c_str()); 
     160    debugOutput(DEBUG_LEVEL_NORMAL, "Model             :  %s\n", getConfigRom().getModelName().c_str()); 
    191161    debugOutput(DEBUG_LEVEL_NORMAL, "Node              :  %d\n", getNodeId()); 
    192     debugOutput(DEBUG_LEVEL_NORMAL, "GUID              :  0x%016llX\n", m_pConfigRom->getGuid()); 
     162    debugOutput(DEBUG_LEVEL_NORMAL, "GUID              :  0x%016llX\n", getConfigRom().getGuid()); 
    193163    debugOutput(DEBUG_LEVEL_NORMAL, "\n" ); 
    194164} 
    195165 
    196166bool 
    197 BounceDevice::addPortsToProcessor( 
     167Device::addPortsToProcessor( 
    198168    Streaming::StreamProcessor *processor, 
    199169    Streaming::Port::E_Direction direction) { 
     
    257227 
    258228bool 
    259 BounceDevice::prepare() { 
    260     debugOutput(DEBUG_LEVEL_NORMAL, "Preparing BounceDevice...\n" ); 
     229Device::prepare() { 
     230    debugOutput(DEBUG_LEVEL_NORMAL, "Preparing Device...\n" ); 
    261231 
    262232    bool snoopMode=false; 
     
    268238    Streaming::StreamProcessor *p; 
    269239 
    270     p=new Streaming::AmdtpReceiveStreamProcessor( 
    271                              m_p1394Service->getPort(), 
    272                              m_samplerate, 
     240    p=new Streaming::AmdtpReceiveStreamProcessor(*this, 
    273241                             BOUNCE_NB_AUDIO_CHANNELS+(BOUNCE_NB_MIDI_CHANNELS?1:0)); 
    274242 
     
    291259    if (snoopMode) { 
    292260        // we are snooping, so this is receive too. 
    293         p=new Streaming::AmdtpReceiveStreamProcessor( 
    294                                 m_p1394Service->getPort(), 
    295                                 m_samplerate, 
     261        p=new Streaming::AmdtpReceiveStreamProcessor(*this, 
    296262                                BOUNCE_NB_AUDIO_CHANNELS+(BOUNCE_NB_MIDI_CHANNELS?1:0)); 
    297263    } else { 
    298         p=new Streaming::AmdtpTransmitStreamProcessor( 
    299                                 m_p1394Service->getPort(), 
    300                                 m_samplerate, 
     264        p=new Streaming::AmdtpTransmitStreamProcessor(*this, 
    301265                                BOUNCE_NB_AUDIO_CHANNELS+(BOUNCE_NB_MIDI_CHANNELS?1:0)); 
    302266    } 
     
    331295 
    332296int 
    333 BounceDevice::getStreamCount() { 
     297Device::getStreamCount() { 
    334298    return m_receiveProcessors.size() + m_transmitProcessors.size(); 
    335299} 
    336300 
    337301Streaming::StreamProcessor * 
    338 BounceDevice::getStreamProcessorByIndex(int i) { 
     302Device::getStreamProcessorByIndex(int i) { 
    339303    if (i<(int)m_receiveProcessors.size()) { 
    340304        return m_receiveProcessors.at(i); 
     
    347311 
    348312bool 
    349 BounceDevice::startStreamByIndex(int i) { 
     313Device::startStreamByIndex(int i) { 
    350314    if (i<(int)m_receiveProcessors.size()) { 
    351315        int n=i; 
     
    431395 
    432396bool 
    433 BounceDevice::stopStreamByIndex(int i) { 
     397Device::stopStreamByIndex(int i) { 
    434398    if (i<(int)m_receiveProcessors.size()) { 
    435399        int n=i; 
     
    505469 
    506470// allocate ISO resources for the SP's 
    507 int BounceDevice::allocateIsoChannel(unsigned int packet_size) { 
     471int Device::allocateIsoChannel(unsigned int packet_size) { 
    508472    unsigned int bandwidth=8+packet_size; 
    509473 
    510     int ch=m_p1394Service->allocateIsoChannelGeneric(bandwidth); 
     474    int ch=get1394Service().allocateIsoChannelGeneric(bandwidth); 
    511475 
    512476    debugOutput(DEBUG_LEVEL_VERBOSE, "allocated channel %d, bandwidth %d\n", 
     
    516480} 
    517481// deallocate ISO resources 
    518 bool BounceDevice::deallocateIsoChannel(int channel) { 
     482bool Device::deallocateIsoChannel(int channel) { 
    519483    debugOutput(DEBUG_LEVEL_VERBOSE, "freeing channel %d\n",channel); 
    520     return m_p1394Service->freeIsoChannel(channel); 
     484    return get1394Service().freeIsoChannel(channel); 
    521485} 
    522486 
     
    524488 
    525489bool 
    526 BounceDevice::readReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 
     490Device::readReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 
    527491    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX\n", offset); 
    528492 
     
    535499    fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 
    536500 
    537     if(!m_p1394Service->read_quadlet( nodeId, addr, result ) ) { 
     501    if(!get1394Service().read_quadlet( nodeId, addr, result ) ) { 
    538502        debugError("Could not read from node 0x%04X addr 0x%012X\n", nodeId, addr); 
    539503        return false; 
     
    545509 
    546510bool 
    547 BounceDevice::writeReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 
     511Device::writeReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 
    548512    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, data: 0x%08X\n", 
    549513        offset, data); 
     
    557521    fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 
    558522 
    559     if(!m_p1394Service->write_quadlet( nodeId, addr, data ) ) { 
     523    if(!get1394Service().write_quadlet( nodeId, addr, data ) ) { 
    560524        debugError("Could not write to node 0x%04X addr 0x%012X\n", nodeId, addr); 
    561525        return false; 
     
    565529 
    566530bool 
    567 BounceDevice::readRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
     531Device::readRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    568532    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX, length %u\n", 
    569533        offset, length); 
     
    577541    fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 
    578542 
    579     if(!m_p1394Service->read( nodeId, addr, length, data ) ) { 
     543    if(!get1394Service().read( nodeId, addr, length, data ) ) { 
    580544        debugError("Could not read from node 0x%04X addr 0x%012llX\n", nodeId, addr); 
    581545        return false; 
     
    585549 
    586550bool 
    587 BounceDevice::writeRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
     551Device::writeRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    588552    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, length: %u\n", 
    589553        offset, length); 
     
    597561    fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 
    598562 
    599     if(!m_p1394Service->write( nodeId, addr, length, data ) ) { 
     563    if(!get1394Service().write( nodeId, addr, length, data ) ) { 
    600564        debugError("Could not write to node 0x%04X addr 0x%012llX\n", nodeId, addr); 
    601565        return false; 
  • trunk/libffado/src/bounce/bounce_avdevice.h

    r1239 r1543  
    5353 
    5454class ConfigRom; 
    55 class Ieee1394Service
     55class DeviceManager
    5656 
    5757namespace Bounce { 
    5858 
    59 // struct to define the supported devices 
    60 struct VendorModelEntry { 
    61     uint32_t vendor_id; 
    62     uint32_t model_id; 
    63     uint32_t unit_specifier_id; 
    64     char *vendor_name; 
    65     char *model_name; 
    66 }; 
    67  
    68 class BounceDevice : public FFADODevice { 
     59class Device : public FFADODevice { 
    6960private: 
    7061    class BounceNotifier; 
    7162public: 
    72     BounceDevice( Ieee1394Service& ieee1394Service, 
    73                   std::auto_ptr<ConfigRom>( configRom )); 
    74     virtual ~BounceDevice(); 
     63    Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
     64    virtual ~Device(); 
    7565 
    76     static bool probe( ConfigRom& configRom, bool generic = false ); 
    77     static FFADODevice * createDevice( Ieee1394Service& ieee1394Service, 
    78                                         std::auto_ptr<ConfigRom>( configRom )); 
    79     static int getConfigurationId( ); 
     66    static bool probe( Util::Configuration&, ConfigRom& configRom, bool generic = false ); 
     67    static FFADODevice * createDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
    8068    virtual bool discover(); 
    8169 
     
    8674    virtual bool setActiveClockSource(ClockSource); 
    8775    virtual ClockSource getActiveClockSource(); 
     76 
     77    virtual std::vector<int> getSupportedSamplingFrequencies(); 
    8878 
    8979    virtual bool prepare(); 
     
    10292protected: 
    10393    unsigned int m_samplerate; 
    104     struct VendorModelEntry* m_model; 
    10594 
    10695    // streaming stuff 
     
    135124    { 
    136125    public: 
    137         BounceNotifier(BounceDevice *, nodeaddr_t start); 
     126        BounceNotifier(Device *, nodeaddr_t start); 
    138127        virtual ~BounceNotifier(); 
    139128 
    140129    private: 
    141         BounceDevice *m_bouncedevice; 
     130        Device *m_bouncedevice; 
    142131    }; 
    143132}; 
  • trunk/libffado/src/bounce/bounce_slave_avdevice.cpp

    r1136 r1543  
    2323 */ 
    2424 
    25 #include "libstreaming/amdtp/AmdtpSlaveStreamProcessor.h" 
     25#include "libstreaming/amdtp/AmdtpReceiveStreamProcessor.h" 
     26#include "libstreaming/amdtp/AmdtpTransmitStreamProcessor.h" 
    2627 
    2728#include "libieee1394/configrom.h" 
     
    3738namespace Bounce { 
    3839 
    39 static VendorModelEntry supportedDeviceList[] = 
    40 
    41   //{vendor_id, model_id, unit_specifier_id, vendor_name, model_name}, 
    42     {FW_VENDORID_FFADO, 0x0B0001, 0x0B0001, "FFADO", "Bounce Slave"}, 
    43 }; 
    44  
    45 BounceSlaveDevice::BounceSlaveDevice( Ieee1394Service& ieee1394Service, 
    46                                       std::auto_ptr<ConfigRom>( configRom )) 
    47     : BounceDevice( ieee1394Service, configRom ) 
     40SlaveDevice::SlaveDevice( DeviceManager& d, std::auto_ptr< ConfigRom >( configRom ) ) 
     41    : Device( d, configRom ) 
    4842{ 
    4943    addOption(Util::OptionContainer::Option("isoTimeoutSecs",(int64_t)120)); 
    5044} 
    5145 
    52 BounceSlaveDevice::~BounceSlaveDevice() { 
    53  
    54 } 
    55  
    56 bool 
    57 BounceSlaveDevice::probe( ConfigRom& configRom
     46SlaveDevice::~SlaveDevice() { 
     47 
     48} 
     49 
     50bool 
     51SlaveDevice::probe( Util::Configuration& c, ConfigRom& configRom, bool generic
    5852{ 
    5953    // we are always capable of constructing a slave device 
     
    6256 
    6357FFADODevice * 
    64 BounceSlaveDevice::createDevice( Ieee1394Service& ieee1394Service, 
    65                             std::auto_ptr<ConfigRom>( configRom )) 
    66 
    67     return new BounceSlaveDevice(ieee1394Service, configRom ); 
    68 
    69  
    70 bool 
    71 BounceSlaveDevice::discover() 
    72 
    73     m_model = &(supportedDeviceList[0]); 
    74     if (m_model != NULL) { 
    75         debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", 
    76                 m_model->vendor_name, m_model->model_name); 
    77         return true; 
    78     } 
    79     return false; 
    80 
    81  
    82 bool BounceSlaveDevice::initMemSpace() { 
     58SlaveDevice::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
     59
     60    return new SlaveDevice(d, configRom ); 
     61
     62 
     63bool 
     64SlaveDevice::discover() 
     65
     66    return true; 
     67
     68 
     69bool SlaveDevice::initMemSpace() { 
    8370    debugOutput(DEBUG_LEVEL_VERBOSE, "Initializing memory space...\n"); 
    8471    fb_quadlet_t result=0xFFFFFFFFLU; 
     
    9683 
    9784    // set everything such that we can be discovered 
    98     m_original_config_rom=save_config_rom( m_p1394Service->getHandle() ); 
    99  
    100     if ( init_config_rom( m_p1394Service->getHandle() ) < 0 ) { 
     85    m_original_config_rom = save_config_rom( get1394Service().getHandle() ); 
     86 
     87    if ( init_config_rom( get1394Service().getHandle() ) < 0 ) { 
    10188        debugError("Could not initalize local config rom\n"); 
    10289        return false; 
     
    10491 
    10592    // refresh our config rom cache 
    106     if ( !m_pConfigRom->initialize() ) { 
     93    if ( !getConfigRom().initialize() ) { 
    10794        // \todo If a PHY on the bus is in power safe mode then 
    10895        // the config rom is missing. So this might be just 
     
    117104} 
    118105 
    119 bool BounceSlaveDevice::restoreMemSpace() { 
     106bool SlaveDevice::restoreMemSpace() { 
    120107    debugOutput(DEBUG_LEVEL_VERBOSE, "Restoring memory space...\n"); 
    121     restore_config_rom( m_p1394Service->getHandle(), m_original_config_rom); 
    122     return true; 
    123 
    124  
    125 bool 
    126 BounceSlaveDevice::lock() { 
    127     debugOutput(DEBUG_LEVEL_VERBOSE, "Locking %s %s at node %d\n", 
    128         m_model->vendor_name, m_model->model_name, getNodeId()); 
     108    restore_config_rom( get1394Service().getHandle(), m_original_config_rom); 
     109    return true; 
     110
     111 
     112bool 
     113SlaveDevice::lock() { 
     114    debugOutput(DEBUG_LEVEL_VERBOSE, "Locking node %d\n", getNodeId()); 
    129115 
    130116    // get a notifier to handle device notifications 
    131117    nodeaddr_t notify_address; 
    132     notify_address = m_p1394Service->findFreeARMBlock( 
     118    notify_address = get1394Service().findFreeARMBlock( 
    133119                        BOUNCE_REGISTER_BASE, 
    134120                        BOUNCE_REGISTER_LENGTH, 
     
    140126    } 
    141127 
    142     m_Notifier=new BounceSlaveDevice::BounceSlaveNotifier(this, notify_address); 
     128    m_Notifier=new SlaveDevice::BounceSlaveNotifier(this, notify_address); 
    143129 
    144130    if(!m_Notifier) { 
     
    147133    } 
    148134 
    149     if (!m_p1394Service->registerARMHandler(m_Notifier)) { 
     135    if (!get1394Service().registerARMHandler(m_Notifier)) { 
    150136        debugError("Could not register notifier\n"); 
    151137        delete m_Notifier; 
     
    164150 
    165151bool 
    166 BounceSlaveDevice::unlock() { 
     152SlaveDevice::unlock() { 
    167153    // (re)initialize the memory space 
    168154    if (!restoreMemSpace()) { 
     
    170156        return false; 
    171157    } 
    172     m_p1394Service->unregisterARMHandler(m_Notifier); 
     158    get1394Service().unregisterARMHandler(m_Notifier); 
    173159    delete m_Notifier; 
    174160    m_Notifier=NULL; 
     
    178164 
    179165bool 
    180 BounceSlaveDevice::prepare() { 
    181     debugOutput(DEBUG_LEVEL_NORMAL, "Preparing BounceSlaveDevice...\n" ); 
     166SlaveDevice::prepare() { 
     167    debugOutput(DEBUG_LEVEL_NORMAL, "Preparing SlaveDevice...\n" ); 
    182168 
    183169    // create & add streamprocessors 
    184170    Streaming::StreamProcessor *p; 
    185171 
    186     p=new Streaming::AmdtpSlaveReceiveStreamProcessor( 
    187                              m_p1394Service->getPort(), 
    188                              m_samplerate, 
    189                              BOUNCE_NB_AUDIO_CHANNELS); 
     172    p = new Streaming::AmdtpReceiveStreamProcessor(*this, 
     173                       BOUNCE_NB_AUDIO_CHANNELS+(BOUNCE_NB_MIDI_CHANNELS?1:0)); 
    190174 
    191175    if(!p->init()) { 
     
    205189 
    206190    // do the transmit processor 
    207     p=new Streaming::AmdtpSlaveTransmitStreamProcessor( 
    208                                 m_p1394Service->getPort(), 
    209                                 m_samplerate, 
    210                                 BOUNCE_NB_AUDIO_CHANNELS); 
     191    p = new Streaming::AmdtpTransmitStreamProcessor(*this,  
     192                       BOUNCE_NB_AUDIO_CHANNELS+(BOUNCE_NB_MIDI_CHANNELS?1:0)); 
    211193 
    212194    if(!p->init()) { 
     
    229211// this has to wait until the ISO channel numbers are written 
    230212bool 
    231 BounceSlaveDevice::startStreamByIndex(int i) { 
     213SlaveDevice::startStreamByIndex(int i) { 
    232214 
    233215    if (i<(int)m_receiveProcessors.size()) { 
     
    258240    } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 
    259241        int n=i-m_receiveProcessors.size(); 
    260         Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 
     242        Streaming::StreamProcessor *p = m_transmitProcessors.at(n); 
    261243 
    262244        // the other side sends on this channel 
     
    289271 
    290272bool 
    291 BounceSlaveDevice::stopStreamByIndex(int i) { 
     273SlaveDevice::stopStreamByIndex(int i) { 
    292274    // nothing special to do I guess... 
    293275    return false; 
     
    296278// helpers 
    297279bool 
    298 BounceSlaveDevice::waitForRegisterNotEqualTo(nodeaddr_t offset, fb_quadlet_t v) { 
     280SlaveDevice::waitForRegisterNotEqualTo(nodeaddr_t offset, fb_quadlet_t v) { 
    299281    debugOutput( DEBUG_LEVEL_VERBOSE, "Waiting for StreamProcessor streams to start running...\n"); 
    300282    // we have to wait until all streamprocessors indicate that they are running 
     
    329311 
    330312 
    331 struct BounceSlaveDevice::configrom_backup 
    332 BounceSlaveDevice::save_config_rom(raw1394handle_t handle) 
     313struct SlaveDevice::configrom_backup 
     314SlaveDevice::save_config_rom(raw1394handle_t handle) 
    333315{ 
    334316    int retval; 
     
    343325 
    344326int 
    345 BounceSlaveDevice::restore_config_rom(raw1394handle_t handle, struct BounceSlaveDevice::configrom_backup old) 
     327SlaveDevice::restore_config_rom(raw1394handle_t handle, struct SlaveDevice::configrom_backup old) 
    346328{ 
    347329    int retval; 
     
    375357 
    376358int 
    377 BounceSlaveDevice::init_config_rom(raw1394handle_t handle) 
     359SlaveDevice::init_config_rom(raw1394handle_t handle) 
    378360{ 
    379361    int retval, i; 
     
    461443// the notifier 
    462444 
    463 BounceSlaveDevice::BounceSlaveNotifier::BounceSlaveNotifier(BounceSlaveDevice *d, nodeaddr_t start) 
     445SlaveDevice::BounceSlaveNotifier::BounceSlaveNotifier(SlaveDevice *d, nodeaddr_t start) 
    464446 : ARMHandler(start, BOUNCE_REGISTER_LENGTH, 
    465447              RAW1394_ARM_READ | RAW1394_ARM_WRITE, // allowed operations 
     
    471453} 
    472454 
    473 BounceSlaveDevice::BounceSlaveNotifier::~BounceSlaveNotifier() 
     455SlaveDevice::BounceSlaveNotifier::~BounceSlaveNotifier() 
    474456{ 
    475457 
  • trunk/libffado/src/bounce/bounce_slave_avdevice.h

    r864 r1543  
    4141namespace Bounce { 
    4242 
    43 class BounceSlaveDevice : public BounceDevice { 
     43class SlaveDevice : public Device { 
    4444    class BounceSlaveNotifier; 
    4545public: 
    4646 
    47     BounceSlaveDevice( Ieee1394Service& ieee1394Service, 
    48                        std::auto_ptr<ConfigRom>( configRom )); 
    49     virtual ~BounceSlaveDevice(); 
     47    SlaveDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom ) ); 
     48    virtual ~SlaveDevice(); 
    5049 
    51     static bool probe( ConfigRom& configRom ); 
    52     static FFADODevice * createDevice( Ieee1394Service& ieee1394Service, 
    53                                         std::auto_ptr<ConfigRom>( configRom )); 
     50    static bool probe( Util::Configuration&, ConfigRom& configRom, bool generic = false ); 
     51    static FFADODevice * createDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
     52 
    5453    bool discover(); 
    5554    bool prepare(); 
     
    8281    BounceSlaveNotifier *m_Notifier; 
    8382    /** 
    84      * this class reacts on the ohter side writing to the 
     83     * this class reacts on the other side writing to the 
    8584     * hosts address space 
    8685     */ 
     
    8887    { 
    8988    public: 
    90         BounceSlaveNotifier(BounceSlaveDevice *, nodeaddr_t start); 
     89        BounceSlaveNotifier(SlaveDevice *, nodeaddr_t start); 
    9190        virtual ~BounceSlaveNotifier(); 
    9291 
    9392    private: 
    94         BounceSlaveDevice *m_bounceslavedevice; 
     93        SlaveDevice *m_bounceslavedevice; 
    9594    }; 
    9695}; 
  • trunk/libffado/src/devicemanager.cpp

    r1539 r1543  
    4343#ifdef ENABLE_BEBOB 
    4444#include "bebob/bebob_avdevice.h" 
     45#endif 
     46 
     47#ifdef ENABLE_MAUDIO 
    4548#include "maudio/maudio_avdevice.h" 
    4649#endif 
     
    933936#ifdef ENABLE_BEBOB 
    934937    debugOutput( DEBUG_LEVEL_VERBOSE, "Trying BeBoB...\n" ); 
    935     if ( BeBoB::AvDevice::probe( getConfiguration(), *configRom, generic ) ) { 
    936         return BeBoB::AvDevice::createDevice( *this, std::auto_ptr<ConfigRom>( configRom ) ); 
     938    if ( BeBoB::Device::probe( getConfiguration(), *configRom, generic ) ) { 
     939        return BeBoB::Device::createDevice( *this, std::auto_ptr<ConfigRom>( configRom ) ); 
    937940    } 
    938941#endif 
     
    952955#endif 
    953956 
     957#ifdef ENABLE_MAUDIO 
     958    debugOutput( DEBUG_LEVEL_VERBOSE, "Trying M-Audio...\n" ); 
     959    if ( MAudio::Device::probe( getConfiguration(), *configRom, generic ) ) { 
     960        return MAudio::Device::createDevice( *this, std::auto_ptr<ConfigRom>( configRom ) ); 
     961    } 
     962#endif 
     963 
    954964// we want to try the non-generic AV/C platforms before trying the generic ones 
    955965#ifdef ENABLE_GENERICAVC 
    956966    debugOutput( DEBUG_LEVEL_VERBOSE, "Trying Generic AV/C...\n" ); 
    957     if ( GenericAVC::AvDevice::probe( getConfiguration(), *configRom, generic ) ) { 
    958         return GenericAVC::AvDevice::createDevice( *this, std::auto_ptr<ConfigRom>( configRom ) ); 
     967    if ( GenericAVC::Device::probe( getConfiguration(), *configRom, generic ) ) { 
     968        return GenericAVC::Device::createDevice( *this, std::auto_ptr<ConfigRom>( configRom ) ); 
    959969    } 
    960970#endif 
     
    969979#ifdef ENABLE_DICE 
    970980    debugOutput( DEBUG_LEVEL_VERBOSE, "Trying Dice...\n" ); 
    971     if ( Dice::DiceAvDevice::probe( *configRom, generic ) ) { 
    972         return Dice::DiceAvDevice::createDevice( *this, std::auto_ptr<ConfigRom>( configRom ) ); 
     981    if ( Dice::Device::probe( getConfiguration(), *configRom, generic ) ) { 
     982        return Dice::Device::createDevice( *this, std::auto_ptr<ConfigRom>( configRom ) ); 
    973983    } 
    974984#endif 
     
    976986#ifdef ENABLE_METRIC_HALO 
    977987    debugOutput( DEBUG_LEVEL_VERBOSE, "Trying Metric Halo...\n" ); 
    978     if ( MetricHalo::MHAvDevice::probe( *configRom, generic ) ) { 
    979         return MetricHalo::MHAvDevice::createDevice( *this, std::auto_ptr<ConfigRom>( configRom ) ); 
     988    if ( MetricHalo::Device::probe( getConfiguration(), *configRom, generic ) ) { 
     989        return MetricHalo::Device::createDevice( *this, std::auto_ptr<ConfigRom>( configRom ) ); 
    980990    } 
    981991#endif 
     
    983993#ifdef ENABLE_RME 
    984994    debugOutput( DEBUG_LEVEL_VERBOSE, "Trying RME...\n" ); 
    985     if ( Rme::RmeDevice::probe( *configRom, generic ) ) { 
    986         return Rme::RmeDevice::createDevice( *this, std::auto_ptr<ConfigRom>( configRom ) ); 
     995    if ( Rme::Device::probe( getConfiguration(), *configRom, generic ) ) { 
     996        return Rme::Device::createDevice( *this, std::auto_ptr<ConfigRom>( configRom ) ); 
    987997    } 
    988998#endif 
     
    9901000#ifdef ENABLE_BOUNCE 
    9911001    debugOutput( DEBUG_LEVEL_VERBOSE, "Trying Bounce...\n" ); 
    992     if ( Bounce::BounceDevice::probe( *configRom, generic ) ) { 
    993         return Bounce::BounceDevice::createDevice( *this, std::auto_ptr<ConfigRom>( configRom ) ); 
     1002    if ( Bounce::Device::probe( getConfiguration(), *configRom, generic ) ) { 
     1003        return Bounce::Device::createDevice( *this, std::auto_ptr<ConfigRom>( configRom ) ); 
    9941004    } 
    9951005#endif 
     
    10251035{ 
    10261036#ifdef ENABLE_BOUNCE 
    1027     if ( Bounce::BounceSlaveDevice::probe( *configRom.get() ) ) { 
    1028         return Bounce::BounceSlaveDevice::createDevice( configRom ); 
     1037    if ( Bounce::SlaveDevice::probe( getConfiguration(), *configRom, false ) ) { 
     1038        return Bounce::SlaveDevice::createDevice(  *this, std::auto_ptr<ConfigRom>( configRom ) ); 
    10291039    } 
    10301040#endif 
  • trunk/libffado/src/dice/dice_avdevice.cpp

    r1539 r1543  
    5050namespace Dice { 
    5151 
    52 // to define the supported devices 
    53 static VendorModelEntry supportedDeviceList[] = 
    54 
    55     // vendor id, model id, vendor name, model name 
    56     {FW_VENDORID_TCAT,   0x00000001, "TCAT", "DiceII EVM"}, 
    57     {FW_VENDORID_TCAT,   0x00000002, "TCAT", "DiceII EVM"}, 
    58     {FW_VENDORID_TCAT,   0x00000004, "TCAT", "DiceII EVM (vxx)"}, 
    59     {FW_VENDORID_TCAT,   0x00000021, "TC Electronic", "Konnekt 8"}, 
    60     {FW_VENDORID_TCAT,   0x00000023, "TC Electronic", "Konnekt Live"}, 
    61     {FW_VENDORID_ALESIS, 0x00000001, "Alesis", "io|14"}, 
    62     {FW_VENDORID_ALESIS, 0x00000000, "Alesis", "Multimix16 Firewire"}, 
    63     {FW_VENDORID_PRESONUS, 0x0000000b, "Presonus", "Firestudio Project"}, 
    64     {FW_VENDORID_FOCUSRITE, 0x00000005, "Focusrite", "Saffire PRO 40"}, 
    65     {FW_VENDORID_WEISS, 0x00000001, "Weiss Engineering Ltd.", "ADC 2"}, 
    66     {FW_VENDORID_WEISS, 0x00000002, "Weiss Engineering Ltd.", "Vesta"}, 
    67     {FW_VENDORID_WEISS, 0x00000003, "Weiss Engineering Ltd.", "Minerva"}, 
    68     {FW_VENDORID_WEISS, 0x00000004, "Weiss Engineering Ltd.", "AFI 1"}, 
    69 }; 
    70  
    71 DiceAvDevice::DiceAvDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
     52Device::Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
    7253    : FFADODevice( d, configRom ) 
    73     , m_model( NULL ) 
    7454    , m_global_reg_offset (0xFFFFFFFFLU) 
    7555    , m_global_reg_size (0xFFFFFFFFLU) 
     
    8868    , m_notifier (NULL) 
    8969{ 
    90     debugOutput( DEBUG_LEVEL_VERBOSE, "Created Dice::DiceAvDevice (NodeID %d)\n", 
     70    debugOutput( DEBUG_LEVEL_VERBOSE, "Created Dice::Device (NodeID %d)\n", 
    9171                 getConfigRom().getNodeId() ); 
    92     addOption(Util::OptionContainer::Option("snoopMode",false)); 
    93 } 
    94  
    95 DiceAvDevice::~DiceAvDevice() 
     72    addOption(Util::OptionContainer::Option("snoopMode", false)); 
     73} 
     74 
     75Device::~Device() 
    9676{ 
    9777    for ( StreamProcessorVectorIterator it = m_receiveProcessors.begin(); 
     
    11494 
    11595bool 
    116 DiceAvDevice::probe( ConfigRom& configRom, bool generic ) 
     96Device::probe( Util::Configuration& c, ConfigRom& configRom, bool generic ) 
    11797{ 
    118     if (generic) return false; 
    119     unsigned int vendorId = configRom.getNodeVendorId(); 
    120     unsigned int modelId = configRom.getModelId(); 
    121  
    122     for ( unsigned int i = 0; 
    123           i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); 
    124           ++i ) 
    125     { 
    126         if ( ( supportedDeviceList[i].vendor_id == vendorId ) 
    127              && ( supportedDeviceList[i].model_id == modelId ) 
    128            ) 
    129         { 
    130             return true; 
    131         } 
    132     } 
    133  
    134     return false; 
     98    if (generic) { 
     99        return false; 
     100    } else { 
     101        // check if device is in supported devices list 
     102        unsigned int vendorId = configRom.getNodeVendorId(); 
     103        unsigned int modelId = configRom.getModelId(); 
     104 
     105        Util::Configuration::VendorModelEntry vme = c.findDeviceVME( vendorId, modelId ); 
     106        return c.isValid(vme) && vme.driver == Util::Configuration::eD_DICE; 
     107    } 
    135108} 
    136109 
    137110FFADODevice * 
    138 DiceAvDevice::createDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
     111Device::createDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
    139112{ 
    140     return new DiceAvDevice( d, configRom ); 
    141 } 
    142  
    143 bool 
    144 DiceAvDevice::discover() 
     113    return new Device( d, configRom ); 
     114} 
     115 
     116bool 
     117Device::discover() 
    145118{ 
    146119    unsigned int vendorId = getConfigRom().getNodeVendorId(); 
    147120    unsigned int modelId = getConfigRom().getModelId(); 
    148121 
    149     for ( unsigned int i = 0; 
    150           i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); 
    151           ++i ) 
    152     { 
    153         if ( ( supportedDeviceList[i].vendor_id == vendorId ) 
    154              && ( supportedDeviceList[i].model_id == modelId ) 
    155            ) 
    156         { 
    157             m_model = &(supportedDeviceList[i]); 
    158         } 
    159     } 
    160  
    161     if (m_model == NULL) { 
    162         debugWarning("DiceAvDevice::discover() called for a non-dice device"); 
    163         return false; 
     122    Util::Configuration &c = getDeviceManager().getConfiguration(); 
     123    Util::Configuration::VendorModelEntry vme = c.findDeviceVME( vendorId, modelId ); 
     124 
     125    if (c.isValid(vme) && vme.driver == Util::Configuration::eD_DICE) { 
     126        debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", 
     127                     vme.vendor_name.c_str(), 
     128                     vme.model_name.c_str()); 
     129    } else { 
     130        debugWarning("Using generic DICE support for unsupported device '%s %s'\n", 
     131                     getConfigRom().getVendorName().c_str(), getConfigRom().getModelName().c_str()); 
    164132    } 
    165133 
     
    169137    } 
    170138 
    171     debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s (nick: %s)\n", 
    172                 m_model->vendor_name, m_model->model_name, getDeviceNickName().c_str()); 
    173  
    174139    return true; 
    175140} 
    176141 
    177142int 
    178 DiceAvDevice::getSamplingFrequency( ) { 
     143Device::getSamplingFrequency( ) { 
    179144    int samplingFrequency; 
    180145 
     
    209174       v.push_back(x); } 
    210175std::vector<int> 
    211 DiceAvDevice::getSupportedSamplingFrequencies() 
     176Device::getSupportedSamplingFrequencies() 
    212177{ 
    213178    std::vector<int> frequencies; 
     
    223188 
    224189int 
    225 DiceAvDevice::getConfigurationId() 
     190Device::getConfigurationId() 
    226191{ 
    227192    return 0; 
     
    229194 
    230195bool 
    231 DiceAvDevice::setSamplingFrequency( int samplingFrequency ) 
     196Device::setSamplingFrequency( int samplingFrequency ) 
    232197{ 
    233198    debugOutput(DEBUG_LEVEL_VERBOSE, "Setting sample rate: %d\n", 
     
    340305 
    341306FFADODevice::ClockSourceVector 
    342 DiceAvDevice::getSupportedClockSources() { 
     307Device::getSupportedClockSources() { 
    343308    FFADODevice::ClockSourceVector r; 
    344309 
     
    388353 
    389354bool 
    390 DiceAvDevice::isClockSourceIdLocked(unsigned int id, quadlet_t ext_status_reg) { 
     355Device::isClockSourceIdLocked(unsigned int id, quadlet_t ext_status_reg) { 
    391356    switch (id) { 
    392357        default: return true; 
     
    418383} 
    419384bool 
    420 DiceAvDevice::isClockSourceIdSlipping(unsigned int id, quadlet_t ext_status_reg) { 
     385Device::isClockSourceIdSlipping(unsigned int id, quadlet_t ext_status_reg) { 
    421386    switch (id) { 
    422387        default: return false; 
     
    449414 
    450415enum FFADODevice::eClockSourceType 
    451 DiceAvDevice::clockIdToType(unsigned int id) { 
     416Device::clockIdToType(unsigned int id) { 
    452417    switch (id) { 
    453418        default: return eCT_Invalid; 
     
    475440 
    476441bool 
    477 DiceAvDevice::setActiveClockSource(ClockSource s) { 
     442Device::setActiveClockSource(ClockSource s) { 
    478443    fb_quadlet_t clockreg; 
    479444    if (!readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &clockreg)) { 
     
    505470 
    506471FFADODevice::ClockSource 
    507 DiceAvDevice::getActiveClockSource() { 
     472Device::getActiveClockSource() { 
    508473    ClockSource s; 
    509474    quadlet_t clock_caps; 
     
    548513 
    549514bool 
    550 DiceAvDevice::setNickname( std::string name) 
     515Device::setNickname( std::string name) 
    551516{ 
    552517    return setDeviceNickName(name); 
     
    554519 
    555520std::string 
    556 DiceAvDevice::getNickname() 
     521Device::getNickname() 
    557522{ 
    558523    return getDeviceNickName(); 
     
    560525 
    561526void 
    562 DiceAvDevice::showDevice() 
     527Device::showDevice() 
    563528{ 
    564529    fb_quadlet_t tmp_quadlet; 
     
    707672// the size of the packet. 
    708673bool 
    709 DiceAvDevice::prepare() { 
     674Device::prepare() { 
    710675    fb_quadlet_t nb_audio; 
    711676    fb_quadlet_t nb_midi; 
     
    977942 
    978943bool 
    979 DiceAvDevice::addChannelToProcessor( 
     944Device::addChannelToProcessor( 
    980945    diceChannelInfo *channelInfo, 
    981946    Streaming::StreamProcessor *processor, 
     
    1034999 
    10351000bool 
    1036 DiceAvDevice::lock() { 
     1001Device::lock() { 
    10371002    fb_octlet_t result; 
    10381003 
    1039     debugOutput(DEBUG_LEVEL_VERBOSE, "Locking %s %s at node %d\n", 
    1040         m_model->vendor_name, m_model->model_name, getNodeId()); 
     1004    debugOutput(DEBUG_LEVEL_VERBOSE, "Locking device at node %d\n", getNodeId()); 
    10411005 
    10421006    bool snoopMode = false; 
     
    10621026        } 
    10631027     
    1064         m_notifier=new DiceAvDevice::DiceNotifier(this, notify_address); 
     1028        m_notifier=new Device::DiceNotifier(this, notify_address); 
    10651029     
    10661030        if(!m_notifier) { 
     
    11101074 
    11111075bool 
    1112 DiceAvDevice::unlock() { 
     1076Device::unlock() { 
    11131077    fb_octlet_t result; 
    11141078 
     
    11571121 
    11581122bool 
    1159 DiceAvDevice::enableStreaming() { 
     1123Device::enableStreaming() { 
    11601124    bool snoopMode = false; 
    11611125    if(!getOption("snoopMode", snoopMode)) { 
     
    11721136 
    11731137bool 
    1174 DiceAvDevice::disableStreaming() { 
     1138Device::disableStreaming() { 
    11751139    bool snoopMode = false; 
    11761140    if(!getOption("snoopMode", snoopMode)) { 
     
    11871151 
    11881152int 
    1189 DiceAvDevice::getStreamCount() { 
     1153Device::getStreamCount() { 
    11901154    return m_receiveProcessors.size() + m_transmitProcessors.size(); 
    11911155} 
    11921156 
    11931157Streaming::StreamProcessor * 
    1194 DiceAvDevice::getStreamProcessorByIndex(int i) { 
     1158Device::getStreamProcessorByIndex(int i) { 
    11951159 
    11961160    if (i<(int)m_receiveProcessors.size()) { 
     
    12041168 
    12051169bool 
    1206 DiceAvDevice::startStreamByIndex(int i) { 
     1170Device::startStreamByIndex(int i) { 
    12071171    bool snoopMode = false; 
    12081172    if(!getOption("snoopMode", snoopMode)) { 
     
    13231287 
    13241288bool 
    1325 DiceAvDevice::stopStreamByIndex(int i) { 
     1289Device::stopStreamByIndex(int i) { 
    13261290    bool snoopMode = false; 
    13271291    if(!getOption("snoopMode", snoopMode)) { 
     
    14151379 
    14161380// allocate ISO resources for the SP's 
    1417 int DiceAvDevice::allocateIsoChannel(unsigned int packet_size) { 
     1381int Device::allocateIsoChannel(unsigned int packet_size) { 
    14181382    unsigned int bandwidth=8+packet_size; 
    14191383 
     
    14261390} 
    14271391// deallocate ISO resources 
    1428 bool DiceAvDevice::deallocateIsoChannel(int channel) { 
     1392bool Device::deallocateIsoChannel(int channel) { 
    14291393    debugOutput(DEBUG_LEVEL_VERBOSE, "freeing channel %d\n",channel); 
    14301394    return get1394Service().freeIsoChannel(channel); 
     
    14321396 
    14331397bool 
    1434 DiceAvDevice::enableIsoStreaming() { 
     1398Device::enableIsoStreaming() { 
    14351399    return writeGlobalReg(DICE_REGISTER_GLOBAL_ENABLE, DICE_ISOSTREAMING_ENABLE); 
    14361400} 
    14371401 
    14381402bool 
    1439 DiceAvDevice::disableIsoStreaming() { 
     1403Device::disableIsoStreaming() { 
    14401404    return writeGlobalReg(DICE_REGISTER_GLOBAL_ENABLE, DICE_ISOSTREAMING_DISABLE); 
    14411405} 
    14421406 
    14431407bool 
    1444 DiceAvDevice::isIsoStreamingEnabled() { 
     1408Device::isIsoStreamingEnabled() { 
    14451409    fb_quadlet_t result; 
    14461410    readGlobalReg(DICE_REGISTER_GLOBAL_ENABLE, &result); 
     
    14551419 */ 
    14561420bool 
    1457 DiceAvDevice::maskedCheckZeroGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t mask) { 
     1421Device::maskedCheckZeroGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t mask) { 
    14581422    fb_quadlet_t result; 
    14591423    readGlobalReg(offset, &result); 
     
    14651429 */ 
    14661430bool 
    1467 DiceAvDevice::maskedCheckNotZeroGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t mask) { 
     1431Device::maskedCheckNotZeroGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t mask) { 
    14681432    return !maskedCheckZeroGlobalReg(offset, mask); 
    14691433} 
    14701434 
    1471 DiceAvDevice::diceNameVector 
    1472 DiceAvDevice::getTxNameString(unsigned int i) { 
     1435Device::diceNameVector 
     1436Device::getTxNameString(unsigned int i) { 
    14731437    diceNameVector names; 
    14741438    char namestring[DICE_TX_NAMES_SIZE+1]; 
     
    14841448} 
    14851449 
    1486 DiceAvDevice::diceNameVector 
    1487 DiceAvDevice::getRxNameString(unsigned int i) { 
     1450Device::diceNameVector 
     1451Device::getRxNameString(unsigned int i) { 
    14881452    diceNameVector names; 
    14891453    char namestring[DICE_RX_NAMES_SIZE+1]; 
     
    14991463} 
    15001464 
    1501 DiceAvDevice::diceNameVector 
    1502 DiceAvDevice::getClockSourceNameString() { 
     1465Device::diceNameVector 
     1466Device::getClockSourceNameString() { 
    15031467    diceNameVector names; 
    15041468    char namestring[DICE_CLOCKSOURCENAMES_SIZE+1]; 
     
    15151479 
    15161480std::string 
    1517 DiceAvDevice::getDeviceNickName() { 
     1481Device::getDeviceNickName() { 
    15181482    char namestring[DICE_NICK_NAME_SIZE+1]; 
    15191483 
     
    15291493 
    15301494bool 
    1531 DiceAvDevice::setDeviceNickName(std::string name) { 
     1495Device::setDeviceNickName(std::string name) { 
    15321496    char namestring[DICE_NICK_NAME_SIZE+1]; 
    15331497    strncpy(namestring, name.c_str(), DICE_NICK_NAME_SIZE); 
     
    15411505} 
    15421506 
    1543 DiceAvDevice::diceNameVector 
    1544 DiceAvDevice::splitNameString(std::string in) { 
     1507Device::diceNameVector 
     1508Device::splitNameString(std::string in) { 
    15451509    diceNameVector names; 
    15461510 
     
    15661530// I/O routines 
    15671531bool 
    1568 DiceAvDevice::initIoFunctions() { 
     1532Device::initIoFunctions() { 
    15691533 
    15701534    // offsets and sizes are returned in quadlets, but we use byte values 
     
    16761640 
    16771641bool 
    1678 DiceAvDevice::readReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 
     1642Device::readReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 
    16791643    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX\n", offset); 
    16801644 
     
    17001664 
    17011665bool 
    1702 DiceAvDevice::writeReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 
     1666Device::writeReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 
    17031667    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, data: 0x%08X\n", 
    17041668        offset, data); 
     
    17201684 
    17211685bool 
    1722 DiceAvDevice::readRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
     1686Device::readRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    17231687    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX, length %u\n", 
    17241688        offset, length); 
     
    17451709 
    17461710bool 
    1747 DiceAvDevice::writeRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
     1711Device::writeRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    17481712    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, length: %u\n", 
    17491713        offset, length); 
     
    17721736 
    17731737bool 
    1774 DiceAvDevice::readRegBlockSwapped(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
     1738Device::readRegBlockSwapped(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    17751739    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX, length %u\n", 
    17761740        offset, length); 
     
    17971761 
    17981762bool 
    1799 DiceAvDevice::writeRegBlockSwapped(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
     1763Device::writeRegBlockSwapped(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    18001764    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, length: %u\n", 
    18011765        offset, length); 
     
    18241788 
    18251789bool 
    1826 DiceAvDevice::readGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 
     1790Device::readGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 
    18271791    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register offset 0x%04llX\n", offset); 
    18281792 
     
    18321796 
    18331797bool 
    1834 DiceAvDevice::writeGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 
     1798Device::writeGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 
    18351799    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register offset 0x%08llX, data: 0x%08X\n", 
    18361800        offset, data); 
     
    18411805 
    18421806bool 
    1843 DiceAvDevice::readGlobalRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
     1807Device::readGlobalRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    18441808    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register block offset 0x%04llX, length %u bytes\n", 
    18451809        offset, length); 
     
    18501814 
    18511815bool 
    1852 DiceAvDevice::writeGlobalRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
     1816Device::writeGlobalRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    18531817    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register block offset 0x%04llX, length %u bytes\n", 
    18541818        offset, length); 
     
    18591823 
    18601824bool 
    1861 DiceAvDevice::readGlobalRegBlockSwapped(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
     1825Device::readGlobalRegBlockSwapped(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    18621826    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register block offset 0x%04llX, length %u bytes\n", 
    18631827        offset, length); 
     
    18681832 
    18691833bool 
    1870 DiceAvDevice::writeGlobalRegBlockSwapped(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
     1834Device::writeGlobalRegBlockSwapped(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    18711835    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register block offset 0x%04llX, length %u bytes\n", 
    18721836        offset, length); 
     
    18771841 
    18781842fb_nodeaddr_t 
    1879 DiceAvDevice::globalOffsetGen(fb_nodeaddr_t offset, size_t length) { 
     1843Device::globalOffsetGen(fb_nodeaddr_t offset, size_t length) { 
    18801844 
    18811845    // registry offsets should always be smaller than 0x7FFFFFFF 
     
    18951859 
    18961860bool 
    1897 DiceAvDevice::readTxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) { 
     1861Device::readTxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) { 
    18981862    debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Reading tx %d register offset 0x%04llX\n", i, offset); 
    18991863 
     
    19031867 
    19041868bool 
    1905 DiceAvDevice::writeTxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t data) { 
     1869Device::writeTxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t data) { 
    19061870    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing tx %d register offset 0x%08llX, data: 0x%08X\n", 
    19071871        i, offset, data); 
     
    19121876 
    19131877bool 
    1914 DiceAvDevice::readTxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
     1878Device::readTxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    19151879    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04llX, length %u bytes\n", 
    19161880        offset, length); 
     
    19211885 
    19221886bool 
    1923 DiceAvDevice::writeTxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
     1887Device::writeTxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    19241888    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04llX, length %u bytes\n", 
    19251889        offset, length); 
     
    19301894 
    19311895bool 
    1932 DiceAvDevice::readTxRegBlockSwapped(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
     1896Device::readTxRegBlockSwapped(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    19331897    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04llX, length %u bytes\n", 
    19341898        offset, length); 
     
    19391903 
    19401904fb_nodeaddr_t 
    1941 DiceAvDevice::txOffsetGen(unsigned int i, fb_nodeaddr_t offset, size_t length) { 
     1905Device::txOffsetGen(unsigned int i, fb_nodeaddr_t offset, size_t length) { 
    19421906    // registry offsets should always be smaller than 0x7FFFFFFF 
    19431907    // because otherwise base + offset > 64bit 
     
    19711935 
    19721936bool 
    1973 DiceAvDevice::readRxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) { 
     1937Device::readRxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) { 
    19741938    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx %d register offset 0x%04llX\n", i, offset); 
    19751939 
     
    19791943 
    19801944bool 
    1981 DiceAvDevice::writeRxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t data) { 
     1945Device::writeRxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t data) { 
    19821946    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register offset 0x%08llX, data: 0x%08X\n", 
    19831947        offset, data); 
     
    19881952 
    19891953bool 
    1990 DiceAvDevice::readRxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
     1954Device::readRxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    19911955    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04llX, length %u bytes\n", 
    19921956        offset, length); 
     
    19971961 
    19981962bool 
    1999 DiceAvDevice::writeRxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
     1963Device::writeRxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    20001964    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04llX, length %u bytes\n", 
    20011965        offset, length); 
     
    20061970 
    20071971bool 
    2008 DiceAvDevice::readRxRegBlockSwapped(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
     1972Device::readRxRegBlockSwapped(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    20091973    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04llX, length %u bytes\n", 
    20101974        offset, length); 
     
    20151979 
    20161980fb_nodeaddr_t 
    2017 DiceAvDevice::rxOffsetGen(unsigned int i, fb_nodeaddr_t offset, size_t length) { 
     1981Device::rxOffsetGen(unsigned int i, fb_nodeaddr_t offset, size_t length) { 
    20181982    // registry offsets should always be smaller than 0x7FFFFFFF 
    20191983    // because otherwise base + offset > 64bit 
     
    20482012// the notifier 
    20492013 
    2050 DiceAvDevice::DiceNotifier::DiceNotifier(DiceAvDevice *d, nodeaddr_t start) 
     2014Device::DiceNotifier::DiceNotifier(Device *d, nodeaddr_t start) 
    20512015 : ARMHandler(start, DICE_NOTIFIER_BLOCK_LENGTH, 
    20522016              RAW1394_ARM_READ | RAW1394_ARM_WRITE | RAW1394_ARM_LOCK, 
     
    20572021} 
    20582022 
    2059 DiceAvDevice::DiceNotifier::~DiceNotifier() 
     2023Device::DiceNotifier::~DiceNotifier() 
    20602024{ 
    20612025 
  • trunk/libffado/src/dice/dice_avdevice.h

    r1336 r1543  
    4545class DiceNotifier; 
    4646 
    47 // struct to define the supported devices 
    48 struct VendorModelEntry { 
    49     unsigned int vendor_id; 
    50     unsigned int model_id; 
    51     const char *vendor_name; 
    52     const char *model_name; 
    53 }; 
    54  
    55 class DiceAvDevice : public FFADODevice { 
     47class Device : public FFADODevice { 
    5648private: 
    5749    class DiceNotifier; 
    5850public: 
    59     DiceAvDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
    60     ~DiceAvDevice(); 
    61  
    62     static bool probe( ConfigRom& configRom, bool generic = false ); 
     51    Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
     52    ~Device(); 
     53 
     54    static bool probe( Util::Configuration& c, ConfigRom& configRom, bool generic = false ); 
    6355    static FFADODevice * createDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
    6456    virtual bool discover(); 
     
    9486 
    9587protected: 
    96     struct VendorModelEntry *m_model; 
    9788 
    9889    // streaming stuff 
     
    204195    { 
    205196    public: 
    206         DiceNotifier(DiceAvDevice *, nodeaddr_t start); 
     197        DiceNotifier(Device *, nodeaddr_t start); 
    207198        virtual ~DiceNotifier(); 
    208199 
    209200    private: 
    210         DiceAvDevice *m_dicedevice; 
     201        Device *m_dicedevice; 
    211202    }; 
    212203}; 
  • trunk/libffado/src/fireworks/fireworks_device.cpp

    r1336 r1543  
    5151 
    5252Device::Device(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
    53     : GenericAVC::AvDevice( d, configRom) 
     53    : GenericAVC::Device( d, configRom) 
    5454    , m_poll_lock( new Util::PosixMutex("DEVPOLL") ) 
    5555    , m_efc_discovery_done ( false ) 
     
    7676    } 
    7777    m_HwInfo.showEfcCmd(); 
    78     GenericAVC::AvDevice::showDevice(); 
     78    GenericAVC::Device::showDevice(); 
    7979} 
    8080 
     
    141141 
    142142    // discover AVC-wise 
    143     if ( !GenericAVC::AvDevice::discoverGeneric() ) { 
    144         debugError( "Could not discover GenericAVC::AvDevice\n" ); 
     143    if ( !GenericAVC::Device::discoverGeneric() ) { 
     144        debugError( "Could not discover GenericAVC::Device\n" ); 
    145145        return false; 
    146146    } 
  • trunk/libffado/src/fireworks/fireworks_device.h

    r1336 r1543  
    4242namespace FireWorks { 
    4343 
    44 class Device : public GenericAVC::AvDevice { 
     44class Device : public GenericAVC::Device { 
    4545    friend class MonitorControl; 
    4646    friend class SimpleControl; 
  • trunk/libffado/src/genericavc/avc_avdevice.cpp

    r1539 r1543  
    4848namespace GenericAVC { 
    4949 
    50 IMPL_DEBUG_MODULE( AvDevice, AvDevice, DEBUG_LEVEL_NORMAL ); 
    51  
    52 AvDevice::AvDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
     50IMPL_DEBUG_MODULE( Device, Device, DEBUG_LEVEL_NORMAL ); 
     51 
     52Device::Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
    5353    : FFADODevice( d, configRom ) 
    5454{ 
    55     debugOutput( DEBUG_LEVEL_VERBOSE, "Created GenericAVC::AvDevice (NodeID %d)\n", 
     55    debugOutput( DEBUG_LEVEL_VERBOSE, "Created GenericAVC::Device (NodeID %d)\n", 
    5656                 getConfigRom().getNodeId() ); 
    5757    addOption(Util::OptionContainer::Option("snoopMode",false)); 
    5858} 
    5959 
    60 AvDevice::~AvDevice() 
     60Device::~Device() 
    6161{ 
    6262    for ( StreamProcessorVectorIterator it = m_receiveProcessors.begin(); 
     
    7575 
    7676bool 
    77 AvDevice::probe( Util::Configuration& c, ConfigRom& configRom, bool generic ) 
     77Device::probe( Util::Configuration& c, ConfigRom& configRom, bool generic ) 
    7878{ 
    7979    if(generic) { 
     
    107107 
    108108FFADODevice * 
    109 AvDevice::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
    110 { 
    111     return new AvDevice(d, configRom ); 
    112 } 
    113  
    114 bool 
    115 AvDevice::discover() 
     109Device::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
     110{ 
     111    return new Device(d, configRom ); 
     112} 
     113 
     114bool 
     115Device::discover() 
    116116{ 
    117117    Util::MutexLockHelper lock(m_DeviceMutex); 
     
    135135 
    136136bool 
    137 AvDevice::discoverGeneric() 
     137Device::discoverGeneric() 
    138138{ 
    139139    if ( !Unit::discover() ) { 
     
    154154 
    155155void 
    156 AvDevice::setVerboseLevel(int l) 
     156Device::setVerboseLevel(int l) 
    157157{ 
    158158    Util::MutexLockHelper lock(m_DeviceMutex); 
     
    166166#include <libieee1394/IEC61883.h> 
    167167enum FFADODevice::eStreamingState 
    168 AvDevice::getStreamingState() 
     168Device::getStreamingState() 
    169169{ 
    170170    // check the IEC plug control registers to see if the device is streaming 
     
    200200 
    201201int 
    202 AvDevice::getSamplingFrequency( ) { 
     202Device::getSamplingFrequency( ) { 
    203203    AVC::Plug* inputPlug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Input, 0 ); 
    204204    if ( !inputPlug ) { 
     
    222222 
    223223bool 
    224 AvDevice::setSamplingFrequency( int s ) 
     224Device::setSamplingFrequency( int s ) 
    225225{ 
    226226    Util::MutexLockHelper lock(m_DeviceMutex); 
     
    274274 
    275275bool 
    276 AvDevice::supportsSamplingFrequency( int s ) 
     276Device::supportsSamplingFrequency( int s ) 
    277277{ 
    278278    Util::MutexLockHelper lock(m_DeviceMutex); 
     
    309309 
    310310std::vector<int> 
    311 AvDevice::getSupportedSamplingFrequencies() 
     311Device::getSupportedSamplingFrequencies() 
    312312{ 
    313313    if (m_supported_frequencies_cache.size() == 0) { 
     
    326326 
    327327FFADODevice::ClockSourceVector 
    328 AvDevice::getSupportedClockSources() { 
     328Device::getSupportedClockSources() { 
    329329    FFADODevice::ClockSourceVector r; 
    330330 
     
    359359 
    360360bool 
    361 AvDevice::setActiveClockSource(ClockSource s) { 
     361Device::setActiveClockSource(ClockSource s) { 
    362362    AVC::Plug *src = m_pPlugManager->getPlug( s.id ); 
    363363    if (!src) { 
     
    382382 
    383383FFADODevice::ClockSource 
    384 AvDevice::getActiveClockSource() { 
     384Device::getActiveClockSource() { 
    385385    const SyncInfo* si=getActiveSyncInfo(); 
    386386    if ( !si ) { 
     
    396396 
    397397FFADODevice::ClockSource 
    398 AvDevice::syncInfoToClockSource(const SyncInfo& si) { 
     398Device::syncInfoToClockSource(const SyncInfo& si) { 
    399399    ClockSource s; 
    400400 
     
    465465 
    466466bool 
    467 AvDevice::lock() { 
     467Device::lock() { 
    468468    bool snoopMode=false; 
    469469    Util::MutexLockHelper lock(m_DeviceMutex); 
     
    482482 
    483483bool 
    484 AvDevice::unlock() { 
     484Device::unlock() { 
    485485    bool snoopMode=false; 
    486486    Util::MutexLockHelper lock(m_DeviceMutex); 
     
    498498 
    499499void 
    500 AvDevice::showDevice() 
     500Device::showDevice() 
    501501{ 
    502502    FFADODevice::showDevice(); 
     
    507507 
    508508bool 
    509 AvDevice::prepare() { 
     509Device::prepare() { 
    510510    bool snoopMode = false; 
    511511    Util::MutexLockHelper lock(m_DeviceMutex); 
     
    653653 
    654654bool 
    655 AvDevice::addPlugToProcessor( 
     655Device::addPlugToProcessor( 
    656656    AVC::Plug& plug, 
    657657    Streaming::StreamProcessor *processor, 
     
    749749 
    750750int 
    751 AvDevice::getStreamCount() { 
     751Device::getStreamCount() { 
    752752    int retval; 
    753753    Util::MutexLockHelper lock(m_DeviceMutex); 
     
    757757 
    758758Streaming::StreamProcessor * 
    759 AvDevice::getStreamProcessorByIndex(int i) { 
     759Device::getStreamProcessorByIndex(int i) { 
    760760 
    761761    if (i<(int)m_receiveProcessors.size()) { 
     
    769769 
    770770bool 
    771 AvDevice::startStreamByIndex(int i) { 
     771Device::startStreamByIndex(int i) { 
    772772    int iso_channel=-1; 
    773773    bool snoopMode=false; 
     
    852852 
    853853bool 
    854 AvDevice::stopStreamByIndex(int i) { 
     854Device::stopStreamByIndex(int i) { 
    855855    bool snoopMode=false; 
    856856    if(!getOption("snoopMode", snoopMode)) { 
     
    910910 
    911911bool 
    912 AvDevice::serialize( std::string basePath, Util::IOSerialize& ser ) const 
     912Device::serialize( std::string basePath, Util::IOSerialize& ser ) const 
    913913{ 
    914914    bool result; 
     
    919919 
    920920bool 
    921 AvDevice::deserialize( std::string basePath, Util::IODeserialize& deser ) 
     921Device::deserialize( std::string basePath, Util::IODeserialize& deser ) 
    922922{ 
    923923    bool result; 
  • trunk/libffado/src/genericavc/avc_avdevice.h

    r1535 r1543  
    2323 */ 
    2424 
    25 #ifndef GENERICAVC_AVDEVICE_H 
    26 #define GENERICAVC_AVDEVICE_H 
     25#ifndef GENERICAVC_DEVICE_H 
     26#define GENERICAVC_DEVICE_H 
    2727 
    2828#include "ffadodevice.h" 
     
    4646namespace GenericAVC { 
    4747 
    48 class AvDevice : public FFADODevice, public AVC::Unit { 
     48class Device : public FFADODevice, public AVC::Unit { 
    4949public: 
    50     AvDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
    51     virtual ~AvDevice(); 
     50    Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
     51    virtual ~Device(); 
    5252 
    5353    static bool probe( Util::Configuration&, ConfigRom& configRom, bool generic = false ); 
  • trunk/libffado/src/libutil/Configuration.h

    r1535 r1543  
    4343    // driver ID's to be used in the config file 
    4444    enum eDrivers { 
    45         eD_Unknown = 0, 
    46         eD_BeBoB = 1, 
    47         eD_FireWorks = 2, 
    48         eD_GenericAVC = 3, 
    49         eD_Oxford = 4, 
    50         eD_MOTU = 10, 
     45        eD_Unknown     = 0, 
     46        eD_BeBoB       = 1, 
     47        eD_FireWorks   = 2, 
     48        eD_GenericAVC  = 3, 
     49        eD_Oxford      = 4, 
     50        eD_MAudio      = 5, 
     51        eD_MOTU        = 10, 
     52        eD_DICE        = 20, 
     53        eD_MetricHalo  = 30, 
     54        eD_RME         = 40, 
     55        eD_Bounce      = 50, 
    5156    }; 
    5257 
  • trunk/libffado/src/maudio/maudio_avdevice.cpp

    r1239 r1543  
    2222 */ 
    2323 
     24#warning M-Audio support is currently useless 
     25 
    2426#include "maudio/maudio_avdevice.h" 
    25 #include "bebob/bebob_avdevice.h" 
    2627 
    2728#include "libieee1394/configrom.h" 
     
    3233#include "debugmodule/debugmodule.h" 
    3334 
     35#include "devicemanager.h" 
     36 
    3437#include <string> 
    3538#include <stdint.h> 
     
    3740namespace MAudio { 
    3841 
    39 AvDevice::AvDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
    40     : BeBoB::AvDevice( d, configRom) 
    41     , m_model ( NULL ) 
     42Device::Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
     43    : FFADODevice( d, configRom) 
    4244{ 
    43     debugOutput( DEBUG_LEVEL_VERBOSE, "Created MAudio::AvDevice (NodeID %d)\n", 
     45    debugOutput( DEBUG_LEVEL_VERBOSE, "Created MAudio::Device (NodeID %d)\n", 
    4446                 getConfigRom().getNodeId() ); 
    4547} 
    4648 
    47 AvDevice::~AvDevice() 
     49Device::~Device() 
    4850{ 
    4951} 
    5052 
    51 static VendorModelEntry supportedDeviceList[] = 
     53bool 
     54Device::probe( Util::Configuration& c, ConfigRom& configRom, bool generic ) 
    5255{ 
    53     //{FW_VENDORID_BRIDGECO, 0x00010048, "BridgeCo", "RD Audio1", "refdesign.xml"}, 
     56    if(generic) { 
     57        return false; 
     58    } else { 
     59        // check if device is in supported devices list 
     60        unsigned int vendorId = configRom.getNodeVendorId(); 
     61        unsigned int modelId = configRom.getModelId(); 
    5462 
    55     {FW_VENDORID_MAUDIO, 0x00010046, "M-Audio", "FW 410", "fw410.xml"}, 
    56     {FW_VENDORID_MAUDIO, 0x00010058, "M-Audio", "FW 410", "fw410.xml"},       // Version 5.10.0.5036 
    57     {FW_VENDORID_MAUDIO, 0x00010060, "M-Audio", "FW Audiophile", "fwap.xml"}, 
    58 }; 
    59  
    60 bool 
    61 AvDevice::probe( ConfigRom& configRom, bool generic ) 
    62 
    63     if (generic) return false; 
    64  
    65     unsigned int iVendorId = configRom.getNodeVendorId(); 
    66     unsigned int iModelId = configRom.getModelId(); 
    67  
    68     for ( unsigned int i = 0; 
    69           i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); 
    70           ++i ) 
    71     { 
    72         if ( ( supportedDeviceList[i].vendor_id == iVendorId ) 
    73              && ( supportedDeviceList[i].model_id == iModelId ) ) 
    74         { 
    75             return true; 
    76         } 
     63        Util::Configuration::VendorModelEntry vme = c.findDeviceVME( vendorId, modelId ); 
     64        return c.isValid(vme) && vme.driver == Util::Configuration::eD_MAudio; 
    7765    } 
    78     return false; 
    7966} 
    8067 
    8168FFADODevice * 
    82 AvDevice::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
     69Device::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
    8370{ 
    84     return new AvDevice( d, configRom ); 
     71    return new Device( d, configRom ); 
    8572} 
    8673 
    8774bool 
    88 AvDevice::discover() 
     75Device::discover() 
    8976{ 
    9077    unsigned int vendorId = getConfigRom().getNodeVendorId(); 
    9178    unsigned int modelId = getConfigRom().getModelId(); 
    9279 
    93     for ( unsigned int i = 0; 
    94           i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); 
    95           ++i ) 
    96     { 
    97         if ( ( supportedDeviceList[i].vendor_id == vendorId ) 
    98              && ( supportedDeviceList[i].model_id == modelId ) 
    99            ) 
    100         { 
    101             m_model = &(supportedDeviceList[i]); 
    102             break; 
    103         } 
     80    Util::Configuration &c = getDeviceManager().getConfiguration(); 
     81    Util::Configuration::VendorModelEntry vme = c.findDeviceVME( vendorId, modelId ); 
     82 
     83    if (c.isValid(vme) && vme.driver == Util::Configuration::eD_MAudio) { 
     84        debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", 
     85                     vme.vendor_name.c_str(), 
     86                     vme.model_name.c_str()); 
     87    } else { 
     88        debugWarning("Using generic M-Audio support for unsupported device '%s %s'\n", 
     89                     getConfigRom().getVendorName().c_str(), getConfigRom().getModelName().c_str()); 
    10490    } 
    105  
    106     if (m_model != NULL) { 
    107         debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", 
    108                 m_model->vendor_name, m_model->model_name); 
    109     } else return false; 
    11091 
    11192    return true; 
    11293} 
    11394 
     95 
     96int 
     97Device::getSamplingFrequency( ) { 
     98    return 0; 
     99} 
     100 
     101std::vector<int> 
     102Device::getSupportedSamplingFrequencies() 
     103{ 
     104    std::vector<int> frequencies; 
     105    return frequencies; 
     106} 
     107 
     108FFADODevice::ClockSourceVector 
     109Device::getSupportedClockSources() { 
     110    FFADODevice::ClockSourceVector r; 
     111    return r; 
     112} 
     113 
    114114bool 
    115 AvDevice::setSamplingFrequency( int eSamplingFrequency ) 
    116 
    117     // not supported 
     115Device::setActiveClockSource(ClockSource s) { 
    118116    return false; 
    119117} 
    120118 
    121 int AvDevice::getSamplingFrequency( ) { 
    122     return 44100; 
    123 
    124  
    125 uint64_t 
    126 AvDevice::getConfigurationId() 
    127 
    128     return 0; 
    129 
    130  
    131 void 
    132 AvDevice::showDevice() 
    133 
     119FFADODevice::ClockSource 
     120Device::getActiveClockSource() { 
     121    ClockSource s; 
     122    return s; 
    134123} 
    135124 
    136125bool 
    137 AvDevice::prepare() { 
     126Device::setSamplingFrequency( int samplingFrequency ) 
     127
     128 
     129    return false; 
     130
     131 
     132bool 
     133Device::lock() { 
    138134 
    139135    return true; 
    140136} 
    141137 
     138 
     139bool 
     140Device::unlock() { 
     141 
     142    return true; 
    142143} 
     144 
     145void 
     146Device::showDevice() 
     147{ 
     148    unsigned int vendorId = getConfigRom().getNodeVendorId(); 
     149    unsigned int modelId = getConfigRom().getModelId(); 
     150 
     151    Util::Configuration &c = getDeviceManager().getConfiguration(); 
     152    Util::Configuration::VendorModelEntry vme = c.findDeviceVME( vendorId, modelId ); 
     153 
     154    debugOutput(DEBUG_LEVEL_VERBOSE, 
     155        "%s %s at node %d\n", vme.vendor_name.c_str(), vme.model_name.c_str(), getNodeId()); 
     156} 
     157 
     158bool 
     159Device::prepare() { 
     160 
     161    return true; 
     162} 
     163 
     164int 
     165Device::getStreamCount() { 
     166    return 0; 
     167} 
     168 
     169Streaming::StreamProcessor * 
     170Device::getStreamProcessorByIndex(int i) { 
     171 
     172    return NULL; 
     173} 
     174 
     175bool 
     176Device::startStreamByIndex(int i) { 
     177    return false; 
     178} 
     179 
     180bool 
     181Device::stopStreamByIndex(int i) { 
     182    return false; 
     183} 
     184 
     185} 
  • trunk/libffado/src/maudio/maudio_avdevice.h

    r1239 r1543  
    4444namespace MAudio { 
    4545 
    46 struct VendorModelEntry { 
    47     unsigned int vendor_id; 
    48     unsigned int model_id; 
    49     const char *vendor_name; 
    50     const char *model_name; 
    51     const char *filename; 
    52 }; 
     46class Device : public FFADODevice { 
     47public: 
     48    Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
     49    virtual ~Device(); 
    5350 
    54 class AvDevice : public BeBoB::AvDevice { 
    55 public: 
    56     AvDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
    57     virtual ~AvDevice(); 
    58  
    59     static bool probe( ConfigRom& configRom, bool generic = false ); 
     51    static bool probe( Util::Configuration& c, ConfigRom& configRom, bool generic = false ); 
    6052    static FFADODevice * createDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
    6153    virtual bool discover(); 
    6254 
    63     virtual uint64_t getConfigurationId( ); 
    64      
    6555    virtual void showDevice(); 
    6656 
    6757    virtual bool setSamplingFrequency( int ); 
    6858    virtual int getSamplingFrequency( ); 
     59    virtual std::vector<int> getSupportedSamplingFrequencies(); 
     60 
     61    virtual ClockSourceVector getSupportedClockSources(); 
     62    virtual bool setActiveClockSource(ClockSource); 
     63    virtual ClockSource getActiveClockSource(); 
     64 
     65    virtual int getStreamCount(); 
    6966 
    7067    virtual bool prepare(); 
     68    virtual bool lock(); 
     69    virtual bool unlock(); 
    7170 
    72 protected: 
    73     struct VendorModelEntry*  m_model; 
     71    virtual Streaming::StreamProcessor *getStreamProcessorByIndex(int i); 
     72    virtual bool startStreamByIndex(int i); 
     73    virtual bool stopStreamByIndex(int i); 
    7474 
    7575}; 
  • trunk/libffado/src/metrichalo/mh_avdevice.cpp

    r1336 r1543  
    3333#include "debugmodule/debugmodule.h" 
    3434 
     35#include "devicemanager.h" 
     36 
    3537#include <string> 
    3638#include <stdint.h> 
     
    4446namespace MetricHalo { 
    4547 
    46 // to define the supported devices 
    47 static VendorModelEntry supportedDeviceList[] = 
    48 
    49     {0x00000000, 0x0000, "Metric Halo", "XXX"}, 
    50 }; 
    51  
    52 MHAvDevice::MHAvDevice( DeviceManager& d, 
     48Device::Device( DeviceManager& d, 
    5349                        std::auto_ptr<ConfigRom>( configRom )) 
    5450    : FFADODevice( d, configRom ) 
    55     , m_model( NULL ) 
    56  
    5751{ 
    58     debugOutput( DEBUG_LEVEL_VERBOSE, "Created MetricHalo::MHAvDevice (NodeID %d)\n", 
     52    debugOutput( DEBUG_LEVEL_VERBOSE, "Created MetricHalo::Device (NodeID %d)\n", 
    5953                 getConfigRom().getNodeId() ); 
    6054} 
    6155 
    62 MHAvDevice::~MHAvDevice() 
     56Device::~Device() 
    6357{ 
    6458 
     
    6660 
    6761bool 
    68 MHAvDevice::probe( ConfigRom& configRom, bool generic ) 
     62Device::probe( Util::Configuration& c, ConfigRom& configRom, bool generic ) 
    6963{ 
    70     if (generic) return false; 
    71     unsigned int vendorId = configRom.getNodeVendorId(); 
    72     unsigned int modelId = configRom.getModelId(); 
     64    if (generic) { 
     65        return false; 
     66    } else { 
     67        // check if device is in supported devices list 
     68        unsigned int vendorId = configRom.getNodeVendorId(); 
     69        unsigned int modelId = configRom.getModelId(); 
    7370 
    74     for ( unsigned int i = 0; 
    75           i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); 
    76           ++i ) 
    77     { 
    78         if ( ( supportedDeviceList[i].vendor_id == vendorId ) 
    79              && ( supportedDeviceList[i].model_id == modelId ) 
    80            ) 
    81         { 
    82             return true; 
    83         } 
     71        Util::Configuration::VendorModelEntry vme = c.findDeviceVME( vendorId, modelId ); 
     72        return c.isValid(vme) && vme.driver == Util::Configuration::eD_MetricHalo; 
    8473    } 
    85  
    86     return false; 
    8774} 
    8875 
    8976FFADODevice * 
    90 MHAvDevice::createDevice( DeviceManager& d, 
     77Device::createDevice( DeviceManager& d, 
    9178                          std::auto_ptr<ConfigRom>( configRom )) 
    9279{ 
    93     return new MHAvDevice(d, configRom ); 
     80    return new Device(d, configRom ); 
    9481} 
    9582 
    9683bool 
    97 MHAvDevice::discover() 
     84Device::discover() 
    9885{ 
    9986    unsigned int vendorId = getConfigRom().getNodeVendorId(); 
    10087    unsigned int modelId = getConfigRom().getModelId(); 
    10188 
    102     for ( unsigned int i = 0; 
    103           i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); 
    104           ++i ) 
    105     { 
    106         if ( ( supportedDeviceList[i].vendor_id == vendorId ) 
    107              && ( supportedDeviceList[i].model_id == modelId ) 
    108            ) 
    109         { 
    110             m_model = &(supportedDeviceList[i]); 
    111         } 
    112     } 
     89    Util::Configuration &c = getDeviceManager().getConfiguration(); 
     90    Util::Configuration::VendorModelEntry vme = c.findDeviceVME( vendorId, modelId ); 
    11391 
    114     if (m_model != NULL) { 
     92    if (c.isValid(vme) && vme.driver == Util::Configuration::eD_MetricHalo) { 
    11593        debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", 
    116                 m_model->vendor_name, m_model->model_name); 
    117         return true; 
     94                     vme.vendor_name.c_str(), 
     95                     vme.model_name.c_str()); 
     96    } else { 
     97        debugWarning("Using generic Metric Halo support for unsupported device '%s %s'\n", 
     98                     getConfigRom().getVendorName().c_str(), getConfigRom().getModelName().c_str()); 
    11899    } 
    119100 
     
    122103 
    123104int 
    124 MHAvDevice::getSamplingFrequency( ) { 
     105Device::getSamplingFrequency( ) { 
    125106    return 0; 
    126107} 
    127108 
    128109std::vector<int> 
    129 MHAvDevice::getSupportedSamplingFrequencies() 
     110Device::getSupportedSamplingFrequencies() 
    130111{ 
    131112    std::vector<int> frequencies; 
     
    134115 
    135116FFADODevice::ClockSourceVector 
    136 MHAvDevice::getSupportedClockSources() { 
     117Device::getSupportedClockSources() { 
    137118    FFADODevice::ClockSourceVector r; 
    138119    return r; 
     
    140121 
    141122bool 
    142 MHAvDevice::setActiveClockSource(ClockSource s) { 
     123Device::setActiveClockSource(ClockSource s) { 
    143124    return false; 
    144125} 
    145126 
    146127FFADODevice::ClockSource 
    147 MHAvDevice::getActiveClockSource() { 
     128Device::getActiveClockSource() { 
    148129    ClockSource s; 
    149130    return s; 
     
    152133 
    153134int 
    154 MHAvDevice::getConfigurationId( ) { 
     135Device::getConfigurationId( ) { 
    155136    return 0; 
    156137} 
    157138 
    158139bool 
    159 MHAvDevice::setSamplingFrequency( int samplingFrequency ) 
     140Device::setSamplingFrequency( int samplingFrequency ) 
    160141{ 
    161142 
     
    164145 
    165146bool 
    166 MHAvDevice::lock() { 
     147Device::lock() { 
    167148 
    168149    return true; 
     
    171152 
    172153bool 
    173 MHAvDevice::unlock() { 
     154Device::unlock() { 
    174155 
    175156    return true; 
     
    177158 
    178159void 
    179 MHAvDevice::showDevice() 
     160Device::showDevice() 
    180161{ 
     162    unsigned int vendorId = getConfigRom().getNodeVendorId(); 
     163    unsigned int modelId = getConfigRom().getModelId(); 
     164 
     165    Util::Configuration &c = getDeviceManager().getConfiguration(); 
     166    Util::Configuration::VendorModelEntry vme = c.findDeviceVME( vendorId, modelId ); 
     167 
    181168    debugOutput(DEBUG_LEVEL_VERBOSE, 
    182         "%s %s at node %d\n", m_model->vendor_name, m_model->model_name, 
    183         getNodeId()); 
     169        "%s %s at node %d\n", vme.vendor_name.c_str(), vme.model_name.c_str(), getNodeId()); 
    184170} 
    185171 
    186172bool 
    187 MHAvDevice::prepare() { 
     173Device::prepare() { 
    188174 
    189175    return true; 
     
    191177 
    192178int 
    193 MHAvDevice::getStreamCount() { 
     179Device::getStreamCount() { 
    194180    return 0; 
    195181} 
    196182 
    197183Streaming::StreamProcessor * 
    198 MHAvDevice::getStreamProcessorByIndex(int i) { 
     184Device::getStreamProcessorByIndex(int i) { 
    199185 
    200186    return NULL; 
     
    202188 
    203189bool 
    204 MHAvDevice::startStreamByIndex(int i) { 
     190Device::startStreamByIndex(int i) { 
    205191    return false; 
    206192} 
    207193 
    208194bool 
    209 MHAvDevice::stopStreamByIndex(int i) { 
     195Device::stopStreamByIndex(int i) { 
    210196    return false; 
    211197} 
  • trunk/libffado/src/metrichalo/mh_avdevice.h

    r1336 r1543  
    2929#include "debugmodule/debugmodule.h" 
    3030#include "libavc/avc_definitions.h" 
     31#include "libutil/Configuration.h" 
    3132 
    3233// #include "libstreaming/mh/MHStreamProcessor.h" 
     
    3738namespace MetricHalo { 
    3839 
    39 // struct to define the supported devices 
    40 struct VendorModelEntry { 
    41     unsigned int vendor_id; 
    42     unsigned int model_id; 
    43     char *vendor_name; 
    44     char *model_name; 
    45 }; 
     40class Device : public FFADODevice { 
     41public: 
     42    Device( DeviceManager& d, 
     43                std::auto_ptr<ConfigRom>( configRom )); 
     44    virtual ~Device(); 
    4645 
    47 class MHAvDevice : public FFADODevice { 
    48 public: 
    49     MHAvDevice( DeviceManager& d, 
    50                 std::auto_ptr<ConfigRom>( configRom )); 
    51     virtual ~MHAvDevice(); 
    52  
    53     static bool probe( ConfigRom& configRom, bool generic = false ); 
     46    static bool probe( Util::Configuration& c, ConfigRom& configRom, bool generic = false ); 
    5447    static FFADODevice * createDevice( DeviceManager& d, 
    5548                                       std::auto_ptr<ConfigRom>( configRom )); 
     
    8073    signed int getIsoSendChannel(void); 
    8174 
    82 protected: 
    83     struct VendorModelEntry *m_model; 
    84  
    8575}; 
    8676 
  • trunk/libffado/src/oxford/oxford_device.cpp

    r1535 r1543  
    4646 
    4747Device::Device(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
    48     : GenericAVC::AvDevice( d, configRom) 
     48    : GenericAVC::Device( d, configRom) 
    4949{ 
    5050    debugOutput( DEBUG_LEVEL_VERBOSE, "Created Oxford::Device (NodeID %d)\n", 
     
    6868{ 
    6969    debugOutput(DEBUG_LEVEL_VERBOSE, "This is a Oxford::Device\n"); 
    70     GenericAVC::AvDevice::showDevice(); 
     70    GenericAVC::Device::showDevice(); 
    7171} 
    7272 
  • trunk/libffado/src/oxford/oxford_device.h

    r1535 r1543  
    3737namespace Oxford { 
    3838 
    39 class Device : public GenericAVC::AvDevice { 
     39class Device : public GenericAVC::Device { 
    4040 
    4141public: 
  • trunk/libffado/src/rme/fireface_flash.cpp

    r1537 r1543  
    2222 */ 
    2323 
    24 /* This file implements the flash memory methods of the RmeDevice object */ 
     24/* This file implements the flash memory methods of the Device object */ 
    2525 
    2626#include "rme/rme_avdevice.h" 
     
    3434 
    3535signed int  
    36 RmeDevice::wait_while_busy(unsigned int init_delay_ms)  
     36Device::wait_while_busy(unsigned int init_delay_ms)  
    3737{ 
    3838    signed int i; 
     
    6060 
    6161signed int 
    62 RmeDevice::get_revision(unsigned int *revision) 
     62Device::get_revision(unsigned int *revision) 
    6363{ 
    6464    signed int err = 0; 
     
    7878 
    7979signed int  
    80 RmeDevice::read_flash(fb_nodeaddr_t addr, quadlet_t *buf, unsigned int n_quads) 
     80Device::read_flash(fb_nodeaddr_t addr, quadlet_t *buf, unsigned int n_quads) 
    8181{ 
    8282    // Read "n_quads" quadlets from the Fireface Flash starting at address 
     
    115115 
    116116signed int  
    117 RmeDevice::read_device_settings(void)  
     117Device::read_device_settings(void)  
    118118{ 
    119119    FF_device_flash_settings_t hw_settings; 
  • trunk/libffado/src/rme/fireface_hw.cpp

    r1537 r1543  
    3232 
    3333signed int  
    34 RmeDevice::init_hardware(void) 
     34Device::init_hardware(void) 
    3535{ 
    3636    // Initialises the hardware to a known state.  This has the side effect 
     
    8888    } 
    8989 
    90     data[2] |= (CR_FREQ0 + CR_FREQ1 + CR_DS + CR_QS); 
     90    data[2] |= (CR2_FREQ0 + CR2_FREQ1 + CR2_DSPEED + CR2_QSSPEED); 
    9191 
    9292//data[0] = 0x00020811;      // Phantom off 
  • trunk/libffado/src/rme/rme_avdevice.cpp

    r1537 r1543  
    3232 
    3333#include "debugmodule/debugmodule.h" 
     34 
     35#include "devicemanager.h" 
    3436 
    3537#include <string> 
     
    7678#define MODEL_SELECTOR(_name,_ff400_arg,_ff800_arg) \ 
    7779unsigned long long int \ 
    78 RmeDevice::_name() { \ 
     80Device::_name() { \ 
    7981    switch (m_rme_model) { \ 
    8082        case RME_MODEL_FIREFACE400: return _ff400_arg; \ 
     
    8688} 
    8789 
    88 // to define the supported devices 
    89 static VendorModelEntry supportedDeviceList[] = 
    90 
    91 //  {vendor_id, unit_version, model identifier, vendor name, model name,} 
    92     {FW_VENDORID_RME, 0x0001, RME_MODEL_FIREFACE800, "RME", "Fireface-800",}, 
    93     {FW_VENDORID_RME, 0x0002, RME_MODEL_FIREFACE400, "RME", "Fireface-400",}, 
    94 }; 
    95  
    96 RmeDevice::RmeDevice( DeviceManager& d, 
     90Device::Device( DeviceManager& d, 
    9791                      std::auto_ptr<ConfigRom>( configRom )) 
    9892    : FFADODevice( d, configRom ) 
    99     , m_model( NULL ) 
    10093    , m_rme_model( RME_MODEL_NONE ) 
    10194    , m_ddsFreq( -1 ) 
    10295{ 
    103     debugOutput( DEBUG_LEVEL_VERBOSE, "Created Rme::RmeDevice (NodeID %d)\n", 
     96    debugOutput( DEBUG_LEVEL_VERBOSE, "Created Rme::Device (NodeID %d)\n", 
    10497                 getConfigRom().getNodeId() ); 
    10598} 
    10699 
    107 RmeDevice::~RmeDevice() 
     100Device::~Device() 
    108101{ 
    109102 
     
    111104 
    112105MODEL_SELECTOR(cmd_buffer_addr, RME_FF400_CMD_BUFFER, RME_FF800_CMD_BUFFER) 
    113 MODEL_SELECTOR(stream_start_reg, RME_FF400_STREAM_START_REG, RME_FF800_STREAM_START_REG
     106MODEL_SELECTOR(stream_start_reg, RME_FF400_STREAM_START_REG0, RME_FF800_STREAM_START_REG0
    114107MODEL_SELECTOR(stream_end_reg, RME_FF400_STREAM_END_REG, RME_FF800_STREAM_END_REG) 
    115108MODEL_SELECTOR(flash_settings_addr, RME_FF400_FLASH_SETTINGS_ADDR, RME_FF800_FLASH_SETTINGS_ADDR) 
     
    119112 
    120113bool 
    121 RmeDevice::probe( ConfigRom& configRom, bool generic ) 
    122 
    123     if (generic) return false; 
    124     unsigned int vendorId = configRom.getNodeVendorId(); 
    125     unsigned int unitVersion = configRom.getUnitVersion(); 
    126  
    127     for ( unsigned int i = 0; 
    128           i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); 
    129           ++i ) 
    130     { 
    131         if ( ( supportedDeviceList[i].vendor_id == vendorId ) 
    132              && ( supportedDeviceList[i].unit_version == unitVersion ) 
    133            ) 
    134         { 
    135             return true; 
    136         } 
    137     } 
    138  
    139     return false; 
     114Device::probe( Util::Configuration& c, ConfigRom& configRom, bool generic ) 
     115
     116    if (generic) { 
     117        return false; 
     118    } else { 
     119        // check if device is in supported devices list 
     120        unsigned int vendorId = configRom.getNodeVendorId(); 
     121        unsigned int modelId = configRom.getModelId(); 
     122 
     123        Util::Configuration::VendorModelEntry vme = c.findDeviceVME( vendorId, modelId ); 
     124        return c.isValid(vme) && vme.driver == Util::Configuration::eD_RME; 
     125    } 
    140126} 
    141127 
    142128FFADODevice * 
    143 RmeDevice::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
    144 { 
    145     return new RmeDevice(d, configRom ); 
    146 } 
    147  
    148 bool 
    149 RmeDevice::discover() 
     129Device::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 
     130{ 
     131    return new Device(d, configRom ); 
     132} 
     133 
     134bool 
     135Device::discover() 
    150136{ 
    151137    unsigned int vendorId = getConfigRom().getNodeVendorId(); 
    152     unsigned int unitVersion = getConfigRom().getUnitVersion(); 
    153  
    154     for ( unsigned int i = 0; 
    155           i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); 
    156           ++i ) 
    157     { 
    158         if ( ( supportedDeviceList[i].vendor_id == vendorId ) 
    159              && ( supportedDeviceList[i].unit_version == unitVersion ) 
    160            ) 
    161         { 
    162             m_model = &(supportedDeviceList[i]); 
    163             m_rme_model = supportedDeviceList[i].model; 
    164         } 
    165     } 
    166  
    167     if (m_model == NULL) 
    168         return false; 
    169  
    170     debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", 
    171         m_model->vendor_name, m_model->model_name); 
     138    unsigned int modelId = getConfigRom().getModelId(); 
     139 
     140    Util::Configuration &c = getDeviceManager().getConfiguration(); 
     141    Util::Configuration::VendorModelEntry vme = c.findDeviceVME( vendorId, modelId ); 
     142 
     143    if (c.isValid(vme) && vme.driver == Util::Configuration::eD_RME) { 
     144        debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", 
     145                     vme.vendor_name.c_str(), 
     146                     vme.model_name.c_str()); 
     147    } else { 
     148        debugWarning("Using generic RME support for unsupported device '%s %s'\n", 
     149                     getConfigRom().getVendorName().c_str(), getConfigRom().getModelName().c_str()); 
     150    } 
     151 
     152    if (modelId == RME_MODEL_FIREFACE800) { 
     153        m_rme_model = RME_MODEL_FIREFACE800; 
     154    } else if (modelId == RME_MODEL_FIREFACE400) { 
     155        m_rme_model = RME_MODEL_FIREFACE400; 
     156    } else { 
     157        debugError("Unsupported model\n"); 
     158    } 
    172159 
    173160    init_hardware(); 
    174 read_device_settings(); 
     161    read_device_settings(); 
    175162 
    176163    return true; 
     
    178165 
    179166int 
    180 RmeDevice::getSamplingFrequency( ) { 
     167Device::getSamplingFrequency( ) { 
    181168/* 
    182169 * Retrieve the current sample rate from the RME device.  At this stage it 
     
    194181 
    195182int 
    196 RmeDevice::getConfigurationId() 
     183Device::getConfigurationId() 
    197184{ 
    198185    return 0; 
     
    200187 
    201188bool 
    202 RmeDevice::setSamplingFrequency( int samplingFrequency ) 
     189Device::setSamplingFrequency( int samplingFrequency ) 
    203190{ 
    204191/* 
     
    246233 
    247234std::vector<int> 
    248 RmeDevice::getSupportedSamplingFrequencies() 
     235Device::getSupportedSamplingFrequencies() 
    249236{ 
    250237    std::vector<int> frequencies; 
     
    262249 
    263250FFADODevice::ClockSourceVector 
    264 RmeDevice::getSupportedClockSources() { 
     251Device::getSupportedClockSources() { 
    265252    FFADODevice::ClockSourceVector r; 
    266253    return r; 
     
    268255 
    269256bool 
    270 RmeDevice::setActiveClockSource(ClockSource s) { 
     257Device::setActiveClockSource(ClockSource s) { 
    271258    return false; 
    272259} 
    273260 
    274261FFADODevice::ClockSource 
    275 RmeDevice::getActiveClockSource() { 
     262Device::getActiveClockSource() { 
    276263    ClockSource s; 
    277264    return s; 
     
    279266 
    280267bool 
    281 RmeDevice::lock() { 
     268Device::lock() { 
    282269 
    283270    return true; 
     
    286273 
    287274bool 
    288 RmeDevice::unlock() { 
     275Device::unlock() { 
    289276 
    290277    return true; 
     
    292279 
    293280void 
    294 RmeDevice::showDevice() 
    295 
    296         debugOutput(DEBUG_LEVEL_VERBOSE, 
    297                 "%s %s at node %d\n", m_model->vendor_name, m_model->model_name, 
    298                 getNodeId()); 
    299 
    300  
    301 bool 
    302 RmeDevice::prepare() { 
    303  
    304         debugOutput(DEBUG_LEVEL_NORMAL, "Preparing RmeDevice...\n" ); 
     281Device::showDevice() 
     282
     283    unsigned int vendorId = getConfigRom().getNodeVendorId(); 
     284    unsigned int modelId = getConfigRom().getModelId(); 
     285 
     286    Util::Configuration &c = getDeviceManager().getConfiguration(); 
     287    Util::Configuration::VendorModelEntry vme = c.findDeviceVME( vendorId, modelId ); 
     288 
     289    debugOutput(DEBUG_LEVEL_VERBOSE, 
     290        "%s %s at node %d\n", vme.vendor_name.c_str(), vme.model_name.c_str(), getNodeId()); 
     291
     292 
     293bool 
     294Device::prepare() { 
     295 
     296        debugOutput(DEBUG_LEVEL_NORMAL, "Preparing Device...\n" ); 
    305297 
    306298        return true; 
     
    308300 
    309301int 
    310 RmeDevice::getStreamCount() { 
     302Device::getStreamCount() { 
    311303        return 0; // one receive, one transmit 
    312304} 
    313305 
    314306Streaming::StreamProcessor * 
    315 RmeDevice::getStreamProcessorByIndex(int i) { 
     307Device::getStreamProcessorByIndex(int i) { 
    316308    return NULL; 
    317309} 
    318310 
    319311bool 
    320 RmeDevice::startStreamByIndex(int i) { 
     312Device::startStreamByIndex(int i) { 
    321313    return false; 
    322314} 
    323315 
    324316bool 
    325 RmeDevice::stopStreamByIndex(int i) { 
     317Device::stopStreamByIndex(int i) { 
    326318    return false; 
    327319 
     
    329321 
    330322unsigned int  
    331 RmeDevice::readRegister(fb_nodeaddr_t reg) { 
     323Device::readRegister(fb_nodeaddr_t reg) { 
    332324 
    333325    quadlet_t quadlet; 
     
    341333 
    342334signed int  
    343 RmeDevice::readBlock(fb_nodeaddr_t reg, quadlet_t *buf, unsigned int n_quads) { 
     335Device::readBlock(fb_nodeaddr_t reg, quadlet_t *buf, unsigned int n_quads) { 
    344336 
    345337    unsigned int i; 
     
    358350 
    359351signed int 
    360 RmeDevice::writeRegister(fb_nodeaddr_t reg, quadlet_t data) { 
     352Device::writeRegister(fb_nodeaddr_t reg, quadlet_t data) { 
    361353 
    362354    unsigned int err = 0; 
     
    370362 
    371363signed int 
    372 RmeDevice::writeBlock(fb_nodeaddr_t reg, quadlet_t *data, unsigned int n_quads) { 
     364Device::writeBlock(fb_nodeaddr_t reg, quadlet_t *data, unsigned int n_quads) { 
    373365// 
    374366// Write a block of data to the device starting at address "reg".  Note that 
  • trunk/libffado/src/rme/rme_avdevice.h

    r1534 r1543  
    3131#include "libavc/avc_definitions.h" 
    3232 
     33#include "libutil/Configuration.h" 
     34 
    3335// #include "libstreaming/rme/RmeStreamProcessor.h" 
    3436 
     
    5052}; 
    5153 
    52 // struct to define the supported devices 
    53 struct VendorModelEntry { 
    54     unsigned int vendor_id; 
    55     unsigned int unit_version; 
    56     enum ERmeModel model; 
    57     const char *vendor_name; 
    58     const char *model_name; 
    59 }; 
    60  
    61 class RmeDevice : public FFADODevice { 
     54class Device : public FFADODevice { 
    6255public: 
    6356 
    64     RmeDevice( DeviceManager& d, 
     57    Device( DeviceManager& d, 
    6558               std::auto_ptr<ConfigRom>( configRom )); 
    66     virtual ~RmeDevice(); 
     59    virtual ~Device(); 
    6760 
    68     static bool probe( ConfigRom& configRom, bool generic = false ); 
     61    static bool probe( Util::Configuration& c, ConfigRom& configRom, bool generic = false ); 
    6962    static FFADODevice * createDevice( DeviceManager& d, 
    7063                                        std::auto_ptr<ConfigRom>( configRom )); 
     
    9891 
    9992protected: 
    100     struct VendorModelEntry *m_model; 
    10193    enum ERmeModel m_rme_model; 
    10294 
  • trunk/libffado/src/SConscript

    r1535 r1543  
    9696        bebob/esi/quatafire610.cpp \ 
    9797        bebob/mackie/onyxmixer.cpp \ 
    98         maudio/maudio_avdevice.cpp \ 
    9998' ) 
    10099 
     
    104103        maudio/fwap.xml \ 
    105104' ) 
     105 
     106maudio_source =  env.Split( '\ 
     107        maudio/maudio_avdevice.cpp \ 
     108' ) 
     109 
     110maudio_pkgdata = env.Split( '\ 
     111' )      
    106112 
    107113genericavc_source =  env.Split( '\ 
     
    155161        bounce/bounce_avdevice.cpp \ 
    156162        bounce/bounce_slave_avdevice.cpp \ 
    157         libstreaming/AmdtpSlaveStreamProcessor.cpp \ 
    158163' ) 
    159164 
     
    207212        source += bebob_source 
    208213        pkgdata += bebob_pkgdata 
     214if env['ENABLE_MAUDIO']: 
     215        libenv.AppendUnique( CCFLAGS=["-DENABLE_MAUDIO"] ) 
     216        source += maudio_source 
     217        pkgdata += maudio_pkgdata 
    209218if env['ENABLE_FIREWORKS']: 
    210219        libenv.AppendUnique( CCFLAGS=["-DENABLE_FIREWORKS"] ) 
     
    247256        else: 
    248257                libenv.PrependUnique( LIBS=["expat"] ) 
     258        if env['REQUIRE_LIBAVC']: 
     259                libenv.MergeFlags( env['LIBAVC1394_FLAGS'] ) 
    249260 
    250261# add the libconfig