Changeset 87905 in vbox
- Timestamp:
- Mar 1, 2021 9:14:13 PM (4 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r87863 r87905 2677 2677 uSD, fSinkActive, fTimerScheduled, tsTransferNext, tsTransferNext - tsNow)); 2678 2678 2679 /* Note: tsTransferNext can be 0, which means we have to run *now*. */2680 2679 hdaR3TimerSet(pDevIns, pStreamShared, tsTransferNext, 2681 2680 true /*fForce*/, tsNow); -
trunk/src/VBox/Devices/Audio/HDAStream.cpp
r87863 r87905 1092 1092 * @param pStreamR3 HDA stream to update (ring-3). 1093 1093 * @param cbToProcessMax How much data (in bytes) to process as maximum. 1094 * @param fInTimer Set if we're in the timer callout.1095 1094 */ 1096 1095 static int hdaR3StreamTransfer(PPDMDEVINS pDevIns, PHDASTATE pThis, PHDASTATER3 pThisCC, PHDASTREAM pStreamShared, 1097 PHDASTREAMR3 pStreamR3, uint32_t cbToProcessMax , bool fInTimer)1096 PHDASTREAMR3 pStreamR3, uint32_t cbToProcessMax) 1098 1097 { 1099 1098 LogFlowFuncEnter(); … … 1534 1533 1535 1534 const bool fTransferComplete = cbLeft == 0; 1536 uint64_t tsTransferNext = 0;1537 1538 1535 if (fTransferComplete) 1539 1536 { … … 1562 1559 /* Set the next transfer timing slot. 1563 1560 * This must happen at a constant rate. */ 1564 tsTransferNext = tsNow + pStreamShared->State.cTransferTicks; 1565 1566 /* If we need to do another transfer, (re-)arm the device timer. */ 1567 if (tsTransferNext) /* Can be 0 if no next transfer is needed. */ 1568 { 1569 Log3Func(("[SD%RU8] Scheduling timer @ %RU64 (in %RU64 ticks)\n", uSD, tsTransferNext, tsTransferNext - tsNow)); 1570 1571 /* Make sure to assign next transfer timestamp before setting the timer. */ 1572 Assert(tsTransferNext > tsNow); 1573 pStreamShared->State.tsTransferNext = tsTransferNext; 1574 1575 Assert(!fInTimer || tsNow == PDMDevHlpTimerGet(pDevIns, pStreamShared->hTimer)); 1576 hdaR3TimerSet(pDevIns, pStreamShared, tsTransferNext, 1577 true /* fForce - skip tsTransferNext check */, fInTimer ? tsNow : 0); 1578 } 1561 pStreamShared->State.tsTransferNext = tsNow + pStreamShared->State.cTransferTicks; 1579 1562 1580 1563 /* Always update this timestamp, no matter what pStreamShared->State.tsTransferNext is. */ … … 1586 1569 uSD, fTransferComplete, pStreamShared->State.cTransferPendingInterrupts)); 1587 1570 Log3Func(("[SD%RU8] tsNow=%RU64, tsTransferNext=%RU64 (in %RU64 ticks)\n", 1588 uSD, tsNow, tsTransferNext, tsTransferNext ? tsTransferNext - tsNow : 0)); 1571 uSD, tsNow, pStreamShared->State.tsTransferNext, 1572 pStreamShared->State.tsTransferNext ? pStreamShared->State.tsTransferNext - tsNow : 0)); 1589 1573 1590 1574 LogFlowFuncLeave(); … … 1659 1643 1660 1644 /* Do the DMA transfer. */ 1661 rc2 = hdaR3StreamTransfer(pDevIns, pThis, pThisCC, pStreamShared, pStreamR3, cbStreamFree , fInTimer);1645 rc2 = hdaR3StreamTransfer(pDevIns, pThis, pThisCC, pStreamShared, pStreamR3, cbStreamFree); 1662 1646 AssertRC(rc2); 1663 1647 … … 1787 1771 if (cbStreamUsed) 1788 1772 { 1789 rc2 = hdaR3StreamTransfer(pDevIns, pThis, pThisCC, pStreamShared, pStreamR3, cbStreamUsed , fInTimer);1773 rc2 = hdaR3StreamTransfer(pDevIns, pThis, pThisCC, pStreamShared, pStreamR3, cbStreamUsed); 1790 1774 AssertRC(rc2); 1791 1775 }
Note:
See TracChangeset
for help on using the changeset viewer.