Changeset 89853 in vbox
- Timestamp:
- Jun 23, 2021 1:19:38 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145310
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHda.cpp
r89849 r89853 5107 5107 "Number of bytes of silence added to cope with underruns.", "Stream%u/DMABufferSilence", idxStream); 5108 5108 } 5109 PDMDevHlpSTAMRegisterF(pDevIns, &pThisCC->aStreams[idxStream].State.StatDmaSkippedPendingBcis, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_COUNT, 5110 "DMA transfer period skipped because of BCIS pending.", "Stream%u/DMASkippedPendingBCIS", idxStream); 5111 5109 5112 PDMDevHlpSTAMRegisterF(pDevIns, &pThisCC->aStreams[idxStream].State.offRead, STAMTYPE_U64, STAMVISIBILITY_USED, STAMUNIT_BYTES, 5110 5113 "Virtual internal buffer read position.", "Stream%u/offRead", idxStream); -
trunk/src/VBox/Devices/Audio/DevHdaStream.cpp
r89848 r89853 1211 1211 * @param pThis The shared HDA device state. 1212 1212 * @param pStreamShared HDA stream to update (shared). 1213 * @param pStreamR3 HDA stream to update (ring-3). 1213 1214 * @param uSD The stream ID (for asserting). 1214 1215 * @param tsNowNs The current RTTimeNano() value. 1215 1216 * @param pszFunction The function name (for logging). 1216 1217 */ 1217 DECLINLINE(bool) hdaR3StreamDoDmaPrologue(PHDASTATE pThis, PHDASTREAM pStreamShared, uint8_t uSD,1218 DECLINLINE(bool) hdaR3StreamDoDmaPrologue(PHDASTATE pThis, PHDASTREAM pStreamShared, PHDASTREAMR3 pStreamR3, uint8_t uSD, 1218 1219 uint64_t tsNowNs, const char *pszFunction) 1219 1220 { … … 1236 1237 else 1237 1238 { 1239 /** @todo r=bird: This is a bit fishy. We should make effort the reschedule 1240 * the transfer immediately after the guest clears the interrupt. 1241 * The same fishy code is present in AC'97 with just a little 1242 * explanation as here, see {9890#c95}. 1243 * 1244 * The reasoning is probably that the developer noticed some windows 1245 * versions don't like having their BCIS interrupts bundled. There were 1246 * comments to that effect elsewhere, probably as a result of a fixed 1247 * uTimerHz approach to DMA scheduling. However, pausing DMA for a 1248 * period isn't going to help us with the host backends, as they don't 1249 * pause and will want samples ASAP. So, we should at least unpause 1250 * DMA as quickly as we possible when BCIS is cleared. We might even 1251 * not skip it iff the DMA work here doesn't involve raising any IOC, 1252 * which is possible although unlikely. */ 1238 1253 Log3(("%s: [SD%RU8] BCIS bit set, skipping transfer\n", pszFunction, uSD)); 1254 STAM_REL_COUNTER_INC(&pStreamR3->State.StatDmaSkippedPendingBcis); 1255 Log(("%s: [SD%RU8] BCIS bit set, skipping transfer\n", pszFunction, uSD)); 1239 1256 # ifdef HDA_STRICT 1240 1257 /* Timing emulation bug or guest is misbehaving -- let me know. */ … … 1387 1404 * Common prologue. 1388 1405 */ 1389 if (hdaR3StreamDoDmaPrologue(pThis, pStreamShared, uSD, tsNowNs, "hdaR3StreamDoDmaInput"))1406 if (hdaR3StreamDoDmaPrologue(pThis, pStreamShared, pStreamR3, uSD, tsNowNs, "hdaR3StreamDoDmaInput")) 1390 1407 { /* likely */ } 1391 1408 else … … 1596 1613 * Common prologue. 1597 1614 */ 1598 if (hdaR3StreamDoDmaPrologue(pThis, pStreamShared, uSD, tsNowNs, "hdaR3StreamDoDmaOutput"))1615 if (hdaR3StreamDoDmaPrologue(pThis, pStreamShared, pStreamR3, uSD, tsNowNs, "hdaR3StreamDoDmaOutput")) 1599 1616 { /* likely */ } 1600 1617 else -
trunk/src/VBox/Devices/Audio/DevHdaStream.h
r89844 r89853 290 290 /** Number of bytes involved in unresolved flow errors. */ 291 291 STAMCOUNTER StatDmaFlowErrorBytes; 292 /** DMA skipped because buffer interrupt pending. */ 293 STAMCOUNTER StatDmaSkippedPendingBcis; 292 294 293 295 STAMPROFILE StatStart; … … 298 300 /** Debug bits. */ 299 301 HDASTREAMDEBUG Dbg; 300 uint64_t au64Alignment[ 2+4];302 uint64_t au64Alignment[1+4]; 301 303 } HDASTREAMR3; 302 304 AssertCompileSizeAlignment(HDASTREAMR3, 64);
Note:
See TracChangeset
for help on using the changeset viewer.