Changeset 664 for trunk

Show
Ignore:
Timestamp:
10/21/07 04:36:28 (16 years ago)
Author:
ppalmers
Message:

- Simplify EFC mixer control
- Implement FireWorks? generic mixer

Files:

Legend:

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

    r662 r664  
    4646 
    4747} 
     48 
    4849bool 
    4950SaffireDevice::buildMixer() 
  • trunk/libffado/src/fireworks/efc/efc_cmds_mixer.cpp

    r663 r664  
    6464} 
    6565 
    66 EfcGenericMixerCmd::EfcGenericMixerCmd(enum eCmdType type,  
    67                                        enum eMixerTarget target,  
     66EfcGenericMixerCmd::EfcGenericMixerCmd(enum eMixerTarget target,  
    6867                                       enum eMixerCommand command) 
    6968    : EfcCmd() 
    7069    , m_channel ( -1 ) 
    7170    , 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 
     80EfcGenericMixerCmd::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); 
    13493} 
    13594 
     
    174133} 
    175134 
     135bool 
     136EfcGenericMixerCmd::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 
     185bool 
     186EfcGenericMixerCmd::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 
     209bool 
     210EfcGenericMixerCmd::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 
    176260void 
    177261EfcGenericMixerCmd::showEfcCmd() 
  • trunk/libffado/src/fireworks/efc/efc_cmds_mixer.h

    r663 r664  
    4242    eMC_Nominal, 
    4343}; 
     44enum eCmdType { 
     45    eCT_Get, 
     46    eCT_Set, 
     47}; 
    4448 
    4549class EfcGenericMixerCmd : public EfcCmd 
    4650{ 
    4751public: 
    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); 
    5454    virtual ~EfcGenericMixerCmd() {}; 
    5555 
     
    5858 
    5959    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"; } 
    6070 
    6171    int32_t     m_channel; 
     
    6878}; 
    6979 
    70 // --- Specific implementations 
    71 class EfcGetGainCmd : public EfcGenericMixerCmd 
    72 { 
    73 public: 
    74     EfcGetGainCmd(enum eMixerTarget t) 
    75     : EfcGenericMixerCmd(eCT_Get, t, eMC_Gain) {}; 
    76     virtual ~EfcGetGainCmd() {}; 
    77  
    78     virtual const char* getCmdName() const 
    79     { return "EfcGetGainCmd"; } 
    80 }; 
    81 class EfcSetGainCmd : public EfcGenericMixerCmd 
    82 { 
    83 public: 
    84     EfcSetGainCmd(enum eMixerTarget t) 
    85     : EfcGenericMixerCmd(eCT_Set, t, eMC_Gain) {}; 
    86     virtual ~EfcSetGainCmd() {}; 
    87  
    88     virtual const char* getCmdName() const 
    89     { return "EfcSetGainCmd"; } 
    90 }; 
    91  
    92 class EfcGetSoloCmd : public EfcGenericMixerCmd 
    93 { 
    94 public: 
    95     EfcGetSoloCmd(enum eMixerTarget t) 
    96     : EfcGenericMixerCmd(eCT_Get, t, eMC_Solo) {}; 
    97     virtual ~EfcGetSoloCmd() {}; 
    98  
    99     virtual const char* getCmdName() const 
    100     { return "EfcGetSoloCmd"; } 
    101 }; 
    102 class EfcSetSoloCmd : public EfcGenericMixerCmd 
    103 { 
    104 public: 
    105     EfcSetSoloCmd(enum eMixerTarget t) 
    106     : EfcGenericMixerCmd(eCT_Set, t, eMC_Solo) {}; 
    107     virtual ~EfcSetSoloCmd() {}; 
    108  
    109     virtual const char* getCmdName() const 
    110     { return "EfcSetSoloCmd"; } 
    111 }; 
    112  
    113 class EfcGetMuteCmd : public EfcGenericMixerCmd 
    114 { 
    115 public: 
    116     EfcGetMuteCmd(enum eMixerTarget t) 
    117     : EfcGenericMixerCmd(eCT_Get, t, eMC_Mute) {}; 
    118     virtual ~EfcGetMuteCmd() {}; 
    119  
    120     virtual const char* getCmdName() const 
    121     { return "EfcGetMuteCmd"; } 
    122 }; 
    123 class EfcSetMuteCmd : public EfcGenericMixerCmd 
    124 { 
    125 public: 
    126     EfcSetMuteCmd(enum eMixerTarget t) 
    127     : EfcGenericMixerCmd(eCT_Set, t, eMC_Mute) {}; 
    128     virtual ~EfcSetMuteCmd() {}; 
    129  
    130     virtual const char* getCmdName() const 
    131     { return "EfcSetMuteCmd"; } 
    132 }; 
    133  
    134 class EfcGetPanCmd : public EfcGenericMixerCmd 
    135 { 
    136 public: 
    137     EfcGetPanCmd(enum eMixerTarget t) 
    138     : EfcGenericMixerCmd(eCT_Get, t, eMC_Pan) {}; 
    139     virtual ~EfcGetPanCmd() {}; 
    140  
    141     virtual const char* getCmdName() const 
    142     { return "EfcGetPanCmd"; } 
    143 }; 
    144 class EfcSetPanCmd : public EfcGenericMixerCmd 
    145 { 
    146 public: 
    147     EfcSetPanCmd(enum eMixerTarget t) 
    148     : EfcGenericMixerCmd(eCT_Set, t, eMC_Pan) {}; 
    149     virtual ~EfcSetPanCmd() {}; 
    150  
    151     virtual const char* getCmdName() const 
    152     { return "EfcSetPanCmd"; } 
    153 }; 
    154  
    155 class EfcGetNominalCmd : public EfcGenericMixerCmd 
    156 { 
    157 public: 
    158     EfcGetNominalCmd(enum eMixerTarget t) 
    159     : EfcGenericMixerCmd(eCT_Get, t, eMC_Nominal) {}; 
    160     virtual ~EfcGetNominalCmd() {}; 
    161  
    162     virtual const char* getCmdName() const 
    163     { return "EfcGetNominalCmd"; } 
    164 }; 
    165 class EfcSetNominalCmd : public EfcGenericMixerCmd 
    166 { 
    167 public: 
    168     EfcSetNominalCmd(enum eMixerTarget t) 
    169     : EfcGenericMixerCmd(eCT_Set, t, eMC_Nominal) {}; 
    170     virtual ~EfcSetNominalCmd() {}; 
    171  
    172     virtual const char* getCmdName() const 
    173     { return "EfcSetNominalCmd"; } 
    174 }; 
    175  
    17680} // namespace FireWorks 
    17781 
  • trunk/libffado/src/fireworks/fireworks_device.cpp

    r639 r664  
    3535#include "config.h" 
    3636 
     37#include "fireworks/fireworks_control.h" 
     38 
     39#include <sstream> 
     40using namespace std; 
     41 
    3742// FireWorks is the platform used and developed by ECHO AUDIO 
    3843namespace FireWorks { 
     
    4247    : GenericAVC::AvDevice( ieee1394Service, configRom) 
    4348    , m_efc_discovery_done ( false ) 
     49    , m_MixerContainer ( NULL ) 
    4450{ 
    4551    debugOutput( DEBUG_LEVEL_VERBOSE, "Created FireWorks::Device (NodeID %d)\n", 
     
    5056Device::~Device() 
    5157{ 
     58    destroyMixer(); 
    5259} 
    5360 
     
    104111    } 
    105112 
     113    if(!buildMixer()) { 
     114        debugWarning("Could not build mixer\n"); 
     115    } 
     116 
    106117    return true; 
    107118} 
     
    135146{ 
    136147    unsigned int vendorId = configRom->getNodeVendorId(); 
    137     unsigned int modelId = configRom->getModelId(); 
     148//     unsigned int modelId = configRom->getModelId(); 
    138149 
    139150    switch(vendorId) { 
     
    176187 
    177188bool 
     189Device::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 
     260bool 
     261Device::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 
     282bool 
    178283Device::updatePolledValues() { 
    179284    bool retval; 
  • trunk/libffado/src/fireworks/fireworks_device.h

    r639 r664  
    5353    virtual void showDevice(); 
    5454     
     55    virtual bool buildMixer(); 
     56    virtual bool destroyMixer(); 
     57 
    5558    virtual ClockSourceVector getSupportedClockSources(); 
    5659    virtual bool setActiveClockSource(ClockSource); 
    5760    virtual ClockSource getActiveClockSource(); 
    5861 
     62    const EfcHardwareInfoCmd getHwInfo() 
     63        {return m_HwInfo;}; 
     64     
     65    bool doEfcOverAVC(EfcCmd& c); 
     66 
    5967// Echo specific stuff 
    6068private: 
    61     bool doEfcOverAVC(EfcCmd& c); 
    6269     
    6370    bool discoverUsingEFC(); 
     
    7885    bool                m_efc_discovery_done; 
    7986 
     87private: 
     88    Control::Container *m_MixerContainer; 
     89 
    8090}; 
    8191 
  • trunk/libffado/src/SConscript

    r663 r664  
    108108fireworks_source =  env.Split( '\ 
    109109        fireworks/fireworks_device.cpp \ 
     110        fireworks/fireworks_control.cpp \ 
    110111        fireworks/efc/efc_avc_cmd.cpp \ 
    111112        fireworks/efc/efc_cmd.cpp \ 
  • trunk/libffado/tests/test-echomixer.cpp

    r663 r664  
    201201    } 
    202202    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 
    210204    unsigned int ch=0; 
    211205     
     
    220214    memset(in_vol, 0, sizeof(uint32_t) * 5 * m_HwInfo.m_nb_phys_audio_in); 
    221215     
     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); 
    222229    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; 
    231238        } 
    232239//         { 
    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)) { 
    236243//                 debugFatal("Cmd failed\n"); 
    237244//             } 
    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; 
    239262//         } 
    240263//         { 
    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)) { 
    244267//                 debugFatal("Cmd failed\n"); 
    245268//             } 
    246 //             pbk_vol[ch][2]=getCmd.m_value; 
     269//             pbk_vol[ch][4]=cmd.m_value; 
    247270//         } 
    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; 
    255332        } 
    256333//         { 
    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)) { 
    260337//                 debugFatal("Cmd failed\n"); 
    261338//             } 
    262 //             pbk_vol[ch][4]=getCmd.m_value; 
     339//             out_vol[ch][1]=cmd.m_value; 
    263340//         } 
    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        } 
    268349//         { 
    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)) { 
    272353//                 debugFatal("Cmd failed\n"); 
    273354//             } 
    274 //             rec_vol[ch][0]=getCmd.m_value; 
     355//             out_vol[ch][3]=cmd.m_value; 
    275356//         } 
    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 
    397414 
    398415    uint32_t monitor_gain[m_HwInfo.m_nb_phys_audio_in][m_HwInfo.m_nb_phys_audio_out]; 
     
    457474    printf("================\n"); 
    458475    printf("        %10s %10s %10s %10s %10s\n","GAIN","PAN","SOLO","MUTE","NOMINAL"); 
     476#ifdef DO_PLAYBACK_MIX 
    459477    printf("Playback mixer state:\n"); 
    460478    for (ch=0;ch<m_HwInfo.m_nb_1394_playback_channels;ch++) { 
     
    462480        int j; 
    463481        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 
    469492    printf("Record mixer state:\n"); 
    470493    for (ch=0;ch<m_HwInfo.m_nb_1394_record_channels;ch++) { 
     
    476499        printf("\n"); 
    477500    }     
    478  
     501#endif 
     502 
     503#ifdef DO_PHYS_OUT_MIX 
    479504    printf("Output mixer state:\n"); 
    480505    for (ch=0;ch<m_HwInfo.m_nb_phys_audio_out;ch++) { 
     
    482507        int j; 
    483508        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 
    489519    printf("Input mixer state:\n"); 
    490520    for (ch=0;ch<m_HwInfo.m_nb_phys_audio_in;ch++) { 
     
    496526        printf("\n"); 
    497527    } 
     528#endif 
    498529     
    499530    printf("\nMonitor state info\n");