VirtualBox

Changeset 87905 in vbox


Ignore:
Timestamp:
Mar 1, 2021 9:14:13 PM (4 years ago)
Author:
vboxsync
Message:

Audio/HDA: Follow-up fixes for r142934. ticketoem2ref:36

Location:
trunk/src/VBox/Devices/Audio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevHDA.cpp

    r87863 r87905  
    26772677                  uSD, fSinkActive, fTimerScheduled, tsTransferNext, tsTransferNext - tsNow));
    26782678
    2679         /* Note: tsTransferNext can be 0, which means we have to run *now*. */
    26802679        hdaR3TimerSet(pDevIns, pStreamShared, tsTransferNext,
    26812680                      true /*fForce*/, tsNow);
  • trunk/src/VBox/Devices/Audio/HDAStream.cpp

    r87863 r87905  
    10921092 * @param   pStreamR3           HDA stream to update (ring-3).
    10931093 * @param   cbToProcessMax      How much data (in bytes) to process as maximum.
    1094  * @param   fInTimer            Set if we're in the timer callout.
    10951094 */
    10961095static int hdaR3StreamTransfer(PPDMDEVINS pDevIns, PHDASTATE pThis, PHDASTATER3 pThisCC, PHDASTREAM pStreamShared,
    1097                                PHDASTREAMR3 pStreamR3, uint32_t cbToProcessMax, bool fInTimer)
     1096                               PHDASTREAMR3 pStreamR3, uint32_t cbToProcessMax)
    10981097{
    10991098    LogFlowFuncEnter();
     
    15341533
    15351534    const bool fTransferComplete  = cbLeft == 0;
    1536     uint64_t   tsTransferNext     = 0;
    1537 
    15381535    if (fTransferComplete)
    15391536    {
     
    15621559    /* Set the next transfer timing slot.
    15631560     * 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;
    15791562
    15801563    /* Always update this timestamp, no matter what pStreamShared->State.tsTransferNext is. */
     
    15861569              uSD, fTransferComplete, pStreamShared->State.cTransferPendingInterrupts));
    15871570    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));
    15891573
    15901574    LogFlowFuncLeave();
     
    16591643
    16601644            /* Do the DMA transfer. */
    1661             rc2 = hdaR3StreamTransfer(pDevIns, pThis, pThisCC, pStreamShared, pStreamR3, cbStreamFree, fInTimer);
     1645            rc2 = hdaR3StreamTransfer(pDevIns, pThis, pThisCC, pStreamShared, pStreamR3, cbStreamFree);
    16621646            AssertRC(rc2);
    16631647
     
    17871771            if (cbStreamUsed)
    17881772            {
    1789                 rc2 = hdaR3StreamTransfer(pDevIns, pThis, pThisCC, pStreamShared, pStreamR3, cbStreamUsed, fInTimer);
     1773                rc2 = hdaR3StreamTransfer(pDevIns, pThis, pThisCC, pStreamShared, pStreamR3, cbStreamUsed);
    17901774                AssertRC(rc2);
    17911775            }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette