Changeset 1543
- Timestamp:
- 04/25/09 10:14:57 (14 years ago)
- Files:
-
- trunk/libffado/configuration (modified) (1 diff)
- trunk/libffado/SConstruct (modified) (5 diffs)
- trunk/libffado/src/bebob/bebob_avdevice.cpp (modified) (33 diffs)
- trunk/libffado/src/bebob/bebob_avdevice.h (modified) (2 diffs)
- trunk/libffado/src/bebob/bebob_mixer.cpp (modified) (1 diff)
- trunk/libffado/src/bebob/bebob_mixer.h (modified) (3 diffs)
- trunk/libffado/src/bebob/edirol/edirol_fa101.cpp (modified) (2 diffs)
- trunk/libffado/src/bebob/edirol/edirol_fa101.h (modified) (1 diff)
- trunk/libffado/src/bebob/edirol/edirol_fa66.cpp (modified) (2 diffs)
- trunk/libffado/src/bebob/edirol/edirol_fa66.h (modified) (1 diff)
- trunk/libffado/src/bebob/esi/quatafire610.cpp (modified) (2 diffs)
- trunk/libffado/src/bebob/esi/quatafire610.h (modified) (1 diff)
- trunk/libffado/src/bebob/focusrite/focusrite_generic.cpp (modified) (3 diffs)
- trunk/libffado/src/bebob/focusrite/focusrite_generic.h (modified) (1 diff)
- trunk/libffado/src/bebob/focusrite/focusrite_saffirepro.cpp (modified) (1 diff)
- trunk/libffado/src/bebob/mackie/onyxmixer.cpp (modified) (2 diffs)
- trunk/libffado/src/bebob/mackie/onyxmixer.h (modified) (1 diff)
- trunk/libffado/src/bebob/template/vendor_device.cpp (modified) (2 diffs)
- trunk/libffado/src/bebob/template/vendor_device.h (modified) (1 diff)
- trunk/libffado/src/bebob/terratec/terratec_device.cpp (modified) (2 diffs)
- trunk/libffado/src/bebob/terratec/terratec_device.h (modified) (1 diff)
- trunk/libffado/src/bounce/bounce_avdevice.cpp (modified) (21 diffs)
- trunk/libffado/src/bounce/bounce_avdevice.h (modified) (4 diffs)
- trunk/libffado/src/bounce/bounce_slave_avdevice.cpp (modified) (21 diffs)
- trunk/libffado/src/bounce/bounce_slave_avdevice.h (modified) (3 diffs)
- trunk/libffado/src/devicemanager.cpp (modified) (8 diffs)
- trunk/libffado/src/dice/dice_avdevice.cpp (modified) (64 diffs)
- trunk/libffado/src/dice/dice_avdevice.h (modified) (3 diffs)
- trunk/libffado/src/fireworks/fireworks_device.cpp (modified) (3 diffs)
- trunk/libffado/src/fireworks/fireworks_device.h (modified) (1 diff)
- trunk/libffado/src/genericavc/avc_avdevice.cpp (modified) (25 diffs)
- trunk/libffado/src/genericavc/avc_avdevice.h (modified) (2 diffs)
- trunk/libffado/src/libutil/Configuration.h (modified) (1 diff)
- trunk/libffado/src/maudio/maudio_avdevice.cpp (modified) (3 diffs)
- trunk/libffado/src/maudio/maudio_avdevice.h (modified) (1 diff)
- trunk/libffado/src/metrichalo/mh_avdevice.cpp (modified) (12 diffs)
- trunk/libffado/src/metrichalo/mh_avdevice.h (modified) (3 diffs)
- trunk/libffado/src/oxford/oxford_device.cpp (modified) (2 diffs)
- trunk/libffado/src/oxford/oxford_device.h (modified) (1 diff)
- trunk/libffado/src/rme/fireface_flash.cpp (modified) (5 diffs)
- trunk/libffado/src/rme/fireface_hw.cpp (modified) (2 diffs)
- trunk/libffado/src/rme/rme_avdevice.cpp (modified) (19 diffs)
- trunk/libffado/src/rme/rme_avdevice.h (modified) (3 diffs)
- trunk/libffado/src/SConscript (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/configuration
r1535 r1543 288 288 driver = 10; 289 289 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; 290 409 } 291 410 ); trunk/libffado/SConstruct
r1535 r1543 60 60 PathOption( "INCLUDEDIR", "Overwrite the directory where headers are installed to.", "$PREFIX/include", PathOption.PathAccept ), 61 61 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 ), 70 71 BoolOption( "ENABLE_GENERICAVC", """\ 71 72 Enable/Disable the the generic avc part (mainly used by apple). … … 204 205 env['SERIALIZE_USE_EXPAT']=0 205 206 207 if env['ENABLE_BOUNCE'] or env['ENABLE_ALL']: 208 env['REQUIRE_LIBAVC']=1 209 else: 210 env['REQUIRE_LIBAVC']=0 211 206 212 if not env.GetOption('clean'): 207 213 # … … 230 236 'dbus-1' : '1.0', 231 237 } 238 239 if env['REQUIRE_LIBAVC']: 240 pkgs['libavc1394'] = '0.5.3' 241 232 242 if not env['SERIALIZE_USE_EXPAT']: 233 243 pkgs['libxml++-2.6'] = '2.13.0' … … 236 246 name2 = pkg.replace("+","").replace(".","").replace("-","").upper() 237 247 env['%s_FLAGS' % name2] = conf.GetPKGFlags( pkg, pkgs[pkg] ) 248 print '%s_FLAGS' % name2 238 249 if env['%s_FLAGS'%name2] == 0: 239 250 allpresent &= 0 … … 345 356 env['ENABLE_RME'] = True 346 357 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 350 359 351 360 if env['ENABLE_BEBOB'] or env['ENABLE_DICE'] \ 352 361 or env['ENABLE_BOUNCE'] or env['ENABLE_FIREWORKS'] \ 353 or env['ENABLE_OXFORD'] :362 or env['ENABLE_OXFORD'] or env['ENABLE_MAUDIO']: 354 363 env['ENABLE_GENERICAVC'] = True 355 364 trunk/libffado/src/bebob/bebob_avdevice.cpp
r1498 r1543 60 60 namespace BeBoB { 61 61 62 AvDevice::AvDevice( DeviceManager& d, std::auto_ptr< ConfigRom >( configRom ) )63 : GenericAVC:: AvDevice( d, configRom )62 Device::Device( DeviceManager& d, std::auto_ptr< ConfigRom >( configRom ) ) 63 : GenericAVC::Device( d, configRom ) 64 64 , m_last_discovery_config_id ( 0xFFFFFFFFFFFFFFFFLLU ) 65 65 , m_Mixer ( 0 ) 66 66 { 67 debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB:: AvDevice (NodeID %d)\n",67 debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::Device (NodeID %d)\n", 68 68 getConfigRom().getNodeId() ); 69 69 } 70 70 71 AvDevice::~AvDevice()71 Device::~Device() 72 72 { 73 73 destroyMixer(); … … 75 75 76 76 bool 77 AvDevice::probe( Util::Configuration& c, ConfigRom& configRom, bool generic )77 Device::probe( Util::Configuration& c, ConfigRom& configRom, bool generic ) 78 78 { 79 79 if(generic) { … … 121 121 122 122 FFADODevice * 123 AvDevice::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom ))123 Device::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 124 124 { 125 125 unsigned int vendorId = configRom->getNodeVendorId(); … … 138 138 return new Edirol::EdirolFa66Device(d, configRom); 139 139 default: 140 return new AvDevice(d, configRom);140 return new Device(d, configRom); 141 141 } 142 142 case FW_VENDORID_ESI: … … 150 150 return new Terratec::Phase88Device(d, configRom); 151 151 default: // return a plain BeBoB device 152 return new AvDevice(d, configRom);152 return new Device(d, configRom); 153 153 } 154 154 case FW_VENDORID_FOCUSRITE: … … 160 160 return new Focusrite::SaffireDevice(d, configRom); 161 161 default: // return a plain BeBoB device 162 return new AvDevice(d, configRom);162 return new Device(d, configRom); 163 163 } 164 164 default: 165 return new AvDevice(d, configRom);165 return new Device(d, configRom); 166 166 } 167 167 return NULL; … … 172 172 v.push_back(x); } 173 173 bool 174 AvDevice::discover()174 Device::discover() 175 175 { 176 176 unsigned int vendorId = getConfigRom().getNodeVendorId(); … … 214 214 215 215 bool 216 AvDevice::buildMixer()216 Device::buildMixer() 217 217 { 218 218 debugOutput(DEBUG_LEVEL_VERBOSE, "Building a generic BeBoB mixer...\n"); … … 234 234 235 235 bool 236 AvDevice::destroyMixer()236 Device::destroyMixer() 237 237 { 238 238 delete m_Mixer; … … 241 241 242 242 bool 243 AvDevice::setSelectorFBValue(int id, int value) {243 Device::setSelectorFBValue(int id, int value) { 244 244 FunctionBlockCmd fbCmd( get1394Service(), 245 245 FunctionBlockCmd::eFBT_Selector, … … 270 270 271 271 int 272 AvDevice::getSelectorFBValue(int id) {272 Device::getSelectorFBValue(int id) { 273 273 274 274 FunctionBlockCmd fbCmd( get1394Service(), … … 300 300 301 301 bool 302 AvDevice::setFeatureFBVolumeCurrent(int id, int channel, int v) {302 Device::setFeatureFBVolumeCurrent(int id, int channel, int v) { 303 303 304 304 FunctionBlockCmd fbCmd( get1394Service(), … … 334 334 335 335 int 336 AvDevice::getFeatureFBVolumeValue(int id, int channel, FunctionBlockCmd::EControlAttribute controlAttribute)336 Device::getFeatureFBVolumeValue(int id, int channel, FunctionBlockCmd::EControlAttribute controlAttribute) 337 337 { 338 338 FunctionBlockCmd fbCmd( get1394Service(), … … 370 370 371 371 int 372 AvDevice::getFeatureFBVolumeMinimum(int id, int channel)372 Device::getFeatureFBVolumeMinimum(int id, int channel) 373 373 { 374 374 return getFeatureFBVolumeValue(id, channel, AVC::FunctionBlockCmd::eCA_Minimum); … … 376 376 377 377 int 378 AvDevice::getFeatureFBVolumeMaximum(int id, int channel)378 Device::getFeatureFBVolumeMaximum(int id, int channel) 379 379 { 380 380 return getFeatureFBVolumeValue(id, channel, AVC::FunctionBlockCmd::eCA_Maximum); … … 382 382 383 383 int 384 AvDevice::getFeatureFBVolumeCurrent(int id, int channel)384 Device::getFeatureFBVolumeCurrent(int id, int channel) 385 385 { 386 386 return getFeatureFBVolumeValue(id, channel, AVC::FunctionBlockCmd::eCA_Current); … … 388 388 389 389 bool 390 AvDevice::setFeatureFBLRBalanceCurrent(int id, int channel, int v) {390 Device::setFeatureFBLRBalanceCurrent(int id, int channel, int v) { 391 391 392 392 FunctionBlockCmd fbCmd( get1394Service(), … … 422 422 423 423 int 424 AvDevice::getFeatureFBLRBalanceValue(int id, int channel, FunctionBlockCmd::EControlAttribute controlAttribute)424 Device::getFeatureFBLRBalanceValue(int id, int channel, FunctionBlockCmd::EControlAttribute controlAttribute) 425 425 { 426 426 FunctionBlockCmd fbCmd( get1394Service(), … … 458 458 459 459 int 460 AvDevice::getFeatureFBLRBalanceMinimum(int id, int channel)460 Device::getFeatureFBLRBalanceMinimum(int id, int channel) 461 461 { 462 462 return getFeatureFBLRBalanceValue(id, channel, AVC::FunctionBlockCmd::eCA_Minimum); … … 464 464 465 465 int 466 AvDevice::getFeatureFBLRBalanceMaximum(int id, int channel)466 Device::getFeatureFBLRBalanceMaximum(int id, int channel) 467 467 { 468 468 return getFeatureFBLRBalanceValue(id, channel, AVC::FunctionBlockCmd::eCA_Maximum); … … 470 470 471 471 int 472 AvDevice::getFeatureFBLRBalanceCurrent(int id, int channel)472 Device::getFeatureFBLRBalanceCurrent(int id, int channel) 473 473 { 474 474 return getFeatureFBLRBalanceValue(id, channel, AVC::FunctionBlockCmd::eCA_Current); … … 476 476 477 477 void 478 AvDevice::showDevice()478 Device::showDevice() 479 479 { 480 480 debugOutput(DEBUG_LEVEL_NORMAL, "Device is a BeBoB device\n"); 481 GenericAVC:: AvDevice::showDevice();481 GenericAVC::Device::showDevice(); 482 482 flushDebugOutput(); 483 483 } 484 484 485 485 void 486 AvDevice::setVerboseLevel(int l)486 Device::setVerboseLevel(int l) 487 487 { 488 488 if (m_Mixer) m_Mixer->setVerboseLevel( l ); 489 GenericAVC:: AvDevice::setVerboseLevel( l );489 GenericAVC::Device::setVerboseLevel( l ); 490 490 debugOutput( DEBUG_LEVEL_VERBOSE, "Setting verbose level to %d...\n", l ); 491 491 } 492 492 493 493 AVC::Subunit* 494 AvDevice::createSubunit(AVC::Unit& unit,494 Device::createSubunit(AVC::Unit& unit, 495 495 AVC::ESubunitType type, 496 496 AVC::subunit_t id ) … … 514 514 515 515 AVC::Plug * 516 AvDevice::createPlug( AVC::Unit* unit,516 Device::createPlug( AVC::Unit* unit, 517 517 AVC::Subunit* subunit, 518 518 AVC::function_block_type_t functionBlockType, … … 537 537 538 538 bool 539 AvDevice::propagatePlugInfo() {539 Device::propagatePlugInfo() { 540 540 // we don't have to propagate since we discover things 541 541 // another way … … 545 545 546 546 uint8_t 547 AvDevice::getConfigurationIdSampleRate()547 Device::getConfigurationIdSampleRate() 548 548 { 549 549 ExtendedStreamFormatCmd extStreamFormatCmd( get1394Service() ); … … 578 578 579 579 uint8_t 580 AvDevice::getConfigurationIdNumberOfChannel( PlugAddress::EPlugDirection ePlugDirection )580 Device::getConfigurationIdNumberOfChannel( PlugAddress::EPlugDirection ePlugDirection ) 581 581 { 582 582 ExtendedPlugInfoCmd extPlugInfoCmd( get1394Service() ); … … 613 613 614 614 uint16_t 615 AvDevice::getConfigurationIdSyncMode()615 Device::getConfigurationIdSyncMode() 616 616 { 617 617 SignalSourceCmd signalSourceCmd( get1394Service() ); … … 659 659 660 660 bool 661 AvDevice::needsRediscovery()661 Device::needsRediscovery() 662 662 { 663 663 // require rediscovery if the config id differs from the one saved … … 667 667 668 668 uint64_t 669 AvDevice::getConfigurationId()669 Device::getConfigurationId() 670 670 { 671 671 // create a unique configuration id. … … 679 679 680 680 bool 681 AvDevice::serialize( std::string basePath,681 Device::serialize( std::string basePath, 682 682 Util::IOSerialize& ser ) const 683 683 { 684 684 bool result; 685 result = GenericAVC:: AvDevice::serialize( basePath, ser );685 result = GenericAVC::Device::serialize( basePath, ser ); 686 686 return result; 687 687 } 688 688 689 689 bool 690 AvDevice::deserialize( std::string basePath,690 Device::deserialize( std::string basePath, 691 691 Util::IODeserialize& deser ) 692 692 { 693 693 bool result; 694 result = GenericAVC:: AvDevice::deserialize( basePath, deser );694 result = GenericAVC::Device::deserialize( basePath, deser ); 695 695 return result; 696 696 } 697 697 698 698 std::string 699 AvDevice::getCachePath()699 Device::getCachePath() 700 700 { 701 701 std::string cachePath; … … 719 719 720 720 bool 721 AvDevice::loadFromCache()721 Device::loadFromCache() 722 722 { 723 723 std::string sDevicePath = getCachePath() + getConfigRom().getGuidString(); … … 767 767 768 768 bool 769 AvDevice::saveCache()769 Device::saveCache() 770 770 { 771 771 // the path looks like this: … … 800 800 // come up with an unique file name for the current settings 801 801 char* configId; 802 asprintf(&configId, "%016llx", BeBoB:: AvDevice::getConfigurationId() );802 asprintf(&configId, "%016llx", BeBoB::Device::getConfigurationId() ); 803 803 if ( !configId ) { 804 804 debugError( "Could not create id string\n" ); trunk/libffado/src/bebob/bebob_avdevice.h
r1498 r1543 22 22 */ 23 23 24 #ifndef BEBOB_ AVDEVICE_H25 #define BEBOB_ AVDEVICE_H24 #ifndef BEBOB_DEVICE_H 25 #define BEBOB_DEVICE_H 26 26 27 27 #include <stdint.h> … … 59 59 namespace BeBoB { 60 60 61 class AvDevice : public GenericAVC::AvDevice {61 class Device : public GenericAVC::Device { 62 62 public: 63 AvDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom ));64 virtual ~ AvDevice();63 Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 64 virtual ~Device(); 65 65 66 66 static bool probe( Util::Configuration&, ConfigRom& configRom, bool generic = false ); trunk/libffado/src/bebob/bebob_mixer.cpp
r1498 r1543 56 56 IMPL_DEBUG_MODULE( Mixer, Mixer, DEBUG_LEVEL_NORMAL ); 57 57 58 Mixer::Mixer( AvDevice &d)58 Mixer::Mixer(Device &d) 59 59 : Control::Container(&d) 60 60 , m_device(d) trunk/libffado/src/bebob/bebob_mixer.h
r1361 r1543 33 33 namespace BeBoB { 34 34 35 class AvDevice;35 class Device; 36 36 class FunctionBlock; 37 37 class FunctionBlockFeature; … … 43 43 { 44 44 public: 45 Mixer( AvDevice &d);45 Mixer(Device &d); 46 46 virtual ~Mixer(); 47 47 … … 60 60 bool clearElements(); 61 61 62 AvDevice& getParent()62 Device& getParent() 63 63 {return m_device;}; 64 64 65 65 protected: 66 AvDevice& m_device;66 Device& m_device; 67 67 protected: 68 68 DECLARE_DEBUG_MODULE; trunk/libffado/src/bebob/edirol/edirol_fa101.cpp
r1498 r1543 29 29 EdirolFa101Device::EdirolFa101Device( DeviceManager& d, 30 30 std::auto_ptr<ConfigRom>( configRom )) 31 : BeBoB:: AvDevice( d , configRom)31 : BeBoB::Device( d , configRom) 32 32 { 33 33 debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::Edirol::EdirolFa101Device (NodeID %d)\n", … … 70 70 { 71 71 debugOutput(DEBUG_LEVEL_VERBOSE, "This is a BeBoB::EdirolFa101::EdirolFa101Device\n"); 72 BeBoB:: AvDevice::showDevice();72 BeBoB::Device::showDevice(); 73 73 } 74 74 trunk/libffado/src/bebob/edirol/edirol_fa101.h
r1199 r1543 30 30 namespace Edirol { 31 31 32 class EdirolFa101Device : public BeBoB:: AvDevice {32 class EdirolFa101Device : public BeBoB::Device { 33 33 public: 34 34 EdirolFa101Device( DeviceManager& d, trunk/libffado/src/bebob/edirol/edirol_fa66.cpp
r1199 r1543 29 29 EdirolFa66Device::EdirolFa66Device( DeviceManager& d, 30 30 std::auto_ptr<ConfigRom>( configRom )) 31 : BeBoB:: AvDevice( d , configRom)31 : BeBoB::Device( d , configRom) 32 32 { 33 33 debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::Edirol::EdirolFa66Device (NodeID %d)\n", … … 68 68 { 69 69 debugOutput(DEBUG_LEVEL_VERBOSE, "This is a BeBoB::EdirolFa66::EdirolFa66Device\n"); 70 BeBoB:: AvDevice::showDevice();70 BeBoB::Device::showDevice(); 71 71 } 72 72 trunk/libffado/src/bebob/edirol/edirol_fa66.h
r1199 r1543 30 30 namespace Edirol { 31 31 32 class EdirolFa66Device : public BeBoB:: AvDevice {32 class EdirolFa66Device : public BeBoB::Device { 33 33 public: 34 34 EdirolFa66Device( DeviceManager& d, trunk/libffado/src/bebob/esi/quatafire610.cpp
r1066 r1543 30 30 31 31 QuataFireDevice::QuataFireDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 32 : BeBoB:: AvDevice( d, configRom)32 : BeBoB::Device( d, configRom) 33 33 { 34 34 m_fixed_clocksource.type = FFADODevice::eCT_Auto; … … 51 51 { 52 52 debugOutput(DEBUG_LEVEL_VERBOSE, "This is a BeBoB::ESI::QuataFireDevice\n"); 53 BeBoB:: AvDevice::showDevice();53 BeBoB::Device::showDevice(); 54 54 } 55 55 trunk/libffado/src/bebob/esi/quatafire610.h
r1066 r1543 31 31 namespace ESI { 32 32 33 class QuataFireDevice : public BeBoB:: AvDevice {33 class QuataFireDevice : public BeBoB::Device { 34 34 35 35 public: trunk/libffado/src/bebob/focusrite/focusrite_generic.cpp
r1531 r1543 31 31 32 32 FocusriteDevice::FocusriteDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 33 : BeBoB:: AvDevice( d, configRom)33 : BeBoB::Device( d, configRom) 34 34 , m_cmd_time_interval( 0 ) 35 35 , m_earliest_next_cmd_time( 0 ) … … 44 44 { 45 45 debugOutput(DEBUG_LEVEL_NORMAL, "This is a BeBoB::Focusrite::FocusriteDevice\n"); 46 BeBoB:: AvDevice::showDevice();46 BeBoB::Device::showDevice(); 47 47 } 48 48 … … 52 52 debugOutput( DEBUG_LEVEL_VERBOSE, "Setting verbose level to %d...\n", l ); 53 53 54 BeBoB:: AvDevice::setVerboseLevel(l);54 BeBoB::Device::setVerboseLevel(l); 55 55 } 56 56 trunk/libffado/src/bebob/focusrite/focusrite_generic.h
r1531 r1543 216 216 }; 217 217 218 class FocusriteDevice : public BeBoB:: AvDevice {218 class FocusriteDevice : public BeBoB::Device { 219 219 public: 220 220 FocusriteDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); trunk/libffado/src/bebob/focusrite/focusrite_saffirepro.cpp
r1498 r1543 546 546 { 547 547 // have the generic mechanism create a unique configuration id. 548 uint64_t id = BeBoB:: AvDevice::getConfigurationId();548 uint64_t id = BeBoB::Device::getConfigurationId(); 549 549 550 550 // there are some parts that can be enabled/disabled and trunk/libffado/src/bebob/mackie/onyxmixer.cpp
r1498 r1543 30 30 31 31 OnyxMixerDevice::OnyxMixerDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 32 : BeBoB:: AvDevice( d, configRom)32 : BeBoB::Device( d, configRom) 33 33 { 34 34 m_fixed_clocksource.type = FFADODevice::eCT_Internal; … … 51 51 { 52 52 debugOutput(DEBUG_LEVEL_VERBOSE, "This is a BeBoB::Mackie::OnyxMixerDevice\n"); 53 BeBoB:: AvDevice::showDevice();53 BeBoB::Device::showDevice(); 54 54 } 55 55 trunk/libffado/src/bebob/mackie/onyxmixer.h
r1210 r1543 31 31 namespace Mackie { 32 32 33 class OnyxMixerDevice : public BeBoB:: AvDevice {33 class OnyxMixerDevice : public BeBoB::Device { 34 34 35 35 public: trunk/libffado/src/bebob/template/vendor_device.cpp
r864 r1543 29 29 VendorDevice::VendorDevice( Ieee1394Service& ieee1394Service, 30 30 std::auto_ptr<ConfigRom>( configRom )) 31 : BeBoB:: AvDevice( ieee1394Service, configRom)31 : BeBoB::Device( ieee1394Service, configRom) 32 32 { 33 33 debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::__Vendor__::VendorDevice (NodeID %d)\n", … … 43 43 { 44 44 debugOutput(DEBUG_LEVEL_VERBOSE, "This is a BeBoB::__Vendor__::VendorDevice\n"); 45 BeBoB:: AvDevice::showDevice();45 BeBoB::Device::showDevice(); 46 46 } 47 47 trunk/libffado/src/bebob/template/vendor_device.h
r864 r1543 32 32 namespace __Vendor__ { 33 33 34 class VendorDevice : public BeBoB:: AvDevice {34 class VendorDevice : public BeBoB::Device { 35 35 public: 36 36 VendorDevice( Ieee1394Service& ieee1394Service, trunk/libffado/src/bebob/terratec/terratec_device.cpp
r1245 r1543 28 28 29 29 Phase88Device::Phase88Device(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 30 : BeBoB:: AvDevice( d, configRom)30 : BeBoB::Device( d, configRom) 31 31 { 32 32 debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::Terratec::Phase88Device (NodeID %d)\n", … … 43 43 { 44 44 debugOutput(DEBUG_LEVEL_NORMAL, "This is a BeBoB::Terratec::Phase88Device\n"); 45 BeBoB:: AvDevice::showDevice();45 BeBoB::Device::showDevice(); 46 46 } 47 47 /* 'externalsync': ['/Mixer/Selector_8', self.comboExtSync], trunk/libffado/src/bebob/terratec/terratec_device.h
r1245 r1543 32 32 namespace Terratec { 33 33 34 class Phase88Device : public BeBoB:: AvDevice {34 class Phase88Device : public BeBoB::Device { 35 35 public: 36 36 Phase88Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); trunk/libffado/src/bounce/bounce_avdevice.cpp
r1239 r1543 28 28 #include "libieee1394/ieee1394service.h" 29 29 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" 36 31 37 32 #include "debugmodule/debugmodule.h" 33 34 #include "devicemanager.h" 38 35 39 36 #include <iostream> … … 46 43 namespace Bounce { 47 44 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 ) 45 Device::Device( DeviceManager& d, std::auto_ptr< ConfigRom >( configRom ) ) 46 : FFADODevice( d, configRom ) 57 47 , m_samplerate (44100) 58 , m_model( NULL )59 48 , m_Notifier ( NULL ) 60 49 { 61 debugOutput( DEBUG_LEVEL_VERBOSE, "Created Bounce:: BounceDevice (NodeID %d)\n",50 debugOutput( DEBUG_LEVEL_VERBOSE, "Created Bounce::Device (NodeID %d)\n", 62 51 getConfigRom().getNodeId() ); 63 52 addOption(Util::OptionContainer::Option("snoopMode",false)); 64 53 } 65 54 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 55 Device::~Device() 56 { 57 58 } 59 60 bool 61 Device::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 } 96 73 return false; 97 74 } 98 75 99 76 FFADODevice * 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", 77 Device::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 78 { 79 return new Device(d, configRom ); 80 } 81 82 bool 83 Device::discover() 84 { 85 debugOutput( DEBUG_LEVEL_VERBOSE, "discovering Device (NodeID %d)\n", 110 86 getNodeId() ); 111 87 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) { 130 95 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 105 int Device::getSamplingFrequency( ) { 138 106 return m_samplerate; 139 107 } 140 108 141 bool BounceDevice::setSamplingFrequency( int s ) {109 bool Device::setSamplingFrequency( int s ) { 142 110 if (s) { 143 111 m_samplerate=s; … … 147 115 148 116 FFADODevice::ClockSourceVector 149 BounceDevice::getSupportedClockSources() {117 Device::getSupportedClockSources() { 150 118 FFADODevice::ClockSourceVector r; 151 119 return r; … … 153 121 154 122 bool 155 BounceDevice::setActiveClockSource(ClockSource s) {123 Device::setActiveClockSource(ClockSource s) { 156 124 return false; 157 125 } 158 126 159 127 FFADODevice::ClockSource 160 BounceDevice::getActiveClockSource() {128 Device::getActiveClockSource() { 161 129 ClockSource s; 162 130 return s; 163 131 } 164 132 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() { 133 std::vector<int> 134 Device::getSupportedSamplingFrequencies() 135 { 136 std::vector<int> frequencies; 137 return frequencies; 138 } 139 140 141 bool 142 Device::lock() { 143 144 return true; 145 } 146 147 148 bool 149 Device::unlock() { 179 150 180 151 return true; … … 182 153 183 154 void 184 BounceDevice::showDevice() 185 { 155 Device::showDevice() 156 { 157 186 158 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()); 191 161 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()); 193 163 debugOutput(DEBUG_LEVEL_NORMAL, "\n" ); 194 164 } 195 165 196 166 bool 197 BounceDevice::addPortsToProcessor(167 Device::addPortsToProcessor( 198 168 Streaming::StreamProcessor *processor, 199 169 Streaming::Port::E_Direction direction) { … … 257 227 258 228 bool 259 BounceDevice::prepare() {260 debugOutput(DEBUG_LEVEL_NORMAL, "Preparing BounceDevice...\n" );229 Device::prepare() { 230 debugOutput(DEBUG_LEVEL_NORMAL, "Preparing Device...\n" ); 261 231 262 232 bool snoopMode=false; … … 268 238 Streaming::StreamProcessor *p; 269 239 270 p=new Streaming::AmdtpReceiveStreamProcessor( 271 m_p1394Service->getPort(), 272 m_samplerate, 240 p=new Streaming::AmdtpReceiveStreamProcessor(*this, 273 241 BOUNCE_NB_AUDIO_CHANNELS+(BOUNCE_NB_MIDI_CHANNELS?1:0)); 274 242 … … 291 259 if (snoopMode) { 292 260 // 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, 296 262 BOUNCE_NB_AUDIO_CHANNELS+(BOUNCE_NB_MIDI_CHANNELS?1:0)); 297 263 } else { 298 p=new Streaming::AmdtpTransmitStreamProcessor( 299 m_p1394Service->getPort(), 300 m_samplerate, 264 p=new Streaming::AmdtpTransmitStreamProcessor(*this, 301 265 BOUNCE_NB_AUDIO_CHANNELS+(BOUNCE_NB_MIDI_CHANNELS?1:0)); 302 266 } … … 331 295 332 296 int 333 BounceDevice::getStreamCount() {297 Device::getStreamCount() { 334 298 return m_receiveProcessors.size() + m_transmitProcessors.size(); 335 299 } 336 300 337 301 Streaming::StreamProcessor * 338 BounceDevice::getStreamProcessorByIndex(int i) {302 Device::getStreamProcessorByIndex(int i) { 339 303 if (i<(int)m_receiveProcessors.size()) { 340 304 return m_receiveProcessors.at(i); … … 347 311 348 312 bool 349 BounceDevice::startStreamByIndex(int i) {313 Device::startStreamByIndex(int i) { 350 314 if (i<(int)m_receiveProcessors.size()) { 351 315 int n=i; … … 431 395 432 396 bool 433 BounceDevice::stopStreamByIndex(int i) {397 Device::stopStreamByIndex(int i) { 434 398 if (i<(int)m_receiveProcessors.size()) { 435 399 int n=i; … … 505 469 506 470 // allocate ISO resources for the SP's 507 int BounceDevice::allocateIsoChannel(unsigned int packet_size) {471 int Device::allocateIsoChannel(unsigned int packet_size) { 508 472 unsigned int bandwidth=8+packet_size; 509 473 510 int ch= m_p1394Service->allocateIsoChannelGeneric(bandwidth);474 int ch=get1394Service().allocateIsoChannelGeneric(bandwidth); 511 475 512 476 debugOutput(DEBUG_LEVEL_VERBOSE, "allocated channel %d, bandwidth %d\n", … … 516 480 } 517 481 // deallocate ISO resources 518 bool BounceDevice::deallocateIsoChannel(int channel) {482 bool Device::deallocateIsoChannel(int channel) { 519 483 debugOutput(DEBUG_LEVEL_VERBOSE, "freeing channel %d\n",channel); 520 return m_p1394Service->freeIsoChannel(channel);484 return get1394Service().freeIsoChannel(channel); 521 485 } 522 486 … … 524 488 525 489 bool 526 BounceDevice::readReg(fb_nodeaddr_t offset, fb_quadlet_t *result) {490 Device::readReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 527 491 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX\n", offset); 528 492 … … 535 499 fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 536 500 537 if(! m_p1394Service->read_quadlet( nodeId, addr, result ) ) {501 if(!get1394Service().read_quadlet( nodeId, addr, result ) ) { 538 502 debugError("Could not read from node 0x%04X addr 0x%012X\n", nodeId, addr); 539 503 return false; … … 545 509 546 510 bool 547 BounceDevice::writeReg(fb_nodeaddr_t offset, fb_quadlet_t data) {511 Device::writeReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 548 512 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, data: 0x%08X\n", 549 513 offset, data); … … 557 521 fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 558 522 559 if(! m_p1394Service->write_quadlet( nodeId, addr, data ) ) {523 if(!get1394Service().write_quadlet( nodeId, addr, data ) ) { 560 524 debugError("Could not write to node 0x%04X addr 0x%012X\n", nodeId, addr); 561 525 return false; … … 565 529 566 530 bool 567 BounceDevice::readRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) {531 Device::readRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 568 532 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX, length %u\n", 569 533 offset, length); … … 577 541 fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 578 542 579 if(! m_p1394Service->read( nodeId, addr, length, data ) ) {543 if(!get1394Service().read( nodeId, addr, length, data ) ) { 580 544 debugError("Could not read from node 0x%04X addr 0x%012llX\n", nodeId, addr); 581 545 return false; … … 585 549 586 550 bool 587 BounceDevice::writeRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) {551 Device::writeRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 588 552 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, length: %u\n", 589 553 offset, length); … … 597 561 fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 598 562 599 if(! m_p1394Service->write( nodeId, addr, length, data ) ) {563 if(!get1394Service().write( nodeId, addr, length, data ) ) { 600 564 debugError("Could not write to node 0x%04X addr 0x%012llX\n", nodeId, addr); 601 565 return false; trunk/libffado/src/bounce/bounce_avdevice.h
r1239 r1543 53 53 54 54 class ConfigRom; 55 class Ieee1394Service;55 class DeviceManager; 56 56 57 57 namespace Bounce { 58 58 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 { 59 class Device : public FFADODevice { 69 60 private: 70 61 class BounceNotifier; 71 62 public: 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(); 75 65 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 )); 80 68 virtual bool discover(); 81 69 … … 86 74 virtual bool setActiveClockSource(ClockSource); 87 75 virtual ClockSource getActiveClockSource(); 76 77 virtual std::vector<int> getSupportedSamplingFrequencies(); 88 78 89 79 virtual bool prepare(); … … 102 92 protected: 103 93 unsigned int m_samplerate; 104 struct VendorModelEntry* m_model;105 94 106 95 // streaming stuff … … 135 124 { 136 125 public: 137 BounceNotifier( BounceDevice *, nodeaddr_t start);126 BounceNotifier(Device *, nodeaddr_t start); 138 127 virtual ~BounceNotifier(); 139 128 140 129 private: 141 BounceDevice *m_bouncedevice;130 Device *m_bouncedevice; 142 131 }; 143 132 }; trunk/libffado/src/bounce/bounce_slave_avdevice.cpp
r1136 r1543 23 23 */ 24 24 25 #include "libstreaming/amdtp/AmdtpSlaveStreamProcessor.h" 25 #include "libstreaming/amdtp/AmdtpReceiveStreamProcessor.h" 26 #include "libstreaming/amdtp/AmdtpTransmitStreamProcessor.h" 26 27 27 28 #include "libieee1394/configrom.h" … … 37 38 namespace Bounce { 38 39 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 ) 40 SlaveDevice::SlaveDevice( DeviceManager& d, std::auto_ptr< ConfigRom >( configRom ) ) 41 : Device( d, configRom ) 48 42 { 49 43 addOption(Util::OptionContainer::Option("isoTimeoutSecs",(int64_t)120)); 50 44 } 51 45 52 BounceSlaveDevice::~BounceSlaveDevice() {53 54 } 55 56 bool 57 BounceSlaveDevice::probe( ConfigRom& configRom)46 SlaveDevice::~SlaveDevice() { 47 48 } 49 50 bool 51 SlaveDevice::probe( Util::Configuration& c, ConfigRom& configRom, bool generic ) 58 52 { 59 53 // we are always capable of constructing a slave device … … 62 56 63 57 FFADODevice * 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() { 58 SlaveDevice::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 59 { 60 return new SlaveDevice(d, configRom ); 61 } 62 63 bool 64 SlaveDevice::discover() 65 { 66 return true; 67 } 68 69 bool SlaveDevice::initMemSpace() { 83 70 debugOutput(DEBUG_LEVEL_VERBOSE, "Initializing memory space...\n"); 84 71 fb_quadlet_t result=0xFFFFFFFFLU; … … 96 83 97 84 // 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 ) { 101 88 debugError("Could not initalize local config rom\n"); 102 89 return false; … … 104 91 105 92 // refresh our config rom cache 106 if ( ! m_pConfigRom->initialize() ) {93 if ( !getConfigRom().initialize() ) { 107 94 // \todo If a PHY on the bus is in power safe mode then 108 95 // the config rom is missing. So this might be just … … 117 104 } 118 105 119 bool BounceSlaveDevice::restoreMemSpace() {106 bool SlaveDevice::restoreMemSpace() { 120 107 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 112 bool 113 SlaveDevice::lock() { 114 debugOutput(DEBUG_LEVEL_VERBOSE, "Locking node %d\n", getNodeId()); 129 115 130 116 // get a notifier to handle device notifications 131 117 nodeaddr_t notify_address; 132 notify_address = m_p1394Service->findFreeARMBlock(118 notify_address = get1394Service().findFreeARMBlock( 133 119 BOUNCE_REGISTER_BASE, 134 120 BOUNCE_REGISTER_LENGTH, … … 140 126 } 141 127 142 m_Notifier=new BounceSlaveDevice::BounceSlaveNotifier(this, notify_address);128 m_Notifier=new SlaveDevice::BounceSlaveNotifier(this, notify_address); 143 129 144 130 if(!m_Notifier) { … … 147 133 } 148 134 149 if (! m_p1394Service->registerARMHandler(m_Notifier)) {135 if (!get1394Service().registerARMHandler(m_Notifier)) { 150 136 debugError("Could not register notifier\n"); 151 137 delete m_Notifier; … … 164 150 165 151 bool 166 BounceSlaveDevice::unlock() {152 SlaveDevice::unlock() { 167 153 // (re)initialize the memory space 168 154 if (!restoreMemSpace()) { … … 170 156 return false; 171 157 } 172 m_p1394Service->unregisterARMHandler(m_Notifier);158 get1394Service().unregisterARMHandler(m_Notifier); 173 159 delete m_Notifier; 174 160 m_Notifier=NULL; … … 178 164 179 165 bool 180 BounceSlaveDevice::prepare() {181 debugOutput(DEBUG_LEVEL_NORMAL, "Preparing BounceSlaveDevice...\n" );166 SlaveDevice::prepare() { 167 debugOutput(DEBUG_LEVEL_NORMAL, "Preparing SlaveDevice...\n" ); 182 168 183 169 // create & add streamprocessors 184 170 Streaming::StreamProcessor *p; 185 171 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)); 190 174 191 175 if(!p->init()) { … … 205 189 206 190 // 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)); 211 193 212 194 if(!p->init()) { … … 229 211 // this has to wait until the ISO channel numbers are written 230 212 bool 231 BounceSlaveDevice::startStreamByIndex(int i) {213 SlaveDevice::startStreamByIndex(int i) { 232 214 233 215 if (i<(int)m_receiveProcessors.size()) { … … 258 240 } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 259 241 int n=i-m_receiveProcessors.size(); 260 Streaming::StreamProcessor *p =m_transmitProcessors.at(n);242 Streaming::StreamProcessor *p = m_transmitProcessors.at(n); 261 243 262 244 // the other side sends on this channel … … 289 271 290 272 bool 291 BounceSlaveDevice::stopStreamByIndex(int i) {273 SlaveDevice::stopStreamByIndex(int i) { 292 274 // nothing special to do I guess... 293 275 return false; … … 296 278 // helpers 297 279 bool 298 BounceSlaveDevice::waitForRegisterNotEqualTo(nodeaddr_t offset, fb_quadlet_t v) {280 SlaveDevice::waitForRegisterNotEqualTo(nodeaddr_t offset, fb_quadlet_t v) { 299 281 debugOutput( DEBUG_LEVEL_VERBOSE, "Waiting for StreamProcessor streams to start running...\n"); 300 282 // we have to wait until all streamprocessors indicate that they are running … … 329 311 330 312 331 struct BounceSlaveDevice::configrom_backup332 BounceSlaveDevice::save_config_rom(raw1394handle_t handle)313 struct SlaveDevice::configrom_backup 314 SlaveDevice::save_config_rom(raw1394handle_t handle) 333 315 { 334 316 int retval; … … 343 325 344 326 int 345 BounceSlaveDevice::restore_config_rom(raw1394handle_t handle, struct BounceSlaveDevice::configrom_backup old)327 SlaveDevice::restore_config_rom(raw1394handle_t handle, struct SlaveDevice::configrom_backup old) 346 328 { 347 329 int retval; … … 375 357 376 358 int 377 BounceSlaveDevice::init_config_rom(raw1394handle_t handle)359 SlaveDevice::init_config_rom(raw1394handle_t handle) 378 360 { 379 361 int retval, i; … … 461 443 // the notifier 462 444 463 BounceSlaveDevice::BounceSlaveNotifier::BounceSlaveNotifier(BounceSlaveDevice *d, nodeaddr_t start)445 SlaveDevice::BounceSlaveNotifier::BounceSlaveNotifier(SlaveDevice *d, nodeaddr_t start) 464 446 : ARMHandler(start, BOUNCE_REGISTER_LENGTH, 465 447 RAW1394_ARM_READ | RAW1394_ARM_WRITE, // allowed operations … … 471 453 } 472 454 473 BounceSlaveDevice::BounceSlaveNotifier::~BounceSlaveNotifier()455 SlaveDevice::BounceSlaveNotifier::~BounceSlaveNotifier() 474 456 { 475 457 trunk/libffado/src/bounce/bounce_slave_avdevice.h
r864 r1543 41 41 namespace Bounce { 42 42 43 class BounceSlaveDevice : public BounceDevice {43 class SlaveDevice : public Device { 44 44 class BounceSlaveNotifier; 45 45 public: 46 46 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(); 50 49 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 54 53 bool discover(); 55 54 bool prepare(); … … 82 81 BounceSlaveNotifier *m_Notifier; 83 82 /** 84 * this class reacts on the o hter side writing to the83 * this class reacts on the other side writing to the 85 84 * hosts address space 86 85 */ … … 88 87 { 89 88 public: 90 BounceSlaveNotifier( BounceSlaveDevice *, nodeaddr_t start);89 BounceSlaveNotifier(SlaveDevice *, nodeaddr_t start); 91 90 virtual ~BounceSlaveNotifier(); 92 91 93 92 private: 94 BounceSlaveDevice *m_bounceslavedevice;93 SlaveDevice *m_bounceslavedevice; 95 94 }; 96 95 }; trunk/libffado/src/devicemanager.cpp
r1539 r1543 43 43 #ifdef ENABLE_BEBOB 44 44 #include "bebob/bebob_avdevice.h" 45 #endif 46 47 #ifdef ENABLE_MAUDIO 45 48 #include "maudio/maudio_avdevice.h" 46 49 #endif … … 933 936 #ifdef ENABLE_BEBOB 934 937 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 ) ); 937 940 } 938 941 #endif … … 952 955 #endif 953 956 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 954 964 // we want to try the non-generic AV/C platforms before trying the generic ones 955 965 #ifdef ENABLE_GENERICAVC 956 966 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 ) ); 959 969 } 960 970 #endif … … 969 979 #ifdef ENABLE_DICE 970 980 debugOutput( DEBUG_LEVEL_VERBOSE, "Trying Dice...\n" ); 971 if ( Dice::D iceAvDevice::probe(*configRom, generic ) ) {972 return Dice::D iceAvDevice::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 ) ); 973 983 } 974 984 #endif … … 976 986 #ifdef ENABLE_METRIC_HALO 977 987 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 ) ); 980 990 } 981 991 #endif … … 983 993 #ifdef ENABLE_RME 984 994 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 ) ); 987 997 } 988 998 #endif … … 990 1000 #ifdef ENABLE_BOUNCE 991 1001 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 ) ); 994 1004 } 995 1005 #endif … … 1025 1035 { 1026 1036 #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 ) ); 1029 1039 } 1030 1040 #endif trunk/libffado/src/dice/dice_avdevice.cpp
r1539 r1543 50 50 namespace Dice { 51 51 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 )) 52 Device::Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 72 53 : FFADODevice( d, configRom ) 73 , m_model( NULL )74 54 , m_global_reg_offset (0xFFFFFFFFLU) 75 55 , m_global_reg_size (0xFFFFFFFFLU) … … 88 68 , m_notifier (NULL) 89 69 { 90 debugOutput( DEBUG_LEVEL_VERBOSE, "Created Dice::D iceAvDevice (NodeID %d)\n",70 debugOutput( DEBUG_LEVEL_VERBOSE, "Created Dice::Device (NodeID %d)\n", 91 71 getConfigRom().getNodeId() ); 92 addOption(Util::OptionContainer::Option("snoopMode", false));93 } 94 95 D iceAvDevice::~DiceAvDevice()72 addOption(Util::OptionContainer::Option("snoopMode", false)); 73 } 74 75 Device::~Device() 96 76 { 97 77 for ( StreamProcessorVectorIterator it = m_receiveProcessors.begin(); … … 114 94 115 95 bool 116 D iceAvDevice::probe(ConfigRom& configRom, bool generic )96 Device::probe( Util::Configuration& c, ConfigRom& configRom, bool generic ) 117 97 { 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 } 135 108 } 136 109 137 110 FFADODevice * 138 D iceAvDevice::createDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom ))111 Device::createDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 139 112 { 140 return new D iceAvDevice( d, configRom );141 } 142 143 bool 144 D iceAvDevice::discover()113 return new Device( d, configRom ); 114 } 115 116 bool 117 Device::discover() 145 118 { 146 119 unsigned int vendorId = getConfigRom().getNodeVendorId(); 147 120 unsigned int modelId = getConfigRom().getModelId(); 148 121 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()); 164 132 } 165 133 … … 169 137 } 170 138 171 debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s (nick: %s)\n",172 m_model->vendor_name, m_model->model_name, getDeviceNickName().c_str());173 174 139 return true; 175 140 } 176 141 177 142 int 178 D iceAvDevice::getSamplingFrequency( ) {143 Device::getSamplingFrequency( ) { 179 144 int samplingFrequency; 180 145 … … 209 174 v.push_back(x); } 210 175 std::vector<int> 211 D iceAvDevice::getSupportedSamplingFrequencies()176 Device::getSupportedSamplingFrequencies() 212 177 { 213 178 std::vector<int> frequencies; … … 223 188 224 189 int 225 D iceAvDevice::getConfigurationId()190 Device::getConfigurationId() 226 191 { 227 192 return 0; … … 229 194 230 195 bool 231 D iceAvDevice::setSamplingFrequency( int samplingFrequency )196 Device::setSamplingFrequency( int samplingFrequency ) 232 197 { 233 198 debugOutput(DEBUG_LEVEL_VERBOSE, "Setting sample rate: %d\n", … … 340 305 341 306 FFADODevice::ClockSourceVector 342 D iceAvDevice::getSupportedClockSources() {307 Device::getSupportedClockSources() { 343 308 FFADODevice::ClockSourceVector r; 344 309 … … 388 353 389 354 bool 390 D iceAvDevice::isClockSourceIdLocked(unsigned int id, quadlet_t ext_status_reg) {355 Device::isClockSourceIdLocked(unsigned int id, quadlet_t ext_status_reg) { 391 356 switch (id) { 392 357 default: return true; … … 418 383 } 419 384 bool 420 D iceAvDevice::isClockSourceIdSlipping(unsigned int id, quadlet_t ext_status_reg) {385 Device::isClockSourceIdSlipping(unsigned int id, quadlet_t ext_status_reg) { 421 386 switch (id) { 422 387 default: return false; … … 449 414 450 415 enum FFADODevice::eClockSourceType 451 D iceAvDevice::clockIdToType(unsigned int id) {416 Device::clockIdToType(unsigned int id) { 452 417 switch (id) { 453 418 default: return eCT_Invalid; … … 475 440 476 441 bool 477 D iceAvDevice::setActiveClockSource(ClockSource s) {442 Device::setActiveClockSource(ClockSource s) { 478 443 fb_quadlet_t clockreg; 479 444 if (!readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &clockreg)) { … … 505 470 506 471 FFADODevice::ClockSource 507 D iceAvDevice::getActiveClockSource() {472 Device::getActiveClockSource() { 508 473 ClockSource s; 509 474 quadlet_t clock_caps; … … 548 513 549 514 bool 550 D iceAvDevice::setNickname( std::string name)515 Device::setNickname( std::string name) 551 516 { 552 517 return setDeviceNickName(name); … … 554 519 555 520 std::string 556 D iceAvDevice::getNickname()521 Device::getNickname() 557 522 { 558 523 return getDeviceNickName(); … … 560 525 561 526 void 562 D iceAvDevice::showDevice()527 Device::showDevice() 563 528 { 564 529 fb_quadlet_t tmp_quadlet; … … 707 672 // the size of the packet. 708 673 bool 709 D iceAvDevice::prepare() {674 Device::prepare() { 710 675 fb_quadlet_t nb_audio; 711 676 fb_quadlet_t nb_midi; … … 977 942 978 943 bool 979 D iceAvDevice::addChannelToProcessor(944 Device::addChannelToProcessor( 980 945 diceChannelInfo *channelInfo, 981 946 Streaming::StreamProcessor *processor, … … 1034 999 1035 1000 bool 1036 D iceAvDevice::lock() {1001 Device::lock() { 1037 1002 fb_octlet_t result; 1038 1003 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()); 1041 1005 1042 1006 bool snoopMode = false; … … 1062 1026 } 1063 1027 1064 m_notifier=new D iceAvDevice::DiceNotifier(this, notify_address);1028 m_notifier=new Device::DiceNotifier(this, notify_address); 1065 1029 1066 1030 if(!m_notifier) { … … 1110 1074 1111 1075 bool 1112 D iceAvDevice::unlock() {1076 Device::unlock() { 1113 1077 fb_octlet_t result; 1114 1078 … … 1157 1121 1158 1122 bool 1159 D iceAvDevice::enableStreaming() {1123 Device::enableStreaming() { 1160 1124 bool snoopMode = false; 1161 1125 if(!getOption("snoopMode", snoopMode)) { … … 1172 1136 1173 1137 bool 1174 D iceAvDevice::disableStreaming() {1138 Device::disableStreaming() { 1175 1139 bool snoopMode = false; 1176 1140 if(!getOption("snoopMode", snoopMode)) { … … 1187 1151 1188 1152 int 1189 D iceAvDevice::getStreamCount() {1153 Device::getStreamCount() { 1190 1154 return m_receiveProcessors.size() + m_transmitProcessors.size(); 1191 1155 } 1192 1156 1193 1157 Streaming::StreamProcessor * 1194 D iceAvDevice::getStreamProcessorByIndex(int i) {1158 Device::getStreamProcessorByIndex(int i) { 1195 1159 1196 1160 if (i<(int)m_receiveProcessors.size()) { … … 1204 1168 1205 1169 bool 1206 D iceAvDevice::startStreamByIndex(int i) {1170 Device::startStreamByIndex(int i) { 1207 1171 bool snoopMode = false; 1208 1172 if(!getOption("snoopMode", snoopMode)) { … … 1323 1287 1324 1288 bool 1325 D iceAvDevice::stopStreamByIndex(int i) {1289 Device::stopStreamByIndex(int i) { 1326 1290 bool snoopMode = false; 1327 1291 if(!getOption("snoopMode", snoopMode)) { … … 1415 1379 1416 1380 // allocate ISO resources for the SP's 1417 int D iceAvDevice::allocateIsoChannel(unsigned int packet_size) {1381 int Device::allocateIsoChannel(unsigned int packet_size) { 1418 1382 unsigned int bandwidth=8+packet_size; 1419 1383 … … 1426 1390 } 1427 1391 // deallocate ISO resources 1428 bool D iceAvDevice::deallocateIsoChannel(int channel) {1392 bool Device::deallocateIsoChannel(int channel) { 1429 1393 debugOutput(DEBUG_LEVEL_VERBOSE, "freeing channel %d\n",channel); 1430 1394 return get1394Service().freeIsoChannel(channel); … … 1432 1396 1433 1397 bool 1434 D iceAvDevice::enableIsoStreaming() {1398 Device::enableIsoStreaming() { 1435 1399 return writeGlobalReg(DICE_REGISTER_GLOBAL_ENABLE, DICE_ISOSTREAMING_ENABLE); 1436 1400 } 1437 1401 1438 1402 bool 1439 D iceAvDevice::disableIsoStreaming() {1403 Device::disableIsoStreaming() { 1440 1404 return writeGlobalReg(DICE_REGISTER_GLOBAL_ENABLE, DICE_ISOSTREAMING_DISABLE); 1441 1405 } 1442 1406 1443 1407 bool 1444 D iceAvDevice::isIsoStreamingEnabled() {1408 Device::isIsoStreamingEnabled() { 1445 1409 fb_quadlet_t result; 1446 1410 readGlobalReg(DICE_REGISTER_GLOBAL_ENABLE, &result); … … 1455 1419 */ 1456 1420 bool 1457 D iceAvDevice::maskedCheckZeroGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t mask) {1421 Device::maskedCheckZeroGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t mask) { 1458 1422 fb_quadlet_t result; 1459 1423 readGlobalReg(offset, &result); … … 1465 1429 */ 1466 1430 bool 1467 D iceAvDevice::maskedCheckNotZeroGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t mask) {1431 Device::maskedCheckNotZeroGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t mask) { 1468 1432 return !maskedCheckZeroGlobalReg(offset, mask); 1469 1433 } 1470 1434 1471 D iceAvDevice::diceNameVector1472 D iceAvDevice::getTxNameString(unsigned int i) {1435 Device::diceNameVector 1436 Device::getTxNameString(unsigned int i) { 1473 1437 diceNameVector names; 1474 1438 char namestring[DICE_TX_NAMES_SIZE+1]; … … 1484 1448 } 1485 1449 1486 D iceAvDevice::diceNameVector1487 D iceAvDevice::getRxNameString(unsigned int i) {1450 Device::diceNameVector 1451 Device::getRxNameString(unsigned int i) { 1488 1452 diceNameVector names; 1489 1453 char namestring[DICE_RX_NAMES_SIZE+1]; … … 1499 1463 } 1500 1464 1501 D iceAvDevice::diceNameVector1502 D iceAvDevice::getClockSourceNameString() {1465 Device::diceNameVector 1466 Device::getClockSourceNameString() { 1503 1467 diceNameVector names; 1504 1468 char namestring[DICE_CLOCKSOURCENAMES_SIZE+1]; … … 1515 1479 1516 1480 std::string 1517 D iceAvDevice::getDeviceNickName() {1481 Device::getDeviceNickName() { 1518 1482 char namestring[DICE_NICK_NAME_SIZE+1]; 1519 1483 … … 1529 1493 1530 1494 bool 1531 D iceAvDevice::setDeviceNickName(std::string name) {1495 Device::setDeviceNickName(std::string name) { 1532 1496 char namestring[DICE_NICK_NAME_SIZE+1]; 1533 1497 strncpy(namestring, name.c_str(), DICE_NICK_NAME_SIZE); … … 1541 1505 } 1542 1506 1543 D iceAvDevice::diceNameVector1544 D iceAvDevice::splitNameString(std::string in) {1507 Device::diceNameVector 1508 Device::splitNameString(std::string in) { 1545 1509 diceNameVector names; 1546 1510 … … 1566 1530 // I/O routines 1567 1531 bool 1568 D iceAvDevice::initIoFunctions() {1532 Device::initIoFunctions() { 1569 1533 1570 1534 // offsets and sizes are returned in quadlets, but we use byte values … … 1676 1640 1677 1641 bool 1678 D iceAvDevice::readReg(fb_nodeaddr_t offset, fb_quadlet_t *result) {1642 Device::readReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 1679 1643 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX\n", offset); 1680 1644 … … 1700 1664 1701 1665 bool 1702 D iceAvDevice::writeReg(fb_nodeaddr_t offset, fb_quadlet_t data) {1666 Device::writeReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 1703 1667 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, data: 0x%08X\n", 1704 1668 offset, data); … … 1720 1684 1721 1685 bool 1722 D iceAvDevice::readRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) {1686 Device::readRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1723 1687 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX, length %u\n", 1724 1688 offset, length); … … 1745 1709 1746 1710 bool 1747 D iceAvDevice::writeRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) {1711 Device::writeRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1748 1712 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, length: %u\n", 1749 1713 offset, length); … … 1772 1736 1773 1737 bool 1774 D iceAvDevice::readRegBlockSwapped(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) {1738 Device::readRegBlockSwapped(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1775 1739 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX, length %u\n", 1776 1740 offset, length); … … 1797 1761 1798 1762 bool 1799 D iceAvDevice::writeRegBlockSwapped(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) {1763 Device::writeRegBlockSwapped(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1800 1764 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, length: %u\n", 1801 1765 offset, length); … … 1824 1788 1825 1789 bool 1826 D iceAvDevice::readGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t *result) {1790 Device::readGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 1827 1791 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register offset 0x%04llX\n", offset); 1828 1792 … … 1832 1796 1833 1797 bool 1834 D iceAvDevice::writeGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t data) {1798 Device::writeGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 1835 1799 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register offset 0x%08llX, data: 0x%08X\n", 1836 1800 offset, data); … … 1841 1805 1842 1806 bool 1843 D iceAvDevice::readGlobalRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) {1807 Device::readGlobalRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1844 1808 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register block offset 0x%04llX, length %u bytes\n", 1845 1809 offset, length); … … 1850 1814 1851 1815 bool 1852 D iceAvDevice::writeGlobalRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) {1816 Device::writeGlobalRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1853 1817 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register block offset 0x%04llX, length %u bytes\n", 1854 1818 offset, length); … … 1859 1823 1860 1824 bool 1861 D iceAvDevice::readGlobalRegBlockSwapped(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) {1825 Device::readGlobalRegBlockSwapped(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1862 1826 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register block offset 0x%04llX, length %u bytes\n", 1863 1827 offset, length); … … 1868 1832 1869 1833 bool 1870 D iceAvDevice::writeGlobalRegBlockSwapped(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) {1834 Device::writeGlobalRegBlockSwapped(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1871 1835 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register block offset 0x%04llX, length %u bytes\n", 1872 1836 offset, length); … … 1877 1841 1878 1842 fb_nodeaddr_t 1879 D iceAvDevice::globalOffsetGen(fb_nodeaddr_t offset, size_t length) {1843 Device::globalOffsetGen(fb_nodeaddr_t offset, size_t length) { 1880 1844 1881 1845 // registry offsets should always be smaller than 0x7FFFFFFF … … 1895 1859 1896 1860 bool 1897 D iceAvDevice::readTxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) {1861 Device::readTxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) { 1898 1862 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Reading tx %d register offset 0x%04llX\n", i, offset); 1899 1863 … … 1903 1867 1904 1868 bool 1905 D iceAvDevice::writeTxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t data) {1869 Device::writeTxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t data) { 1906 1870 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing tx %d register offset 0x%08llX, data: 0x%08X\n", 1907 1871 i, offset, data); … … 1912 1876 1913 1877 bool 1914 D iceAvDevice::readTxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) {1878 Device::readTxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1915 1879 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04llX, length %u bytes\n", 1916 1880 offset, length); … … 1921 1885 1922 1886 bool 1923 D iceAvDevice::writeTxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) {1887 Device::writeTxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1924 1888 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04llX, length %u bytes\n", 1925 1889 offset, length); … … 1930 1894 1931 1895 bool 1932 D iceAvDevice::readTxRegBlockSwapped(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) {1896 Device::readTxRegBlockSwapped(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1933 1897 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04llX, length %u bytes\n", 1934 1898 offset, length); … … 1939 1903 1940 1904 fb_nodeaddr_t 1941 D iceAvDevice::txOffsetGen(unsigned int i, fb_nodeaddr_t offset, size_t length) {1905 Device::txOffsetGen(unsigned int i, fb_nodeaddr_t offset, size_t length) { 1942 1906 // registry offsets should always be smaller than 0x7FFFFFFF 1943 1907 // because otherwise base + offset > 64bit … … 1971 1935 1972 1936 bool 1973 D iceAvDevice::readRxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) {1937 Device::readRxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) { 1974 1938 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx %d register offset 0x%04llX\n", i, offset); 1975 1939 … … 1979 1943 1980 1944 bool 1981 D iceAvDevice::writeRxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t data) {1945 Device::writeRxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t data) { 1982 1946 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register offset 0x%08llX, data: 0x%08X\n", 1983 1947 offset, data); … … 1988 1952 1989 1953 bool 1990 D iceAvDevice::readRxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) {1954 Device::readRxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1991 1955 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04llX, length %u bytes\n", 1992 1956 offset, length); … … 1997 1961 1998 1962 bool 1999 D iceAvDevice::writeRxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) {1963 Device::writeRxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 2000 1964 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04llX, length %u bytes\n", 2001 1965 offset, length); … … 2006 1970 2007 1971 bool 2008 D iceAvDevice::readRxRegBlockSwapped(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) {1972 Device::readRxRegBlockSwapped(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 2009 1973 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04llX, length %u bytes\n", 2010 1974 offset, length); … … 2015 1979 2016 1980 fb_nodeaddr_t 2017 D iceAvDevice::rxOffsetGen(unsigned int i, fb_nodeaddr_t offset, size_t length) {1981 Device::rxOffsetGen(unsigned int i, fb_nodeaddr_t offset, size_t length) { 2018 1982 // registry offsets should always be smaller than 0x7FFFFFFF 2019 1983 // because otherwise base + offset > 64bit … … 2048 2012 // the notifier 2049 2013 2050 D iceAvDevice::DiceNotifier::DiceNotifier(DiceAvDevice *d, nodeaddr_t start)2014 Device::DiceNotifier::DiceNotifier(Device *d, nodeaddr_t start) 2051 2015 : ARMHandler(start, DICE_NOTIFIER_BLOCK_LENGTH, 2052 2016 RAW1394_ARM_READ | RAW1394_ARM_WRITE | RAW1394_ARM_LOCK, … … 2057 2021 } 2058 2022 2059 D iceAvDevice::DiceNotifier::~DiceNotifier()2023 Device::DiceNotifier::~DiceNotifier() 2060 2024 { 2061 2025 trunk/libffado/src/dice/dice_avdevice.h
r1336 r1543 45 45 class DiceNotifier; 46 46 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 { 47 class Device : public FFADODevice { 56 48 private: 57 49 class DiceNotifier; 58 50 public: 59 D iceAvDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom ));60 ~D iceAvDevice();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 ); 63 55 static FFADODevice * createDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 64 56 virtual bool discover(); … … 94 86 95 87 protected: 96 struct VendorModelEntry *m_model;97 88 98 89 // streaming stuff … … 204 195 { 205 196 public: 206 DiceNotifier(D iceAvDevice *, nodeaddr_t start);197 DiceNotifier(Device *, nodeaddr_t start); 207 198 virtual ~DiceNotifier(); 208 199 209 200 private: 210 D iceAvDevice *m_dicedevice;201 Device *m_dicedevice; 211 202 }; 212 203 }; trunk/libffado/src/fireworks/fireworks_device.cpp
r1336 r1543 51 51 52 52 Device::Device(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 53 : GenericAVC:: AvDevice( d, configRom)53 : GenericAVC::Device( d, configRom) 54 54 , m_poll_lock( new Util::PosixMutex("DEVPOLL") ) 55 55 , m_efc_discovery_done ( false ) … … 76 76 } 77 77 m_HwInfo.showEfcCmd(); 78 GenericAVC:: AvDevice::showDevice();78 GenericAVC::Device::showDevice(); 79 79 } 80 80 … … 141 141 142 142 // 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" ); 145 145 return false; 146 146 } trunk/libffado/src/fireworks/fireworks_device.h
r1336 r1543 42 42 namespace FireWorks { 43 43 44 class Device : public GenericAVC:: AvDevice {44 class Device : public GenericAVC::Device { 45 45 friend class MonitorControl; 46 46 friend class SimpleControl; trunk/libffado/src/genericavc/avc_avdevice.cpp
r1539 r1543 48 48 namespace GenericAVC { 49 49 50 IMPL_DEBUG_MODULE( AvDevice, AvDevice, DEBUG_LEVEL_NORMAL );51 52 AvDevice::AvDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom ))50 IMPL_DEBUG_MODULE( Device, Device, DEBUG_LEVEL_NORMAL ); 51 52 Device::Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 53 53 : FFADODevice( d, configRom ) 54 54 { 55 debugOutput( DEBUG_LEVEL_VERBOSE, "Created GenericAVC:: AvDevice (NodeID %d)\n",55 debugOutput( DEBUG_LEVEL_VERBOSE, "Created GenericAVC::Device (NodeID %d)\n", 56 56 getConfigRom().getNodeId() ); 57 57 addOption(Util::OptionContainer::Option("snoopMode",false)); 58 58 } 59 59 60 AvDevice::~AvDevice()60 Device::~Device() 61 61 { 62 62 for ( StreamProcessorVectorIterator it = m_receiveProcessors.begin(); … … 75 75 76 76 bool 77 AvDevice::probe( Util::Configuration& c, ConfigRom& configRom, bool generic )77 Device::probe( Util::Configuration& c, ConfigRom& configRom, bool generic ) 78 78 { 79 79 if(generic) { … … 107 107 108 108 FFADODevice * 109 AvDevice::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom ))110 { 111 return new AvDevice(d, configRom );112 } 113 114 bool 115 AvDevice::discover()109 Device::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 110 { 111 return new Device(d, configRom ); 112 } 113 114 bool 115 Device::discover() 116 116 { 117 117 Util::MutexLockHelper lock(m_DeviceMutex); … … 135 135 136 136 bool 137 AvDevice::discoverGeneric()137 Device::discoverGeneric() 138 138 { 139 139 if ( !Unit::discover() ) { … … 154 154 155 155 void 156 AvDevice::setVerboseLevel(int l)156 Device::setVerboseLevel(int l) 157 157 { 158 158 Util::MutexLockHelper lock(m_DeviceMutex); … … 166 166 #include <libieee1394/IEC61883.h> 167 167 enum FFADODevice::eStreamingState 168 AvDevice::getStreamingState()168 Device::getStreamingState() 169 169 { 170 170 // check the IEC plug control registers to see if the device is streaming … … 200 200 201 201 int 202 AvDevice::getSamplingFrequency( ) {202 Device::getSamplingFrequency( ) { 203 203 AVC::Plug* inputPlug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Input, 0 ); 204 204 if ( !inputPlug ) { … … 222 222 223 223 bool 224 AvDevice::setSamplingFrequency( int s )224 Device::setSamplingFrequency( int s ) 225 225 { 226 226 Util::MutexLockHelper lock(m_DeviceMutex); … … 274 274 275 275 bool 276 AvDevice::supportsSamplingFrequency( int s )276 Device::supportsSamplingFrequency( int s ) 277 277 { 278 278 Util::MutexLockHelper lock(m_DeviceMutex); … … 309 309 310 310 std::vector<int> 311 AvDevice::getSupportedSamplingFrequencies()311 Device::getSupportedSamplingFrequencies() 312 312 { 313 313 if (m_supported_frequencies_cache.size() == 0) { … … 326 326 327 327 FFADODevice::ClockSourceVector 328 AvDevice::getSupportedClockSources() {328 Device::getSupportedClockSources() { 329 329 FFADODevice::ClockSourceVector r; 330 330 … … 359 359 360 360 bool 361 AvDevice::setActiveClockSource(ClockSource s) {361 Device::setActiveClockSource(ClockSource s) { 362 362 AVC::Plug *src = m_pPlugManager->getPlug( s.id ); 363 363 if (!src) { … … 382 382 383 383 FFADODevice::ClockSource 384 AvDevice::getActiveClockSource() {384 Device::getActiveClockSource() { 385 385 const SyncInfo* si=getActiveSyncInfo(); 386 386 if ( !si ) { … … 396 396 397 397 FFADODevice::ClockSource 398 AvDevice::syncInfoToClockSource(const SyncInfo& si) {398 Device::syncInfoToClockSource(const SyncInfo& si) { 399 399 ClockSource s; 400 400 … … 465 465 466 466 bool 467 AvDevice::lock() {467 Device::lock() { 468 468 bool snoopMode=false; 469 469 Util::MutexLockHelper lock(m_DeviceMutex); … … 482 482 483 483 bool 484 AvDevice::unlock() {484 Device::unlock() { 485 485 bool snoopMode=false; 486 486 Util::MutexLockHelper lock(m_DeviceMutex); … … 498 498 499 499 void 500 AvDevice::showDevice()500 Device::showDevice() 501 501 { 502 502 FFADODevice::showDevice(); … … 507 507 508 508 bool 509 AvDevice::prepare() {509 Device::prepare() { 510 510 bool snoopMode = false; 511 511 Util::MutexLockHelper lock(m_DeviceMutex); … … 653 653 654 654 bool 655 AvDevice::addPlugToProcessor(655 Device::addPlugToProcessor( 656 656 AVC::Plug& plug, 657 657 Streaming::StreamProcessor *processor, … … 749 749 750 750 int 751 AvDevice::getStreamCount() {751 Device::getStreamCount() { 752 752 int retval; 753 753 Util::MutexLockHelper lock(m_DeviceMutex); … … 757 757 758 758 Streaming::StreamProcessor * 759 AvDevice::getStreamProcessorByIndex(int i) {759 Device::getStreamProcessorByIndex(int i) { 760 760 761 761 if (i<(int)m_receiveProcessors.size()) { … … 769 769 770 770 bool 771 AvDevice::startStreamByIndex(int i) {771 Device::startStreamByIndex(int i) { 772 772 int iso_channel=-1; 773 773 bool snoopMode=false; … … 852 852 853 853 bool 854 AvDevice::stopStreamByIndex(int i) {854 Device::stopStreamByIndex(int i) { 855 855 bool snoopMode=false; 856 856 if(!getOption("snoopMode", snoopMode)) { … … 910 910 911 911 bool 912 AvDevice::serialize( std::string basePath, Util::IOSerialize& ser ) const912 Device::serialize( std::string basePath, Util::IOSerialize& ser ) const 913 913 { 914 914 bool result; … … 919 919 920 920 bool 921 AvDevice::deserialize( std::string basePath, Util::IODeserialize& deser )921 Device::deserialize( std::string basePath, Util::IODeserialize& deser ) 922 922 { 923 923 bool result; trunk/libffado/src/genericavc/avc_avdevice.h
r1535 r1543 23 23 */ 24 24 25 #ifndef GENERICAVC_ AVDEVICE_H26 #define GENERICAVC_ AVDEVICE_H25 #ifndef GENERICAVC_DEVICE_H 26 #define GENERICAVC_DEVICE_H 27 27 28 28 #include "ffadodevice.h" … … 46 46 namespace GenericAVC { 47 47 48 class AvDevice : public FFADODevice, public AVC::Unit {48 class Device : public FFADODevice, public AVC::Unit { 49 49 public: 50 AvDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom ));51 virtual ~ AvDevice();50 Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 51 virtual ~Device(); 52 52 53 53 static bool probe( Util::Configuration&, ConfigRom& configRom, bool generic = false ); trunk/libffado/src/libutil/Configuration.h
r1535 r1543 43 43 // driver ID's to be used in the config file 44 44 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, 51 56 }; 52 57 trunk/libffado/src/maudio/maudio_avdevice.cpp
r1239 r1543 22 22 */ 23 23 24 #warning M-Audio support is currently useless 25 24 26 #include "maudio/maudio_avdevice.h" 25 #include "bebob/bebob_avdevice.h"26 27 27 28 #include "libieee1394/configrom.h" … … 32 33 #include "debugmodule/debugmodule.h" 33 34 35 #include "devicemanager.h" 36 34 37 #include <string> 35 38 #include <stdint.h> … … 37 40 namespace MAudio { 38 41 39 AvDevice::AvDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 40 : BeBoB::AvDevice( d, configRom) 41 , m_model ( NULL ) 42 Device::Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 43 : FFADODevice( d, configRom) 42 44 { 43 debugOutput( DEBUG_LEVEL_VERBOSE, "Created MAudio:: AvDevice (NodeID %d)\n",45 debugOutput( DEBUG_LEVEL_VERBOSE, "Created MAudio::Device (NodeID %d)\n", 44 46 getConfigRom().getNodeId() ); 45 47 } 46 48 47 AvDevice::~AvDevice()49 Device::~Device() 48 50 { 49 51 } 50 52 51 static VendorModelEntry supportedDeviceList[] = 53 bool 54 Device::probe( Util::Configuration& c, ConfigRom& configRom, bool generic ) 52 55 { 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(); 54 62 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; 77 65 } 78 return false;79 66 } 80 67 81 68 FFADODevice * 82 AvDevice::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom ))69 Device::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 83 70 { 84 return new AvDevice( d, configRom );71 return new Device( d, configRom ); 85 72 } 86 73 87 74 bool 88 AvDevice::discover()75 Device::discover() 89 76 { 90 77 unsigned int vendorId = getConfigRom().getNodeVendorId(); 91 78 unsigned int modelId = getConfigRom().getModelId(); 92 79 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()); 104 90 } 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;110 91 111 92 return true; 112 93 } 113 94 95 96 int 97 Device::getSamplingFrequency( ) { 98 return 0; 99 } 100 101 std::vector<int> 102 Device::getSupportedSamplingFrequencies() 103 { 104 std::vector<int> frequencies; 105 return frequencies; 106 } 107 108 FFADODevice::ClockSourceVector 109 Device::getSupportedClockSources() { 110 FFADODevice::ClockSourceVector r; 111 return r; 112 } 113 114 114 bool 115 AvDevice::setSamplingFrequency( int eSamplingFrequency ) 116 { 117 // not supported 115 Device::setActiveClockSource(ClockSource s) { 118 116 return false; 119 117 } 120 118 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 { 119 FFADODevice::ClockSource 120 Device::getActiveClockSource() { 121 ClockSource s; 122 return s; 134 123 } 135 124 136 125 bool 137 AvDevice::prepare() { 126 Device::setSamplingFrequency( int samplingFrequency ) 127 { 128 129 return false; 130 } 131 132 bool 133 Device::lock() { 138 134 139 135 return true; 140 136 } 141 137 138 139 bool 140 Device::unlock() { 141 142 return true; 142 143 } 144 145 void 146 Device::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 158 bool 159 Device::prepare() { 160 161 return true; 162 } 163 164 int 165 Device::getStreamCount() { 166 return 0; 167 } 168 169 Streaming::StreamProcessor * 170 Device::getStreamProcessorByIndex(int i) { 171 172 return NULL; 173 } 174 175 bool 176 Device::startStreamByIndex(int i) { 177 return false; 178 } 179 180 bool 181 Device::stopStreamByIndex(int i) { 182 return false; 183 } 184 185 } trunk/libffado/src/maudio/maudio_avdevice.h
r1239 r1543 44 44 namespace MAudio { 45 45 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 }; 46 class Device : public FFADODevice { 47 public: 48 Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 49 virtual ~Device(); 53 50 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 ); 60 52 static FFADODevice * createDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 61 53 virtual bool discover(); 62 54 63 virtual uint64_t getConfigurationId( );64 65 55 virtual void showDevice(); 66 56 67 57 virtual bool setSamplingFrequency( int ); 68 58 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(); 69 66 70 67 virtual bool prepare(); 68 virtual bool lock(); 69 virtual bool unlock(); 71 70 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); 74 74 75 75 }; trunk/libffado/src/metrichalo/mh_avdevice.cpp
r1336 r1543 33 33 #include "debugmodule/debugmodule.h" 34 34 35 #include "devicemanager.h" 36 35 37 #include <string> 36 38 #include <stdint.h> … … 44 46 namespace MetricHalo { 45 47 46 // to define the supported devices 47 static VendorModelEntry supportedDeviceList[] = 48 { 49 {0x00000000, 0x0000, "Metric Halo", "XXX"}, 50 }; 51 52 MHAvDevice::MHAvDevice( DeviceManager& d, 48 Device::Device( DeviceManager& d, 53 49 std::auto_ptr<ConfigRom>( configRom )) 54 50 : FFADODevice( d, configRom ) 55 , m_model( NULL )56 57 51 { 58 debugOutput( DEBUG_LEVEL_VERBOSE, "Created MetricHalo:: MHAvDevice (NodeID %d)\n",52 debugOutput( DEBUG_LEVEL_VERBOSE, "Created MetricHalo::Device (NodeID %d)\n", 59 53 getConfigRom().getNodeId() ); 60 54 } 61 55 62 MHAvDevice::~MHAvDevice()56 Device::~Device() 63 57 { 64 58 … … 66 60 67 61 bool 68 MHAvDevice::probe(ConfigRom& configRom, bool generic )62 Device::probe( Util::Configuration& c, ConfigRom& configRom, bool generic ) 69 63 { 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(); 73 70 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; 84 73 } 85 86 return false;87 74 } 88 75 89 76 FFADODevice * 90 MHAvDevice::createDevice( DeviceManager& d,77 Device::createDevice( DeviceManager& d, 91 78 std::auto_ptr<ConfigRom>( configRom )) 92 79 { 93 return new MHAvDevice(d, configRom );80 return new Device(d, configRom ); 94 81 } 95 82 96 83 bool 97 MHAvDevice::discover()84 Device::discover() 98 85 { 99 86 unsigned int vendorId = getConfigRom().getNodeVendorId(); 100 87 unsigned int modelId = getConfigRom().getModelId(); 101 88 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 ); 113 91 114 if ( m_model != NULL) {92 if (c.isValid(vme) && vme.driver == Util::Configuration::eD_MetricHalo) { 115 93 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()); 118 99 } 119 100 … … 122 103 123 104 int 124 MHAvDevice::getSamplingFrequency( ) {105 Device::getSamplingFrequency( ) { 125 106 return 0; 126 107 } 127 108 128 109 std::vector<int> 129 MHAvDevice::getSupportedSamplingFrequencies()110 Device::getSupportedSamplingFrequencies() 130 111 { 131 112 std::vector<int> frequencies; … … 134 115 135 116 FFADODevice::ClockSourceVector 136 MHAvDevice::getSupportedClockSources() {117 Device::getSupportedClockSources() { 137 118 FFADODevice::ClockSourceVector r; 138 119 return r; … … 140 121 141 122 bool 142 MHAvDevice::setActiveClockSource(ClockSource s) {123 Device::setActiveClockSource(ClockSource s) { 143 124 return false; 144 125 } 145 126 146 127 FFADODevice::ClockSource 147 MHAvDevice::getActiveClockSource() {128 Device::getActiveClockSource() { 148 129 ClockSource s; 149 130 return s; … … 152 133 153 134 int 154 MHAvDevice::getConfigurationId( ) {135 Device::getConfigurationId( ) { 155 136 return 0; 156 137 } 157 138 158 139 bool 159 MHAvDevice::setSamplingFrequency( int samplingFrequency )140 Device::setSamplingFrequency( int samplingFrequency ) 160 141 { 161 142 … … 164 145 165 146 bool 166 MHAvDevice::lock() {147 Device::lock() { 167 148 168 149 return true; … … 171 152 172 153 bool 173 MHAvDevice::unlock() {154 Device::unlock() { 174 155 175 156 return true; … … 177 158 178 159 void 179 MHAvDevice::showDevice()160 Device::showDevice() 180 161 { 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 181 168 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()); 184 170 } 185 171 186 172 bool 187 MHAvDevice::prepare() {173 Device::prepare() { 188 174 189 175 return true; … … 191 177 192 178 int 193 MHAvDevice::getStreamCount() {179 Device::getStreamCount() { 194 180 return 0; 195 181 } 196 182 197 183 Streaming::StreamProcessor * 198 MHAvDevice::getStreamProcessorByIndex(int i) {184 Device::getStreamProcessorByIndex(int i) { 199 185 200 186 return NULL; … … 202 188 203 189 bool 204 MHAvDevice::startStreamByIndex(int i) {190 Device::startStreamByIndex(int i) { 205 191 return false; 206 192 } 207 193 208 194 bool 209 MHAvDevice::stopStreamByIndex(int i) {195 Device::stopStreamByIndex(int i) { 210 196 return false; 211 197 } trunk/libffado/src/metrichalo/mh_avdevice.h
r1336 r1543 29 29 #include "debugmodule/debugmodule.h" 30 30 #include "libavc/avc_definitions.h" 31 #include "libutil/Configuration.h" 31 32 32 33 // #include "libstreaming/mh/MHStreamProcessor.h" … … 37 38 namespace MetricHalo { 38 39 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 }; 40 class Device : public FFADODevice { 41 public: 42 Device( DeviceManager& d, 43 std::auto_ptr<ConfigRom>( configRom )); 44 virtual ~Device(); 46 45 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 ); 54 47 static FFADODevice * createDevice( DeviceManager& d, 55 48 std::auto_ptr<ConfigRom>( configRom )); … … 80 73 signed int getIsoSendChannel(void); 81 74 82 protected:83 struct VendorModelEntry *m_model;84 85 75 }; 86 76 trunk/libffado/src/oxford/oxford_device.cpp
r1535 r1543 46 46 47 47 Device::Device(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 48 : GenericAVC:: AvDevice( d, configRom)48 : GenericAVC::Device( d, configRom) 49 49 { 50 50 debugOutput( DEBUG_LEVEL_VERBOSE, "Created Oxford::Device (NodeID %d)\n", … … 68 68 { 69 69 debugOutput(DEBUG_LEVEL_VERBOSE, "This is a Oxford::Device\n"); 70 GenericAVC:: AvDevice::showDevice();70 GenericAVC::Device::showDevice(); 71 71 } 72 72 trunk/libffado/src/oxford/oxford_device.h
r1535 r1543 37 37 namespace Oxford { 38 38 39 class Device : public GenericAVC:: AvDevice {39 class Device : public GenericAVC::Device { 40 40 41 41 public: trunk/libffado/src/rme/fireface_flash.cpp
r1537 r1543 22 22 */ 23 23 24 /* This file implements the flash memory methods of the RmeDevice object */24 /* This file implements the flash memory methods of the Device object */ 25 25 26 26 #include "rme/rme_avdevice.h" … … 34 34 35 35 signed int 36 RmeDevice::wait_while_busy(unsigned int init_delay_ms)36 Device::wait_while_busy(unsigned int init_delay_ms) 37 37 { 38 38 signed int i; … … 60 60 61 61 signed int 62 RmeDevice::get_revision(unsigned int *revision)62 Device::get_revision(unsigned int *revision) 63 63 { 64 64 signed int err = 0; … … 78 78 79 79 signed int 80 RmeDevice::read_flash(fb_nodeaddr_t addr, quadlet_t *buf, unsigned int n_quads)80 Device::read_flash(fb_nodeaddr_t addr, quadlet_t *buf, unsigned int n_quads) 81 81 { 82 82 // Read "n_quads" quadlets from the Fireface Flash starting at address … … 115 115 116 116 signed int 117 RmeDevice::read_device_settings(void)117 Device::read_device_settings(void) 118 118 { 119 119 FF_device_flash_settings_t hw_settings; trunk/libffado/src/rme/fireface_hw.cpp
r1537 r1543 32 32 33 33 signed int 34 RmeDevice::init_hardware(void)34 Device::init_hardware(void) 35 35 { 36 36 // Initialises the hardware to a known state. This has the side effect … … 88 88 } 89 89 90 data[2] |= (CR _FREQ0 + CR_FREQ1 + CR_DS + CR_QS);90 data[2] |= (CR2_FREQ0 + CR2_FREQ1 + CR2_DSPEED + CR2_QSSPEED); 91 91 92 92 //data[0] = 0x00020811; // Phantom off trunk/libffado/src/rme/rme_avdevice.cpp
r1537 r1543 32 32 33 33 #include "debugmodule/debugmodule.h" 34 35 #include "devicemanager.h" 34 36 35 37 #include <string> … … 76 78 #define MODEL_SELECTOR(_name,_ff400_arg,_ff800_arg) \ 77 79 unsigned long long int \ 78 RmeDevice::_name() { \80 Device::_name() { \ 79 81 switch (m_rme_model) { \ 80 82 case RME_MODEL_FIREFACE400: return _ff400_arg; \ … … 86 88 } 87 89 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, 90 Device::Device( DeviceManager& d, 97 91 std::auto_ptr<ConfigRom>( configRom )) 98 92 : FFADODevice( d, configRom ) 99 , m_model( NULL )100 93 , m_rme_model( RME_MODEL_NONE ) 101 94 , m_ddsFreq( -1 ) 102 95 { 103 debugOutput( DEBUG_LEVEL_VERBOSE, "Created Rme:: RmeDevice (NodeID %d)\n",96 debugOutput( DEBUG_LEVEL_VERBOSE, "Created Rme::Device (NodeID %d)\n", 104 97 getConfigRom().getNodeId() ); 105 98 } 106 99 107 RmeDevice::~RmeDevice()100 Device::~Device() 108 101 { 109 102 … … 111 104 112 105 MODEL_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)106 MODEL_SELECTOR(stream_start_reg, RME_FF400_STREAM_START_REG0, RME_FF800_STREAM_START_REG0) 114 107 MODEL_SELECTOR(stream_end_reg, RME_FF400_STREAM_END_REG, RME_FF800_STREAM_END_REG) 115 108 MODEL_SELECTOR(flash_settings_addr, RME_FF400_FLASH_SETTINGS_ADDR, RME_FF800_FLASH_SETTINGS_ADDR) … … 119 112 120 113 bool 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; 114 Device::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 } 140 126 } 141 127 142 128 FFADODevice * 143 RmeDevice::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom ))144 { 145 return new RmeDevice(d, configRom );146 } 147 148 bool 149 RmeDevice::discover()129 Device::createDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )) 130 { 131 return new Device(d, configRom ); 132 } 133 134 bool 135 Device::discover() 150 136 { 151 137 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 } 172 159 173 160 init_hardware(); 174 read_device_settings();161 read_device_settings(); 175 162 176 163 return true; … … 178 165 179 166 int 180 RmeDevice::getSamplingFrequency( ) {167 Device::getSamplingFrequency( ) { 181 168 /* 182 169 * Retrieve the current sample rate from the RME device. At this stage it … … 194 181 195 182 int 196 RmeDevice::getConfigurationId()183 Device::getConfigurationId() 197 184 { 198 185 return 0; … … 200 187 201 188 bool 202 RmeDevice::setSamplingFrequency( int samplingFrequency )189 Device::setSamplingFrequency( int samplingFrequency ) 203 190 { 204 191 /* … … 246 233 247 234 std::vector<int> 248 RmeDevice::getSupportedSamplingFrequencies()235 Device::getSupportedSamplingFrequencies() 249 236 { 250 237 std::vector<int> frequencies; … … 262 249 263 250 FFADODevice::ClockSourceVector 264 RmeDevice::getSupportedClockSources() {251 Device::getSupportedClockSources() { 265 252 FFADODevice::ClockSourceVector r; 266 253 return r; … … 268 255 269 256 bool 270 RmeDevice::setActiveClockSource(ClockSource s) {257 Device::setActiveClockSource(ClockSource s) { 271 258 return false; 272 259 } 273 260 274 261 FFADODevice::ClockSource 275 RmeDevice::getActiveClockSource() {262 Device::getActiveClockSource() { 276 263 ClockSource s; 277 264 return s; … … 279 266 280 267 bool 281 RmeDevice::lock() {268 Device::lock() { 282 269 283 270 return true; … … 286 273 287 274 bool 288 RmeDevice::unlock() {275 Device::unlock() { 289 276 290 277 return true; … … 292 279 293 280 void 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" ); 281 Device::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 293 bool 294 Device::prepare() { 295 296 debugOutput(DEBUG_LEVEL_NORMAL, "Preparing Device...\n" ); 305 297 306 298 return true; … … 308 300 309 301 int 310 RmeDevice::getStreamCount() {302 Device::getStreamCount() { 311 303 return 0; // one receive, one transmit 312 304 } 313 305 314 306 Streaming::StreamProcessor * 315 RmeDevice::getStreamProcessorByIndex(int i) {307 Device::getStreamProcessorByIndex(int i) { 316 308 return NULL; 317 309 } 318 310 319 311 bool 320 RmeDevice::startStreamByIndex(int i) {312 Device::startStreamByIndex(int i) { 321 313 return false; 322 314 } 323 315 324 316 bool 325 RmeDevice::stopStreamByIndex(int i) {317 Device::stopStreamByIndex(int i) { 326 318 return false; 327 319 … … 329 321 330 322 unsigned int 331 RmeDevice::readRegister(fb_nodeaddr_t reg) {323 Device::readRegister(fb_nodeaddr_t reg) { 332 324 333 325 quadlet_t quadlet; … … 341 333 342 334 signed int 343 RmeDevice::readBlock(fb_nodeaddr_t reg, quadlet_t *buf, unsigned int n_quads) {335 Device::readBlock(fb_nodeaddr_t reg, quadlet_t *buf, unsigned int n_quads) { 344 336 345 337 unsigned int i; … … 358 350 359 351 signed int 360 RmeDevice::writeRegister(fb_nodeaddr_t reg, quadlet_t data) {352 Device::writeRegister(fb_nodeaddr_t reg, quadlet_t data) { 361 353 362 354 unsigned int err = 0; … … 370 362 371 363 signed int 372 RmeDevice::writeBlock(fb_nodeaddr_t reg, quadlet_t *data, unsigned int n_quads) {364 Device::writeBlock(fb_nodeaddr_t reg, quadlet_t *data, unsigned int n_quads) { 373 365 // 374 366 // Write a block of data to the device starting at address "reg". Note that trunk/libffado/src/rme/rme_avdevice.h
r1534 r1543 31 31 #include "libavc/avc_definitions.h" 32 32 33 #include "libutil/Configuration.h" 34 33 35 // #include "libstreaming/rme/RmeStreamProcessor.h" 34 36 … … 50 52 }; 51 53 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 { 54 class Device : public FFADODevice { 62 55 public: 63 56 64 RmeDevice( DeviceManager& d,57 Device( DeviceManager& d, 65 58 std::auto_ptr<ConfigRom>( configRom )); 66 virtual ~ RmeDevice();59 virtual ~Device(); 67 60 68 static bool probe( ConfigRom& configRom, bool generic = false );61 static bool probe( Util::Configuration& c, ConfigRom& configRom, bool generic = false ); 69 62 static FFADODevice * createDevice( DeviceManager& d, 70 63 std::auto_ptr<ConfigRom>( configRom )); … … 98 91 99 92 protected: 100 struct VendorModelEntry *m_model;101 93 enum ERmeModel m_rme_model; 102 94 trunk/libffado/src/SConscript
r1535 r1543 96 96 bebob/esi/quatafire610.cpp \ 97 97 bebob/mackie/onyxmixer.cpp \ 98 maudio/maudio_avdevice.cpp \99 98 ' ) 100 99 … … 104 103 maudio/fwap.xml \ 105 104 ' ) 105 106 maudio_source = env.Split( '\ 107 maudio/maudio_avdevice.cpp \ 108 ' ) 109 110 maudio_pkgdata = env.Split( '\ 111 ' ) 106 112 107 113 genericavc_source = env.Split( '\ … … 155 161 bounce/bounce_avdevice.cpp \ 156 162 bounce/bounce_slave_avdevice.cpp \ 157 libstreaming/AmdtpSlaveStreamProcessor.cpp \158 163 ' ) 159 164 … … 207 212 source += bebob_source 208 213 pkgdata += bebob_pkgdata 214 if env['ENABLE_MAUDIO']: 215 libenv.AppendUnique( CCFLAGS=["-DENABLE_MAUDIO"] ) 216 source += maudio_source 217 pkgdata += maudio_pkgdata 209 218 if env['ENABLE_FIREWORKS']: 210 219 libenv.AppendUnique( CCFLAGS=["-DENABLE_FIREWORKS"] ) … … 247 256 else: 248 257 libenv.PrependUnique( LIBS=["expat"] ) 258 if env['REQUIRE_LIBAVC']: 259 libenv.MergeFlags( env['LIBAVC1394_FLAGS'] ) 249 260 250 261 # add the libconfig