Changeset 1535

Show
Ignore:
Timestamp:
04/12/09 06:51:07 (14 years ago)
Author:
ppalmers
Message:

add support for the FCA-202, and possibly other Oxford FW-92x devices

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/configuration

    r1531 r1535  
    263263    driver = 2; 
    264264    xmit_max_cycles_early_transmit = 2; 
     265}, 
     266{ 
     267    vendorid = 0x1564; 
     268    modelid = 0xFC22; 
     269    vendorname = "Behringer"; 
     270    modelname = "FCA202"; 
     271    driver = 4; 
    265272}, 
    266273{ 
  • trunk/libffado/SConstruct

    r1531 r1535  
    6262        BoolOption( "ENABLE_BEBOB", "Enable/Disable the bebob part.", True ), 
    6363        BoolOption( "ENABLE_FIREWORKS", "Enable/Disable the ECHO Audio FireWorks AV/C part.", True ), 
     64        BoolOption( "ENABLE_OXFORD", "Enable/Disable support for the Oxford Semiconductor AV/C platform.", True ), 
    6465        BoolOption( "ENABLE_MOTU", "Enable/Disable the MOTU part.", True ), 
    6566        BoolOption( "ENABLE_DICE", "Enable/Disable the DICE part.", True ), 
     
    338339        env['ENABLE_BEBOB'] = True 
    339340        env['ENABLE_FIREWORKS'] = True 
     341        env['ENABLE_OXFORD'] = True 
    340342        env['ENABLE_MOTU'] = True 
    341343        env['ENABLE_DICE'] = True 
     
    347349env['ENABLE_BOUNCE'] = False 
    348350 
    349 if env['ENABLE_BEBOB'] or env['ENABLE_DICE'] or env['ENABLE_BOUNCE'] or env['ENABLE_FIREWORKS']: 
     351if env['ENABLE_BEBOB'] or env['ENABLE_DICE'] \ 
     352   or env['ENABLE_BOUNCE'] or env['ENABLE_FIREWORKS'] \ 
     353   or env['ENABLE_OXFORD']: 
    350354        env['ENABLE_GENERICAVC'] = True 
    351355 
  • trunk/libffado/src/debugmodule/debugmodule.cpp

    r1254 r1535  
    673673        name[0]=0; 
    674674        getFunctionName(m_backtrace_buffer[j], name, 64); 
    675         chars_written += snprintf(m_backtrace_strbuffer + chars_written, MB_BUFFERSIZE-chars_written, "%s ", name); 
     675        chars_written += snprintf(m_backtrace_strbuffer + chars_written, MB_BUFFERSIZE-chars_written, "%s\n", name); 
    676676    } 
    677677    chars_written += snprintf(m_backtrace_strbuffer + chars_written, MB_BUFFERSIZE-chars_written, "\n"); 
  • trunk/libffado/src/debugmodule/debugmodule.h

    r1254 r1535  
    3434#include <iostream> 
    3535#include <semaphore.h> 
     36 
     37#define FFADO_ASSERT(x) { \ 
     38    if(!(x)) { \ 
     39        m_debugModule.print( DebugModule::eDL_Fatal,        \ 
     40                                __FILE__,                   \ 
     41                                __FUNCTION__,               \ 
     42                                __LINE__,                   \ 
     43                                "Assertion failed...\n");      \ 
     44        debugPrintBacktrace( 10 ); \ 
     45        DebugModuleManager::instance()->flush(); \ 
     46        assert(x); \ 
     47    }} 
    3648 
    3749typedef short debug_level_t; 
  • trunk/libffado/src/devicemanager.cpp

    r1531 r1535  
    5252#ifdef ENABLE_FIREWORKS 
    5353    #include "fireworks/fireworks_device.h" 
     54#endif 
     55 
     56#ifdef ENABLE_OXFORD 
     57    #include "oxford/oxford_device.h" 
    5458#endif 
    5559 
     
    941945#endif 
    942946 
     947#ifdef ENABLE_OXFORD 
     948    debugOutput( DEBUG_LEVEL_VERBOSE, "Trying Oxford FW90x...\n" ); 
     949    if ( Oxford::Device::probe( getConfiguration(), *configRom, generic ) ) { 
     950        return Oxford::Device::createDevice( *this, std::auto_ptr<ConfigRom>( configRom ) ); 
     951    } 
     952#endif 
     953 
    943954// we want to try the non-generic AV/C platforms before trying the generic ones 
    944955#ifdef ENABLE_GENERICAVC 
  • trunk/libffado/src/genericavc/avc_avdevice.cpp

    r1531 r1535  
    4646#include <libraw1394/csr.h> 
    4747 
    48 using namespace AVC; 
    49  
    5048namespace GenericAVC { 
    5149 
     
    8179    if(generic) { 
    8280        // check if we have a music subunit 
    83         SubUnitInfoCmd subUnitInfoCmd( configRom.get1394Service() ); 
    84         subUnitInfoCmd.setCommandType( AVCCommand::eCT_Status ); 
     81        AVC::SubUnitInfoCmd subUnitInfoCmd( configRom.get1394Service() ); 
     82        subUnitInfoCmd.setCommandType( AVC::AVCCommand::eCT_Status ); 
    8583        subUnitInfoCmd.m_page = 0; 
    8684        subUnitInfoCmd.setNodeId( configRom.getNodeId() ); 
     
    9189        } 
    9290        for ( int i = 0; i < subUnitInfoCmd.getNrOfValidEntries(); ++i ) { 
    93             subunit_type_t subunit_type 
     91            AVC::subunit_type_t subunit_type 
    9492                = subUnitInfoCmd.m_table[i].m_subunit_type; 
    95             if (subunit_type == eST_Music) return true; 
     93            if (subunit_type == AVC::eST_Music) return true; 
    9694        } 
    9795 
     
    203201int 
    204202AvDevice::getSamplingFrequency( ) { 
    205     AVC::Plug* inputPlug = getPlugById( m_pcrPlugs, Plug::eAPD_Input, 0 ); 
     203    AVC::Plug* inputPlug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Input, 0 ); 
    206204    if ( !inputPlug ) { 
    207205        debugError( "setSampleRate: Could not retrieve iso input plug 0\n" ); 
    208206        return false; 
    209207    } 
    210     AVC::Plug* outputPlug = getPlugById( m_pcrPlugs, Plug::eAPD_Output, 0 ); 
     208    AVC::Plug* outputPlug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Output, 0 ); 
    211209    if ( !outputPlug ) { 
    212210        debugError( "setSampleRate: Could not retrieve iso output plug 0\n" ); 
     
    241239        return true; 
    242240    } else { 
    243         AVC::Plug* plug = getPlugById( m_pcrPlugs, Plug::eAPD_Input, 0 ); 
     241        AVC::Plug* plug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Input, 0 ); 
    244242        if ( !plug ) { 
    245243            debugError( "setSampleRate: Could not retrieve iso input plug 0\n" ); 
     
    253251        } 
    254252 
    255         plug = getPlugById( m_pcrPlugs, Plug::eAPD_Output,  0 ); 
     253        plug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Output,  0 ); 
    256254        if ( !plug ) { 
    257255            debugError( "setSampleRate: Could not retrieve iso output plug 0\n" ); 
     
    280278    Util::MutexLockHelper lock(m_DeviceMutex); 
    281279 
    282     AVC::Plug* plug = getPlugById( m_pcrPlugs, Plug::eAPD_Input, 0 ); 
     280    AVC::Plug* plug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Input, 0 ); 
    283281    if ( !plug ) { 
    284282        debugError( "Could not retrieve iso input plug 0\n" ); 
     
    292290    } 
    293291 
    294     plug = getPlugById( m_pcrPlugs, Plug::eAPD_Output,  0 ); 
     292    plug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Output,  0 ); 
    295293    if ( !plug ) { 
    296294        debugError( "Could not retrieve iso output plug 0\n" ); 
     
    333331    Util::MutexLockHelper lock(m_DeviceMutex); 
    334332 
    335     PlugVector syncMSUInputPlugs = m_pPlugManager->getPlugsByType( 
    336         eST_Music, 
     333    AVC::PlugVector syncMSUInputPlugs = m_pPlugManager->getPlugsByType( 
     334        AVC::eST_Music, 
    337335        0, 
    338336        0xff, 
    339337        0xff, 
    340         Plug::eAPA_SubunitPlug, 
    341         Plug::eAPD_Input, 
    342         Plug::eAPT_Sync ); 
     338        AVC::Plug::eAPA_SubunitPlug, 
     339        AVC::Plug::eAPD_Input, 
     340        AVC::Plug::eAPT_Sync ); 
    343341    if ( !syncMSUInputPlugs.size() ) { 
    344342        // there exist devices which do not have a sync plug 
     
    362360bool 
    363361AvDevice::setActiveClockSource(ClockSource s) { 
    364     Plug *src=m_pPlugManager->getPlug( s.id ); 
     362    AVC::Plug *src = m_pPlugManager->getPlug( s.id ); 
    365363    if (!src) { 
    366364        debugError("Could not find plug with id %d\n", s.id); 
     
    413411    // now figure out what type this is 
    414412    switch(si.m_source->getPlugType()) { 
    415         case Plug::eAPT_IsoStream: 
     413        case AVC::Plug::eAPT_IsoStream: 
    416414            s.type=eCT_SytMatch; 
    417415            break; 
    418         case Plug::eAPT_Sync: 
    419             if(si.m_source->getPlugAddressType() == Plug::eAPA_PCR) { 
     416        case AVC::Plug::eAPT_Sync: 
     417            if(si.m_source->getPlugAddressType() == AVC::Plug::eAPA_PCR) { 
    420418                s.type=eCT_SytStream; // this is logical 
    421             } else if(si.m_source->getPlugAddressType() == Plug::eAPA_SubunitPlug) { 
     419            } else if(si.m_source->getPlugAddressType() == AVC::Plug::eAPA_SubunitPlug) { 
    422420                s.type=eCT_Internal; // this assumes some stuff 
    423             } else if(si.m_source->getPlugAddressType() == Plug::eAPA_ExternalPlug) { 
     421            } else if(si.m_source->getPlugAddressType() == AVC::Plug::eAPA_ExternalPlug) { 
    424422                std::string plugname=si.m_source->getName(); 
    425423                s.description=plugname; 
     
    434432            } 
    435433            break; 
    436         case Plug::eAPT_Digital: 
    437             if(si.m_source->getPlugAddressType() == Plug::eAPA_ExternalPlug) { 
     434        case AVC::Plug::eAPT_Digital: 
     435            if(si.m_source->getPlugAddressType() == AVC::Plug::eAPA_ExternalPlug) { 
    438436                std::string plugname=si.m_source->getName(); 
    439437                s.description=plugname; 
     
    519517    // get plugs 
    520518 
    521     AVC::Plug* inputPlug = getPlugById( m_pcrPlugs, Plug::eAPD_Input, 0 ); 
     519    AVC::Plug* inputPlug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Input, 0 ); 
    522520    if ( !inputPlug ) { 
    523521        debugError( "setSampleRate: Could not retrieve iso input plug 0\n" ); 
    524522        return false; 
    525523    } 
    526     AVC::Plug* outputPlug = getPlugById( m_pcrPlugs, Plug::eAPD_Output, 0 ); 
     524    AVC::Plug* outputPlug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Output, 0 ); 
    527525    if ( !outputPlug ) { 
    528526        debugError( "setSampleRate: Could not retrieve iso output plug 0\n" ); 
     
    665663    } 
    666664 
    667     Plug::ClusterInfoVector& clusterInfos = plug.getClusterInfos(); 
    668     for ( Plug::ClusterInfoVector::const_iterator it = clusterInfos.begin(); 
     665    AVC::Plug::ClusterInfoVector& clusterInfos = plug.getClusterInfos(); 
     666    for ( AVC::Plug::ClusterInfoVector::const_iterator it = clusterInfos.begin(); 
    669667          it != clusterInfos.end(); 
    670668          ++it ) 
    671669    { 
    672         const Plug::ClusterInfo* clusterInfo = &( *it ); 
    673  
    674         Plug::ChannelInfoVector channelInfos = clusterInfo->m_channelInfos; 
    675         for ( Plug::ChannelInfoVector::const_iterator it = channelInfos.begin(); 
     670        const AVC::Plug::ClusterInfo* clusterInfo = &( *it ); 
     671 
     672        AVC::Plug::ChannelInfoVector channelInfos = clusterInfo->m_channelInfos; 
     673        for ( AVC::Plug::ChannelInfoVector::const_iterator it = channelInfos.begin(); 
    676674              it != channelInfos.end(); 
    677675              ++it ) 
    678676        { 
    679             const Plug::ChannelInfo* channelInfo = &( *it ); 
     677            const AVC::Plug::ChannelInfo* channelInfo = &( *it ); 
    680678            std::ostringstream portname; 
    681679 
     
    684682            Streaming::Port *p=NULL; 
    685683            switch(clusterInfo->m_portType) { 
    686             case ExtendedPlugInfoClusterInfoSpecificData::ePT_Speaker: 
    687             case ExtendedPlugInfoClusterInfoSpecificData::ePT_Headphone: 
    688             case ExtendedPlugInfoClusterInfoSpecificData::ePT_Microphone: 
    689             case ExtendedPlugInfoClusterInfoSpecificData::ePT_Line: 
    690             case ExtendedPlugInfoClusterInfoSpecificData::ePT_Analog: 
     684            case AVC::ExtendedPlugInfoClusterInfoSpecificData::ePT_Speaker: 
     685            case AVC::ExtendedPlugInfoClusterInfoSpecificData::ePT_Headphone: 
     686            case AVC::ExtendedPlugInfoClusterInfoSpecificData::ePT_Microphone: 
     687            case AVC::ExtendedPlugInfoClusterInfoSpecificData::ePT_Line: 
     688            case AVC::ExtendedPlugInfoClusterInfoSpecificData::ePT_Analog: 
    691689                debugOutput(DEBUG_LEVEL_VERBOSE, " Adding audio channel %s (pos=0x%02X, loc=0x%02X)\n", 
    692690                    channelInfo->m_name.c_str(), channelInfo->m_streamPosition, channelInfo->m_location); 
     
    701699                break; 
    702700 
    703             case ExtendedPlugInfoClusterInfoSpecificData::ePT_MIDI: 
     701            case AVC::ExtendedPlugInfoClusterInfoSpecificData::ePT_MIDI: 
    704702                debugOutput(DEBUG_LEVEL_VERBOSE, " Adding MIDI channel %s (pos=0x%02X, loc=0x%02X)\n", 
    705703                    channelInfo->m_name.c_str(), channelInfo->m_streamPosition, processor->getPortCount(Streaming::Port::E_Midi)); 
     
    719717 
    720718                break; 
    721             case ExtendedPlugInfoClusterInfoSpecificData::ePT_SPDIF: 
    722             case ExtendedPlugInfoClusterInfoSpecificData::ePT_ADAT: 
    723             case ExtendedPlugInfoClusterInfoSpecificData::ePT_TDIF: 
    724             case ExtendedPlugInfoClusterInfoSpecificData::ePT_MADI: 
    725             case ExtendedPlugInfoClusterInfoSpecificData::ePT_Digital: 
     719            case AVC::ExtendedPlugInfoClusterInfoSpecificData::ePT_SPDIF: 
     720            case AVC::ExtendedPlugInfoClusterInfoSpecificData::ePT_ADAT: 
     721            case AVC::ExtendedPlugInfoClusterInfoSpecificData::ePT_TDIF: 
     722            case AVC::ExtendedPlugInfoClusterInfoSpecificData::ePT_MADI: 
     723            case AVC::ExtendedPlugInfoClusterInfoSpecificData::ePT_Digital: 
    726724                debugOutput(DEBUG_LEVEL_VERBOSE, " Adding digital audio channel %s (pos=0x%02X, loc=0x%02X)\n", 
    727725                    channelInfo->m_name.c_str(), channelInfo->m_streamPosition, channelInfo->m_location); 
     
    736734                break; 
    737735 
    738             case ExtendedPlugInfoClusterInfoSpecificData::ePT_NoType: 
     736            case AVC::ExtendedPlugInfoClusterInfoSpecificData::ePT_NoType: 
    739737            default: 
    740738            // unsupported 
     
    743741 
    744742            if (!p) { 
    745                 debugOutput(DEBUG_LEVEL_VERBOSE, "Skipped port %s\n",channelInfo->m_name.c_str()); 
     743                debugOutput(DEBUG_LEVEL_VERBOSE, "Skipped port %s\n", channelInfo->m_name.c_str()); 
    746744            } 
    747745         } 
  • trunk/libffado/src/genericavc/avc_avdevice.h

    r1498 r1535  
    5353    static bool probe( Util::Configuration&, ConfigRom& configRom, bool generic = false ); 
    5454    virtual bool discover(); 
    55     bool discoverGeneric(); 
    5655    static FFADODevice * createDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
    5756 
     
    9089 
    9190protected: 
     91    bool discoverGeneric(); 
    9292    virtual bool addPlugToProcessor( AVC::Plug& plug, Streaming::StreamProcessor *processor, 
    9393                             Streaming::AmdtpAudioPort::E_Direction direction); 
  • trunk/libffado/src/libavc/audiosubunit/avc_audiosubunit.cpp

    r864 r1535  
    2727 
    2828#include "../audiosubunit/avc_function_block.h" 
    29  
     29#include "../audiosubunit/avc_descriptor_audio.h" 
    3030 
    3131#include <sstream> 
     
    3737SubunitAudio::SubunitAudio( Unit& unit, subunit_t id ) 
    3838    : Subunit( unit, eST_Audio, id ) 
     39    , m_identifier_descriptor ( new AVCAudioIdentifierDescriptor( &unit, this ) ) 
    3940{ 
    4041} 
     
    5960    } 
    6061 
     62    // load the descriptor (if not already loaded) 
     63//     m_identifier_descriptor->setVerboseLevel(DEBUG_LEVEL_VERY_VERBOSE); 
     64//     if (m_identifier_descriptor != NULL) { 
     65//         if(!m_identifier_descriptor->load()) { 
     66//             debugWarning("Could not load Audio Subunit Identifier descriptor\n"); 
     67//         } 
     68//     } 
     69 
    6170    return true; 
    6271} 
  • trunk/libffado/src/libavc/audiosubunit/avc_audiosubunit.h

    r1154 r1535  
    5959                                         Util::IODeserialize& deser ) { return true; } 
    6060 
     61    class AVCAudioIdentifierDescriptor*  m_identifier_descriptor; 
     62 
    6163}; 
    6264 
  • trunk/libffado/src/libavc/general/avc_plug.cpp

    r1498 r1535  
    288288Plug::discoverNoOfChannels() 
    289289{ 
     290    if (m_nrOfChannels == 0) { 
     291        // not discovered yet, get from ext stream format 
     292        ExtendedStreamFormatCmd extStreamFormatCmd = 
     293            setPlugAddrToStreamFormatCmd( ExtendedStreamFormatCmd::eSF_ExtendedStreamFormatInformationCommand ); 
     294        extStreamFormatCmd.setVerbose( getDebugLevel() ); 
     295     
     296        if ( !extStreamFormatCmd.fire() ) { 
     297            debugError( "stream format command failed\n" ); 
     298            return false; 
     299        } 
     300     
     301        if ( ( extStreamFormatCmd.getStatus() ==  ExtendedStreamFormatCmd::eS_NoStreamFormat ) 
     302            || ( extStreamFormatCmd.getStatus() ==  ExtendedStreamFormatCmd::eS_NotUsed ) ) 
     303        { 
     304            debugOutput( DEBUG_LEVEL_VERBOSE, 
     305                        "No stream format information available\n" ); 
     306            return true; 
     307        } 
     308     
     309        if ( !extStreamFormatCmd.getFormatInformation() ) { 
     310            debugOutput(DEBUG_LEVEL_NORMAL, "No stream format information for plug found -> skip\n" ); 
     311            return true; 
     312        } 
     313     
     314        if ( extStreamFormatCmd.getFormatInformation()->m_root 
     315            != FormatInformation::eFHR_AudioMusic  ) 
     316        { 
     317            debugOutput(DEBUG_LEVEL_NORMAL, "Format hierarchy root is not Audio&Music -> skip\n" ); 
     318            return true; 
     319        } 
     320     
     321        FormatInformation* formatInfo = 
     322            extStreamFormatCmd.getFormatInformation(); 
     323        FormatInformationStreamsCompound* compoundStream 
     324            = dynamic_cast< FormatInformationStreamsCompound* > ( 
     325                formatInfo->m_streams ); 
     326        if ( compoundStream ) { 
     327            unsigned int nb_channels = 0; 
     328            for ( int i = 1; 
     329                i <= compoundStream->m_numberOfStreamFormatInfos; 
     330                ++i ) 
     331            { 
     332                StreamFormatInfo* streamFormatInfo = 
     333                    compoundStream->m_streamFormatInfos[ i - 1 ]; 
     334     
     335                debugOutput( DEBUG_LEVEL_VERBOSE, 
     336                            "number of channels = %d, stream format = %d\n", 
     337                            streamFormatInfo->m_numberOfChannels, 
     338                            streamFormatInfo->m_streamFormat ); 
     339                // FIXME: might not be correct to sum all 
     340                nb_channels += streamFormatInfo->m_numberOfChannels; 
     341            } 
     342            m_nrOfChannels = nb_channels; 
     343        } 
     344        return true; 
     345    } else { 
     346        // already got the nb channels from somewhere else 
     347        return true; 
     348    } 
     349} 
     350 
     351bool 
     352Plug::discoverChannelPosition() 
     353{ 
    290354 
    291355    return true; 
     
    293357 
    294358bool 
    295 Plug::discoverChannelPosition() 
     359Plug::discoverChannelName() 
    296360{ 
    297361 
     
    300364 
    301365bool 
    302 Plug::discoverChannelName() 
    303 { 
    304  
    305     return true; 
    306 } 
    307  
    308 bool 
    309366Plug::discoverClusterInfo() 
    310367{ 
    311  
     368    // if there are no cluster info's, we'll have to come up with some 
     369    if(m_clusterInfos.size() == 0) { 
     370        debugOutput( DEBUG_LEVEL_VERBOSE, "fixing up cluster infos\n"); 
     371        // we figure out how many channels we have, and build one cluster 
     372        struct ClusterInfo c; 
     373        c.m_index = 1; 
     374        c.m_portType = 0; 
     375        c.m_name = "Unknown"; 
     376 
     377        c.m_nrOfChannels = m_nrOfChannels; 
     378        for(int i=0; i<m_nrOfChannels; i++) { 
     379            struct ChannelInfo ci; 
     380            ci.m_streamPosition = i; 
     381            ci.m_location = 0xFF; 
     382            ci.m_name = "Unknown"; 
     383            c.m_channelInfos.push_back(ci); 
     384        } 
     385        c.m_streamFormat = 0; // filled in later 
     386         
     387        m_clusterInfos.push_back(c); 
     388    } 
     389     
    312390    return true; 
    313391} 
     
    372450                            "No matching cluster " 
    373451                            "info found for index %d\n",  i ); 
    374                     return false; 
     452                    //return false; 
    375453            } 
    376454            StreamFormatInfo* streamFormatInfo = 
     
    382460                         streamFormatInfo->m_streamFormat ); 
    383461 
    384             int nrOfChannels = clusterInfo->m_nrOfChannels; 
    385             if ( streamFormatInfo->m_streamFormat == 
    386                  FormatInformation::eFHL2_AM824_MIDI_CONFORMANT ) 
    387             { 
    388                 // 8 logical midi channels fit into 1 channel 
    389                 nrOfChannels = ( ( nrOfChannels + 7 ) / 8 ); 
    390             } 
    391             // sanity check 
    392             if ( nrOfChannels != streamFormatInfo->m_numberOfChannels ) 
    393             { 
    394                 debugOutput(DEBUG_LEVEL_NORMAL,  
    395                               "Number of channels " 
    396                               "mismatch: '%s' plug discovering reported " 
    397                               "%d channels for cluster '%s', while stream " 
    398                               "format reported %d\n", 
    399                               getName(), 
    400                               nrOfChannels, 
    401                               clusterInfo->m_name.c_str(), 
    402                               streamFormatInfo->m_numberOfChannels); 
    403             } 
    404             clusterInfo->m_streamFormat = streamFormatInfo->m_streamFormat; 
    405  
    406             debugOutput( DEBUG_LEVEL_VERBOSE, 
    407                          "%s plug %d cluster info %d ('%s'): " 
    408                          "stream format %d\n", 
    409                          getName(), 
    410                          m_id, 
    411                          i, 
    412                          clusterInfo->m_name.c_str(), 
    413                          clusterInfo->m_streamFormat ); 
     462            if ( clusterInfo ) { 
     463                int nrOfChannels = clusterInfo->m_nrOfChannels; 
     464                if ( streamFormatInfo->m_streamFormat == 
     465                    FormatInformation::eFHL2_AM824_MIDI_CONFORMANT ) 
     466                { 
     467                    // 8 logical midi channels fit into 1 channel 
     468                    nrOfChannels = ( ( nrOfChannels + 7 ) / 8 ); 
     469                } 
     470                // sanity check 
     471                if ( nrOfChannels != streamFormatInfo->m_numberOfChannels ) 
     472                { 
     473                    debugOutput(DEBUG_LEVEL_NORMAL,  
     474                                "Number of channels " 
     475                                "mismatch: '%s' plug discovering reported " 
     476                                "%d channels for cluster '%s', while stream " 
     477                                "format reported %d\n", 
     478                                getName(), 
     479                                nrOfChannels, 
     480                                clusterInfo->m_name.c_str(), 
     481                                streamFormatInfo->m_numberOfChannels); 
     482                } 
     483                clusterInfo->m_streamFormat = streamFormatInfo->m_streamFormat; 
     484     
     485                debugOutput( DEBUG_LEVEL_VERBOSE, 
     486                            "%s plug %d cluster info %d ('%s'): " 
     487                            "stream format %d\n", 
     488                            getName(), 
     489                            m_id, 
     490                            i, 
     491                            clusterInfo->m_name.c_str(), 
     492                            clusterInfo->m_streamFormat ); 
     493            } 
    414494        } 
    415495    } 
  • trunk/libffado/src/libieee1394/ieee1394service.cpp

    r1498 r1535  
    533533    } else { 
    534534        #ifdef DEBUG 
    535         debugOutput(DEBUG_LEVEL_NORMAL
     535        debugOutput(DEBUG_LEVEL_VERBOSE
    536536                    "raw1394_read failed: node 0x%hX, addr = 0x%016llX, length = %u\n", 
    537537                    nodeId, addr, length); 
  • trunk/libffado/src/libieee1394/IsoHandler.cpp

    r1531 r1535  
    625625                                m_receive_mode, 
    626626                                m_irq_interval)) { 
    627             debugFatal("Could not do receive initialisation!\n" ); 
     627            debugFatal("Could not do receive initialization (PACKET_PER_BUFFER)!\n" ); 
    628628            debugFatal("  %s\n",strerror(errno)); 
    629629            return false; 
  • trunk/libffado/src/libieee1394/IsoHandlerManager.cpp

    r1531 r1535  
    792792        } 
    793793 
     794        // apparently a too small value causes issues too 
     795        if(max_packet_size < 200) max_packet_size = 200; 
     796 
    794797        // the interrupt/wakeup interval prediction of raw1394 is a mess... 
    795798        int irq_interval = (packets_per_period-1) / min_interrupts_per_period; 
  • trunk/libffado/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.h

    r1531 r1535  
    8080    virtual ~AmdtpReceiveStreamProcessor() {}; 
    8181 
    82     enum eChildReturnValue processPacketHeader(unsigned char *data, unsigned int length, 
    83                                                unsigned char tag, unsigned char sy, 
    84                                                uint32_t pkt_ctr); 
    85     enum eChildReturnValue processPacketData(unsigned char *data, unsigned int length); 
     82    virtual enum eChildReturnValue processPacketHeader(unsigned char *data, unsigned int length, 
     83                                                       unsigned char tag, unsigned char sy, 
     84                                                       uint32_t pkt_ctr); 
     85    virtual enum eChildReturnValue processPacketData(unsigned char *data, unsigned int length); 
    8686 
    8787    virtual bool prepareChild(); 
     
    100100    bool processReadBlock(char *data, unsigned int nevents, unsigned int offset); 
    101101 
    102 private
     102protected
    103103    void decodeAudioPortsFloat(quadlet_t *data, unsigned int offset, unsigned int nevents); 
    104104    void decodeAudioPortsInt24(quadlet_t *data, unsigned int offset, unsigned int nevents); 
  • trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp

    r1531 r1535  
    517517                return RAW1394_ISO_ERROR; 
    518518            } 
     519 
     520            // don't process the data when waiting for a stream 
     521            if(m_state == ePS_WaitingForStream) { 
     522                return RAW1394_ISO_OK; 
     523            } 
    519524        } 
    520525 
  • trunk/libffado/src/libutil/Configuration.h

    r1531 r1535  
    4747        eD_FireWorks = 2, 
    4848        eD_GenericAVC = 3, 
     49        eD_Oxford = 4, 
    4950        eD_MOTU = 10, 
    5051    }; 
  • trunk/libffado/src/SConscript

    r1534 r1535  
    3636        debugmodule/debugmodule.cpp \ 
    3737        DeviceStringParser.cpp \ 
    38         libavc/streamformat/avc_extended_stream_format.cpp \ 
    39         libavc/musicsubunit/avc_descriptor_music.cpp \ 
    40         libavc/musicsubunit/avc_musicsubunit.cpp \ 
    41         libavc/audiosubunit/avc_audiosubunit.cpp \ 
    42         libavc/audiosubunit/avc_function_block.cpp \ 
    43         libavc/descriptors/avc_descriptor_cmd.cpp \ 
    44         libavc/descriptors/avc_descriptor.cpp \ 
    45         libavc/general/avc_extended_subunit_info.cpp \ 
    46         libavc/general/avc_unit_info.cpp \ 
    47         libavc/general/avc_generic.cpp \ 
    48         libavc/general/avc_subunit_info.cpp \ 
    49         libavc/general/avc_connect.cpp \ 
    50         libavc/general/avc_signal_format.cpp \ 
    51         libavc/general/avc_extended_cmd_generic.cpp \ 
    52         libavc/general/avc_extended_plug_info.cpp \ 
    53         libavc/general/avc_plug_info.cpp \ 
    54         libavc/general/avc_unit.cpp \ 
    55         libavc/general/avc_subunit.cpp \ 
    56         libavc/general/avc_plug.cpp \ 
    57         libavc/general/avc_vendor_dependent_cmd.cpp \ 
    58         libavc/avc_definitions.cpp \ 
    59         libavc/ccm/avc_signal_source.cpp \ 
    6038        libieee1394/ARMHandler.cpp \ 
    6139        libieee1394/configrom.cpp \ 
     
    9977        ffado_source.append('libutil/serialize_libxml.cpp') 
    10078 
    101  
    10279bebob_source = env.Split( '\ 
    10380        bebob/bebob_avdevice.cpp \ 
     
    12198        maudio/maudio_avdevice.cpp \ 
    12299' ) 
     100 
    123101bebob_pkgdata = env.Split( '\ 
    124102        maudio/refdesign.xml \ 
     
    153131' ) 
    154132 
     133oxford_source =  env.Split( '\ 
     134        oxford/oxford_device.cpp \ 
     135        libstreaming/amdtp-oxford/AmdtpOxfordReceiveStreamProcessor.cpp \ 
     136' ) 
     137 
     138oxford_pkgdata = env.Split( '\ 
     139' )      
     140 
    155141motu_source = env.Split( '\ 
    156142        motu/motu_avdevice.cpp \ 
     
    189175' ) 
    190176 
     177libavc_source = env.Split( '\ 
     178        libavc/streamformat/avc_extended_stream_format.cpp \ 
     179        libavc/musicsubunit/avc_descriptor_music.cpp \ 
     180        libavc/musicsubunit/avc_musicsubunit.cpp \ 
     181        libavc/audiosubunit/avc_audiosubunit.cpp \ 
     182        libavc/audiosubunit/avc_descriptor_audio.cpp \ 
     183        libavc/audiosubunit/avc_function_block.cpp \ 
     184        libavc/descriptors/avc_descriptor_cmd.cpp \ 
     185        libavc/descriptors/avc_descriptor.cpp \ 
     186        libavc/general/avc_extended_subunit_info.cpp \ 
     187        libavc/general/avc_unit_info.cpp \ 
     188        libavc/general/avc_generic.cpp \ 
     189        libavc/general/avc_subunit_info.cpp \ 
     190        libavc/general/avc_connect.cpp \ 
     191        libavc/general/avc_signal_format.cpp \ 
     192        libavc/general/avc_extended_cmd_generic.cpp \ 
     193        libavc/general/avc_extended_plug_info.cpp \ 
     194        libavc/general/avc_plug_info.cpp \ 
     195        libavc/general/avc_unit.cpp \ 
     196        libavc/general/avc_subunit.cpp \ 
     197        libavc/general/avc_plug.cpp \ 
     198        libavc/general/avc_vendor_dependent_cmd.cpp \ 
     199        libavc/avc_definitions.cpp \ 
     200        libavc/ccm/avc_signal_source.cpp \ 
     201' ) 
    191202 
    192203source = ffado_source 
     
    200211        source += fireworks_source 
    201212        pkgdata += fireworks_pkgdata 
     213if env['ENABLE_OXFORD']: 
     214        libenv.AppendUnique( CCFLAGS=["-DENABLE_OXFORD"] ) 
     215        source += oxford_source 
     216        pkgdata += oxford_pkgdata 
    202217if env['ENABLE_MOTU']: 
    203218        libenv.AppendUnique( CCFLAGS=["-DENABLE_MOTU"] ) 
     
    219234if env['ENABLE_GENERICAVC']: 
    220235        libenv.AppendUnique( CCFLAGS=["-DENABLE_GENERICAVC"] ) 
     236        source += libavc_source 
    221237        source += amdtp_source 
    222238        source += genericavc_source 
  • trunk/libffado/tests/test-focusrite.cpp

    r1184 r1535  
    3333#include "libavc/general/avc_generic.h" 
    3434#include "libutil/Time.h" 
     35#include "libutil/ByteSwap.h" 
    3536 
    3637#include "bebob/focusrite/focusrite_cmd.h" 
     38#include "bebob/focusrite/focusrite_generic.h" 
    3739using namespace BeBoB::Focusrite; 
    3840 
     
    122124        break; 
    123125    case ARGP_KEY_END: 
    124         if(arguments->nargs<4) { 
    125             printf("not enough arguments\n"); 
    126             return -1; 
    127         } 
     126 
    128127         
    129128        break; 
     
    165164        cmd.setVerbose( DEBUG_LEVEL_NORMAL ); 
    166165     
    167     #define TOTAL_IDS_TO_SCAN 128 
     166    #define TOTAL_IDS_TO_SCAN 110 
    168167    uint32_t old_vals[TOTAL_IDS_TO_SCAN+1]; 
     168    m_1394Service->setVerboseLevel(DEBUG_LEVEL_INFO); 
    169169     
    170170    while(1) { 
    171         for (int id=0; id<TOTAL_IDS_TO_SCAN;id++) { 
     171        for (int id=88; id<TOTAL_IDS_TO_SCAN;id++) { 
     172            quadlet_t value; 
     173            int ntries=5; 
     174            bool retval = false; 
     175            fb_nodeaddr_t addr = FR_PARAM_SPACE_START + (id * 4); 
     176            fb_nodeid_t nodeId = arguments.node | 0xFFC0; 
    172177//             if (id==64) continue; // metering 
    173178//             if (id==65) continue; // metering 
    174179//             if (id==66) continue; // metering 
    175180//             if (id==67) continue; // metering 
    176             cmd.setCommandType( AVC::AVCCommand::eCT_Status ); 
    177             cmd.setNodeId( arguments.node  ); 
    178             cmd.setSubunitType( AVC::eST_Unit  ); 
    179             cmd.setSubunitId( 0xff ); 
    180             cmd.m_id=id; 
    181             cmd.m_value=0; 
    182      
    183             if ( !cmd.fire() ) { 
    184                 debugError( "FocusriteVendorDependentCmd info command failed\n" ); 
    185                 // shouldn't this be an error situation? 
    186     //             return false; 
     181            while(ntries-- && !(retval = m_1394Service->read_quadlet(nodeId, addr, &value))) { 
     182                SleepRelativeUsec(10000); 
    187183            } 
    188             if (old_vals[id] != cmd.m_value) { 
    189                 printf("%04d changed from %08X to %08X\n", cmd.m_id,  old_vals[id], cmd.m_value); 
    190                 old_vals[id] = cmd.m_value; 
     184            if (!retval) { 
     185                debugError( " read from %16llX failed (id: %d)\n", addr, id); 
     186            } else { 
     187                value = CondSwapFromBus32(value); 
     188             
     189                if (old_vals[id] != value) { 
     190                    printf("%04d changed from %08X to %08X\n", id,  old_vals[id], value); 
     191                    old_vals[id] = value; 
     192                } 
    191193            } 
    192194        }