Changeset 1263
- Timestamp:
- 06/21/08 07:05:50 (13 years ago)
- Files:
-
- branches/libffado-2.0/src/devicemanager.cpp (modified) (2 diffs)
- branches/libffado-2.0/src/ffadodevice.h (modified) (1 diff)
- branches/libffado-2.0/src/libieee1394/IsoHandler.cpp (modified) (21 diffs)
- branches/libffado-2.0/src/libieee1394/IsoHandler.h (modified) (4 diffs)
- branches/libffado-2.0/src/libieee1394/IsoHandlerManager.cpp (modified) (15 diffs)
- branches/libffado-2.0/src/libieee1394/IsoHandlerManager.h (modified) (3 diffs)
- branches/libffado-2.0/src/libstreaming/generic/StreamProcessor.cpp (modified) (3 diffs)
- branches/libffado-2.0/src/libstreaming/generic/StreamProcessor.h (modified) (1 diff)
- branches/libffado-2.0/src/libstreaming/StreamProcessorManager.cpp (modified) (12 diffs)
- branches/libffado-2.0/src/libstreaming/StreamProcessorManager.h (modified) (3 diffs)
- branches/libffado-2.0/src/libutil/Thread.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/libffado-2.0/src/devicemanager.cpp
r1229 r1263 68 68 , m_avDevicesLock( new Util::PosixMutex() ) 69 69 , m_BusResetLock( new Util::PosixMutex() ) 70 , m_processorManager( new Streaming::StreamProcessorManager( ) )70 , m_processorManager( new Streaming::StreamProcessorManager( *this ) ) 71 71 , m_deviceStringParser( new DeviceStringParser() ) 72 72 , m_used_cache_last_time( false ) … … 956 956 } 957 957 958 959 958 void 960 959 DeviceManager::setVerboseLevel(int l) branches/libffado-2.0/src/ffadodevice.h
r1129 r1263 42 42 namespace Streaming { 43 43 class StreamProcessor; 44 class StreamProcessorManager;45 44 } 46 45 branches/libffado-2.0/src/libieee1394/IsoHandler.cpp
r1247 r1263 63 63 unsigned int length, unsigned char channel, 64 64 unsigned char tag, unsigned char sy, unsigned int cycle, 65 unsigned int dropped 1) {65 unsigned int dropped) { 66 66 67 67 IsoHandler *recvHandler = static_cast<IsoHandler *>(raw1394_get_userdata(handle)); 68 68 assert(recvHandler); 69 69 70 unsigned int skipped = (dropped1 & 0xFFFF0000) >> 16; 71 unsigned int dropped = dropped1 & 0xFFFF; 72 73 return recvHandler->putPacket(data, length, channel, tag, sy, cycle, dropped, skipped); 70 return recvHandler->putPacket(data, length, channel, tag, sy, cycle, dropped); 74 71 } 75 72 … … 92 89 , m_last_cycle( -1 ) 93 90 , m_last_now( 0xFFFFFFFF ) 91 , m_last_packet_handled_at( 0xFFFFFFFF ) 94 92 , m_Client( 0 ) 95 93 , m_speed( RAW1394_ISO_SPEED_400 ) … … 100 98 , m_packets ( 0 ) 101 99 , m_dropped( 0 ) 100 , m_skipped( 0 ) 102 101 , m_min_ahead( 7999 ) 103 102 #endif … … 115 114 , m_last_cycle( -1 ) 116 115 , m_last_now( 0xFFFFFFFF ) 116 , m_last_packet_handled_at( 0xFFFFFFFF ) 117 117 , m_Client( 0 ) 118 118 , m_speed( RAW1394_ISO_SPEED_400 ) … … 122 122 , m_packets ( 0 ) 123 123 , m_dropped( 0 ) 124 , m_skipped( 0 ) 124 125 , m_min_ahead( 7999 ) 125 126 #endif … … 138 139 , m_last_cycle( -1 ) 139 140 , m_last_now( 0xFFFFFFFF ) 141 , m_last_packet_handled_at( 0xFFFFFFFF ) 140 142 , m_Client( 0 ) 141 143 , m_speed( speed ) … … 145 147 , m_packets( 0 ) 146 148 , m_dropped( 0 ) 149 , m_skipped( 0 ) 150 , m_min_ahead( 7999 ) 147 151 #endif 148 152 { … … 169 173 if(m_Client) { 170 174 bool result; 175 171 176 if (m_type == eHT_Receive) { 172 177 result = m_Client->canProducePacket(); … … 175 180 } 176 181 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, " returns %d\n", result); 177 return result ;182 return result && (m_State != E_Error); 178 183 } else { 179 184 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, " no client\n"); … … 261 266 } 262 267 268 // wake up any waiting reads/polls 269 raw1394_wake_up(m_handle); 270 263 271 // this is put here to try and avoid the 264 272 // Runaway context problem 265 273 // don't know if it will help though. 266 raw1394_iso_xmit_sync(m_handle); 274 if(m_State != E_Error) { // if the handler is dead, this might block forever 275 raw1394_iso_xmit_sync(m_handle); 276 } 267 277 raw1394_iso_stop(m_handle); 268 278 m_State = E_Prepared; … … 308 318 IsoHandler::notifyOfDeath() 309 319 { 320 m_State = E_Error; 321 310 322 // notify the client of the fact that we have died 311 323 m_Client->handlerDied(); 324 325 // wake ourselves up 326 raw1394_wake_up(m_handle); 312 327 } 313 328 … … 331 346 } 332 347 #ifdef DEBUG 333 debugOutputShort( DEBUG_LEVEL_NORMAL, " Last cycle, dropped.........: %4d, %4u \n",334 m_last_cycle, m_dropped );348 debugOutputShort( DEBUG_LEVEL_NORMAL, " Last cycle, dropped.........: %4d, %4u, %4u\n", 349 m_last_cycle, m_dropped, m_skipped); 335 350 #endif 336 351 … … 340 355 { 341 356 setDebugLevel(l); 357 debugOutput( DEBUG_LEVEL_VERBOSE, "Setting verbose level to %d...\n", l ); 342 358 } 343 359 … … 381 397 unsigned char *data, unsigned int length, 382 398 unsigned char channel, unsigned char tag, unsigned char sy, 383 unsigned int cycle, unsigned int dropped , unsigned int skipped) {399 unsigned int cycle, unsigned int dropped) { 384 400 385 401 // keep track of dropped cycles … … 389 405 #ifdef DEBUG 390 406 if (dropped_cycles < 0) { 391 debugWarning("(%p) dropped < 1 (%d), cycle: %d, last_cycle: %d, dropped: %d , 'skipped'=%u\n",392 this, dropped_cycles, cycle, m_last_cycle, dropped , skipped);407 debugWarning("(%p) dropped < 1 (%d), cycle: %d, last_cycle: %d, dropped: %d\n", 408 this, dropped_cycles, cycle, m_last_cycle, dropped); 393 409 } 394 410 if (dropped_cycles > 0) { 395 411 debugOutput(DEBUG_LEVEL_NORMAL, 396 "(%p) dropped %d packets on cycle %u, 'dropped'=%u, 'skipped'=%u,cycle=%d, m_last_cycle=%d\n",397 this, dropped_cycles, cycle, dropped, skipped,cycle, m_last_cycle);412 "(%p) dropped %d packets on cycle %u, 'dropped'=%u, cycle=%d, m_last_cycle=%d\n", 413 this, dropped_cycles, cycle, dropped, cycle, m_last_cycle); 398 414 m_dropped += dropped_cycles; 399 415 } … … 477 493 } 478 494 #endif 495 m_last_packet_handled_at = pkt_ctr; 479 496 480 497 // leave the offset field (for now?) 481 498 482 499 debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 483 "received packet: length=%d, channel=%d, cycle=%d \n",484 length, channel, cycle );500 "received packet: length=%d, channel=%d, cycle=%d, at %08X\n", 501 length, channel, cycle, pkt_ctr); 485 502 #ifdef DEBUG 486 503 m_packets++; … … 496 513 // iterate the client if required 497 514 if(m_Client) { 498 enum raw1394_iso_disposition retval = m_Client->putPacket(data, length, channel, tag, sy, pkt_ctr, dropped_cycles , skipped);515 enum raw1394_iso_disposition retval = m_Client->putPacket(data, length, channel, tag, sy, pkt_ctr, dropped_cycles); 499 516 if (retval == RAW1394_ISO_OK) { 500 517 if (m_dont_exit_iterate_loop) { … … 527 544 pkt_ctr = cycle << 12; 528 545 529 #if 0 // we don't need this for xmit530 546 // if we assume that one iterate() loop doesn't take longer than 0.5 seconds, 531 547 // the seconds field won't change while the iterate loop runs … … 560 576 uint32_t pkt_ctr_ref = cycle << 12; 561 577 pkt_ctr_ref |= (now_secs_ref & 0x7F) << 25; 562 578 563 579 if(pkt_ctr != pkt_ctr_ref) { 564 580 debugWarning("reconstructed CTR counter discrepancy\n"); … … 566 582 } 567 583 #endif 568 #endif 569 } 570 584 } 585 if (m_packets < m_buf_packets) { // these are still prebuffer packets 586 m_last_packet_handled_at = 0xFFFFFFFF; 587 } else { 588 m_last_packet_handled_at = pkt_ctr; 589 } 571 590 debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, 572 "sending packet: length=%d, cycle=%d \n",573 *length, cycle );591 "sending packet: length=%d, cycle=%d, at %08X\n", 592 *length, cycle, pkt_ctr); 574 593 575 594 #ifdef DEBUG … … 593 612 "(%p) skipped %d cycles, cycle: %d, last_cycle: %d, dropped: %d\n", 594 613 this, skipped, cycle, m_last_cycle, dropped); 614 m_skipped += skipped; 595 615 } 596 616 if (dropped_cycles < 0) { branches/libffado-2.0/src/libieee1394/IsoHandler.h
r1247 r1263 69 69 putPacket(unsigned char *data, unsigned int length, 70 70 unsigned char channel, unsigned char tag, unsigned char sy, 71 unsigned int cycle, unsigned int dropped , unsigned int skipped);71 unsigned int cycle, unsigned int dropped); 72 72 73 73 static enum raw1394_iso_disposition iso_transmit_handler(raw1394handle_t handle, … … 161 161 */ 162 162 uint32_t getLastIterateTime() {return m_last_now;}; 163 164 /** 165 * @brief returns the CTR value saved at the last iterate handler call 166 * @return CTR value saved at last iterate handler call 167 */ 168 uint32_t getLastPacketTime() {return m_last_packet_handled_at;}; 163 169 164 170 void notifyOfDeath(); … … 172 178 int m_last_cycle; 173 179 uint32_t m_last_now; 180 uint32_t m_last_packet_handled_at; 174 181 175 182 Streaming::StreamProcessor *m_Client; // FIXME: implement with functors … … 189 196 E_Prepared, 190 197 E_Running, 191 E_Error 198 E_Error, 192 199 }; 193 200 enum EHandlerStates m_State; 194 201 202 public: 195 203 #ifdef DEBUG 196 204 unsigned int m_packets; 197 205 unsigned int m_dropped; 206 unsigned int m_skipped; 198 207 int m_min_ahead; 199 208 #endif 200 209 210 protected: 201 211 DECLARE_DEBUG_MODULE; 202 212 }; branches/libffado-2.0/src/libieee1394/IsoHandlerManager.cpp
r1262 r1263 47 47 , m_SyncIsoHandler ( NULL ) 48 48 , m_handlerType( t ) 49 , m_running( false ) 49 50 { 50 51 } … … 73 74 74 75 sem_init(&m_activity_semaphore, 0, 0); 76 m_running = true; 75 77 return true; 76 78 } … … 81 83 debugOutput(DEBUG_LEVEL_VERBOSE, "(%p) enter\n", this); 82 84 INC_ATOMIC(&request_update); 85 86 if (m_running) { 87 int timeout = 1000; 88 while(request_update && timeout--) { 89 Util::SystemTimeSource::SleepUsecRelative(1000); 90 } 91 if(timeout == 0) { 92 debugError("timeout waiting for shadow map update\n"); 93 } 94 } 95 debugOutput(DEBUG_LEVEL_VERBOSE, "(%p) exit\n", this); 83 96 return true; 84 97 } … … 139 152 IsoTask::Execute() 140 153 { 141 debugOutput Extreme(DEBUG_LEVEL_VERY_VERBOSE,142 143 154 debugOutput(DEBUG_LEVEL_ULTRA_VERBOSE, 155 "(%p, %s) Execute\n", 156 this, (m_handlerType == IsoHandler::eHT_Transmit? "Transmit": "Receive")); 144 157 int err; 145 158 unsigned int i; … … 157 170 if(m_successive_short_loops > 10000) { 158 171 debugError("Shutting down runaway thread\n"); 172 m_running = false; 159 173 return false; 160 174 } … … 209 223 210 224 if(no_one_to_poll) { 211 debugOutput Extreme(DEBUG_LEVEL_VERBOSE,212 213 225 debugOutput(DEBUG_LEVEL_ULTRA_VERBOSE, 226 "(%p, %s) No one to poll, waiting for something to happen\n", 227 this, (m_handlerType == IsoHandler::eHT_Transmit? "Transmit": "Receive")); 214 228 // wait for something to happen 215 229 switch(waitForActivity()) { … … 247 261 } 248 262 debugFatal("poll error: %s\n", strerror (errno)); 263 m_running = false; 249 264 return false; 250 265 } … … 255 270 for (i = 0; i < m_poll_nfds_shadow; i++) { 256 271 // figure out if a handler has died 257 // all handlers in the poll() are active, so they should be iterated 258 // now and then. If they aren't, the handler has died.259 uint32_t last_ call = m_IsoHandler_map_shadow[i]->getLastIterateTime();260 if (last_ call== 0xFFFFFFFF) {272 273 // this is the time of the last packet we saw in the iterate() handler 274 uint32_t last_packet_seen = m_IsoHandler_map_shadow[i]->getLastPacketTime(); 275 if (last_packet_seen == 0xFFFFFFFF) { 261 276 // this was not iterated yet, so can't be dead 277 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, 278 "(%p, %s) handler %d didn't see any packets yet\n", 279 this, (m_handlerType == IsoHandler::eHT_Transmit? "Transmit": "Receive"), i); 262 280 continue; 263 281 } 264 282 265 uint64_t last_call_ticks = CYCLE_TIMER_TO_TICKS(last_call); 266 // we use 4 seconds since that should not cause issues with startup 267 int64_t max_diff_ticks = TICKS_PER_SECOND * 4; 268 int64_t measured_diff_ticks = diffTicks(ctr_at_poll_return_ticks, last_call_ticks); 269 283 uint64_t last_packet_seen_ticks = CYCLE_TIMER_TO_TICKS(last_packet_seen); 284 // we use a relatively large value to distinguish between "death" and xrun 285 int64_t max_diff_ticks = TICKS_PER_SECOND * 1; 286 int64_t measured_diff_ticks = diffTicks(ctr_at_poll_return_ticks, last_packet_seen_ticks); 287 288 debugOutputExtreme(DEBUG_LEVEL_VERBOSE, 289 "(%p, %s) check handler %d: diff = %lld, max = %lld, now: %08lX, last: %08lX\n", 290 this, (m_handlerType == IsoHandler::eHT_Transmit? "Transmit": "Receive"), 291 i, measured_diff_ticks, max_diff_ticks, ctr_at_poll_return, last_packet_seen); 270 292 if(measured_diff_ticks > max_diff_ticks) { 271 293 debugFatal("(%p, %s) Handler died: now: %08lX, last: %08lX, diff: %lld (max: %lld)\n", 272 294 this, (m_handlerType == IsoHandler::eHT_Transmit? "Transmit": "Receive"), 273 ctr_at_poll_return, last_ call, measured_diff_ticks, max_diff_ticks);295 ctr_at_poll_return, last_packet_seen, measured_diff_ticks, max_diff_ticks); 274 296 m_IsoHandler_map_shadow[i]->notifyOfDeath(); 275 297 handler_died = true; … … 277 299 } 278 300 if(handler_died) { 301 m_running = false; 279 302 return false; // one or more handlers have died 280 303 } … … 361 384 } 362 385 363 debugOutput Extreme(DEBUG_LEVEL_VERBOSE,364 365 386 debugOutput(DEBUG_LEVEL_ULTRA_VERBOSE, 387 "(%p, %s) got activity\n", 388 this, (m_handlerType == IsoHandler::eHT_Transmit? "Transmit": "Receive")); 366 389 return eAR_Activity; 367 390 } … … 372 395 // signal the activity cond var 373 396 sem_post(&m_activity_semaphore); 374 debugOutput Extreme(DEBUG_LEVEL_VERBOSE,375 376 397 debugOutput(DEBUG_LEVEL_ULTRA_VERBOSE, 398 "(%p, %s) activity\n", 399 this, (m_handlerType == IsoHandler::eHT_Transmit? "Transmit": "Receive")); 377 400 } 378 401 379 402 void IsoTask::setVerboseLevel(int i) { 380 403 setDebugLevel(i); 404 debugOutput( DEBUG_LEVEL_VERBOSE, "Setting verbose level to %d...\n", i ); 381 405 } 382 406 … … 643 667 bool IsoHandlerManager::registerStream(StreamProcessor *stream) 644 668 { 645 debugOutput( DEBUG_LEVEL_VERBOSE, "Registering stream %p\n",stream);669 debugOutput( DEBUG_LEVEL_VERBOSE, "Registering %s stream %p\n", stream->getTypeString(), stream); 646 670 assert(stream); 647 671 … … 768 792 bool IsoHandlerManager::unregisterStream(StreamProcessor *stream) 769 793 { 770 debugOutput( DEBUG_LEVEL_VERBOSE, "Unregistering stream %p\n",stream);794 debugOutput( DEBUG_LEVEL_VERBOSE, "Unregistering %s stream %p\n", stream->getTypeString(), stream); 771 795 assert(stream); 772 796 … … 896 920 { 897 921 if((*it)->isStreamRegistered(stream)) { 898 return(*it)->flush();922 (*it)->flush(); 899 923 } 900 924 } 901 925 debugError("Stream %p has no attached handler\n", stream); 902 926 return; 927 } 928 929 IsoHandler * 930 IsoHandlerManager::getHandlerForStream(Streaming::StreamProcessor *stream) { 931 for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin(); 932 it != m_IsoHandlers.end(); 933 ++it ) 934 { 935 if((*it)->isStreamRegistered(stream)) { 936 return (*it); 937 } 938 } 939 debugError("Stream %p has no attached handler\n", stream); 940 return NULL; 903 941 } 904 942 … … 1006 1044 if(m_IsoThreadReceive) m_IsoThreadReceive->setVerboseLevel(i); 1007 1045 if(m_IsoTaskReceive) m_IsoTaskReceive->setVerboseLevel(i); 1046 setDebugLevel(i); 1047 debugOutput( DEBUG_LEVEL_VERBOSE, "Setting verbose level to %d...\n", i ); 1008 1048 } 1009 1049 branches/libffado-2.0/src/libieee1394/IsoHandlerManager.h
r1144 r1263 43 43 namespace Streaming { 44 44 class StreamProcessor; 45 class StreamProcessorManager;46 45 typedef std::vector<StreamProcessor *> StreamProcessorVector; 47 46 typedef std::vector<StreamProcessor *>::iterator StreamProcessorVectorIterator; … … 113 112 114 113 enum IsoHandler::EHandlerType m_handlerType; 114 bool m_running; 115 115 116 // debug stuff 116 117 DECLARE_DEBUG_MODULE; … … 180 181 181 182 void flushHandlerForStream(Streaming::StreamProcessor *stream); 183 IsoHandler * getHandlerForStream(Streaming::StreamProcessor *stream); 182 184 183 185 Ieee1394Service& get1394Service() {return m_service;}; branches/libffado-2.0/src/libstreaming/generic/StreamProcessor.cpp
r1168 r1263 109 109 m_state = ePS_Stopped; 110 110 m_in_xrun = true; 111 SIGNAL_ACTIVITY_ALL; 111 112 } 112 113 … … 287 288 unsigned char channel, unsigned char tag, unsigned char sy, 288 289 uint32_t pkt_ctr, 289 unsigned int dropped_cycles , unsigned int skipped) {290 unsigned int dropped_cycles) { 290 291 // bypass based upon state 291 292 #ifdef DEBUG … … 1793 1794 #ifdef DEBUG 1794 1795 debugOutputShort( DEBUG_LEVEL_NORMAL, " StreamProcessor %p, %s:\n", this, ePTToString(m_processor_type)); 1795 debugOutputShort( DEBUG_LEVEL_NORMAL, " Port, Channel : %d, %d\n", m_1394service.getPort(), m_channel); 1796 debugOutputShort( DEBUG_LEVEL_NORMAL, " Port, Channel : %d, %d\n", m_1394service.getPort(), m_channel); 1797 IsoHandler *h = m_IsoHandlerManager.getHandlerForStream(this); 1798 if (h) { 1799 debugOutputShort( DEBUG_LEVEL_NORMAL, " Packets, Dropped, Skipped : %d, %d, %d\n", 1800 h->m_packets, h->m_dropped, h->m_skipped); 1801 } else { 1802 debugError("No handler for stream??\n"); 1803 } 1796 1804 uint64_t now = m_1394service.getCycleTimerTicks(); 1797 1805 debugOutputShort( DEBUG_LEVEL_NORMAL, " Now : %011llu (%03us %04uc %04ut)\n", branches/libffado-2.0/src/libstreaming/generic/StreamProcessor.h
r1190 r1263 152 152 putPacket(unsigned char *data, unsigned int length, 153 153 unsigned char channel, unsigned char tag, unsigned char sy, 154 uint32_t pkt_ctr, unsigned int dropped , unsigned int skipped);154 uint32_t pkt_ctr, unsigned int dropped); 155 155 156 156 enum raw1394_iso_disposition branches/libffado-2.0/src/libstreaming/StreamProcessorManager.cpp
r1262 r1263 28 28 #include "libieee1394/cycletimer.h" 29 29 30 #include "devicemanager.h" 31 30 32 #include "libutil/Time.h" 31 33 … … 38 40 IMPL_DEBUG_MODULE( StreamProcessorManager, StreamProcessorManager, DEBUG_LEVEL_VERBOSE ); 39 41 40 StreamProcessorManager::StreamProcessorManager( )42 StreamProcessorManager::StreamProcessorManager(DeviceManager &p) 41 43 : m_is_slave( false ) 42 44 , m_SyncSource(NULL) 45 , m_parent( p ) 43 46 , m_xrun_happened( false ) 44 47 , m_activity_wait_timeout_usec( 1000*1000 ) … … 56 59 } 57 60 58 StreamProcessorManager::StreamProcessorManager(unsigned int period, unsigned int framerate, unsigned int nb_buffers) 61 StreamProcessorManager::StreamProcessorManager(DeviceManager &p, unsigned int period, 62 unsigned int framerate, unsigned int nb_buffers) 59 63 : m_is_slave( false ) 60 64 , m_SyncSource(NULL) 65 , m_parent( p ) 61 66 , m_xrun_happened( false ) 62 67 , m_activity_wait_timeout_usec( 1000*1000 ) … … 698 703 } else { 699 704 debugOutput(DEBUG_LEVEL_VERBOSE, "Sync start try %d failed...\n", ntries); 705 if(m_shutdown_needed) { 706 debugOutput(DEBUG_LEVEL_VERBOSE, "Some fatal error occurred, stop trying.\n"); 707 return false; 708 } 700 709 } 701 710 } … … 704 713 return false; 705 714 } 706 715 debugOutput( DEBUG_LEVEL_VERBOSE, " Started...\n"); 707 716 return true; 708 717 } … … 815 824 return false; 816 825 } 826 debugOutput( DEBUG_LEVEL_VERBOSE, " Stopped...\n"); 817 827 return true; 818 828 } … … 900 910 case eAR_Error: 901 911 debugError("Error while waiting for activity\n"); 912 m_shutdown_needed = true; 902 913 return false; 903 914 case eAR_Interrupted: … … 906 917 break; 907 918 case eAR_Timeout: 908 // FIXME: what to do here?909 919 debugWarning("Timeout while waiting for activity\n"); 910 break; 920 #ifdef DEBUG 921 setVerboseLevel(DEBUG_LEVEL_ULTRA_VERBOSE); 922 m_parent.setVerboseLevel(DEBUG_LEVEL_ULTRA_VERBOSE); 923 // sleep for a brief moment, such that we can see what is happening in the other threads 924 SleepRelativeUsec(1000*100); 925 #endif 926 // this is a serious error since apparently there was not 927 // enough activity. This means one of the streams died. 928 m_shutdown_needed = true; 929 return false; 911 930 case eAR_Activity: 912 931 // do nothing … … 1215 1234 1216 1235 void StreamProcessorManager::setVerboseLevel(int l) { 1217 setDebugLevel(l);1218 1236 if(m_WaitLock) m_WaitLock->setVerboseLevel(l); 1219 1237 1220 debugOutput( DEBUG_LEVEL_VERBOSE, " Receive processors...\n");1221 1238 for ( StreamProcessorVectorIterator it = m_ReceiveProcessors.begin(); 1222 1239 it != m_ReceiveProcessors.end(); … … 1224 1241 (*it)->setVerboseLevel(l); 1225 1242 } 1226 1227 debugOutput( DEBUG_LEVEL_VERBOSE, " Transmit processors...\n");1228 1243 for ( StreamProcessorVectorIterator it = m_TransmitProcessors.begin(); 1229 1244 it != m_TransmitProcessors.end(); … … 1231 1246 (*it)->setVerboseLevel(l); 1232 1247 } 1233 } 1234 1248 setDebugLevel(l); 1249 debugOutput( DEBUG_LEVEL_VERBOSE, "Setting verbose level to %d...\n", l ); 1250 } 1235 1251 1236 1252 int StreamProcessorManager::getPortCount(enum Port::E_PortType type, enum Port::E_Direction direction) { … … 1273 1289 1274 1290 // TODO: implement a port map here, instead of the loop 1275 1276 1291 Port* StreamProcessorManager::getPortByIndex(int idx, enum Port::E_Direction direction) { 1277 1292 int count=0; branches/libffado-2.0/src/libstreaming/StreamProcessorManager.h
r1262 r1263 36 36 #include <semaphore.h> 37 37 38 class DeviceManager; 39 38 40 namespace Streaming { 39 41 … … 56 58 }; 57 59 58 StreamProcessorManager(); 59 StreamProcessorManager(unsigned int period, unsigned int rate, unsigned int nb_buffers); 60 StreamProcessorManager(DeviceManager &parent); 61 StreamProcessorManager(DeviceManager &parent, unsigned int period, 62 unsigned int rate, unsigned int nb_buffers); 60 63 virtual ~StreamProcessorManager(); 61 64 … … 157 160 protected: // FIXME: private? 158 161 162 // parent device manager 163 DeviceManager &m_parent; 164 159 165 // thread related vars 160 166 bool m_xrun_happened; branches/libffado-2.0/src/libutil/Thread.h
r1144 r1263 113 113 114 114 virtual void setVerboseLevel(int l) 115 {setDebugLevel(l);}; 115 { setDebugLevel(l); 116 debugOutput( DEBUG_LEVEL_VERBOSE, "Setting verbose level to %d...\n", l ); 117 }; 116 118 protected: 117 119 DECLARE_DEBUG_MODULE;