Changeset 1046
- Timestamp:
- 04/26/08 09:42:39 (4 years ago)
- Files:
-
- trunk/libffado/config.h.in (modified) (1 diff)
- trunk/libffado/src/debugmodule/debugmodule.cpp (modified) (20 diffs)
- trunk/libffado/src/debugmodule/debugmodule.h (modified) (9 diffs)
- trunk/libffado/src/ffado.cpp (modified) (2 diffs)
- trunk/libffado/src/libieee1394/ARMHandler.cpp (modified) (5 diffs)
- trunk/libffado/src/libieee1394/ieee1394service.cpp (modified) (1 diff)
- trunk/libffado/src/libieee1394/IsoHandler.cpp (modified) (3 diffs)
- trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp (modified) (6 diffs)
- trunk/libffado/src/libstreaming/StreamProcessorManager.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/config.h.in
r1042 r1046 39 39 #define HAVE_LRINTF $HAVE_LRINTF 40 40 41 #define DEBUG_IMPLEMENT_BACKLOG 0 41 // use a RT-safe message buffer for debug output 42 // useful to disable this when the code aborts/segfaults to 43 // not lose debug output. should be enabled though. 44 #define DEBUG_USE_MESSAGE_BUFFER 1 45 // max message length in the debug messagebuffer 46 #define DEBUG_MAX_MESSAGE_LENGTH 512 47 // number of messages in the debug messagebuffer (power of two) 48 #define DEBUG_MB_BUFFERS 1024 49 50 // support a debug backlog 51 // note that this does not influence non-debug builds 52 #define DEBUG_BACKLOG_SUPPORT 0 53 // number of messages in the backlog buffer (power of two) 54 #define DEBUG_BACKLOG_MB_BUFFERS 64 55 56 // support backtrace debugging 57 // note that this does not influence non-debug builds 58 #define DEBUG_BACKTRACE_SUPPORT 0 59 // max length of backtrace 60 #define DEBUG_MAX_BACKTRACE_LENGTH 8 61 // max amount of function pointers to keep track of 62 #define DEBUG_MAX_BACKTRACE_FUNCTIONS_SEEN 64 42 63 43 64 // make this zero to disable the most extreme 44 65 // debug logging in the critical sections 45 66 #define DEBUG_EXTREME_ENABLE 0 46 47 // use a RT-safe message buffer for debug output48 // useful to disable this when the code aborts/segfaults to49 // not lose debug output. should be enabled though.50 #define DEBUG_USE_MESSAGE_BUFFER 151 67 52 68 // watchdog trunk/libffado/src/debugmodule/debugmodule.cpp
r1030 r1046 92 92 93 93 // bypass for performance 94 #if def IMPLEMENT_BACKLOG94 #if DEBUG_BACKLOG_SUPPORT 95 95 if (level > BACKLOG_MIN_LEVEL 96 96 && level > m_level) { … … 124 124 } 125 125 126 #if def IMPLEMENT_BACKLOG126 #if DEBUG_BACKLOG_SUPPORT 127 127 // print to backlog if necessary 128 128 if (level <= BACKLOG_MIN_LEVEL) { … … 146 146 { 147 147 // bypass for performance 148 #if def IMPLEMENT_BACKLOG148 #if DEBUG_BACKLOG_SUPPORT 149 149 if (level > BACKLOG_MIN_LEVEL 150 150 && level > m_level) { … … 203 203 } 204 204 205 #if def IMPLEMENT_BACKLOG205 #if DEBUG_BACKLOG_SUPPORT 206 206 // print to backlog if necessary 207 207 if (level <= BACKLOG_MIN_LEVEL) { … … 240 240 DebugModuleManager::DebugModuleManager() 241 241 : mb_initialized(0) 242 #if DEBUG_USE_MESSAGE_BUFFER 242 243 , mb_inbuffer(0) 243 244 , mb_outbuffer(0) 244 245 , mb_overruns(0) 246 #endif 247 #if DEBUG_BACKTRACE_SUPPORT 245 248 , m_backtrace_buffer_nb_seen(0) 246 #ifdef IMPLEMENT_BACKLOG 249 #endif 250 #if DEBUG_BACKLOG_SUPPORT 247 251 , bl_mb_inbuffer(0) 248 252 #endif … … 266 270 return; 267 271 272 #if DEBUG_USE_MESSAGE_BUFFER 268 273 pthread_mutex_lock(&mb_write_lock); 269 274 mb_initialized = 0; … … 273 278 pthread_join(mb_writer_thread, NULL); 274 279 mb_flush(); 275 280 #endif 281 282 #if DEBUG_BACKTRACE_SUPPORT 276 283 pthread_mutex_lock(&m_backtrace_lock); 277 284 // print a list of the symbols seen in a backtrace … … 287 294 } 288 295 pthread_mutex_unlock(&m_backtrace_lock); 289 296 #endif 297 298 #if DEBUG_USE_MESSAGE_BUFFER 290 299 if (mb_overruns) 291 300 fprintf(stderr, "WARNING: %d message buffer overruns!\n", … … 296 305 pthread_mutex_destroy(&mb_write_lock); 297 306 pthread_cond_destroy(&mb_ready_cond); 298 307 #endif 308 309 #if DEBUG_BACKTRACE_SUPPORT 299 310 pthread_mutex_destroy(&m_backtrace_lock); 300 301 #ifdef IMPLEMENT_BACKLOG 311 #endif 312 313 #if DEBUG_BACKLOG_SUPPORT 302 314 pthread_mutex_destroy(&bl_mb_write_lock); 303 315 #endif … … 314 326 // cout << "DebugModuleManager init..." << endl; 315 327 328 #if DEBUG_USE_MESSAGE_BUFFER 329 pthread_mutex_init(&mb_flush_lock, NULL); 316 330 pthread_mutex_init(&mb_write_lock, NULL); 317 pthread_mutex_init(&mb_flush_lock, NULL);318 331 pthread_cond_init(&mb_ready_cond, NULL); 319 320 pthread_mutex_init(&m_backtrace_lock, NULL);321 332 322 333 mb_overruns = 0; 323 334 mb_initialized = 1; 324 335 325 #ifdef IMPLEMENT_BACKLOG326 pthread_mutex_init(&bl_mb_write_lock, NULL);327 #endif328 329 336 if (pthread_create(&mb_writer_thread, NULL, &mb_thread_func, (void *)this) != 0) 330 337 mb_initialized = 0; 338 #endif 339 340 #if DEBUG_BACKTRACE_SUPPORT 341 pthread_mutex_init(&m_backtrace_lock, NULL); 342 #endif 343 344 #if DEBUG_BACKLOG_SUPPORT 345 pthread_mutex_init(&bl_mb_write_lock, NULL); 346 #endif 331 347 332 348 return true; … … 413 429 DebugModuleManager::flush() 414 430 { 415 #if defDEBUG_USE_MESSAGE_BUFFER431 #if DEBUG_USE_MESSAGE_BUFFER 416 432 mb_flush(); 417 433 #else … … 420 436 } 421 437 438 #if DEBUG_USE_MESSAGE_BUFFER 422 439 void 423 440 DebugModuleManager::mb_flush() … … 439 456 } 440 457 441 #ifdef IMPLEMENT_BACKLOG 458 void * 459 DebugModuleManager::mb_thread_func(void *arg) 460 { 461 462 DebugModuleManager *m=static_cast<DebugModuleManager *>(arg); 463 464 /* The mutex is only to eliminate collisions between multiple 465 * writer threads and protect the condition variable. */ 466 pthread_mutex_lock(&m->mb_write_lock); 467 468 while (m->mb_initialized) { 469 pthread_cond_wait(&m->mb_ready_cond, &m->mb_write_lock); 470 471 /* releasing the mutex reduces contention */ 472 pthread_mutex_unlock(&m->mb_write_lock); 473 m->mb_flush(); 474 pthread_mutex_lock(&m->mb_write_lock); 475 } 476 477 pthread_mutex_unlock(&m->mb_write_lock); 478 479 return NULL; 480 } 481 #endif 482 483 #if DEBUG_BACKLOG_SUPPORT 442 484 void 443 485 DebugModuleManager::showBackLog() … … 491 533 pthread_mutex_unlock(&m->mb_flush_lock); 492 534 } 493 #endif 494 495 void * 496 DebugModuleManager::mb_thread_func(void *arg) 497 { 498 499 DebugModuleManager *m=static_cast<DebugModuleManager *>(arg); 500 501 /* The mutex is only to eliminate collisions between multiple 502 * writer threads and protect the condition variable. */ 503 pthread_mutex_lock(&m->mb_write_lock); 504 505 while (m->mb_initialized) { 506 pthread_cond_wait(&m->mb_ready_cond, &m->mb_write_lock); 507 508 /* releasing the mutex reduces contention */ 509 pthread_mutex_unlock(&m->mb_write_lock); 510 m->mb_flush(); 511 pthread_mutex_lock(&m->mb_write_lock); 512 } 513 514 pthread_mutex_unlock(&m->mb_write_lock); 515 516 return NULL; 517 } 518 519 #ifdef IMPLEMENT_BACKLOG 535 520 536 void 521 537 DebugModuleManager::backlog_print(const char *msg) … … 543 559 DebugModuleManager::print(const char *msg) 544 560 { 545 #if defDEBUG_USE_MESSAGE_BUFFER561 #if DEBUG_USE_MESSAGE_BUFFER 546 562 unsigned int ntries; 547 563 struct timespec wait = {0,50000}; 548 #endif549 564 550 565 if (!mb_initialized) { … … 556 571 } 557 572 558 #ifdef DEBUG_USE_MESSAGE_BUFFER559 573 ntries=1; 560 574 while (ntries) { // try a few times … … 580 594 } 581 595 596 #if DEBUG_BACKTRACE_SUPPORT 582 597 void 583 598 DebugModuleManager::printBacktrace(int len) … … 586 601 int chars_written=0; 587 602 588 if(len >MAX_BACKTRACE_SIZE) {589 len = MAX_BACKTRACE_SIZE;603 if(len > DEBUG_MAX_BACKTRACE_LENGTH) { 604 len = DEBUG_MAX_BACKTRACE_LENGTH; 590 605 } 591 606 … … 609 624 seen = false; 610 625 int j; 611 for (j=0; j<m_backtrace_buffer_nb_seen & j < MAX_BACKTRACE_FUNCTIONS_SEEN; j++) {626 for (j=0; j<m_backtrace_buffer_nb_seen & j < DEBUG_MAX_BACKTRACE_FUNCTIONS_SEEN; j++) { 612 627 if(m_backtrace_buffer_seen[j] == m_backtrace_buffer[i]) { 613 628 seen = true; … … 625 640 pthread_mutex_unlock(&m_backtrace_lock); 626 641 } 642 #endif 627 643 628 644 //---------------------------------------- trunk/libffado/src/debugmodule/debugmodule.h
r1030 r1046 46 46 #define DEBUG_LEVEL_ULTRA_VERBOSE 8 47 47 48 #define DEBUG_MAX_MESSAGE_LENGTH 51249 50 #define MAX_BACKTRACE_SIZE 3251 #define MAX_BACKTRACE_FUNCTIONS_SEEN 12852 53 48 /* MB_NEXT() relies on the fact that MB_BUFFERS is a power of two */ 54 #define MB_BUFFERS (1<<16) 55 56 #define MB_NEXT(index) (((index)+1) & (MB_BUFFERS-1)) 57 49 #define MB_NEXT(index) (((index)+1) & (DEBUG_MB_BUFFERS-1)) 58 50 #define MB_BUFFERSIZE DEBUG_MAX_MESSAGE_LENGTH 59 51 60 #ifdef DEBUG 61 #if DEBUG_IMPLEMENT_BACKLOG 62 #define IMPLEMENT_BACKLOG 63 #endif 64 #endif 65 66 #ifdef IMPLEMENT_BACKLOG 52 // no backtrace support when not debugging 53 #ifndef DEBUG 54 #undef DEBUG_BACKTRACE_SUPPORT 55 #define DEBUG_BACKTRACE_SUPPORT 0 56 #endif 57 58 // no backlog support when not debugging 59 #ifndef DEBUG 60 #undef DEBUG_BACKLOG_SUPPORT 61 #define DEBUG_BACKLOG_SUPPORT 0 62 #endif 63 67 64 // the backlog is a similar buffer as the message buffer 68 #define BACKLOG_MB_BUFFERS (256) 69 #define BACKLOG_MB_NEXT(index) (((index)+1) & (BACKLOG_MB_BUFFERS-1)) 70 #define BACKLOG_MIN_LEVEL DEBUG_LEVEL_VERY_VERBOSE 71 #endif 65 #define DEBUG_BACKLOG_MB_NEXT(index) (((index)+1) & (DEBUG_BACKLOG_MB_BUFFERS-1)) 66 #define DEBUG_BACKLOG_MIN_LEVEL DEBUG_LEVEL_VERY_VERBOSE 72 67 73 68 #define debugFatal( format, args... ) \ … … 155 150 #define flushDebugOutput() DebugModuleManager::instance()->flush() 156 151 157 #if def IMPLEMENT_BACKLOG152 #if DEBUG_BACKLOG_SUPPORT 158 153 159 154 #define debugShowBackLog() \ … … 249 244 250 245 /* 246 * Backtrace support 247 */ 248 #ifdef DEBUG 249 #if DEBUG_BACKTRACE_SUPPORT 250 #define debugPrintBacktrace( _SIZE_ ) \ 251 DebugModuleManager::instance()->printBacktrace( _SIZE_ ); 252 #endif 253 #else 254 #define debugPrintBacktrace( _SIZE_ ) 255 #endif 256 257 /* 251 258 * helper functions 252 259 */ … … 313 320 void flush(); 314 321 322 #if DEBUG_BACKLOG_SUPPORT 315 323 // the backlog is a ringbuffer of all the messages 316 324 // that have been recorded using the debugPrint … … 321 329 void showBackLog(); 322 330 void showBackLog(int nblines); 323 331 #endif 332 333 #if DEBUG_BACKTRACE_SUPPORT 324 334 void printBacktrace(int len); 335 #endif 336 325 337 protected: 326 338 bool registerModule( DebugModule& debugModule ); … … 330 342 331 343 void print(const char *msg); 344 345 #if DEBUG_BACKLOG_SUPPORT 332 346 void backlog_print(const char *msg); 347 #endif 333 348 334 349 private: … … 338 353 typedef std::vector< DebugModule* >::iterator DebugModuleVectorIterator; 339 354 340 char mb_buffers[MB_BUFFERS][MB_BUFFERSIZE];341 355 unsigned int mb_initialized; 356 357 #if DEBUG_USE_MESSAGE_BUFFER 358 char mb_buffers[DEBUG_MB_BUFFERS][MB_BUFFERSIZE]; 342 359 unsigned int mb_inbuffer; 343 360 unsigned int mb_outbuffer; … … 347 364 pthread_mutex_t mb_flush_lock; 348 365 pthread_cond_t mb_ready_cond; 349 366 #endif 367 368 #if DEBUG_BACKTRACE_SUPPORT 350 369 pthread_mutex_t m_backtrace_lock; 351 370 char m_backtrace_strbuffer[MB_BUFFERSIZE]; 352 void *m_backtrace_buffer[ MAX_BACKTRACE_SIZE];353 void *m_backtrace_buffer_seen[ MAX_BACKTRACE_FUNCTIONS_SEEN];371 void *m_backtrace_buffer[DEBUG_MAX_BACKTRACE_LENGTH]; 372 void *m_backtrace_buffer_seen[DEBUG_MAX_BACKTRACE_FUNCTIONS_SEEN]; 354 373 int m_backtrace_buffer_nb_seen; 355 374 #endif 375 356 376 static void *mb_thread_func(void *arg); 357 377 void mb_flush(); 358 378 359 #if def IMPLEMENT_BACKLOG379 #if DEBUG_BACKLOG_SUPPORT 360 380 // the backlog 361 char bl_mb_buffers[ BACKLOG_MB_BUFFERS][MB_BUFFERSIZE];381 char bl_mb_buffers[DEBUG_BACKLOG_MB_BUFFERS][MB_BUFFERSIZE]; 362 382 unsigned int bl_mb_inbuffer; 363 383 pthread_mutex_t bl_mb_write_lock; … … 368 388 }; 369 389 370 371 /* 372 * Backtrace support 373 */ 374 #ifdef DEBUG 375 #define debugPrintBacktrace( _SIZE_ ) \ 376 DebugModuleManager::instance()->printBacktrace( _SIZE_ ); 377 #else 378 #define debugPrintBacktrace( _SIZE_ ) 379 #endif 380 381 382 #endif 390 #endif trunk/libffado/src/ffado.cpp
r967 r1046 97 97 struct _ffado_device *dev = new struct _ffado_device; 98 98 99 debugWarning("%s built %s %s\n", ffado_get_version(), __DATE__, __TIME__);99 printMessage("%s built %s %s\n", ffado_get_version(), __DATE__, __TIME__); 100 100 101 101 if(!dev) { … … 248 248 return ffado_wait_ok; 249 249 } else if (result == DeviceManager::eWR_Xrun) { 250 debug Warning("Handled XRUN\n");250 debugOutput(DEBUG_LEVEL_NORMAL, "Handled XRUN\n"); 251 251 xruns++; 252 252 return ffado_wait_xrun; trunk/libffado/src/libieee1394/ARMHandler.cpp
r864 r1046 24 24 #include "ARMHandler.h" 25 25 26 IMPL_DEBUG_MODULE( ARMHandler, ARMHandler, DEBUG_LEVEL_ VERBOSE);26 IMPL_DEBUG_MODULE( ARMHandler, ARMHandler, DEBUG_LEVEL_NORMAL); 27 27 /** 28 28 * @param start identifies addressrange … … 68 68 69 69 bool ARMHandler::handleRead(struct raw1394_arm_request *req) { 70 debugOutput(DEBUG_LEVEL_VERBOSE, "Read\n");70 debugOutput(DEBUG_LEVEL_VERBOSE, "Read\n"); 71 71 printRequest(req); 72 72 return true; … … 74 74 75 75 bool ARMHandler::handleWrite(struct raw1394_arm_request *req) { 76 debugOutput(DEBUG_LEVEL_VERBOSE, "Write\n");76 debugOutput(DEBUG_LEVEL_VERBOSE, "Write\n"); 77 77 printRequest(req); 78 78 return true; … … 80 80 81 81 bool ARMHandler::handleLock(struct raw1394_arm_request *req) { 82 debugOutput(DEBUG_LEVEL_VERBOSE, "Lock\n");82 debugOutput(DEBUG_LEVEL_VERBOSE, "Lock\n"); 83 83 printRequest(req); 84 84 return true; … … 109 109 110 110 void ARMHandler::printRequest(struct raw1394_arm_request *arm_req) { 111 debugOutput(DEBUG_LEVEL_VERBOSE, " request info: \n");112 debugOutput(DEBUG_LEVEL_VERBOSE, " from node 0x%04X to node 0x%04X\n",111 debugOutput(DEBUG_LEVEL_VERBOSE, " request info: \n"); 112 debugOutput(DEBUG_LEVEL_VERBOSE, " from node 0x%04X to node 0x%04X\n", 113 113 arm_req->source_nodeid, arm_req->destination_nodeid); 114 debugOutput(DEBUG_LEVEL_VERBOSE, " tlabel: 0x%02X, tcode: 0x%02X, extended tcode: 0x%02X\n",114 debugOutput(DEBUG_LEVEL_VERBOSE, " tlabel: 0x%02X, tcode: 0x%02X, extended tcode: 0x%02X\n", 115 115 arm_req->tlabel, arm_req->tcode, arm_req->extended_transaction_code); 116 debugOutput(DEBUG_LEVEL_VERBOSE, " generation: %lu\n",116 debugOutput(DEBUG_LEVEL_VERBOSE, " generation: %lu\n", 117 117 arm_req->generation); 118 debugOutput(DEBUG_LEVEL_VERBOSE, " buffer length: %lu\n",118 debugOutput(DEBUG_LEVEL_VERBOSE, " buffer length: %lu\n", 119 119 arm_req->buffer_length); 120 120 printBufferBytes(DEBUG_LEVEL_VERBOSE, arm_req->buffer_length, arm_req->buffer); trunk/libffado/src/libieee1394/ieee1394service.cpp
r1044 r1046 421 421 } else { 422 422 #ifdef DEBUG 423 debugError("raw1394_read failed: node 0x%hX, addr = 0x%016llX, length = %u\n", 424 nodeId, addr, length); 423 debugOutput(DEBUG_LEVEL_NORMAL, 424 "raw1394_read failed: node 0x%hX, addr = 0x%016llX, length = %u\n", 425 nodeId, addr, length); 425 426 #endif 426 427 return false; trunk/libffado/src/libieee1394/IsoHandler.cpp
r1040 r1046 429 429 if (dropped_cycles < 0) { 430 430 debugWarning("(%p) dropped < 1 (%d), cycle: %d, last_cycle: %d, dropped: %d, 'skipped'=%u\n", 431 this, dropped_cycles, cycle, m_last_cycle, dropped, skipped);431 this, dropped_cycles, cycle, m_last_cycle, dropped, skipped); 432 432 } 433 433 if (dropped_cycles > 0) { 434 debugWarning("(%p) dropped %d packets on cycle %u, 'dropped'=%u, 'skipped'=%u, cycle=%d, m_last_cycle=%d\n", 435 this, dropped_cycles, cycle, dropped, skipped, cycle, m_last_cycle); 434 debugOutput(DEBUG_LEVEL_NORMAL, 435 "(%p) dropped %d packets on cycle %u, 'dropped'=%u, 'skipped'=%u, cycle=%d, m_last_cycle=%d\n", 436 this, dropped_cycles, cycle, dropped, skipped, cycle, m_last_cycle); 436 437 m_dropped += dropped_cycles; 437 438 } … … 537 538 #ifdef DEBUG 538 539 if(skipped) { 539 debugWarning("(%p) skipped %d cycles, cycle: %d, last_cycle: %d, dropped: %d\n", 540 this, skipped, cycle, m_last_cycle, dropped); 540 debugOutput(DEBUG_LEVEL_NORMAL, 541 "(%p) skipped %d cycles, cycle: %d, last_cycle: %d, dropped: %d\n", 542 this, skipped, cycle, m_last_cycle, dropped); 541 543 } 542 544 if (dropped_cycles < 0) { … … 545 547 } 546 548 if (dropped_cycles > 0) { 547 debugWarning("(%p) dropped %d packets on cycle %u (last_cycle=%u, dropped=%d, skipped: %d)\n", 548 this, dropped_cycles, cycle, m_last_cycle, dropped, skipped); 549 m_dropped += dropped_cycles; 549 debugOutput(DEBUG_LEVEL_NORMAL, 550 "(%p) dropped %d packets on cycle %u (last_cycle=%u, dropped=%d, skipped: %d)\n", 551 this, dropped_cycles, cycle, m_last_cycle, dropped, skipped); 552 m_dropped += dropped_cycles - skipped; 550 553 } 551 554 #endif trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp
r1036 r1046 352 352 // this is an xrun situation 353 353 m_in_xrun = true; 354 debug Warning("Should update state to WaitingForStreamDisable due to dropped packet xrun\n");354 debugOutput(DEBUG_LEVEL_NORMAL, "Should update state to WaitingForStreamDisable due to dropped packet xrun\n"); 355 355 m_cycle_to_switch_state = CYCLE_TIMER_GET_CYCLES(pkt_ctr) + 1; // switch in the next cycle 356 356 m_next_state = ePS_WaitingForStreamDisable; … … 391 391 // they represent a discontinuity in the timestamps, and hence are 392 392 // to be dealt with 393 debug Warning("(%p) Correcting timestamp for dropped cycles, discarding packet...\n", this);393 debugOutput(DEBUG_LEVEL_NORMAL, "(%p) Correcting timestamp for dropped cycles, discarding packet...\n", this); 394 394 m_data_buffer->setBufferTailTimestamp(substractTicks(m_last_timestamp, 395 395 (uint64_t)(getNominalFramesPerPacket() … … 439 439 // allow for the xrun to be picked up 440 440 if (result2 == eCRV_XRun) { 441 debug Warning("processPacketData xrun\n");441 debugOutput(DEBUG_LEVEL_NORMAL, "processPacketData xrun\n"); 442 442 m_in_xrun = true; 443 443 debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to WaitingForStreamDisable due to data xrun\n"); … … 497 497 if(m_state == ePS_Running) { 498 498 debugShowBackLogLines(200); 499 debug Warning("dropped packets xrun\n");499 debugOutput(DEBUG_LEVEL_NORMAL, "dropped packets xrun\n"); 500 500 debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to WaitingForStreamDisable due to dropped packets xrun\n"); 501 501 m_cycle_to_switch_state = CYCLE_TIMER_GET_CYCLES(pkt_ctr) + 1; … … 623 623 // allow for the xrun to be picked up 624 624 if (result2 == eCRV_XRun) { 625 debug Warning("generatePacketData xrun\n");625 debugOutput(DEBUG_LEVEL_NORMAL, "generatePacketData xrun\n"); 626 626 m_in_xrun = true; 627 627 debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to WaitingForStreamDisable due to data xrun\n"); … … 661 661 } 662 662 } else if (result == eCRV_XRun) { // pick up the possible xruns 663 debug Warning("generatePacketHeader xrun\n");663 debugOutput(DEBUG_LEVEL_NORMAL, "generatePacketHeader xrun\n"); 664 664 m_in_xrun = true; 665 665 debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to WaitingForStreamDisable due to header xrun\n"); trunk/libffado/src/libstreaming/StreamProcessorManager.cpp
r1045 r1046 149 149 if (result == ETIMEDOUT) { 150 150 debugOutput(DEBUG_LEVEL_VERBOSE, 151 "(%p) pthread_cond_timedwait() timed out (result=%d)\n",151 "(%p) sem_timedwait() timed out (result=%d)\n", 152 152 this, result); 153 153 return eAR_Timeout; 154 154 } else if (result == EINTR) { 155 155 debugOutput(DEBUG_LEVEL_VERBOSE, 156 "(%p) pthread_cond_[timed]wait() interrupted by signal (result=%d)\n",156 "(%p) sem_[timed]wait() interrupted by signal (result=%d)\n", 157 157 this, result); 158 158 return eAR_Interrupted; 159 159 } else { 160 debugError("(%p) pthread_cond_[timed]wait error (result=%d)\n",160 debugError("(%p) sem_[timed]wait error (result=%d)\n", 161 161 this, result); 162 162 debugError("(%p) timeout_sec=%d timeout_nsec=%lld ts.sec=%d ts.nsec=%lld\n", … … 1002 1002 1003 1003 if ((*it)->xrunOccurred()) { 1004 debugWarning("Xrun on RECV SP %p due to ISO side xrun\n",*it); 1004 debugOutput(DEBUG_LEVEL_NORMAL, 1005 "Xrun on RECV SP %p due to ISO side xrun\n", *it); 1005 1006 (*it)->dumpInfo(); 1006 1007 } 1007 1008 if (!((*it)->canClientTransferFrames(m_period))) { 1008 debugWarning("Xrun on RECV SP %p due to buffer side xrun\n",*it); 1009 debugOutput(DEBUG_LEVEL_NORMAL, 1010 "Xrun on RECV SP %p due to buffer side xrun\n", *it); 1009 1011 (*it)->dumpInfo(); 1010 1012 } … … 1014 1016 ++it ) { 1015 1017 if ((*it)->xrunOccurred()) { 1016 debugWarning("Xrun on XMIT SP %p due to ISO side xrun\n",*it); 1018 debugOutput(DEBUG_LEVEL_NORMAL, 1019 "Xrun on XMIT SP %p due to ISO side xrun\n", *it); 1017 1020 } 1018 1021 if (!((*it)->canClientTransferFrames(m_period))) { 1019 debugWarning("Xrun on XMIT SP %p due to buffer side xrun\n",*it); 1022 debugOutput(DEBUG_LEVEL_NORMAL, 1023 "Xrun on XMIT SP %p due to buffer side xrun\n", *it); 1020 1024 } 1021 1025 } 1022 1026 #endif 1023 1024 1027 m_nbperiods++; 1025 1026 1028 // now we can signal the client that we are (should be) ready 1027 1029 return !xrun_occurred;
