Changeset 2090

Show
Ignore:
Timestamp:
03/28/12 01:11:56 (12 years ago)
Author:
jwoithe
Message:

Fixes to the AVC EnhancedMixer? functional block which are needed for use with the M-Audio Ozonic. This patch has only been tested against an Ozonic, so it's probably wise for owners of other Bebob-based devices to test this to ensure there are no regressions. From Orania in ticket #341.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libavc/audiosubunit/avc_function_block.cpp

    r1568 r2090  
    184184    : IBusData() 
    185185    , m_controlSelector( FunctionBlockProcessing::eCSE_Processing_EnhancedMixer ) 
    186     , m_statusSelector( eSS_ProgramableState
     186    , m_statusSelector( eSS_Level
    187187    , m_controlDataLength( 0 ) 
    188188{ 
     
    212212    switch (m_statusSelector) { 
    213213        case eSS_ProgramableState: 
    214             m_controlDataLength=m_LevelData.size()
     214               m_controlDataLength=m_ProgramableStateData.size()/8
    215215            data_length_hi=(m_controlDataLength >> 8); 
    216216            data_length_lo=(m_controlDataLength & 0xFF); 
     
    218218            bStatus &= se.write( data_length_lo,  "FunctionBlockProcessingEnhancedMixer controlDataLengthLo" ); 
    219219 
    220             for (int i=0;i<m_controlDataLength/8;i++) { 
     220            for (int i=0;i<m_controlDataLength;i++) { 
    221221                byte_t value=0; 
    222222                 
     
    228228                bStatus &= se.write( value,  "FunctionBlockProcessingEnhancedMixer data" ); 
    229229            } 
    230              
    231             todo=m_controlDataLength%8; 
    232             done=m_controlDataLength-todo; 
    233             if (todo) { 
    234                 byte_t value=0; 
    235                 for (int j=0;j<todo;j++) { 
    236                     control_data_ext_length_t bit_value=m_ProgramableStateData.at(done*8+j); 
    237                     value |= bit_value << (7-j); 
    238                 } 
    239                 bStatus &= se.write( value,  "FunctionBlockProcessingEnhancedMixer data" ); 
    240             } 
    241230            break; 
    242231        case eSS_Level: 
    243             m_controlDataLength=m_LevelData.size()/2; 
     232            m_controlDataLength=m_LevelData.size()*2; 
    244233            data_length_hi=(m_controlDataLength >> 8); 
    245234            data_length_lo=(m_controlDataLength & 0xFF); 
     
    286275        case eSS_ProgramableState: 
    287276            m_ProgramableStateData.clear(); 
    288             for (int i=0;i<m_controlDataLength/8;i++) { 
     277            for (int i=0;i<m_controlDataLength;i++) { 
    289278                byte_t value; 
    290279                bStatus &= de.read( &value); 
    291280 
    292281                for (int j=7;j>=0;j--) { 
    293                     byte_t bit_value; 
    294                     bit_value=(((1<<j) & value) ? 1 : 0); 
    295                     m_ProgramableStateData.push_back(bit_value); 
    296                 } 
    297             } 
    298  
    299             todo=m_controlDataLength%8; 
    300             if (todo) { 
    301                 byte_t value; 
    302                 bStatus &= de.read( &value); 
    303  
    304                 for (int j=7;j>7-todo;j--) { 
    305282                    byte_t bit_value; 
    306283                    bit_value=(((1<<j) & value) ? 1 : 0);