Changeset 89847 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 23, 2021 8:47:54 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHdaStream.cpp
r89845 r89847 73 73 pStreamShared->State.fInReset = false; 74 74 pStreamShared->State.fRunning = false; 75 # ifdef HDA_USE_DMA_ACCESS_HANDLER75 # ifdef HDA_USE_DMA_ACCESS_HANDLER 76 76 RTListInit(&pStreamR3->State.lstDMAHandlers); 77 # endif77 # endif 78 78 79 79 AssertPtr(pStreamR3->pHDAStateR3); 80 80 AssertPtr(pStreamR3->pHDAStateR3->pDevIns); 81 81 82 # ifdef DEBUG82 # ifdef DEBUG 83 83 int rc = RTCritSectInit(&pStreamR3->Dbg.CritSect); 84 84 AssertRCReturn(rc, rc); 85 # endif85 # endif 86 86 87 87 const bool fIsInput = hdaGetDirFromSD(uSD) == PDMAUDIODIR_IN; … … 178 178 } 179 179 180 # ifdef DEBUG180 # ifdef DEBUG 181 181 if (RTCritSectIsInitialized(&pStreamR3->Dbg.CritSect)) 182 182 { … … 184 184 AssertRC(rc2); 185 185 } 186 # endif186 # endif 187 187 188 188 if (pStreamR3->Dbg.Runtime.fEnabled) … … 697 697 hdaR3StreamSetPositionAbs(pStreamShared, pDevIns, pThis, HDA_STREAM_REG(pThis, LPIB, uSD)); 698 698 699 # ifdef LOG_ENABLED699 # ifdef LOG_ENABLED 700 700 hdaR3BDLEDumpAll(pDevIns, pThis, pStreamShared->u64BDLBase, pStreamShared->u16LVI + 1); 701 # endif701 # endif 702 702 703 703 /* … … 784 784 LogRelMax(32, ("HDA: Initializing stream #%RU8 failed with %Rrc\n", uSD, rc)); 785 785 786 # ifdef VBOX_WITH_DTRACE786 # ifdef VBOX_WITH_DTRACE 787 787 VBOXDD_HDA_STREAM_SETUP((uint32_t)uSD, rc, pStreamShared->State.Cfg.Props.uHz, 788 788 pStreamShared->State.aSchedule[pStreamShared->State.cSchedule - 1].cPeriodTicks, 789 789 pStreamShared->State.aSchedule[pStreamShared->State.cSchedule - 1].cbPeriod); 790 # endif790 # endif 791 791 return rc; 792 792 } … … 841 841 HDA_STREAM_REG(pThis, BDPL, uSD) = 0; 842 842 843 # ifdef HDA_USE_DMA_ACCESS_HANDLER843 # ifdef HDA_USE_DMA_ACCESS_HANDLER 844 844 hdaR3StreamUnregisterDMAHandlers(pThis, pStream); 845 # endif845 # endif 846 846 847 847 /* Assign the default mixer sink to the stream. */ … … 881 881 pStreamR3->State.offRead = 0; 882 882 883 # ifdef DEBUG883 # ifdef DEBUG 884 884 pStreamR3->Dbg.cReadsTotal = 0; 885 885 pStreamR3->Dbg.cbReadTotal = 0; … … 890 890 pStreamR3->Dbg.cbWrittenHz = 0; 891 891 pStreamR3->Dbg.tsWriteSlotBegin = 0; 892 # endif892 # endif 893 893 894 894 /* Report that we're done resetting this stream. */ 895 895 HDA_STREAM_REG(pThis, CTL, uSD) = 0; 896 896 897 # ifdef VBOX_WITH_DTRACE897 # ifdef VBOX_WITH_DTRACE 898 898 VBOXDD_HDA_STREAM_RESET((uint32_t)uSD); 899 # endif899 # endif 900 900 LogFunc(("[SD%RU8] Reset\n", uSD)); 901 901 … … 1024 1024 1025 1025 1026 # if 0 /* Not used atm. */1026 # if 0 /* Not used atm. */ 1027 1027 static uint32_t hdaR3StreamGetPosition(PHDASTATE pThis, PHDASTREAM pStreamShared) 1028 1028 { 1029 1029 return HDA_STREAM_REG(pThis, LPIB, pStreamShared->u8SD); 1030 1030 } 1031 # endif1031 # endif 1032 1032 1033 1033 /** … … 1237 1237 { 1238 1238 Log3(("%s: [SD%RU8] BCIS bit set, skipping transfer\n", pszFunction, uSD)); 1239 # ifdef HDA_STRICT1239 # ifdef HDA_STRICT 1240 1240 /* Timing emulation bug or guest is misbehaving -- let me know. */ 1241 1241 AssertMsgFailed(("%s: BCIS bit for stream #%RU8 still set when it shouldn't\n", pszFunction, uSD)); 1242 # endif1242 # endif 1243 1243 return false; 1244 1244 } … … 1436 1436 AssertRC(rc2); 1437 1437 1438 # ifdef HDA_DEBUG_SILENCE1438 # ifdef HDA_DEBUG_SILENCE 1439 1439 fix me if relevant; 1440 # endif1440 # endif 1441 1441 if (RT_LIKELY(!pStreamR3->Dbg.Runtime.fEnabled)) 1442 1442 { /* likely */ } … … 1444 1444 AudioHlpFileWrite(pStreamR3->Dbg.Runtime.pFileDMARaw, pvBufSrc, cbBufSrc, 0 /* fFlags */); 1445 1445 1446 # ifdef VBOX_WITH_DTRACE1446 # ifdef VBOX_WITH_DTRACE 1447 1447 VBOXDD_HDA_STREAM_DMA_IN((uint32_t)uSD, (uint32_t)cbBufSrc, pStreamR3->State.offRead); 1448 # endif1448 # endif 1449 1449 pStreamR3->State.offRead += cbBufSrc; 1450 1450 RTCircBufReleaseReadBlock(pCircBuf, cbBufSrc); … … 1551 1551 static void hdaR3StreamPullFromMixer(PHDASTREAMR3 pStreamR3, PAUDMIXSINK pSink) 1552 1552 { 1553 # ifdef LOG_ENABLED1553 # ifdef LOG_ENABLED 1554 1554 uint64_t const offWriteOld = pStreamR3->State.offWrite; 1555 # endif1555 # endif 1556 1556 pStreamR3->State.offWrite = AudioMixerSinkTransferToCircBuf(pSink, 1557 1557 pStreamR3->State.pCircBuf, … … 1606 1606 * 1607 1607 */ 1608 # if 01608 # if 0 1609 1609 uint8_t abBounce[4096 + 128]; /* Most guest does at most 4KB BDLE. So, 4KB + space for a partial frame to reduce loops. */ 1610 1610 uint32_t cbBounce = 0; /* in case of incomplete frames between buffer segments */ 1611 # endif1611 # endif 1612 1612 PRTCIRCBUF pCircBuf = pStreamR3->State.pCircBuf; 1613 1613 uint32_t cbLeft = cbToProduce; … … 1626 1626 1627 1627 /* Need to diverge if the BDLEs contain misaligned entries. */ 1628 # if 01628 # if 0 1629 1629 if (/** @todo pStreamShared->State.fFrameAlignedBuffers */) 1630 # endif1630 # endif 1631 1631 { 1632 1632 if (cbChunk <= cbLeft) … … 1649 1649 AssertRC(rc2); 1650 1650 1651 # ifdef HDA_DEBUG_SILENCE1651 # ifdef HDA_DEBUG_SILENCE 1652 1652 fix me if relevant; 1653 # endif1653 # endif 1654 1654 if (RT_LIKELY(!pStreamR3->Dbg.Runtime.fEnabled)) 1655 1655 { /* likely */ } … … 1657 1657 AudioHlpFileWrite(pStreamR3->Dbg.Runtime.pFileDMARaw, pvBufDst, cbBufDst, 0 /* fFlags */); 1658 1658 1659 # ifdef VBOX_WITH_DTRACE1659 # ifdef VBOX_WITH_DTRACE 1660 1660 VBOXDD_HDA_STREAM_DMA_OUT((uint32_t)uSD, (uint32_t)cbBufDst, pStreamR3->State.offWrite); 1661 # endif1661 # endif 1662 1662 pStreamR3->State.offWrite += cbBufDst; 1663 1663 RTCircBufReleaseWriteBlock(pCircBuf, cbBufDst); … … 1671 1671 } 1672 1672 } 1673 # if 01673 # if 0 1674 1674 /* 1675 1675 * Need to map the frame content, so we need to read the guest data … … 1732 1732 offBounce, cFramesToConvert, cbBufDst, ASMMemIsZero(pvBufDst, cbBufDst) ? " all zero" : "")); 1733 1733 1734 # ifdef HDA_DEBUG_SILENCE1734 # ifdef HDA_DEBUG_SILENCE 1735 1735 fix me if relevant; 1736 # endif1736 # endif 1737 1737 if (RT_LIKELY(!pStreamR3->Dbg.Runtime.fEnabled)) 1738 1738 { /* likely */ } … … 1760 1760 Log5Func(("loop0: GCPhys=%RGp cbBounce=%#x cbLeft=%#x\n", GCPhys, cbBounce, cbLeft)); 1761 1761 } 1762 # endif1762 # endif 1763 1763 1764 1764 STAM_PROFILE_STOP(&pThis->StatOut, a); … … 1771 1771 1772 1772 Assert(cbLeft == 0); /* There shall be no break statements in the above loop, so cbLeft is always zero here! */ 1773 # if 01773 # if 0 1774 1774 AssertMsg(cbBounce == 0, ("%#x\n", cbBounce)); 1775 # endif1775 # endif 1776 1776 1777 1777 /* … … 1799 1799 static void hdaR3StreamPushToMixer(PHDASTREAM pStreamShared, PHDASTREAMR3 pStreamR3, PAUDMIXSINK pSink, uint64_t nsNow) 1800 1800 { 1801 # ifdef LOG_ENABLED1801 # ifdef LOG_ENABLED 1802 1802 uint64_t const offReadOld = pStreamR3->State.offRead; 1803 # endif1803 # endif 1804 1804 pStreamR3->State.offRead = AudioMixerSinkTransferFromCircBuf(pSink, 1805 1805 pStreamR3->State.pCircBuf, … … 2197 2197 2198 2198 2199 # if 0 /* unused - no prototype even */2199 # if 0 /* unused - no prototype even */ 2200 2200 /** 2201 2201 * Updates an HDA stream's current read or write buffer position (depending on the stream type) by … … 2231 2231 return u32LPIB; 2232 2232 } 2233 # endif2233 # endif 2234 2234 2235 2235 # ifdef HDA_USE_DMA_ACCESS_HANDLER
Note:
See TracChangeset
for help on using the changeset viewer.