- Timestamp:
- 11/02/08 02:33:07 (15 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/libffado-2.0/src/bebob/focusrite/focusrite_saffirepro.cpp
r1406 r1410 312 312 result &= m_ControlContainer->addElement(m_deviceNameControl); 313 313 314 // add a direct register access element 315 result &= addElement(new RegisterControl(*this, "Register", "Register Access", "Direct register access")); 316 314 317 if (!result) { 315 318 debugWarning("One or more device control elements could not be created."); … … 422 425 debugOutput(DEBUG_LEVEL_VERBOSE, "SYNC_CONFIG field value: %08lX\n", sync ); 423 426 424 switch(sync & 0xFF) {427 switch(sync & FR_SAFFIREPRO_CMD_ID_SYNC_CONFIG_MASK) { 425 428 default: 426 429 debugWarning( "Unexpected SYNC_CONFIG field value: %08lX\n", sync ); … … 434 437 break; 435 438 case FR_SAFFIREPRO_CMD_SYNC_CONFIG_ADAT1: 439 m_adat1_clocksource.active=true; 440 m_active_clocksource = &m_adat1_clocksource; 441 break; 442 case FR_SAFFIREPRO_CMD_SYNC_CONFIG_ADAT2: 443 m_adat2_clocksource.active=true; 444 m_active_clocksource = &m_adat2_clocksource; 445 break; 446 case FR_SAFFIREPRO_CMD_SYNC_CONFIG_WORDCLOCK: 436 447 m_wordclock_clocksource.active=true; 437 448 m_active_clocksource = &m_wordclock_clocksource; 438 449 break; 439 case FR_SAFFIREPRO_CMD_SYNC_CONFIG_ADAT2: 440 m_adat1_clocksource.active=true; 441 m_active_clocksource = &m_adat1_clocksource; 442 break; 443 case FR_SAFFIREPRO_CMD_SYNC_CONFIG_WORDCLOCK: 444 m_adat2_clocksource.active=true; 445 m_active_clocksource = &m_adat2_clocksource; 446 break; 447 } 448 switch((sync >> 8) & 0xFF) { 450 } 451 switch((sync && FR_SAFFIREPRO_CMD_ID_SYNC_LOCK_MASK) >> 8) { 449 452 case FR_SAFFIREPRO_CMD_SYNC_CONFIG_INTERNAL: 450 453 // always locked … … 454 457 break; 455 458 case FR_SAFFIREPRO_CMD_SYNC_CONFIG_ADAT1: 456 m_ wordclock_clocksource.locked=true;459 m_adat1_clocksource.locked=true; 457 460 break; 458 461 case FR_SAFFIREPRO_CMD_SYNC_CONFIG_ADAT2: 459 m_adat 1_clocksource.locked=true;462 m_adat2_clocksource.locked=true; 460 463 break; 461 464 case FR_SAFFIREPRO_CMD_SYNC_CONFIG_WORDCLOCK: 462 m_ adat2_clocksource.locked=true;465 m_wordclock_clocksource.locked=true; 463 466 break; 464 467 default: … … 513 516 } 514 517 return r; 518 } 519 520 std::vector<int> 521 SaffireProDevice::getSupportedSamplingFrequencies() 522 { 523 std::vector<int> frequencies; 524 frequencies.push_back(44100); 525 frequencies.push_back(48000); 526 frequencies.push_back(88200); 527 frequencies.push_back(96000); 528 frequencies.push_back(176400); 529 frequencies.push_back(192000); 530 return frequencies; 515 531 } 516 532 … … 697 713 698 714 // the device needs quite some time to reboot 699 Util::SystemTimeSource::SleepUsecRelative( 2* 1000 * 1000);715 Util::SystemTimeSource::SleepUsecRelative(6 * 1000 * 1000); 700 716 701 717 // wait for the device to finish the reboot … … 727 743 Util::SystemTimeSource::SleepUsecRelative(1 * 1000 * 1000); 728 744 745 // update the generation of the 1394 service 746 get1394Service().updateGeneration(); 747 748 // update our config rom since it might have changed 749 // if this fails it means we have disappeared from the bus 750 // that's bad. 751 if(!getConfigRom().updatedNodeId()) { 752 debugError("Could not update node id\n"); 753 getDeviceManager().unlockBusResetHandler(); 754 return false; 755 } 756 729 757 // we have to rediscover the device 730 758 if (discover()) break; … … 754 782 return false; 755 783 } 756 757 784 return true; 758 785 } 759 786 // not executable 760 787 return false; 761 762 788 } 763 789