Changeset 821
- Timestamp:
- 01/06/08 07:46:47 (16 years ago)
- Files:
-
- branches/api-cleanup/config.h.in (modified) (1 diff)
- branches/api-cleanup/libffado/ffado.h (modified) (2 diffs)
- branches/api-cleanup/src/devicemanager.cpp (modified) (1 diff)
- branches/api-cleanup/src/devicemanager.h (modified) (2 diffs)
- branches/api-cleanup/src/ffado.cpp (modified) (2 diffs)
- branches/api-cleanup/src/libieee1394/IsoHandler.cpp (modified) (3 diffs)
- branches/api-cleanup/src/libstreaming/generic/StreamProcessor.cpp (modified) (27 diffs)
- branches/api-cleanup/src/libstreaming/StreamProcessorManager.cpp (modified) (7 diffs)
- branches/api-cleanup/tests/streaming/teststreaming3.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/api-cleanup/config.h.in
r807 r821 67 67 #define STREAMPROCESSORMANAGER_PRESTART_CYCLES_FOR_XMIT 20 68 68 #define STREAMPROCESSORMANAGER_PRESTART_CYCLES_FOR_RECV 0 69 #define STREAMPROCESSORMANAGER_SYNCSTART_TRIES 10 69 70 #define STREAMPROCESSORMANAGER_ALIGN_AVERAGE_TIME_MSEC 200 70 71 #define STREAMPROCESSORMANAGER_NB_ALIGN_TRIES 40 branches/api-cleanup/libffado/ffado.h
r816 r821 217 217 218 218 /** 219 * 220 * Wait responses 221 * 222 */ 223 typedef enum { 224 ffado_wait_error = -2, 225 ffado_wait_xrun = -1, 226 ffado_wait_ok = 0, 227 } ffado_wait_response; 228 229 /** 219 230 * Initializes the streaming from/to a FFADO device. A FFADO device 220 231 * is a virtual device composed of several BeBoB or compatible devices, … … 408 419 * @return The number of frames ready. -1 when a problem occurred. 409 420 */ 410 intffado_streaming_wait(ffado_device_t *dev);421 ffado_wait_response ffado_streaming_wait(ffado_device_t *dev); 411 422 412 423 /** branches/api-cleanup/src/devicemanager.cpp
r807 r821 553 553 } 554 554 555 bool 555 enum DeviceManager::eWaitResult 556 556 DeviceManager::waitForPeriod() { 557 557 if(m_processorManager->waitForPeriod()) { 558 return true;558 return eWR_OK; 559 559 } else { 560 560 debugWarning("XRUN detected\n"); 561 561 // do xrun recovery 562 562 if(m_processorManager->handleXrun()) { 563 return false;563 return eWR_Xrun; 564 564 } else { 565 565 debugError("Could not handle XRUN\n"); 566 return false;566 return eWR_Error; 567 567 } 568 568 } branches/api-cleanup/src/devicemanager.h
r777 r821 61 61 { 62 62 public: 63 enum eWaitResult { 64 eWR_OK, 65 eWR_Xrun, 66 eWR_Error, 67 }; 68 63 69 DeviceManager(); 64 70 ~DeviceManager(); … … 79 85 bool stopStreaming(); 80 86 bool resetStreaming(); 81 boolwaitForPeriod();87 enum eWaitResult waitForPeriod(); 82 88 bool setStreamingParams(unsigned int period, unsigned int rate, unsigned int nb_buffers); 83 89 branches/api-cleanup/src/ffado.cpp
r816 r821 226 226 } 227 227 228 int ffado_streaming_wait(ffado_device_t *dev) { 228 ffado_wait_response 229 ffado_streaming_wait(ffado_device_t *dev) { 229 230 static int periods=0; 230 231 static int periods_print=0; … … 242 243 } 243 244 244 if(dev->m_deviceManager->waitForPeriod()) { 245 return dev->options.period_size; 245 enum DeviceManager::eWaitResult result; 246 result = dev->m_deviceManager->waitForPeriod(); 247 if(result == DeviceManager::eWR_OK) { 248 return ffado_wait_ok; 249 } else if (result == DeviceManager::eWR_Xrun) { 250 debugWarning("Handled XRUN\n"); 251 xruns++; 252 return ffado_wait_xrun; 246 253 } else { 247 debug Warning("XRUN\n");254 debugError("Unhandled XRUN (BUG)\n"); 248 255 xruns++; 249 return -1;256 return ffado_wait_error; 250 257 } 251 258 } branches/api-cleanup/src/libieee1394/IsoHandler.cpp
r815 r821 214 214 // wait for the availability of frames in the client 215 215 // (blocking for transmit handlers) 216 217 216 #if 0 //#ifdef DEBUG 218 217 if (getType() == eHT_Transmit) { 219 debugOutput(DEBUG_LEVEL_VER BOSE, "(%p) Waiting for Client to signal frame availability...\n", this);218 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "(%p) Waiting for Client to signal frame availability...\n", this); 220 219 } 221 220 #endif … … 223 222 224 223 #if ISOHANDLER_USE_POLL 225 uint64_t poll_enter = m_manager.get1394Service().getCurrentTimeAsUsecs(); 226 err = poll(&m_poll_fd, 1, m_poll_timeout); 227 uint64_t poll_exit = m_manager.get1394Service().getCurrentTimeAsUsecs(); 228 if (err == -1) { 229 if (errno == EINTR) { 230 return true; 231 } 232 debugFatal("%p, poll error: %s\n", this, strerror (errno)); 233 return false; 234 } 235 uint64_t iter_enter=0; 236 uint64_t iter_exit=0; 237 if(m_poll_fd.revents & (POLLIN)) { 238 iter_enter = m_manager.get1394Service().getCurrentTimeAsUsecs(); 239 if(!iterate()) { 240 debugOutput( DEBUG_LEVEL_VERBOSE, 241 "IsoHandler (%p): Failed to iterate handler\n", 242 this); 224 bool result = true; 225 while(result && m_Client && m_Client->canProcessPackets()) { 226 int err = poll(&m_poll_fd, 1, m_poll_timeout); 227 if (err == -1) { 228 if (errno == EINTR) { 229 return true; 230 } 231 debugFatal("%p, poll error: %s\n", this, strerror (errno)); 243 232 return false; 244 233 } 245 iter_exit = m_manager.get1394Service().getCurrentTimeAsUsecs(); 246 } else { 247 if (m_poll_fd.revents & POLLERR) { 248 debugWarning("error on fd for %p\n", this); 234 235 if(m_poll_fd.revents & (POLLIN)) { 236 result=iterate(); 237 if(!result) { 238 debugOutput( DEBUG_LEVEL_VERBOSE, 239 "IsoHandler (%p): Failed to iterate handler\n", 240 this); 241 } 242 } else { 243 if (m_poll_fd.revents & POLLERR) { 244 debugWarning("error on fd for %p\n", this); 245 } 246 if (m_poll_fd.revents & POLLHUP) { 247 debugWarning("hangup on fd for %p\n",this); 248 } 249 break; 249 250 } 250 if (m_poll_fd.revents & POLLHUP) { 251 debugWarning("hangup on fd for %p\n",this); 252 } 253 } 254 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "(%c %p) poll took %lldus, iterate took %lldus\n", 255 (getType()==eHT_Receive?'R':'X'), this, 256 poll_exit-poll_enter, iter_exit-iter_enter); 257 return true; 251 } 252 return result; 258 253 #else 259 254 // iterate() is blocking if no 1394 data is available 260 255 // so poll'ing is not really necessary 261 256 bool result = true; 262 while(result && m_Client ->canProcessPackets()) {257 while(result && m_Client && m_Client->canProcessPackets()) { 263 258 result = iterate(); 264 //debugOutput(DEBUG_LEVEL_VERBOSE, "(%p, %s) Iterate returned: %d\n", 265 // this, (m_type==eHT_Receive?"Receive":"Transmit"), result); 259 // if (getType() == eHT_Receive) { 260 // debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "(%p, %s) Iterate returned: %d\n", 261 // this, (m_type==eHT_Receive?"Receive":"Transmit"), result); 262 // } 266 263 } 267 264 return result; … … 275 272 bool 276 273 IsoHandler::iterate() { 277 //debugOutput(DEBUG_LEVEL_VERBOSE, "(%p, %s) Iterating ISO handler\n", 278 // this, (m_type==eHT_Receive?"Receive":"Transmit")); 274 // if(m_type==eHT_Receive) { 275 // debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "(%p, %s) Iterating ISO handler\n", 276 // this, (m_type==eHT_Receive?"Receive":"Transmit")); 277 // } 279 278 if(m_State == E_Running) { 280 279 #if ISOHANDLER_FLUSH_BEFORE_ITERATE branches/api-cleanup/src/libstreaming/generic/StreamProcessor.cpp
r816 r821 288 288 unsigned char channel, unsigned char tag, unsigned char sy, 289 289 unsigned int cycle, unsigned int dropped) { 290 #ifdef DEBUG 290 291 if(m_last_cycle == -1) { 291 292 debugOutput(DEBUG_LEVEL_VERBOSE, "Handler for %s SP %p is alive (cycle = %u)\n", getTypeString(), this, cycle); 292 293 } 294 #endif 293 295 294 296 int dropped_cycles = 0; … … 303 305 this, dropped_cycles, cycle, dropped, cycle, m_last_cycle); 304 306 m_dropped += dropped_cycles; 305 m_in_xrun = true;306 307 m_last_cycle = cycle; 307 POST_SEMAPHORE;308 return RAW1394_ISO_DEFER;309 //flushDebugOutput();310 //assert(0);311 308 } 312 309 } … … 346 343 // the received data can be discarded while waiting for the stream 347 344 // to be disabled 345 // similarly for dropped packets 348 346 return RAW1394_ISO_OK; 349 347 } … … 374 372 m_last_good_cycle = cycle; 375 373 m_last_dropped = dropped_cycles; 376 377 // check whether we are waiting for a stream to startup378 // this requires that the packet is good379 if(m_state == ePS_WaitingForStream) {380 // since we have a packet with an OK header,381 // we can indicate that the stream started up382 383 // we then check whether we have to switch on this cycle384 if (diffCycles(cycle, m_cycle_to_switch_state) >= 0) {385 debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to DryRunning due to good packet\n");386 // hence go to the dryRunning state387 m_next_state = ePS_DryRunning;388 if (!updateState()) { // we are allowed to change the state directly389 debugError("Could not update state!\n");390 POST_SEMAPHORE;391 return RAW1394_ISO_ERROR;392 }393 } else {394 // not time (yet) to switch state395 }396 // in both cases we don't want to process the data397 return RAW1394_ISO_OK;398 }399 400 // check whether a state change has been requested401 // note that only the wait state changes are synchronized with the cycles402 else if(m_state != m_next_state) {403 debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state from %s to %s\n",404 ePSToString(m_state), ePSToString(m_next_state));405 // execute the requested change406 if (!updateState()) { // we are allowed to change the state directly407 debugError("Could not update state!\n");408 POST_SEMAPHORE;409 return RAW1394_ISO_ERROR;410 }411 }412 374 413 375 // handle dropped cycles … … 429 391 return RAW1394_ISO_ERROR; 430 392 } 393 } 394 } 395 396 // check whether we are waiting for a stream to startup 397 // this requires that the packet is good 398 if(m_state == ePS_WaitingForStream) { 399 // since we have a packet with an OK header, 400 // we can indicate that the stream started up 401 402 // we then check whether we have to switch on this cycle 403 if (diffCycles(cycle, m_cycle_to_switch_state) >= 0) { 404 debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to DryRunning due to good packet\n"); 405 // hence go to the dryRunning state 406 m_next_state = ePS_DryRunning; 407 if (!updateState()) { // we are allowed to change the state directly 408 debugError("Could not update state!\n"); 409 POST_SEMAPHORE; 410 return RAW1394_ISO_ERROR; 411 } 412 } else { 413 // not time (yet) to switch state 414 } 415 // in both cases we don't want to process the data 416 return RAW1394_ISO_OK; 417 } 418 419 // check whether a state change has been requested 420 // note that only the wait state changes are synchronized with the cycles 421 else if(m_state != m_next_state) { 422 debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state from %s to %s\n", 423 ePSToString(m_state), ePSToString(m_next_state)); 424 // execute the requested change 425 if (!updateState()) { // we are allowed to change the state directly 426 debugError("Could not update state!\n"); 431 427 POST_SEMAPHORE; 432 return RAW1394_ISO_ DEFER;428 return RAW1394_ISO_ERROR; 433 429 } 434 430 } … … 468 464 unsigned int signal_period = m_signal_period * (semval + 1) + m_signal_offset; 469 465 if(bufferfill >= signal_period) { 470 debugOutput(DEBUG_LEVEL_VER BOSE, "(%p) buffer fill (%d) > signal period (%d), sem_val=%d\n",466 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "(%p) buffer fill (%d) > signal period (%d), sem_val=%d\n", 471 467 this, m_data_buffer->getBufferFill(), signal_period, semval); 472 468 POST_SEMAPHORE; … … 511 507 int cycle_diff; 512 508 509 #ifdef DEBUG 513 510 if(m_last_cycle == -1) { 514 511 debugOutput(DEBUG_LEVEL_VERBOSE, "Handler for %s SP %p is alive (cycle = %d)\n", getTypeString(), this, cycle); 515 512 } 513 #endif 516 514 517 515 int dropped_cycles = 0; … … 532 530 debugWarning("dropped packets xrun\n"); 533 531 debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to WaitingForStreamDisable due to dropped packets xrun\n"); 532 m_cycle_to_switch_state = cycle + 1; 534 533 m_next_state = ePS_WaitingForStreamDisable; 535 534 // execute the requested change … … 546 545 } 547 546 547 #ifdef DEBUG 548 548 // bypass based upon state 549 549 if (m_state == ePS_Invalid) { … … 551 551 return RAW1394_ISO_ERROR; 552 552 } 553 #endif 554 553 555 if (m_state == ePS_Created) { 554 556 *tag = 0; … … 580 582 m_in_xrun = true; 581 583 debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to WaitingForStreamDisable due to data xrun\n"); 584 m_cycle_to_switch_state = cycle + 1; 582 585 m_next_state = ePS_WaitingForStreamDisable; 583 586 // execute the requested change … … 673 676 m_in_xrun = true; 674 677 debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to WaitingForStreamDisable due to data xrun\n"); 675 m_cycle_to_switch_state = cycle +1; // switch in the next cycle678 m_cycle_to_switch_state = cycle + 1; // switch in the next cycle 676 679 m_next_state = ePS_WaitingForStreamDisable; 677 680 // execute the requested change … … 692 695 m_in_xrun = true; 693 696 debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to WaitingForStreamDisable due to header xrun\n"); 697 m_cycle_to_switch_state = cycle + 1; // switch in the next cycle 694 698 m_next_state = ePS_WaitingForStreamDisable; 695 699 // execute the requested change … … 744 748 } 745 749 746 debugOutput(DEBUG_LEVEL_ VERY_VERBOSE, "XMIT EMPTY: CY=%04u\n", cycle);750 debugOutput(DEBUG_LEVEL_ULTRA_VERBOSE, "XMIT EMPTY: CY=%04u\n", cycle); 747 751 generateSilentPacketHeader(data, length, tag, sy, cycle, dropped_cycles, max_length); 748 752 generateSilentPacketData(data, length, tag, sy, cycle, dropped_cycles, max_length); … … 840 844 unsigned int bufferfill = m_data_buffer->getBufferFill(); 841 845 if (bufferfill >= m_signal_period + m_signal_offset) { 842 debugOutput(DEBUG_LEVEL_VER BOSE, "(%p) sufficient frames in buffer (%d / %d), posting semaphore\n",846 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "(%p) sufficient frames in buffer (%d / %d), posting semaphore\n", 843 847 this, bufferfill, m_signal_period + m_signal_offset); 844 848 POST_SEMAPHORE; 845 849 } else { 846 debugOutput(DEBUG_LEVEL_VER BOSE, "(%p) insufficient frames in buffer (%d / %d), not posting semaphore\n",850 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "(%p) insufficient frames in buffer (%d / %d), not posting semaphore\n", 847 851 this, bufferfill, m_signal_period + m_signal_offset); 848 852 } … … 898 902 { 899 903 int result; 900 if(m_state == ePS_Running ) {904 if(m_state == ePS_Running && m_next_state == ePS_Running) { 901 905 result = sem_wait(&m_signal_semaphore); 902 906 #ifdef DEBUG 903 907 int tmp; 904 908 sem_getvalue(&m_signal_semaphore, &tmp); 905 debugOutput(DEBUG_LEVEL_VER BOSE, " sem_wait returns: %d, sem_value: %d\n", result, tmp);909 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, " sem_wait returns: %d, sem_value: %d\n", result, tmp); 906 910 #endif 907 911 return result == 0; 908 912 } else { 909 913 // when we're not running, we can always provide frames 914 // when we're in a state transition, keep iterating too 910 915 debugOutput(DEBUG_LEVEL_VERBOSE, "Not running...\n"); 911 916 return true; … … 928 933 StreamProcessor::canProcessPackets() 929 934 { 930 if(m_state != ePS_Running ) return true;935 if(m_state != ePS_Running || m_next_state != ePS_Running) return true; 931 936 bool result; 932 937 int bufferfill; … … 937 942 } 938 943 result = bufferfill > getNominalFramesPerPacket(); 939 //debugOutput(DEBUG_LEVEL_VERBOSE, "(%p, %s) for a bufferfill of %d, we return %d\n",940 //this, ePTToString(getType()), bufferfill, result);944 // debugOutput(DEBUG_LEVEL_VERBOSE, "(%p, %s) for a bufferfill of %d, we return %d\n", 945 // this, ePTToString(getType()), bufferfill, result); 941 946 return result; 942 947 } … … 1117 1122 m_cycle_to_switch_state = TICKS_TO_CYCLES(time_instant); 1118 1123 m_next_state = state; 1124 POST_SEMAPHORE; // needed to ensure that things don't get deadlocked 1119 1125 return true; 1120 1126 } … … 1597 1603 // do init here 1598 1604 result = doStop(); 1599 if (result) return true;1605 if (result) {POST_SEMAPHORE; return true;} 1600 1606 else goto updateState_exit_change_failed; 1601 1607 } … … 1607 1613 } 1608 1614 result = doWaitForRunningStream(); 1609 if (result) return true;1615 if (result) {POST_SEMAPHORE; return true;} 1610 1616 else goto updateState_exit_change_failed; 1611 1617 } … … 1618 1624 } 1619 1625 result = doDryRunning(); 1620 if (result) return true;1626 if (result) {POST_SEMAPHORE; return true;} 1621 1627 else goto updateState_exit_change_failed; 1622 1628 } … … 1635 1641 result = doWaitForStreamEnable(); 1636 1642 } 1637 if (result) return true;1643 if (result) {POST_SEMAPHORE; return true;} 1638 1644 else goto updateState_exit_change_failed; 1639 1645 } … … 1652 1658 result = doRunning(); 1653 1659 } 1654 if (result) return true;1660 if (result) {POST_SEMAPHORE; return true;} 1655 1661 else goto updateState_exit_change_failed; 1656 1662 } … … 1662 1668 } 1663 1669 result = doWaitForStreamDisable(); 1664 if (result) return true;1670 if (result) {POST_SEMAPHORE; return true;} 1665 1671 else goto updateState_exit_change_failed; 1666 1672 } … … 1672 1678 } 1673 1679 result = doDryRunning(); 1674 if (result) return true;1680 if (result) {POST_SEMAPHORE; return true;} 1675 1681 else goto updateState_exit_change_failed; 1676 1682 } … … 1680 1686 debugError("Invalid state transition: %s => %s\n", 1681 1687 ePSToString(m_state), ePSToString(next_state)); 1688 POST_SEMAPHORE; 1682 1689 return false; 1683 1690 updateState_exit_change_failed: 1684 1691 debugError("State transition failed: %s => %s\n", 1685 1692 ePSToString(m_state), ePSToString(next_state)); 1693 POST_SEMAPHORE; 1686 1694 return false; 1687 1695 } branches/api-cleanup/src/libstreaming/StreamProcessorManager.cpp
r816 r821 419 419 } 420 420 421 // now align the received streams422 421 if(!alignReceivedStreams()) { 423 debugError("Could not align streams \n");422 debugError("Could not align streams...\n"); 424 423 return false; 425 424 } 425 426 426 debugOutput( DEBUG_LEVEL_VERBOSE, " StreamProcessor streams running...\n"); 427 427 return true; … … 431 431 StreamProcessorManager::alignReceivedStreams() 432 432 { 433 if(m_SyncSource == NULL) return false;434 433 debugOutput( DEBUG_LEVEL_VERBOSE, "Aligning received streams...\n"); 435 434 unsigned int nb_sync_runs; … … 508 507 debugOutput( DEBUG_LEVEL_VERBOSE, "Starting Processors...\n"); 509 508 510 // put all SP's into dry-running state511 if (!startDryRunning()) {512 debugFatal("Could not put SP's in dry-running state\n");513 return false;514 }515 516 509 // start all SP's synchonized 517 if (!syncStartAll()) { 510 bool start_result = false; 511 for (int ntries; ntries < STREAMPROCESSORMANAGER_SYNCSTART_TRIES; ntries++) { 512 // put all SP's into dry-running state 513 if (!startDryRunning()) { 514 debugOutput(DEBUG_LEVEL_VERBOSE, "Could not put SP's in dry-running state (try %d)\n", ntries); 515 start_result = false; 516 continue; 517 } 518 519 start_result = syncStartAll(); 520 if(start_result) { 521 break; 522 } else { 523 debugOutput(DEBUG_LEVEL_VERBOSE, "Sync start try %d failed...\n", ntries); 524 } 525 } 526 if (!start_result) { 518 527 debugFatal("Could not syncStartAll...\n"); 519 528 return false; 520 529 } 530 521 531 return true; 522 532 } … … 645 655 */ 646 656 647 // put all SP's back into dry-running state648 if (!startDryRunning()) {649 debugFatal("Could not put SP's in dry-running state\n");650 return false;651 }652 653 657 debugOutput( DEBUG_LEVEL_VERBOSE, "Restarting StreamProcessors...\n"); 654 658 // start all SP's synchonized 655 if (!syncStartAll()) { 659 bool start_result = false; 660 for (int ntries; ntries < STREAMPROCESSORMANAGER_SYNCSTART_TRIES; ntries++) { 661 // put all SP's into dry-running state 662 if (!startDryRunning()) { 663 debugShowBackLog(); 664 debugOutput(DEBUG_LEVEL_VERBOSE, "Could not put SP's in dry-running state (try %d)\n", ntries); 665 start_result = false; 666 continue; 667 } 668 669 start_result = syncStartAll(); 670 if(start_result) { 671 break; 672 } else { 673 debugOutput(DEBUG_LEVEL_VERBOSE, "Sync start try %d failed...\n", ntries); 674 } 675 } 676 if (!start_result) { 656 677 debugFatal("Could not syncStartAll...\n"); 657 678 return false; 658 679 } 659 660 680 debugOutput( DEBUG_LEVEL_VERBOSE, "Xrun handled...\n"); 661 681 … … 677 697 678 698 while(period_not_ready) { 679 debugOutput( DEBUG_LEVEL_VER BOSE, "waiting for period (%d frames in buffer)...\n", m_SyncSource->getBufferFill());699 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "waiting for period (%d frames in buffer)...\n", m_SyncSource->getBufferFill()); 680 700 if(!m_SyncSource->waitForSignal()) { 681 701 debugError("Error waiting for signal\n"); … … 688 708 #ifdef DEBUG 689 709 if(period_not_ready) { 690 debugOutput(DEBUG_LEVEL_VER BOSE, "period is not ready (bufferfill: %u)\n", bufferfill);710 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "period is not ready (bufferfill: %u)\n", bufferfill); 691 711 } else { 692 debugOutput(DEBUG_LEVEL_VER BOSE, "period is ready (bufferfill: %u)\n", bufferfill);712 debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "period is ready (bufferfill: %u)\n", bufferfill); 693 713 } 694 714 #endif … … 719 739 // and the receive processors should have done their transfer. 720 740 m_time_of_transfer = m_SyncSource->getTimeAtPeriod(); 721 debugOutput( DEBUG_LEVEL_VER BOSE, "transfer at %llu ticks...\n",741 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "transfer at %llu ticks...\n", 722 742 m_time_of_transfer); 723 743 branches/api-cleanup/tests/streaming/teststreaming3.cpp
r818 r821 267 267 268 268 int nb_in_channels=0, nb_out_channels=0; 269 int retval=0;270 269 int i=0; 271 270 int start_flag = 0; … … 413 412 debugOutput(DEBUG_LEVEL_NORMAL, "Entering receive loop (IN: %d, OUT: %d)\n", nb_in_channels, nb_out_channels); 414 413 while(run && start_flag==0) { 415 retval = ffado_streaming_wait(dev); 416 if (retval < 0) { 414 ffado_wait_response response; 415 response = ffado_streaming_wait(dev); 416 if (response == ffado_wait_xrun) { 417 417 debugOutput(DEBUG_LEVEL_NORMAL, "Xrun\n"); 418 418 ffado_streaming_reset(dev); 419 419 continue; 420 } 421 420 } else if (response == ffado_wait_error) { 421 debugError("fatal xrun\n"); 422 break; 423 } 422 424 ffado_streaming_transfer_capture_buffers(dev); 423 425