Changeset 664
- Timestamp:
- 10/21/07 04:36:28 (16 years ago)
- Files:
-
- trunk/libffado/src/bebob/focusrite/focusrite_saffire.cpp (modified) (1 diff)
- trunk/libffado/src/fireworks/efc/efc_cmds_mixer.cpp (modified) (2 diffs)
- trunk/libffado/src/fireworks/efc/efc_cmds_mixer.h (modified) (3 diffs)
- trunk/libffado/src/fireworks/fireworks_device.cpp (modified) (6 diffs)
- trunk/libffado/src/fireworks/fireworks_device.h (modified) (2 diffs)
- trunk/libffado/src/SConscript (modified) (1 diff)
- trunk/libffado/tests/test-echomixer.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/bebob/focusrite/focusrite_saffire.cpp
r662 r664 46 46 47 47 } 48 48 49 bool 49 50 SaffireDevice::buildMixer() trunk/libffado/src/fireworks/efc/efc_cmds_mixer.cpp
r663 r664 64 64 } 65 65 66 EfcGenericMixerCmd::EfcGenericMixerCmd(enum eCmdType type, 67 enum eMixerTarget target, 66 EfcGenericMixerCmd::EfcGenericMixerCmd(enum eMixerTarget target, 68 67 enum eMixerCommand command) 69 68 : EfcCmd() 70 69 , m_channel ( -1 ) 71 70 , m_value ( 0 ) 72 , m_type ( type ) 73 , m_target ( target ) 74 , m_command ( command ) 75 { 76 switch (target) { 77 case eMT_PhysicalOutputMix: 78 m_category_id=EFC_CAT_PHYSICAL_OUTPUT_MIX; 79 break; 80 case eMT_PhysicalInputMix: 81 m_category_id=EFC_CAT_PHYSICAL_INPUT_MIX; 82 break; 83 case eMT_PlaybackMix: 84 m_category_id=EFC_CAT_PLAYBACK_MIX; 85 break; 86 case eMT_RecordMix: 87 m_category_id=EFC_CAT_RECORD_MIX; 88 break; 89 default: 90 debugError("Invalid mixer target: %d\n", target); 91 } 92 93 if (type == eCT_Get) { 94 switch (command) { 95 case eMC_Gain: 96 m_command_id=EFC_CMD_MIXER_GET_GAIN; 97 break; 98 case eMC_Solo: 99 m_command_id=EFC_CMD_MIXER_GET_SOLO; 100 break; 101 case eMC_Mute: 102 m_command_id=EFC_CMD_MIXER_GET_MUTE; 103 break; 104 case eMC_Pan: 105 m_command_id=EFC_CMD_MIXER_GET_PAN; 106 break; 107 case eMC_Nominal: 108 m_command_id=EFC_CMD_MIXER_GET_NOMINAL; 109 break; 110 default: 111 debugError("Invalid mixer get command: %d\n", command); 112 } 113 } else { 114 switch (command) { 115 case eMC_Gain: 116 m_command_id=EFC_CMD_MIXER_SET_GAIN; 117 break; 118 case eMC_Solo: 119 m_command_id=EFC_CMD_MIXER_SET_SOLO; 120 break; 121 case eMC_Mute: 122 m_command_id=EFC_CMD_MIXER_SET_MUTE; 123 break; 124 case eMC_Pan: 125 m_command_id=EFC_CMD_MIXER_SET_PAN; 126 break; 127 case eMC_Nominal: 128 m_command_id=EFC_CMD_MIXER_SET_NOMINAL; 129 break; 130 default: 131 debugError("Invalid mixer set command: %d\n", command); 132 } 133 } 71 { 72 m_type=eCT_Get; 73 m_target=target; 74 m_command=command; 75 setTarget(target); 76 setCommand(command); 77 setType(eCT_Get); 78 } 79 80 EfcGenericMixerCmd::EfcGenericMixerCmd(enum eMixerTarget target, 81 enum eMixerCommand command, 82 int channel) 83 : EfcCmd() 84 , m_channel ( channel ) 85 , m_value ( 0 ) 86 { 87 m_type=eCT_Get; 88 m_target=target; 89 m_command=command; 90 setTarget(target); 91 setCommand(command); 92 setType(eCT_Get); 134 93 } 135 94 … … 174 133 } 175 134 135 bool 136 EfcGenericMixerCmd::setType( enum eCmdType type ) 137 { 138 m_type=type; 139 if (type == eCT_Get) { 140 switch (m_command) { 141 case eMC_Gain: 142 m_command_id=EFC_CMD_MIXER_GET_GAIN; 143 break; 144 case eMC_Solo: 145 m_command_id=EFC_CMD_MIXER_GET_SOLO; 146 break; 147 case eMC_Mute: 148 m_command_id=EFC_CMD_MIXER_GET_MUTE; 149 break; 150 case eMC_Pan: 151 m_command_id=EFC_CMD_MIXER_GET_PAN; 152 break; 153 case eMC_Nominal: 154 m_command_id=EFC_CMD_MIXER_GET_NOMINAL; 155 break; 156 default: 157 debugError("Invalid mixer get command: %d\n", m_command); 158 return false; 159 } 160 } else { 161 switch (m_command) { 162 case eMC_Gain: 163 m_command_id=EFC_CMD_MIXER_SET_GAIN; 164 break; 165 case eMC_Solo: 166 m_command_id=EFC_CMD_MIXER_SET_SOLO; 167 break; 168 case eMC_Mute: 169 m_command_id=EFC_CMD_MIXER_SET_MUTE; 170 break; 171 case eMC_Pan: 172 m_command_id=EFC_CMD_MIXER_SET_PAN; 173 break; 174 case eMC_Nominal: 175 m_command_id=EFC_CMD_MIXER_SET_NOMINAL; 176 break; 177 default: 178 debugError("Invalid mixer set command: %d\n", m_command); 179 return false; 180 } 181 } 182 return true; 183 } 184 185 bool 186 EfcGenericMixerCmd::setTarget( enum eMixerTarget target ) 187 { 188 m_target=target; 189 switch (target) { 190 case eMT_PhysicalOutputMix: 191 m_category_id=EFC_CAT_PHYSICAL_OUTPUT_MIX; 192 break; 193 case eMT_PhysicalInputMix: 194 m_category_id=EFC_CAT_PHYSICAL_INPUT_MIX; 195 break; 196 case eMT_PlaybackMix: 197 m_category_id=EFC_CAT_PLAYBACK_MIX; 198 break; 199 case eMT_RecordMix: 200 m_category_id=EFC_CAT_RECORD_MIX; 201 break; 202 default: 203 debugError("Invalid mixer target: %d\n", target); 204 return false; 205 } 206 return true; 207 } 208 209 bool 210 EfcGenericMixerCmd::setCommand( enum eMixerCommand command ) 211 { 212 m_command=command; 213 if (m_type == eCT_Get) { 214 switch (command) { 215 case eMC_Gain: 216 m_command_id=EFC_CMD_MIXER_GET_GAIN; 217 break; 218 case eMC_Solo: 219 m_command_id=EFC_CMD_MIXER_GET_SOLO; 220 break; 221 case eMC_Mute: 222 m_command_id=EFC_CMD_MIXER_GET_MUTE; 223 break; 224 case eMC_Pan: 225 m_command_id=EFC_CMD_MIXER_GET_PAN; 226 break; 227 case eMC_Nominal: 228 m_command_id=EFC_CMD_MIXER_GET_NOMINAL; 229 break; 230 default: 231 debugError("Invalid mixer get command: %d\n", command); 232 return false; 233 } 234 } else { 235 switch (command) { 236 case eMC_Gain: 237 m_command_id=EFC_CMD_MIXER_SET_GAIN; 238 break; 239 case eMC_Solo: 240 m_command_id=EFC_CMD_MIXER_SET_SOLO; 241 break; 242 case eMC_Mute: 243 m_command_id=EFC_CMD_MIXER_SET_MUTE; 244 break; 245 case eMC_Pan: 246 m_command_id=EFC_CMD_MIXER_SET_PAN; 247 break; 248 case eMC_Nominal: 249 m_command_id=EFC_CMD_MIXER_SET_NOMINAL; 250 break; 251 default: 252 debugError("Invalid mixer set command: %d\n", command); 253 return false; 254 } 255 } 256 return true; 257 } 258 259 176 260 void 177 261 EfcGenericMixerCmd::showEfcCmd() trunk/libffado/src/fireworks/efc/efc_cmds_mixer.h
r663 r664 42 42 eMC_Nominal, 43 43 }; 44 enum eCmdType { 45 eCT_Get, 46 eCT_Set, 47 }; 44 48 45 49 class EfcGenericMixerCmd : public EfcCmd 46 50 { 47 51 public: 48 enum eCmdType { 49 eCT_Get, 50 eCT_Set, 51 }; 52 public: 53 EfcGenericMixerCmd(enum eCmdType, enum eMixerTarget, enum eMixerCommand); 52 EfcGenericMixerCmd(enum eMixerTarget, enum eMixerCommand); 53 EfcGenericMixerCmd(enum eMixerTarget, enum eMixerCommand, int channel); 54 54 virtual ~EfcGenericMixerCmd() {}; 55 55 … … 58 58 59 59 virtual void showEfcCmd(); 60 61 bool setType( enum eCmdType type ); 62 enum eCmdType getType() {return m_type;}; 63 bool setTarget( enum eMixerTarget target ); 64 enum eMixerTarget getTarget() {return m_target;}; 65 bool setCommand( enum eMixerCommand cmd ); 66 enum eMixerCommand getCommand() {return m_command;}; 67 68 virtual const char* getCmdName() const 69 { return "EfcGenericMixerCmd"; } 60 70 61 71 int32_t m_channel; … … 68 78 }; 69 79 70 // --- Specific implementations71 class EfcGetGainCmd : public EfcGenericMixerCmd72 {73 public:74 EfcGetGainCmd(enum eMixerTarget t)75 : EfcGenericMixerCmd(eCT_Get, t, eMC_Gain) {};76 virtual ~EfcGetGainCmd() {};77 78 virtual const char* getCmdName() const79 { return "EfcGetGainCmd"; }80 };81 class EfcSetGainCmd : public EfcGenericMixerCmd82 {83 public:84 EfcSetGainCmd(enum eMixerTarget t)85 : EfcGenericMixerCmd(eCT_Set, t, eMC_Gain) {};86 virtual ~EfcSetGainCmd() {};87 88 virtual const char* getCmdName() const89 { return "EfcSetGainCmd"; }90 };91 92 class EfcGetSoloCmd : public EfcGenericMixerCmd93 {94 public:95 EfcGetSoloCmd(enum eMixerTarget t)96 : EfcGenericMixerCmd(eCT_Get, t, eMC_Solo) {};97 virtual ~EfcGetSoloCmd() {};98 99 virtual const char* getCmdName() const100 { return "EfcGetSoloCmd"; }101 };102 class EfcSetSoloCmd : public EfcGenericMixerCmd103 {104 public:105 EfcSetSoloCmd(enum eMixerTarget t)106 : EfcGenericMixerCmd(eCT_Set, t, eMC_Solo) {};107 virtual ~EfcSetSoloCmd() {};108 109 virtual const char* getCmdName() const110 { return "EfcSetSoloCmd"; }111 };112 113 class EfcGetMuteCmd : public EfcGenericMixerCmd114 {115 public:116 EfcGetMuteCmd(enum eMixerTarget t)117 : EfcGenericMixerCmd(eCT_Get, t, eMC_Mute) {};118 virtual ~EfcGetMuteCmd() {};119 120 virtual const char* getCmdName() const121 { return "EfcGetMuteCmd"; }122 };123 class EfcSetMuteCmd : public EfcGenericMixerCmd124 {125 public:126 EfcSetMuteCmd(enum eMixerTarget t)127 : EfcGenericMixerCmd(eCT_Set, t, eMC_Mute) {};128 virtual ~EfcSetMuteCmd() {};129 130 virtual const char* getCmdName() const131 { return "EfcSetMuteCmd"; }132 };133 134 class EfcGetPanCmd : public EfcGenericMixerCmd135 {136 public:137 EfcGetPanCmd(enum eMixerTarget t)138 : EfcGenericMixerCmd(eCT_Get, t, eMC_Pan) {};139 virtual ~EfcGetPanCmd() {};140 141 virtual const char* getCmdName() const142 { return "EfcGetPanCmd"; }143 };144 class EfcSetPanCmd : public EfcGenericMixerCmd145 {146 public:147 EfcSetPanCmd(enum eMixerTarget t)148 : EfcGenericMixerCmd(eCT_Set, t, eMC_Pan) {};149 virtual ~EfcSetPanCmd() {};150 151 virtual const char* getCmdName() const152 { return "EfcSetPanCmd"; }153 };154 155 class EfcGetNominalCmd : public EfcGenericMixerCmd156 {157 public:158 EfcGetNominalCmd(enum eMixerTarget t)159 : EfcGenericMixerCmd(eCT_Get, t, eMC_Nominal) {};160 virtual ~EfcGetNominalCmd() {};161 162 virtual const char* getCmdName() const163 { return "EfcGetNominalCmd"; }164 };165 class EfcSetNominalCmd : public EfcGenericMixerCmd166 {167 public:168 EfcSetNominalCmd(enum eMixerTarget t)169 : EfcGenericMixerCmd(eCT_Set, t, eMC_Nominal) {};170 virtual ~EfcSetNominalCmd() {};171 172 virtual const char* getCmdName() const173 { return "EfcSetNominalCmd"; }174 };175 176 80 } // namespace FireWorks 177 81 trunk/libffado/src/fireworks/fireworks_device.cpp
r639 r664 35 35 #include "config.h" 36 36 37 #include "fireworks/fireworks_control.h" 38 39 #include <sstream> 40 using namespace std; 41 37 42 // FireWorks is the platform used and developed by ECHO AUDIO 38 43 namespace FireWorks { … … 42 47 : GenericAVC::AvDevice( ieee1394Service, configRom) 43 48 , m_efc_discovery_done ( false ) 49 , m_MixerContainer ( NULL ) 44 50 { 45 51 debugOutput( DEBUG_LEVEL_VERBOSE, "Created FireWorks::Device (NodeID %d)\n", … … 50 56 Device::~Device() 51 57 { 58 destroyMixer(); 52 59 } 53 60 … … 104 111 } 105 112 113 if(!buildMixer()) { 114 debugWarning("Could not build mixer\n"); 115 } 116 106 117 return true; 107 118 } … … 135 146 { 136 147 unsigned int vendorId = configRom->getNodeVendorId(); 137 unsigned int modelId = configRom->getModelId();148 // unsigned int modelId = configRom->getModelId(); 138 149 139 150 switch(vendorId) { … … 176 187 177 188 bool 189 Device::buildMixer() 190 { 191 bool result=true; 192 debugOutput(DEBUG_LEVEL_VERBOSE, "Building a FireWorks mixer...\n"); 193 194 destroyMixer(); 195 196 // create the mixer object container 197 m_MixerContainer = new Control::Container("Mixer"); 198 199 if (!m_MixerContainer) { 200 debugError("Could not create mixer container...\n"); 201 return false; 202 } 203 204 // create control objects for the audiofire 205 206 // matrix mix controls 207 result &= m_MixerContainer->addElement( 208 new MonitorControl(*this, MonitorControl::eMC_Gain, "MonitorGain")); 209 210 result &= m_MixerContainer->addElement( 211 new MonitorControl(*this, MonitorControl::eMC_Mute, "MonitorMute")); 212 213 result &= m_MixerContainer->addElement( 214 new MonitorControl(*this, MonitorControl::eMC_Solo, "MonitorSolo")); 215 216 result &= m_MixerContainer->addElement( 217 new MonitorControl(*this, MonitorControl::eMC_Pan, "MonitorPan")); 218 219 // Playback mix controls 220 for (int ch=0;ch<m_HwInfo.m_nb_1394_playback_channels;ch++) { 221 std::ostringstream node_name; 222 node_name << "PC" << ch; 223 224 result &= m_MixerContainer->addElement( 225 new BinaryControl(*this, eMT_PlaybackMix, eMC_Mute, ch, 0, node_name.str()+"Mute")); 226 result &= m_MixerContainer->addElement( 227 new SimpleControl(*this, eMT_PlaybackMix, eMC_Gain, ch, node_name.str()+"Gain")); 228 } 229 230 // Physical output mix controls 231 for (int ch=0;ch<m_HwInfo.m_nb_phys_audio_out;ch++) { 232 std::ostringstream node_name; 233 node_name << "OUT" << ch; 234 235 result &= m_MixerContainer->addElement( 236 new BinaryControl(*this, eMT_PhysicalOutputMix, eMC_Mute, ch, 0, node_name.str()+"Mute")); 237 result &= m_MixerContainer->addElement( 238 new BinaryControl(*this, eMT_PhysicalOutputMix, eMC_Nominal, ch, 1, node_name.str()+"Nominal")); 239 result &= m_MixerContainer->addElement( 240 new SimpleControl(*this, eMT_PhysicalOutputMix, eMC_Gain, ch, node_name.str()+"Gain")); 241 } 242 243 if (!result) { 244 debugWarning("One or more control elements could not be created."); 245 // clean up those that couldn't be created 246 destroyMixer(); 247 return false; 248 } 249 250 if (!addElement(m_MixerContainer)) { 251 debugWarning("Could not register mixer to device\n"); 252 // clean up 253 destroyMixer(); 254 return false; 255 } 256 257 return true; 258 } 259 260 bool 261 Device::destroyMixer() 262 { 263 debugOutput(DEBUG_LEVEL_VERBOSE, "destroy mixer...\n"); 264 265 if (m_MixerContainer == NULL) { 266 debugOutput(DEBUG_LEVEL_VERBOSE, "no mixer to destroy...\n"); 267 return true; 268 } 269 270 if (!deleteElement(m_MixerContainer)) { 271 debugError("Mixer present but not registered to the avdevice\n"); 272 return false; 273 } 274 275 // remove and delete (as in free) child control elements 276 m_MixerContainer->clearElements(true); 277 delete m_MixerContainer; 278 return true; 279 } 280 281 282 bool 178 283 Device::updatePolledValues() { 179 284 bool retval; trunk/libffado/src/fireworks/fireworks_device.h
r639 r664 53 53 virtual void showDevice(); 54 54 55 virtual bool buildMixer(); 56 virtual bool destroyMixer(); 57 55 58 virtual ClockSourceVector getSupportedClockSources(); 56 59 virtual bool setActiveClockSource(ClockSource); 57 60 virtual ClockSource getActiveClockSource(); 58 61 62 const EfcHardwareInfoCmd getHwInfo() 63 {return m_HwInfo;}; 64 65 bool doEfcOverAVC(EfcCmd& c); 66 59 67 // Echo specific stuff 60 68 private: 61 bool doEfcOverAVC(EfcCmd& c);62 69 63 70 bool discoverUsingEFC(); … … 78 85 bool m_efc_discovery_done; 79 86 87 private: 88 Control::Container *m_MixerContainer; 89 80 90 }; 81 91 trunk/libffado/src/SConscript
r663 r664 108 108 fireworks_source = env.Split( '\ 109 109 fireworks/fireworks_device.cpp \ 110 fireworks/fireworks_control.cpp \ 110 111 fireworks/efc/efc_avc_cmd.cpp \ 111 112 fireworks/efc/efc_cmd.cpp \ trunk/libffado/tests/test-echomixer.cpp
r663 r664 201 201 } 202 202 m_HwInfo.showEfcCmd(); 203 204 // uint32_t m_nb_1394_playback_channels; 205 // uint32_t m_nb_1394_record_channels; 206 // 207 // uint32_t m_nb_phys_audio_out; 208 // uint32_t m_nb_phys_audio_in; 209 203 210 204 unsigned int ch=0; 211 205 … … 220 214 memset(in_vol, 0, sizeof(uint32_t) * 5 * m_HwInfo.m_nb_phys_audio_in); 221 215 216 enum eMixerTarget t=eMT_PlaybackMix; 217 enum eMixerCommand c = eMC_Gain; 218 enum eCmdType type = eCT_Get; 219 EfcGenericMixerCmd cmd(t,c); 220 cmd.setType(type); 221 222 #define DO_PLAYBACK_MIX 223 // #define DO_RECORD_MIX 224 #define DO_PHYS_OUT_MIX 225 // #define DO_PHYS_IN_MIX 226 227 #ifdef DO_PLAYBACK_MIX 228 cmd.setTarget(eMT_PlaybackMix); 222 229 for (ch=0;ch<m_HwInfo.m_nb_1394_playback_channels;ch++) { 223 enum eMixerTarget t=eMT_PlaybackMix; 224 { 225 EfcGetGainCmd getCmd(t);226 getCmd.m_channel=ch;227 if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) {228 debugFatal("Cmd failed\n"); 229 } 230 pbk_vol[ch][0]= getCmd.m_value;230 // for (ch=0;ch<1;ch++) { 231 { 232 cmd.setCommand(eMC_Gain); 233 cmd.m_channel=ch; 234 if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 235 debugFatal("Cmd failed\n"); 236 } 237 pbk_vol[ch][0]=cmd.m_value; 231 238 } 232 239 // { 233 // EfcGetPanCmd getCmd(t);234 // getCmd.m_channel=ch;235 // if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) {240 // cmd.setCommand(eMC_Solo); 241 // cmd.m_channel=ch; 242 // if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 236 243 // debugFatal("Cmd failed\n"); 237 244 // } 238 // pbk_vol[ch][1]=getCmd.m_value; 245 // pbk_vol[ch][1]=cmd.m_value; 246 // } 247 { 248 cmd.setCommand(eMC_Mute); 249 cmd.m_channel=ch; 250 if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 251 debugFatal("Cmd failed\n"); 252 } 253 pbk_vol[ch][2]=cmd.m_value; 254 } 255 // { 256 // cmd.setCommand(eMC_Pan); 257 // cmd.m_channel=ch; 258 // if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 259 // debugFatal("Cmd failed\n"); 260 // } 261 // pbk_vol[ch][3]=cmd.m_value; 239 262 // } 240 263 // { 241 // EfcGetSoloCmd getCmd(t);242 // getCmd.m_channel=ch;243 // if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) {264 // cmd.setCommand(eMC_Nominal); 265 // cmd.m_channel=ch; 266 // if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 244 267 // debugFatal("Cmd failed\n"); 245 268 // } 246 // pbk_vol[ch][ 2]=getCmd.m_value;269 // pbk_vol[ch][4]=cmd.m_value; 247 270 // } 248 { 249 EfcGetMuteCmd getCmd(t); 250 getCmd.m_channel=ch; 251 if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) { 252 debugFatal("Cmd failed\n"); 253 } 254 pbk_vol[ch][3]=getCmd.m_value; 271 } 272 #endif 273 274 #ifdef DO_RECORD_MIX 275 cmd.setTarget(eMT_RecordMix); 276 for (ch=0;ch<m_HwInfo.m_nb_1394_record_channels;ch++) { 277 // for (ch=0;ch<1;ch++) { 278 { 279 cmd.setCommand(eMC_Gain); 280 cmd.m_channel=ch; 281 if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 282 debugFatal("Cmd failed\n"); 283 } 284 rec_vol[ch][0]=cmd.m_value; 285 } 286 { 287 cmd.setCommand(eMC_Solo); 288 cmd.m_channel=ch; 289 if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 290 debugFatal("Cmd failed\n"); 291 } 292 rec_vol[ch][1]=cmd.m_value; 293 } 294 { 295 cmd.setCommand(eMC_Mute); 296 cmd.m_channel=ch; 297 if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 298 debugFatal("Cmd failed\n"); 299 } 300 rec_vol[ch][2]=cmd.m_value; 301 } 302 { 303 cmd.setCommand(eMC_Pan); 304 cmd.m_channel=ch; 305 if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 306 debugFatal("Cmd failed\n"); 307 } 308 rec_vol[ch][3]=cmd.m_value; 309 } 310 { 311 cmd.setCommand(eMC_Nominal); 312 cmd.m_channel=ch; 313 if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 314 debugFatal("Cmd failed\n"); 315 } 316 rec_vol[ch][4]=cmd.m_value; 317 } 318 } 319 #endif 320 321 #ifdef DO_PHYS_OUT_MIX 322 cmd.setTarget(eMT_PhysicalOutputMix); 323 for (ch=0;ch<m_HwInfo.m_nb_phys_audio_out;ch++) { 324 // for (ch=0;ch<1;ch++) { 325 { 326 cmd.setCommand(eMC_Gain); 327 cmd.m_channel=ch; 328 if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 329 debugFatal("Cmd failed\n"); 330 } 331 out_vol[ch][0]=cmd.m_value; 255 332 } 256 333 // { 257 // EfcGetNominalCmd getCmd(t);258 // getCmd.m_channel=ch;259 // if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) {334 // cmd.setCommand(eMC_Solo); 335 // cmd.m_channel=ch; 336 // if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 260 337 // debugFatal("Cmd failed\n"); 261 338 // } 262 // pbk_vol[ch][4]=getCmd.m_value;339 // out_vol[ch][1]=cmd.m_value; 263 340 // } 264 } 265 266 // for (ch=0;ch<m_HwInfo.m_nb_1394_record_channels;ch++) { 267 // enum eMixerTarget t=eMT_RecordMix; 341 { 342 cmd.setCommand(eMC_Mute); 343 cmd.m_channel=ch; 344 if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 345 debugFatal("Cmd failed\n"); 346 } 347 out_vol[ch][2]=cmd.m_value; 348 } 268 349 // { 269 // EfcGetGainCmd getCmd(t);270 // getCmd.m_channel=ch;271 // if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) {350 // cmd.setCommand(eMC_Pan); 351 // cmd.m_channel=ch; 352 // if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 272 353 // debugFatal("Cmd failed\n"); 273 354 // } 274 // rec_vol[ch][0]=getCmd.m_value;355 // out_vol[ch][3]=cmd.m_value; 275 356 // } 276 // { 277 // EfcGetPanCmd getCmd(t); 278 // getCmd.m_channel=ch; 279 // if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) { 280 // debugFatal("Cmd failed\n"); 281 // } 282 // rec_vol[ch][1]=getCmd.m_value; 283 // } 284 // { 285 // EfcGetSoloCmd getCmd(t); 286 // getCmd.m_channel=ch; 287 // if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) { 288 // debugFatal("Cmd failed\n"); 289 // } 290 // rec_vol[ch][2]=getCmd.m_value; 291 // } 292 // { 293 // EfcGetMuteCmd getCmd(t); 294 // getCmd.m_channel=ch; 295 // if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) { 296 // debugFatal("Cmd failed\n"); 297 // } 298 // rec_vol[ch][3]=getCmd.m_value; 299 // } 300 // { 301 // EfcGetNominalCmd getCmd(t); 302 // getCmd.m_channel=ch; 303 // if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) { 304 // debugFatal("Cmd failed\n"); 305 // } 306 // rec_vol[ch][4]=getCmd.m_value; 307 // } 308 // } 309 310 for (ch=0;ch<m_HwInfo.m_nb_phys_audio_out;ch++) { 311 enum eMixerTarget t=eMT_PhysicalOutputMix; 312 { 313 EfcGetGainCmd getCmd(t); 314 getCmd.m_channel=ch; 315 if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) { 316 debugFatal("Cmd failed\n"); 317 } 318 out_vol[ch][0]=getCmd.m_value; 319 } 320 // { 321 // EfcGetPanCmd getCmd(t); 322 // getCmd.m_channel=ch; 323 // if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) { 324 // debugFatal("Cmd failed\n"); 325 // } 326 // out_vol[ch][1]=getCmd.m_value; 327 // } 328 // { 329 // EfcGetSoloCmd getCmd(t); 330 // getCmd.m_channel=ch; 331 // if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) { 332 // debugFatal("Cmd failed\n"); 333 // } 334 // out_vol[ch][2]=getCmd.m_value; 335 // } 336 { 337 EfcGetMuteCmd getCmd(t); 338 getCmd.m_channel=ch; 339 if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) { 340 debugFatal("Cmd failed\n"); 341 } 342 out_vol[ch][3]=getCmd.m_value; 343 } 344 { 345 EfcGetNominalCmd getCmd(t); 346 getCmd.m_channel=ch; 347 if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) { 348 debugFatal("Cmd failed\n"); 349 } 350 out_vol[ch][4]=getCmd.m_value; 351 } 352 } 353 354 // for (ch=0;ch<m_HwInfo.m_nb_phys_audio_in;ch++) { 355 // enum eMixerTarget t=eMT_PhysicalInputMix; 356 // { 357 // EfcGetGainCmd getCmd(t); 358 // getCmd.m_channel=ch; 359 // if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) { 360 // debugFatal("Cmd failed\n"); 361 // } 362 // in_vol[ch][0]=getCmd.m_value; 363 // } 364 // { 365 // EfcGetPanCmd getCmd(t); 366 // getCmd.m_channel=ch; 367 // if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) { 368 // debugFatal("Cmd failed\n"); 369 // } 370 // in_vol[ch][1]=getCmd.m_value; 371 // } 372 // { 373 // EfcGetSoloCmd getCmd(t); 374 // getCmd.m_channel=ch; 375 // if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) { 376 // debugFatal("Cmd failed\n"); 377 // } 378 // in_vol[ch][2]=getCmd.m_value; 379 // } 380 // { 381 // EfcGetMuteCmd getCmd(t); 382 // getCmd.m_channel=ch; 383 // if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) { 384 // debugFatal("Cmd failed\n"); 385 // } 386 // in_vol[ch][3]=getCmd.m_value; 387 // } 388 // { 389 // EfcGetNominalCmd getCmd(t); 390 // getCmd.m_channel=ch; 391 // if (!doEfcOverAVC(*m_1394Service, arguments.node, getCmd)) { 392 // debugFatal("Cmd failed\n"); 393 // } 394 // in_vol[ch][4]=getCmd.m_value; 395 // } 396 // } 357 { 358 cmd.setCommand(eMC_Nominal); 359 cmd.m_channel=ch; 360 if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 361 debugFatal("Cmd failed\n"); 362 } 363 out_vol[ch][4]=cmd.m_value; 364 } 365 } 366 #endif 367 368 #ifdef DO_PHYS_IN_MIX 369 cmd.setTarget(eMT_PhysicalInputMix); 370 for (ch=0;ch<m_HwInfo.m_nb_phys_audio_in;ch++) { 371 // for (ch=0;ch<1;ch++) { 372 { 373 cmd.setCommand(eMC_Gain); 374 cmd.m_channel=ch; 375 if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 376 debugFatal("Cmd failed\n"); 377 } 378 in_vol[ch][0]=cmd.m_value; 379 } 380 { 381 cmd.setCommand(eMC_Solo); 382 cmd.m_channel=ch; 383 if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 384 debugFatal("Cmd failed\n"); 385 } 386 in_vol[ch][1]=cmd.m_value; 387 } 388 { 389 cmd.setCommand(eMC_Mute); 390 cmd.m_channel=ch; 391 if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 392 debugFatal("Cmd failed\n"); 393 } 394 in_vol[ch][2]=cmd.m_value; 395 } 396 { 397 cmd.setCommand(eMC_Pan); 398 cmd.m_channel=ch; 399 if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 400 debugFatal("Cmd failed\n"); 401 } 402 in_vol[ch][3]=cmd.m_value; 403 } 404 { 405 cmd.setCommand(eMC_Nominal); 406 cmd.m_channel=ch; 407 if (!doEfcOverAVC(*m_1394Service, arguments.node, cmd)) { 408 debugFatal("Cmd failed\n"); 409 } 410 in_vol[ch][4]=cmd.m_value; 411 } 412 } 413 #endif 397 414 398 415 uint32_t monitor_gain[m_HwInfo.m_nb_phys_audio_in][m_HwInfo.m_nb_phys_audio_out]; … … 457 474 printf("================\n"); 458 475 printf(" %10s %10s %10s %10s %10s\n","GAIN","PAN","SOLO","MUTE","NOMINAL"); 476 #ifdef DO_PLAYBACK_MIX 459 477 printf("Playback mixer state:\n"); 460 478 for (ch=0;ch<m_HwInfo.m_nb_1394_playback_channels;ch++) { … … 462 480 int j; 463 481 for (j=0;j<5;j++) { 464 printf("%10u ", pbk_vol[ch][j]); 465 } 466 printf("\n"); 467 } 468 482 if (j==0 || j==2) 483 printf("%10u ", pbk_vol[ch][j]); 484 else 485 printf("%10s ", "*"); 486 } 487 printf("\n"); 488 } 489 #endif 490 491 #ifdef DO_RECORD_MIX 469 492 printf("Record mixer state:\n"); 470 493 for (ch=0;ch<m_HwInfo.m_nb_1394_record_channels;ch++) { … … 476 499 printf("\n"); 477 500 } 478 501 #endif 502 503 #ifdef DO_PHYS_OUT_MIX 479 504 printf("Output mixer state:\n"); 480 505 for (ch=0;ch<m_HwInfo.m_nb_phys_audio_out;ch++) { … … 482 507 int j; 483 508 for (j=0;j<5;j++) { 484 printf("%10u ", out_vol[ch][j]); 485 } 486 printf("\n"); 487 } 488 509 if (j==0 || j==2 || j==4) 510 printf("%10u ", out_vol[ch][j]); 511 else 512 printf("%10s ", "*"); 513 } 514 printf("\n"); 515 } 516 #endif 517 518 #ifdef DO_PHYS_IN_MIX 489 519 printf("Input mixer state:\n"); 490 520 for (ch=0;ch<m_HwInfo.m_nb_phys_audio_in;ch++) { … … 496 526 printf("\n"); 497 527 } 528 #endif 498 529 499 530 printf("\nMonitor state info\n");