Changeset 87944 in vbox for trunk/src/VBox/Devices/Audio/DevHDA.cpp
- Timestamp:
- Mar 4, 2021 9:14:58 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r87926 r87944 1438 1438 AssertRC(rc2); 1439 1439 1440 uint64_t const tsNow = PDMDevHlpTimerGet(pDevIns, pStreamShared->hTimer);1441 rc2 = hdaR3TimerSet(pDevIns, pStreamShared, tsNow + pStreamShared->State.cTransferTicks, true /* fForce */, tsNow);1442 AssertRC(rc2);1440 /* Avoid going through the timer here by calling the stream's timer function directly. 1441 * Should speed up starting the stream transfers. */ 1442 hdaR3StreamTimerMain(pDevIns, pThis, pThisCC, pStreamShared, pStreamR3); 1443 1443 } 1444 1444 else … … 2649 2649 Assert(PDMDevHlpTimerIsLockOwner(pDevIns, hTimer)); 2650 2650 2651 hdaR3StreamUpdate(pDevIns, pThis, pThisCC, pStreamShared, pStreamR3, true /* fInTimer */); 2652 2653 /* Flag indicating whether to kick the timer again for a new data processing round. */ 2654 bool fSinkActive = false; 2655 if (pStreamR3->pMixSink) 2656 fSinkActive = AudioMixerSinkIsActive(pStreamR3->pMixSink->pMixSink); 2657 2658 #ifdef LOG_ENABLED 2659 const uint8_t uSD = pStreamShared->u8SD; 2660 #endif 2661 2662 if (fSinkActive) 2663 { 2664 const uint64_t tsNow = PDMDevHlpTimerGet(pDevIns, hTimer); /* (For virtual sync this remains the same for the whole callout IIRC) */ 2665 const bool fTimerScheduled = hdaR3StreamTransferIsScheduled(pStreamShared, tsNow); 2666 2667 uint64_t tsTransferNext = 0; 2668 if (fTimerScheduled) 2669 { 2670 Assert(pStreamShared->State.tsTransferNext); /* Make sure that a new transfer timestamp is set. */ 2671 tsTransferNext = pStreamShared->State.tsTransferNext; 2672 } 2673 else /* Schedule at the precalculated rate. */ 2674 tsTransferNext = tsNow + pStreamShared->State.cTransferTicks; 2675 2676 Log3Func(("[SD%RU8] fSinksActive=%RTbool, fTimerScheduled=%RTbool, tsTransferNext=%RU64 (in %RU64)\n", 2677 uSD, fSinkActive, fTimerScheduled, tsTransferNext, tsTransferNext - tsNow)); 2678 2679 hdaR3TimerSet(pDevIns, pStreamShared, tsTransferNext, 2680 true /*fForce*/, tsNow); 2681 } 2682 else 2683 Log3Func(("[SD%RU8] fSinksActive=%RTbool\n", uSD, fSinkActive)); 2651 hdaR3StreamTimerMain(pDevIns, pThis, pThisCC, pStreamShared, pStreamR3); 2684 2652 } 2685 2653 … … 3532 3500 #endif 3533 3501 if (hdaR3StreamTransferIsScheduled(pStreamShared, PDMDevHlpTimerGet(pDevIns, pStreamShared->hTimer))) 3534 hdaR3TimerSet(pDevIns, pStreamShared, hdaR3StreamTransferGetNext(pStreamShared), true /*fForce*/, 0 /*tsNow*/); 3502 { 3503 /* Avoid going through the timer here by calling the stream's timer function directly. 3504 * Should speed up starting the stream transfers. */ 3505 hdaR3StreamTimerMain(pDevIns, pThis, pThisCC, pStreamShared, pStreamR3); 3506 } 3535 3507 3536 3508 /* Also keep track of the currently active streams. */
Note:
See TracChangeset
for help on using the changeset viewer.