Changeset 584

Show
Ignore:
Timestamp:
08/29/07 04:44:02 (13 years ago)
Author:
ppalmers
Message:

- fix bug introduced in previous commit
- focusrite and terratec now have specific bebob devices

Files:

Legend:

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

    r583 r584  
    2828#include "bebob/bebob_mixer.h" 
    2929 
    30 #include "bebob/focusrite/focusrite.h" 
    31 #include "bebob/terratec/terratec.h" 
     30#include "bebob/focusrite/focusrite_device.h" 
     31#include "bebob/terratec/terratec_device.h" 
    3232 
    3333#include "libieee1394/configrom.h" 
     
    5454namespace BeBoB { 
    5555 
     56#define FW_VENDORID_TERRATEC  0x000aac 
     57#define FW_VENDORID_MACKIE    0x00000f 
     58#define FW_VENDORID_APOGEE    0x0003db 
     59#define FW_VENDORID_BRIDGECO  0x0007f5 
     60#define FW_VENDORID_PRESONUS  0x000a92 
     61#define FW_VENDORID_ESI       0x000f1b 
     62#define FW_VENDORID_FOCUSRITE 0x00130e 
     63#define FW_VENDORID_EDIROL    0x0040ab 
     64#define FW_VENDORID_MAUDIO    0x000d6c 
     65 
    5666static GenericAVC::VendorModelEntry supportedDeviceList[] = 
    5767{ 
    58     {0x00000f, 0x00010065, "Mackie", "Onyx Firewire"}, 
    59  
    60     {0x0003db, 0x00010048, "Apogee Electronics", "Rosetta 200"}, 
    61  
    62     {0x0007f5, 0x00010048, "BridgeCo", "RD Audio1"}, 
    63  
    64     {0x000a92, 0x00010000, "PreSonus", "FIREBOX"}, 
    65     {0x000a92, 0x00010066, "PreSonus", "FirePOD"}, 
    66  
    67     {0x000aac, 0x00000003, "TerraTec Electronic GmbH", "Phase 88 FW"}, 
    68     {0x000aac, 0x00000004, "TerraTec Electronic GmbH", "Phase X24 FW (model version 4)"}, 
    69     {0x000aac, 0x00000007, "TerraTec Electronic GmbH", "Phase X24 FW (model version 7)"}, 
    70  
    71     {0x000f1b, 0x00010064, "ESI", "Quatafire 610"}, 
    72  
    73     {0x00130e, 0x00000000, "Focusrite", "Saffire (LE)"}, 
    74     {0x00130e, 0x00000003, "Focusrite", "Saffire Pro26IO"}, 
    75     {0x00130e, 0x00000006, "Focusrite", "Saffire Pro10IO"}, 
    76  
    77     {0x0040ab, 0x00010048, "EDIROL", "FA-101"}, 
    78     {0x0040ab, 0x00010049, "EDIROL", "FA-66"}, 
    79  
    80     {0x000d6c, 0x00010062, "M-Audio", "FW Solo"}, 
    81     {0x000d6c, 0x00010081, "M-Audio", "NRV10"}, 
     68    {FW_VENDORID_MACKIE, 0x00010065, "Mackie", "Onyx Firewire"}, 
     69 
     70    {FW_VENDORID_APOGEE, 0x00010048, "Apogee Electronics", "Rosetta 200"}, 
     71 
     72    {FW_VENDORID_BRIDGECO, 0x00010048, "BridgeCo", "RD Audio1"}, 
     73 
     74    {FW_VENDORID_PRESONUS, 0x00010000, "PreSonus", "FIREBOX"}, 
     75    {FW_VENDORID_PRESONUS, 0x00010066, "PreSonus", "FirePOD"}, 
     76 
     77    {FW_VENDORID_TERRATEC, 0x00000003, "TerraTec Electronic GmbH", "Phase 88 FW"}, 
     78    {FW_VENDORID_TERRATEC, 0x00000004, "TerraTec Electronic GmbH", "Phase X24 FW (model version 4)"}, 
     79    {FW_VENDORID_TERRATEC, 0x00000007, "TerraTec Electronic GmbH", "Phase X24 FW (model version 7)"}, 
     80 
     81    {FW_VENDORID_ESI, 0x00010064, "ESI", "Quatafire 610"}, 
     82 
     83    {FW_VENDORID_FOCUSRITE, 0x00000000, "Focusrite", "Saffire (LE)"}, 
     84    {FW_VENDORID_FOCUSRITE, 0x00000003, "Focusrite", "Saffire Pro26IO"}, 
     85    {FW_VENDORID_FOCUSRITE, 0x00000006, "Focusrite", "Saffire Pro10IO"}, 
     86 
     87    {FW_VENDORID_EDIROL, 0x00010048, "EDIROL", "FA-101"}, 
     88    {FW_VENDORID_EDIROL, 0x00010049, "EDIROL", "FA-66"}, 
     89 
     90    {FW_VENDORID_MAUDIO, 0x00010062, "M-Audio", "FW Solo"}, 
     91    {FW_VENDORID_MAUDIO, 0x00010081, "M-Audio", "NRV10"}, 
    8292}; 
    8393 
     
    8898{ 
    8999    debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::AvDevice (NodeID %d)\n", 
    90                  configRom->getNodeId() ); 
     100                 getConfigRom().getNodeId() ); 
    91101} 
    92102 
     
    96106        delete m_Mixer; 
    97107    } 
     108} 
     109 
     110bool 
     111AvDevice::probe( ConfigRom& configRom ) 
     112{ 
     113    unsigned int vendorId = configRom.getNodeVendorId(); 
     114    unsigned int modelId = configRom.getModelId(); 
     115 
     116    //GenericAVC::VendorModel vendorModel( "/home/wagi/src/libffado/src/bebob/ffado_driver_bebob.txt" ); 
     117 
     118    for ( unsigned int i = 0; 
     119          i < ( sizeof( supportedDeviceList )/sizeof( GenericAVC::VendorModelEntry ) ); 
     120          ++i ) 
     121    { 
     122        if ( ( supportedDeviceList[i].vendor_id == vendorId ) 
     123             && ( supportedDeviceList[i].model_id == modelId ) ) 
     124        { 
     125            return true; 
     126        } 
     127    } 
     128    return false; 
     129} 
     130 
     131FFADODevice * 
     132AvDevice::createDevice( Ieee1394Service& ieee1394Service, 
     133                        std::auto_ptr<ConfigRom>( configRom )) 
     134{ 
     135    unsigned int vendorId = configRom->getNodeVendorId(); 
     136    unsigned int modelId = configRom->getModelId(); 
     137                    return new Focusrite::SaffireProDevice(ieee1394Service, configRom); 
     138     
     139    switch (vendorId) { 
     140        case FW_VENDORID_TERRATEC: 
     141            return new Terratec::PhaseSeriesDevice(ieee1394Service, configRom); 
     142        case FW_VENDORID_FOCUSRITE: 
     143            switch(modelId) { 
     144                case 0x00000003: 
     145                case 0x00000006: 
     146                    return new Focusrite::SaffireProDevice(ieee1394Service, configRom); 
     147                default: // return a plain BeBoB device 
     148                    return new AvDevice(ieee1394Service, configRom); 
     149           } 
     150        default: 
     151            return new AvDevice(ieee1394Service, configRom); 
     152    } 
     153    return NULL; 
     154} 
     155 
     156bool 
     157AvDevice::discover() 
     158{ 
     159    unsigned int vendorId = m_pConfigRom->getNodeVendorId(); 
     160    unsigned int modelId = m_pConfigRom->getModelId(); 
     161 
     162    for ( unsigned int i = 0; 
     163          i < ( sizeof( supportedDeviceList )/sizeof( GenericAVC::VendorModelEntry ) ); 
     164          ++i ) 
     165    { 
     166        if ( ( supportedDeviceList[i].vendor_id == vendorId ) 
     167             && ( supportedDeviceList[i].model_id == modelId ) 
     168           ) 
     169        { 
     170            m_model = &(supportedDeviceList[i]); 
     171            break; 
     172        } 
     173    } 
     174 
     175    if (m_model != NULL) { 
     176        debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", 
     177                m_model->vendor_name, m_model->model_name); 
     178    } else return false; 
     179 
     180    if ( !Unit::discover() ) { 
     181        debugError( "Could not discover unit\n" ); 
     182        return false; 
     183    } 
     184 
     185    if((getAudioSubunit( 0 ) == NULL)) { 
     186        debugError( "Unit doesn't have an Audio subunit.\n"); 
     187        return false; 
     188    } 
     189    if((getMusicSubunit( 0 ) == NULL)) { 
     190        debugError( "Unit doesn't have a Music subunit.\n"); 
     191        return false; 
     192    } 
     193 
     194    // create a Mixer 
     195    // this removes the mixer if it already exists 
     196    // note: a mixer self-registers to it's parent 
     197    if(m_Mixer != NULL) { 
     198        delete m_Mixer; 
     199    } 
     200 
     201//      create the mixer & register it 
     202    if(getAudioSubunit(0) == NULL) { 
     203        debugWarning("Could not find audio subunit, mixer not available.\n"); 
     204        m_Mixer = NULL; 
     205    } else { 
     206        m_Mixer = new Mixer(*this); 
     207    } 
     208    return true; 
    98209} 
    99210 
     
    147258    if (p) p->setVerboseLevel(getDebugLevel()); 
    148259    return p; 
    149 } 
    150  
    151 bool 
    152 AvDevice::probe( ConfigRom& configRom ) 
    153 { 
    154     unsigned int vendorId = configRom.getNodeVendorId(); 
    155     unsigned int modelId = configRom.getModelId(); 
    156  
    157     //GenericAVC::VendorModel vendorModel( "/home/wagi/src/libffado/src/bebob/ffado_driver_bebob.txt" ); 
    158  
    159     for ( unsigned int i = 0; 
    160           i < ( sizeof( supportedDeviceList )/sizeof( GenericAVC::VendorModelEntry ) ); 
    161           ++i ) 
    162     { 
    163         if ( ( supportedDeviceList[i].vendor_id == vendorId ) 
    164              && ( supportedDeviceList[i].model_id == modelId ) ) 
    165         { 
    166             return true; 
    167         } 
    168     } 
    169     return false; 
    170 } 
    171  
    172 FFADODevice * 
    173 AvDevice::createDevice( Ieee1394Service& ieee1394Service, 
    174                         std::auto_ptr<ConfigRom>( configRom )) 
    175 { 
    176     return new AvDevice(ieee1394Service, configRom ); 
    177 } 
    178  
    179 bool 
    180 AvDevice::discover() 
    181 { 
    182     unsigned int vendorId = m_pConfigRom->getNodeVendorId(); 
    183     unsigned int modelId = m_pConfigRom->getModelId(); 
    184  
    185     for ( unsigned int i = 0; 
    186           i < ( sizeof( supportedDeviceList )/sizeof( GenericAVC::VendorModelEntry ) ); 
    187           ++i ) 
    188     { 
    189         if ( ( supportedDeviceList[i].vendor_id == vendorId ) 
    190              && ( supportedDeviceList[i].model_id == modelId ) 
    191            ) 
    192         { 
    193             m_model = &(supportedDeviceList[i]); 
    194             break; 
    195         } 
    196     } 
    197  
    198     if (m_model != NULL) { 
    199         debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", 
    200                 m_model->vendor_name, m_model->model_name); 
    201     } else return false; 
    202  
    203     if ( !Unit::discover() ) { 
    204         debugError( "Could not discover unit\n" ); 
    205         return false; 
    206     } 
    207  
    208     if((getAudioSubunit( 0 ) == NULL)) { 
    209         debugError( "Unit doesn't have an Audio subunit.\n"); 
    210         return false; 
    211     } 
    212     if((getMusicSubunit( 0 ) == NULL)) { 
    213         debugError( "Unit doesn't have a Music subunit.\n"); 
    214         return false; 
    215     } 
    216  
    217     // create a Mixer 
    218     // this removes the mixer if it already exists 
    219     // note: a mixer self-registers to it's parent 
    220     if(m_Mixer != NULL) { 
    221         delete m_Mixer; 
    222     } 
    223  
    224 //      create the mixer & register it 
    225     if(getAudioSubunit(0) == NULL) { 
    226         debugWarning("Could not find audio subunit, mixer not available.\n"); 
    227         m_Mixer = NULL; 
    228     } else { 
    229         m_Mixer = new Mixer(*this); 
    230     } 
    231     return true; 
    232260} 
    233261 
     
    448476//     AvDevice* pDev = new AvDevice( 
    449477//         std::auto_ptr<ConfigRom>(configRom), 
    450 //         ieee1394Service, configRom->getNodeId()); 
     478//         ieee1394Service, getConfigRom().getNodeId()); 
    451479// 
    452480//     if ( pDev ) { 
  • trunk/libffado/src/bebob/bebob_avdevice.h

    r583 r584  
    2828 
    2929#include "debugmodule/debugmodule.h" 
     30 
     31#include "libieee1394/configrom.h" 
     32#include "libieee1394/ieee1394service.h" 
     33 
    3034#include "libavc/avc_definitions.h" 
    3135#include "libavc/general/avc_extended_cmd_generic.h" 
     
    5054#include <sstream> 
    5155#include <vector> 
    52  
    53 class ConfigRom; 
    54 class Ieee1394Service; 
    5556 
    5657namespace BeBoB { 
  • trunk/libffado/src/bebob/focusrite/focusrite_cmd.cpp

    r580 r584  
    2222 */ 
    2323 
    24 #include "focusrite.h" 
     24#include "focusrite_cmd.h" 
    2525 
    2626#include <netinet/in.h> 
  • trunk/libffado/src/bebob/terratec/terratec_cmd.cpp

    r580 r584  
    2222 */ 
    2323 
    24 #include "terratec.h" 
     24#include "terratec_cmd.h" 
    2525 
    2626#include <netinet/in.h> 
  • trunk/libffado/src/bounce/bounce_avdevice.cpp

    r583 r584  
    6060{ 
    6161    debugOutput( DEBUG_LEVEL_VERBOSE, "Created Bounce::BounceDevice (NodeID %d)\n", 
    62                  configRom->getNodeId() ); 
     62                 getConfigRom().getNodeId() ); 
    6363    addOption(Util::OptionContainer::Option("snoopMode",false)); 
    6464} 
  • trunk/libffado/src/dice/dice_avdevice.cpp

    r583 r584  
    7272{ 
    7373    debugOutput( DEBUG_LEVEL_VERBOSE, "Created Dice::DiceAvDevice (NodeID %d)\n", 
    74                  configRom->getNodeId() ); 
     74                 getConfigRom().getNodeId() ); 
    7575 
    7676} 
  • trunk/libffado/src/ffadodevice.cpp

    r583 r584  
    3333#include <assert.h> 
    3434 
    35 IMPL_DEBUG_MODULE( FFADODevice, FFADODevice, DEBUG_LEVEL_NORMAL ); 
     35IMPL_DEBUG_MODULE( FFADODevice, FFADODevice, DEBUG_LEVEL_VERBOSE ); 
    3636 
    3737FFADODevice::FFADODevice( Ieee1394Service& ieee1394Service, 
    38                     std::auto_ptr<ConfigRom>( configRom )) 
     38                          std::auto_ptr<ConfigRom>( configRom )) 
    3939    : Control::Container() 
    4040    , m_pConfigRom( configRom ) 
     
    4444 
    4545    std::ostringstream nodestr; 
    46     nodestr << "node" << m_pConfigRom->getNodeId(); 
     46    nodestr << "node" << getConfigRom().getNodeId(); 
    4747     
    4848//     setOscBase(nodestr.str()); 
  • trunk/libffado/src/genericavc/avc_avdevice.cpp

    r583 r584  
    6363{ 
    6464    debugOutput( DEBUG_LEVEL_VERBOSE, "Created GenericAVC::AvDevice (NodeID %d)\n", 
    65                  configRom->getNodeId() ); 
     65                 getConfigRom().getNodeId() ); 
    6666    addOption(Util::OptionContainer::Option("snoopMode",false)); 
    6767} 
  • trunk/libffado/src/maudio/maudio_avdevice.cpp

    r583 r584  
    4646{ 
    4747    debugOutput( DEBUG_LEVEL_VERBOSE, "Created MAudio::AvDevice (NodeID %d)\n", 
    48                  configRom->getNodeId() ); 
     48                 getConfigRom().getNodeId() ); 
    4949} 
    5050 
  • trunk/libffado/src/metrichalo/mh_avdevice.cpp

    r583 r584  
    5757{ 
    5858    debugOutput( DEBUG_LEVEL_VERBOSE, "Created MetricHalo::MHAvDevice (NodeID %d)\n", 
    59                  configRom->getNodeId() ); 
     59                 getConfigRom().getNodeId() ); 
    6060} 
    6161 
  • trunk/libffado/src/motu/motu_avdevice.cpp

    r583 r584  
    6868{ 
    6969    debugOutput( DEBUG_LEVEL_VERBOSE, "Created Motu::MotuDevice (NodeID %d)\n", 
    70                  configRom->getNodeId() ); 
     70                 getConfigRom().getNodeId() ); 
    7171 
    7272} 
  • trunk/libffado/src/rme/rme_avdevice.cpp

    r583 r584  
    5656{ 
    5757    debugOutput( DEBUG_LEVEL_VERBOSE, "Created Rme::RmeDevice (NodeID %d)\n", 
    58                  configRom->getNodeId() ); 
     58                 getConfigRom().getNodeId() ); 
    5959} 
    6060 
  • trunk/libffado/src/SConscript

    r581 r584  
    8181        bebob/bebob_functionblock.cpp \ 
    8282        bebob/bebob_mixer.cpp \ 
    83         bebob/focusrite/focusrite.cpp \ 
    84         bebob/terratec/terratec.cpp \ 
     83        bebob/focusrite/focusrite_device.cpp \ 
     84        bebob/focusrite/focusrite_cmd.cpp \ 
     85        bebob/terratec/terratec_device.cpp \ 
     86        bebob/terratec/terratec_cmd.cpp \ 
    8587        maudio/maudio_avdevice.cpp \ 
    8688' ) 
  • trunk/libffado/tests/test-ffado.cpp

    r582 r584  
    3636#include "ffadodevice.h" 
    3737 
    38 #include "bebob/focusrite/focusrite.h" 
     38#include "bebob/focusrite/focusrite_cmd.h" 
    3939 
    4040#include <dbus-c++/dbus.h>