Changeset 1606
- Timestamp:
- 07/25/09 06:58:45 (14 years ago)
- Files:
-
- trunk/libffado/src/rme/fireface_hw.cpp (modified) (2 diffs)
- trunk/libffado/src/rme/fireface_settings_ctrls.cpp (modified) (5 diffs)
- trunk/libffado/src/rme/fireface_settings_ctrls.h (modified) (2 diffs)
- trunk/libffado/src/rme/rme_avdevice.cpp (modified) (3 diffs)
- trunk/libffado/src/rme/rme_avdevice.h (modified) (2 diffs)
- trunk/libffado/src/rme/rme_avdevice_settings.cpp (modified) (1 diff)
- trunk/libffado/support/mixer-qt4/mixer_rme.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/rme/fireface_hw.cpp
r1599 r1606 64 64 m_dds_freq = 0; 65 65 66 return set_hardware_params(&settings); 66 if (set_hardware_params(&settings) != 0) 67 return -1; 68 69 // Also configure the TCO (Time Code Option) settings for those devices 70 // which have a TCO. 71 if (tco_present) { 72 memset(&tco_settings, 0, sizeof(tco_settings)); 73 return write_tco_settings(&tco_settings); 74 } 75 76 return 0; 67 77 } 68 78 … … 345 355 //This is just for testing - it's a known consistent configuration 346 356 //data[0] = 0x00020811; // Phantom off 347 data[0] = 0x00020811; // Phantom on 348 data[1] = 0x0000031e; 349 data[2] = 0xc400101f; 357 //data[0] = 0x00020811; // Phantom on 358 //data[1] = 0x0000031e; 359 //data[2] = 0xc400101f; 360 debugOutput(DEBUG_LEVEL_VERBOSE, "set hardware registers: 0x%08x 0x%08x 0x%08x\n", 361 data[0], data[1], data[2]); 350 362 351 363 conf_reg = (m_rme_model==RME_MODEL_FIREFACE800)?RME_FF800_CONF_REG:RME_FF400_CONF_REG; trunk/libffado/src/rme/fireface_settings_ctrls.cpp
r1600 r1606 81 81 unsigned int on = (v & (0x00000001 << i)) != 0; 82 82 err = m_parent.setPhantom(i, on); 83 if (!err && on) { 84 m_value |= (0x01 << i); 85 } else { 86 m_value &= ~(0x01 << i); 83 if (!err) { 84 if (on) { 85 m_value |= (0x01 << i); 86 } else { 87 m_value &= ~(0x01 << i); 88 } 87 89 } 88 90 } … … 93 95 // set these. 94 96 case RME_CTRL_INFO_MODEL: 97 case RME_CTRL_INFO_TCO_PRESENT: 95 98 debugOutput(DEBUG_LEVEL_ERROR, "Attempt to set readonly info control 0x%08x\n", m_type); 96 99 err = 1; … … 108 111 RmeSettingsCtrl::getValue() { 109 112 113 signed int i; 114 signed int val = 0; 115 110 116 switch (m_type) { 111 117 case RME_CTRL_NONE: … … 114 120 115 121 case RME_CTRL_PHANTOM_SW: 116 return m_value; 122 for (i=0; i<3; i++) 123 val |= (m_parent.getPhantom(i) << i); 124 return val; 117 125 break; 118 126 … … 120 128 return m_parent.getRmeModel(); 121 129 break; 130 131 case RME_CTRL_INFO_TCO_PRESENT: 132 return m_parent.getTcoPresent(); 122 133 123 134 default: trunk/libffado/src/rme/fireface_settings_ctrls.h
r1605 r1606 47 47 48 48 #define RME_CTRL_INFO_MODEL 0x0100 49 #define RME_CTRL_INFO_TCO_PRESENT 0x0200 49 50 50 51 class Device; … … 69 70 unsigned int m_type; 70 71 unsigned int m_value, m_info; 72 71 73 }; 72 74 trunk/libffado/src/rme/rme_avdevice.cpp
r1605 r1606 89 89 , samples_per_packet( 0 ) 90 90 , speed800( 0 ) 91 , m_MixerContainer( NULL ) 92 , m_ControlContainer( NULL ) 91 93 { 92 94 debugOutput( DEBUG_LEVEL_VERBOSE, "Created Rme::Device (NodeID %d)\n", 93 95 getConfigRom().getNodeId() ); 96 memset(&settings, 0, sizeof(settings)); 97 memset(&tco_settings, 0, sizeof(tco_settings)); 94 98 } 95 99 … … 114 118 return false; 115 119 } 120 121 result &= m_ControlContainer->addElement( 122 new RmeSettingsCtrl(*this, RME_CTRL_INFO_MODEL, 0, 123 "Model", "Model ID", "")); 124 result &= m_ControlContainer->addElement( 125 new RmeSettingsCtrl(*this, RME_CTRL_INFO_TCO_PRESENT, 0, 126 "TCO_present", "TCO is present", "")); 116 127 117 128 result &= m_ControlContainer->addElement( … … 230 241 tco_present = (read_tco(NULL, 0) == 0); 231 242 } 243 debugOutput(DEBUG_LEVEL_VERBOSE, "TCO present: %s\n", 244 tco_present?"yes":"no"); 232 245 233 246 // Find out the device's streaming status trunk/libffado/src/rme/rme_avdevice.h
r1605 r1606 93 93 94 94 /* Device control functions */ 95 signed int getPhantom(unsigned int channel); 95 96 signed int setPhantom(unsigned int channel, unsigned int status); 96 97 97 98 /* General information functions */ 98 99 signed int getRmeModel(void) { return m_rme_model; } 100 signed int getTcoPresent(void) { return tco_present; } 99 101 100 102 protected: … … 107 109 signed int tco_present; 108 110 FF_software_settings_t settings; 111 FF_TCO_settings_t tco_settings; 109 112 110 113 signed int num_channels; trunk/libffado/src/rme/rme_avdevice_settings.cpp
r1599 r1606 29 29 30 30 signed int 31 Device::getPhantom(unsigned int channel) { 32 33 if (channel > 3) { 34 debugOutput(DEBUG_LEVEL_WARNING, "Channel %d phantom power not supported\n", channel); 35 return -1; 36 } 37 38 return settings.mic_phantom[channel] != 0; 39 } 40 41 signed int 31 42 Device::setPhantom(unsigned int channel, unsigned int status) { 32 43 trunk/libffado/support/mixer-qt4/mixer_rme.py
r1602 r1606 42 42 def init(self): 43 43 44 self.PhantomSwitches={ 45 self.phantom_0: ['/Control/Phantom', 0], 46 self.phantom_1: ['/Control/Phantom', 1], 47 self.phantom_2: ['/Control/Phantom', 2], 48 self.phantom_3: ['/Control/Phantom', 3], 49 } 50 44 51 # Other mixer variables 45 52 self.is_streaming = 0 46 53 self.sample_rate = 0 47 54 self.model = 0 55 self.tco_present = 0 56 57 # Public slot: update phantom power hardware switchs 58 def updatePhantomSwitch(self, a0): 59 sender = self.sender() 60 # Value is the phantom switch value, with a corresponding enable 61 # bit in the high 16 bit word 62 val = (a0 << self.PhantomSwitches[sender][1]) | (0x00010000 << self.PhantomSwitches[sender][1]) 63 log.debug("phantom switch %d set to %d" % (self.PhantomSwitches[sender][1], a0)) 64 self.hw.setDiscrete(self.PhantomSwitches[sender][0], val) 48 65 49 66 # Hide and disable a control … … 60 77 # Retrieve other device settings as needed and customise the UI 61 78 # based on these options. 62 #self.model = self.hw.getDiscrete('/Mixer/Info/Model') 63 #log.debug("device model identifier: %d" % (self.model)) 79 self.model = self.hw.getDiscrete('/Control/Model') 80 log.debug("device model identifier: %d" % (self.model)) 81 self.tco_present = self.hw.getDiscrete('/Control/TCO_present') 82 log.debug("device has TCO: %d" % (self.tco_present)) 64 83 #self.sample_rate = self.hw.getDiscrete('/Mixer/Info/SampleRate') 65 84 #log.debug("device sample rate: %d" % (self.sample_rate)) 85 86 # The Fireface-400 only has 2 phantom-capable channels 87 if (self.model == RME_MODEL_FF400): 88 self.phantom_2.setEnabled(False) 89 self.phantom_3.setEnabled(False) 90 91 # Get current hardware values and connect GUI element signals to 92 # their respective slots 93 for ctrl, info in self.PhantomSwitches.iteritems(): 94 if (not(ctrl.isEnabled())): 95 continue 96 val = (self.hw.getDiscrete(info[0]) >> info[1]) & 0x01 97 log.debug("phantom switch %d is %d" % (info[1], val)) 98 if val: 99 ctrl.setChecked(True) 100 else: 101 ctrl.setChecked(False) 102 QObject.connect(ctrl, SIGNAL('toggled(bool)'), self.updatePhantomSwitch)