Changeset 1535
- Timestamp:
- 04/12/09 06:51:07 (14 years ago)
- Files:
-
- trunk/libffado/configuration (modified) (1 diff)
- trunk/libffado/SConstruct (modified) (3 diffs)
- trunk/libffado/src/debugmodule/debugmodule.cpp (modified) (1 diff)
- trunk/libffado/src/debugmodule/debugmodule.h (modified) (1 diff)
- trunk/libffado/src/devicemanager.cpp (modified) (2 diffs)
- trunk/libffado/src/genericavc/avc_avdevice.cpp (modified) (19 diffs)
- trunk/libffado/src/genericavc/avc_avdevice.h (modified) (2 diffs)
- trunk/libffado/src/libavc/audiosubunit/avc_audiosubunit.cpp (modified) (3 diffs)
- trunk/libffado/src/libavc/audiosubunit/avc_audiosubunit.h (modified) (1 diff)
- trunk/libffado/src/libavc/audiosubunit/avc_descriptor_audio.cpp (added)
- trunk/libffado/src/libavc/audiosubunit/avc_descriptor_audio.h (added)
- trunk/libffado/src/libavc/general/avc_plug.cpp (modified) (5 diffs)
- trunk/libffado/src/libieee1394/ieee1394service.cpp (modified) (1 diff)
- trunk/libffado/src/libieee1394/IsoHandler.cpp (modified) (1 diff)
- trunk/libffado/src/libieee1394/IsoHandlerManager.cpp (modified) (1 diff)
- trunk/libffado/src/libstreaming/amdtp-oxford (added)
- trunk/libffado/src/libstreaming/amdtp-oxford/AmdtpOxfordReceiveStreamProcessor.cpp (added)
- trunk/libffado/src/libstreaming/amdtp-oxford/AmdtpOxfordReceiveStreamProcessor.h (added)
- trunk/libffado/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.h (modified) (2 diffs)
- trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp (modified) (1 diff)
- trunk/libffado/src/libutil/Configuration.h (modified) (1 diff)
- trunk/libffado/src/oxford (added)
- trunk/libffado/src/oxford/oxford_device.cpp (added)
- trunk/libffado/src/oxford/oxford_device.h (added)
- trunk/libffado/src/SConscript (modified) (7 diffs)
- trunk/libffado/tests/test-focusrite.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/configuration
r1531 r1535 263 263 driver = 2; 264 264 xmit_max_cycles_early_transmit = 2; 265 }, 266 { 267 vendorid = 0x1564; 268 modelid = 0xFC22; 269 vendorname = "Behringer"; 270 modelname = "FCA202"; 271 driver = 4; 265 272 }, 266 273 { trunk/libffado/SConstruct
r1531 r1535 62 62 BoolOption( "ENABLE_BEBOB", "Enable/Disable the bebob part.", True ), 63 63 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 ), 64 65 BoolOption( "ENABLE_MOTU", "Enable/Disable the MOTU part.", True ), 65 66 BoolOption( "ENABLE_DICE", "Enable/Disable the DICE part.", True ), … … 338 339 env['ENABLE_BEBOB'] = True 339 340 env['ENABLE_FIREWORKS'] = True 341 env['ENABLE_OXFORD'] = True 340 342 env['ENABLE_MOTU'] = True 341 343 env['ENABLE_DICE'] = True … … 347 349 env['ENABLE_BOUNCE'] = False 348 350 349 if env['ENABLE_BEBOB'] or env['ENABLE_DICE'] or env['ENABLE_BOUNCE'] or env['ENABLE_FIREWORKS']: 351 if env['ENABLE_BEBOB'] or env['ENABLE_DICE'] \ 352 or env['ENABLE_BOUNCE'] or env['ENABLE_FIREWORKS'] \ 353 or env['ENABLE_OXFORD']: 350 354 env['ENABLE_GENERICAVC'] = True 351 355 trunk/libffado/src/debugmodule/debugmodule.cpp
r1254 r1535 673 673 name[0]=0; 674 674 getFunctionName(m_backtrace_buffer[j], name, 64); 675 chars_written += snprintf(m_backtrace_strbuffer + chars_written, MB_BUFFERSIZE-chars_written, "%s 675 chars_written += snprintf(m_backtrace_strbuffer + chars_written, MB_BUFFERSIZE-chars_written, "%s\n", name); 676 676 } 677 677 chars_written += snprintf(m_backtrace_strbuffer + chars_written, MB_BUFFERSIZE-chars_written, "\n"); trunk/libffado/src/debugmodule/debugmodule.h
r1254 r1535 34 34 #include <iostream> 35 35 #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 }} 36 48 37 49 typedef short debug_level_t; trunk/libffado/src/devicemanager.cpp
r1531 r1535 52 52 #ifdef ENABLE_FIREWORKS 53 53 #include "fireworks/fireworks_device.h" 54 #endif 55 56 #ifdef ENABLE_OXFORD 57 #include "oxford/oxford_device.h" 54 58 #endif 55 59 … … 941 945 #endif 942 946 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 943 954 // we want to try the non-generic AV/C platforms before trying the generic ones 944 955 #ifdef ENABLE_GENERICAVC trunk/libffado/src/genericavc/avc_avdevice.cpp
r1531 r1535 46 46 #include <libraw1394/csr.h> 47 47 48 using namespace AVC;49 50 48 namespace GenericAVC { 51 49 … … 81 79 if(generic) { 82 80 // check if we have a music subunit 83 SubUnitInfoCmd subUnitInfoCmd( configRom.get1394Service() );84 subUnitInfoCmd.setCommandType( AVC Command::eCT_Status );81 AVC::SubUnitInfoCmd subUnitInfoCmd( configRom.get1394Service() ); 82 subUnitInfoCmd.setCommandType( AVC::AVCCommand::eCT_Status ); 85 83 subUnitInfoCmd.m_page = 0; 86 84 subUnitInfoCmd.setNodeId( configRom.getNodeId() ); … … 91 89 } 92 90 for ( int i = 0; i < subUnitInfoCmd.getNrOfValidEntries(); ++i ) { 93 subunit_type_t subunit_type91 AVC::subunit_type_t subunit_type 94 92 = subUnitInfoCmd.m_table[i].m_subunit_type; 95 if (subunit_type == eST_Music) return true;93 if (subunit_type == AVC::eST_Music) return true; 96 94 } 97 95 … … 203 201 int 204 202 AvDevice::getSamplingFrequency( ) { 205 AVC::Plug* inputPlug = getPlugById( m_pcrPlugs, Plug::eAPD_Input, 0 );203 AVC::Plug* inputPlug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Input, 0 ); 206 204 if ( !inputPlug ) { 207 205 debugError( "setSampleRate: Could not retrieve iso input plug 0\n" ); 208 206 return false; 209 207 } 210 AVC::Plug* outputPlug = getPlugById( m_pcrPlugs, Plug::eAPD_Output, 0 );208 AVC::Plug* outputPlug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Output, 0 ); 211 209 if ( !outputPlug ) { 212 210 debugError( "setSampleRate: Could not retrieve iso output plug 0\n" ); … … 241 239 return true; 242 240 } else { 243 AVC::Plug* plug = getPlugById( m_pcrPlugs, Plug::eAPD_Input, 0 );241 AVC::Plug* plug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Input, 0 ); 244 242 if ( !plug ) { 245 243 debugError( "setSampleRate: Could not retrieve iso input plug 0\n" ); … … 253 251 } 254 252 255 plug = getPlugById( m_pcrPlugs, Plug::eAPD_Output, 0 );253 plug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Output, 0 ); 256 254 if ( !plug ) { 257 255 debugError( "setSampleRate: Could not retrieve iso output plug 0\n" ); … … 280 278 Util::MutexLockHelper lock(m_DeviceMutex); 281 279 282 AVC::Plug* plug = getPlugById( m_pcrPlugs, Plug::eAPD_Input, 0 );280 AVC::Plug* plug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Input, 0 ); 283 281 if ( !plug ) { 284 282 debugError( "Could not retrieve iso input plug 0\n" ); … … 292 290 } 293 291 294 plug = getPlugById( m_pcrPlugs, Plug::eAPD_Output, 0 );292 plug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Output, 0 ); 295 293 if ( !plug ) { 296 294 debugError( "Could not retrieve iso output plug 0\n" ); … … 333 331 Util::MutexLockHelper lock(m_DeviceMutex); 334 332 335 PlugVector syncMSUInputPlugs = m_pPlugManager->getPlugsByType(336 eST_Music,333 AVC::PlugVector syncMSUInputPlugs = m_pPlugManager->getPlugsByType( 334 AVC::eST_Music, 337 335 0, 338 336 0xff, 339 337 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 ); 343 341 if ( !syncMSUInputPlugs.size() ) { 344 342 // there exist devices which do not have a sync plug … … 362 360 bool 363 361 AvDevice::setActiveClockSource(ClockSource s) { 364 Plug *src=m_pPlugManager->getPlug( s.id );362 AVC::Plug *src = m_pPlugManager->getPlug( s.id ); 365 363 if (!src) { 366 364 debugError("Could not find plug with id %d\n", s.id); … … 413 411 // now figure out what type this is 414 412 switch(si.m_source->getPlugType()) { 415 case Plug::eAPT_IsoStream:413 case AVC::Plug::eAPT_IsoStream: 416 414 s.type=eCT_SytMatch; 417 415 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) { 420 418 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) { 422 420 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) { 424 422 std::string plugname=si.m_source->getName(); 425 423 s.description=plugname; … … 434 432 } 435 433 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) { 438 436 std::string plugname=si.m_source->getName(); 439 437 s.description=plugname; … … 519 517 // get plugs 520 518 521 AVC::Plug* inputPlug = getPlugById( m_pcrPlugs, Plug::eAPD_Input, 0 );519 AVC::Plug* inputPlug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Input, 0 ); 522 520 if ( !inputPlug ) { 523 521 debugError( "setSampleRate: Could not retrieve iso input plug 0\n" ); 524 522 return false; 525 523 } 526 AVC::Plug* outputPlug = getPlugById( m_pcrPlugs, Plug::eAPD_Output, 0 );524 AVC::Plug* outputPlug = getPlugById( m_pcrPlugs, AVC::Plug::eAPD_Output, 0 ); 527 525 if ( !outputPlug ) { 528 526 debugError( "setSampleRate: Could not retrieve iso output plug 0\n" ); … … 665 663 } 666 664 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(); 669 667 it != clusterInfos.end(); 670 668 ++it ) 671 669 { 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(); 676 674 it != channelInfos.end(); 677 675 ++it ) 678 676 { 679 const Plug::ChannelInfo* channelInfo = &( *it );677 const AVC::Plug::ChannelInfo* channelInfo = &( *it ); 680 678 std::ostringstream portname; 681 679 … … 684 682 Streaming::Port *p=NULL; 685 683 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: 691 689 debugOutput(DEBUG_LEVEL_VERBOSE, " Adding audio channel %s (pos=0x%02X, loc=0x%02X)\n", 692 690 channelInfo->m_name.c_str(), channelInfo->m_streamPosition, channelInfo->m_location); … … 701 699 break; 702 700 703 case ExtendedPlugInfoClusterInfoSpecificData::ePT_MIDI:701 case AVC::ExtendedPlugInfoClusterInfoSpecificData::ePT_MIDI: 704 702 debugOutput(DEBUG_LEVEL_VERBOSE, " Adding MIDI channel %s (pos=0x%02X, loc=0x%02X)\n", 705 703 channelInfo->m_name.c_str(), channelInfo->m_streamPosition, processor->getPortCount(Streaming::Port::E_Midi)); … … 719 717 720 718 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: 726 724 debugOutput(DEBUG_LEVEL_VERBOSE, " Adding digital audio channel %s (pos=0x%02X, loc=0x%02X)\n", 727 725 channelInfo->m_name.c_str(), channelInfo->m_streamPosition, channelInfo->m_location); … … 736 734 break; 737 735 738 case ExtendedPlugInfoClusterInfoSpecificData::ePT_NoType:736 case AVC::ExtendedPlugInfoClusterInfoSpecificData::ePT_NoType: 739 737 default: 740 738 // unsupported … … 743 741 744 742 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()); 746 744 } 747 745 } trunk/libffado/src/genericavc/avc_avdevice.h
r1498 r1535 53 53 static bool probe( Util::Configuration&, ConfigRom& configRom, bool generic = false ); 54 54 virtual bool discover(); 55 bool discoverGeneric();56 55 static FFADODevice * createDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 57 56 … … 90 89 91 90 protected: 91 bool discoverGeneric(); 92 92 virtual bool addPlugToProcessor( AVC::Plug& plug, Streaming::StreamProcessor *processor, 93 93 Streaming::AmdtpAudioPort::E_Direction direction); trunk/libffado/src/libavc/audiosubunit/avc_audiosubunit.cpp
r864 r1535 27 27 28 28 #include "../audiosubunit/avc_function_block.h" 29 29 #include "../audiosubunit/avc_descriptor_audio.h" 30 30 31 31 #include <sstream> … … 37 37 SubunitAudio::SubunitAudio( Unit& unit, subunit_t id ) 38 38 : Subunit( unit, eST_Audio, id ) 39 , m_identifier_descriptor ( new AVCAudioIdentifierDescriptor( &unit, this ) ) 39 40 { 40 41 } … … 59 60 } 60 61 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 61 70 return true; 62 71 } trunk/libffado/src/libavc/audiosubunit/avc_audiosubunit.h
r1154 r1535 59 59 Util::IODeserialize& deser ) { return true; } 60 60 61 class AVCAudioIdentifierDescriptor* m_identifier_descriptor; 62 61 63 }; 62 64 trunk/libffado/src/libavc/general/avc_plug.cpp
r1498 r1535 288 288 Plug::discoverNoOfChannels() 289 289 { 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 351 bool 352 Plug::discoverChannelPosition() 353 { 290 354 291 355 return true; … … 293 357 294 358 bool 295 Plug::discoverChannel Position()359 Plug::discoverChannelName() 296 360 { 297 361 … … 300 364 301 365 bool 302 Plug::discoverChannelName()303 {304 305 return true;306 }307 308 bool309 366 Plug::discoverClusterInfo() 310 367 { 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 312 390 return true; 313 391 } … … 372 450 "No matching cluster " 373 451 "info found for index %d\n", i ); 374 return false;452 //return false; 375 453 } 376 454 StreamFormatInfo* streamFormatInfo = … … 382 460 streamFormatInfo->m_streamFormat ); 383 461 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 } 414 494 } 415 495 } trunk/libffado/src/libieee1394/ieee1394service.cpp
r1498 r1535 533 533 } else { 534 534 #ifdef DEBUG 535 debugOutput(DEBUG_LEVEL_ NORMAL,535 debugOutput(DEBUG_LEVEL_VERBOSE, 536 536 "raw1394_read failed: node 0x%hX, addr = 0x%016llX, length = %u\n", 537 537 nodeId, addr, length); trunk/libffado/src/libieee1394/IsoHandler.cpp
r1531 r1535 625 625 m_receive_mode, 626 626 m_irq_interval)) { 627 debugFatal("Could not do receive initiali sation!\n" );627 debugFatal("Could not do receive initialization (PACKET_PER_BUFFER)!\n" ); 628 628 debugFatal(" %s\n",strerror(errno)); 629 629 return false; trunk/libffado/src/libieee1394/IsoHandlerManager.cpp
r1531 r1535 792 792 } 793 793 794 // apparently a too small value causes issues too 795 if(max_packet_size < 200) max_packet_size = 200; 796 794 797 // the interrupt/wakeup interval prediction of raw1394 is a mess... 795 798 int irq_interval = (packets_per_period-1) / min_interrupts_per_period; trunk/libffado/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.h
r1531 r1535 80 80 virtual ~AmdtpReceiveStreamProcessor() {}; 81 81 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); 86 86 87 87 virtual bool prepareChild(); … … 100 100 bool processReadBlock(char *data, unsigned int nevents, unsigned int offset); 101 101 102 pr ivate:102 protected: 103 103 void decodeAudioPortsFloat(quadlet_t *data, unsigned int offset, unsigned int nevents); 104 104 void decodeAudioPortsInt24(quadlet_t *data, unsigned int offset, unsigned int nevents); trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp
r1531 r1535 517 517 return RAW1394_ISO_ERROR; 518 518 } 519 520 // don't process the data when waiting for a stream 521 if(m_state == ePS_WaitingForStream) { 522 return RAW1394_ISO_OK; 523 } 519 524 } 520 525 trunk/libffado/src/libutil/Configuration.h
r1531 r1535 47 47 eD_FireWorks = 2, 48 48 eD_GenericAVC = 3, 49 eD_Oxford = 4, 49 50 eD_MOTU = 10, 50 51 }; trunk/libffado/src/SConscript
r1534 r1535 36 36 debugmodule/debugmodule.cpp \ 37 37 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 \60 38 libieee1394/ARMHandler.cpp \ 61 39 libieee1394/configrom.cpp \ … … 99 77 ffado_source.append('libutil/serialize_libxml.cpp') 100 78 101 102 79 bebob_source = env.Split( '\ 103 80 bebob/bebob_avdevice.cpp \ … … 121 98 maudio/maudio_avdevice.cpp \ 122 99 ' ) 100 123 101 bebob_pkgdata = env.Split( '\ 124 102 maudio/refdesign.xml \ … … 153 131 ' ) 154 132 133 oxford_source = env.Split( '\ 134 oxford/oxford_device.cpp \ 135 libstreaming/amdtp-oxford/AmdtpOxfordReceiveStreamProcessor.cpp \ 136 ' ) 137 138 oxford_pkgdata = env.Split( '\ 139 ' ) 140 155 141 motu_source = env.Split( '\ 156 142 motu/motu_avdevice.cpp \ … … 189 175 ' ) 190 176 177 libavc_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 ' ) 191 202 192 203 source = ffado_source … … 200 211 source += fireworks_source 201 212 pkgdata += fireworks_pkgdata 213 if env['ENABLE_OXFORD']: 214 libenv.AppendUnique( CCFLAGS=["-DENABLE_OXFORD"] ) 215 source += oxford_source 216 pkgdata += oxford_pkgdata 202 217 if env['ENABLE_MOTU']: 203 218 libenv.AppendUnique( CCFLAGS=["-DENABLE_MOTU"] ) … … 219 234 if env['ENABLE_GENERICAVC']: 220 235 libenv.AppendUnique( CCFLAGS=["-DENABLE_GENERICAVC"] ) 236 source += libavc_source 221 237 source += amdtp_source 222 238 source += genericavc_source trunk/libffado/tests/test-focusrite.cpp
r1184 r1535 33 33 #include "libavc/general/avc_generic.h" 34 34 #include "libutil/Time.h" 35 #include "libutil/ByteSwap.h" 35 36 36 37 #include "bebob/focusrite/focusrite_cmd.h" 38 #include "bebob/focusrite/focusrite_generic.h" 37 39 using namespace BeBoB::Focusrite; 38 40 … … 122 124 break; 123 125 case ARGP_KEY_END: 124 if(arguments->nargs<4) { 125 printf("not enough arguments\n"); 126 return -1; 127 } 126 128 127 129 128 break; … … 165 164 cmd.setVerbose( DEBUG_LEVEL_NORMAL ); 166 165 167 #define TOTAL_IDS_TO_SCAN 1 28166 #define TOTAL_IDS_TO_SCAN 110 168 167 uint32_t old_vals[TOTAL_IDS_TO_SCAN+1]; 168 m_1394Service->setVerboseLevel(DEBUG_LEVEL_INFO); 169 169 170 170 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; 172 177 // if (id==64) continue; // metering 173 178 // if (id==65) continue; // metering 174 179 // if (id==66) continue; // metering 175 180 // 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); 187 183 } 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 } 191 193 } 192 194 }