Changeset 88572 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Apr 16, 2021 7:30:00 PM (4 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHda.cpp
r88561 r88572 1301 1301 if (pStreamShared->State.fRunning) 1302 1302 { 1303 int rc2 = hdaR3StreamEnable(p StreamShared, pStreamR3, false /* fEnable */);1303 int rc2 = hdaR3StreamEnable(pThis, pStreamShared, pStreamR3, false /* fEnable */); 1304 1304 AssertRC(rc2); Assert(!pStreamShared->State.fRunning); 1305 1305 pStreamShared->State.fRunning = false; … … 1380 1380 { 1381 1381 /* Enable/disable the stream. */ 1382 rc2 = hdaR3StreamEnable(p StreamShared, pStreamR3, fRun /* fEnable */);1382 rc2 = hdaR3StreamEnable(pThis, pStreamShared, pStreamR3, fRun /* fEnable */); 1383 1383 AssertRC(rc2); 1384 1384 … … 2518 2518 /* Only disable the stream if the stream descriptor # has changed. */ 2519 2519 if (pSink->pStreamShared->u8SD != uSD) 2520 hdaR3StreamEnable(p Sink->pStreamShared, pSink->pStreamR3, false /*fEnable*/);2520 hdaR3StreamEnable(pThis, pSink->pStreamShared, pSink->pStreamR3, false /*fEnable*/); 2521 2521 2522 2522 pSink->pStreamR3->pMixSink = NULL; … … 2766 2766 2767 2767 /* We're doing this unconditionally, hope that's not problematic in any way... */ 2768 int rc = hdaR3StreamEnable(p StreamShared, &pThisCC->aStreams[idxStream], false /* fEnable */);2768 int rc = hdaR3StreamEnable(pThis, pStreamShared, &pThisCC->aStreams[idxStream], false /* fEnable */); 2769 2769 AssertLogRelMsg(RT_SUCCESS(rc) && !pStreamShared->State.fRunning, 2770 2770 ("Disabling stream #%u failed: %Rrc, fRunning=%d\n", idxStream, rc, pStreamShared->State.fRunning)); … … 3474 3474 #endif 3475 3475 /* (Re-)enable the stream. */ 3476 rc2 = hdaR3StreamEnable(p StreamShared, pStreamR3, true /* fEnable */);3476 rc2 = hdaR3StreamEnable(pThis, pStreamShared, pStreamR3, true /* fEnable */); 3477 3477 AssertRC(rc2); 3478 3478 -
trunk/src/VBox/Devices/Audio/DevHdaStream.cpp
r88357 r88572 885 885 * 886 886 * @returns VBox status code. 887 * @param pThis The shared HDA device state. 887 888 * @param pStreamShared HDA stream to enable or disable - shared bits. 888 889 * @param pStreamR3 HDA stream to enable or disable - ring-3 bits. 889 890 * @param fEnable Whether to enable or disble the stream. 890 891 */ 891 int hdaR3StreamEnable(PHDAST REAM pStreamShared, PHDASTREAMR3 pStreamR3, bool fEnable)892 int hdaR3StreamEnable(PHDASTATE pThis, PHDASTREAM pStreamShared, PHDASTREAMR3 pStreamR3, bool fEnable) 892 893 { 893 894 AssertPtr(pStreamR3); … … 942 943 pStreamShared->State.tsTransferLast = 0; /* Make sure it's not stale and messes up WALCLK calculations. */ 943 944 pStreamShared->State.fRunning = fEnable; 945 946 /* 947 * Set the FIFORDY bit when we start running and clear it when stopping. 948 * 949 * This prevents Linux from timing out in snd_hdac_stream_sync when starting 950 * a stream. Technically, Linux also uses the SSYNC feature there, but we 951 * can get away with just setting the FIFORDY bit for now. 952 */ 953 if (fEnable) 954 HDA_STREAM_REG(pThis, STS, pStreamShared->u8SD) |= HDA_SDSTS_FIFORDY; 955 else 956 HDA_STREAM_REG(pThis, STS, pStreamShared->u8SD) &= ~HDA_SDSTS_FIFORDY; 944 957 } 945 958 … … 1204 1217 pStreamShared->State.tsLastTransferNs = tsNowNs; 1205 1218 1206 /*1207 * Set the FIFORDY bit on the stream while doing the transfer.1208 */1209 /** @todo r=bird: I don't get the HDA_SDSTS_FIFORDY logic. Unless we're1210 * assuming SMP guest and that it can get stream registers while we're1211 * here. Only it cannot do the later because we're sitting on the big1212 * HDA device lock, see assertions in hdaR3Timer(). So, this is an1213 * pointless guesture given that we clear it again after the loop. */1214 HDA_STREAM_REG(pThis, STS, uSD) |= HDA_SDSTS_FIFORDY;1215 1216 1219 return true; 1217 1220 } … … 1221 1224 * 1222 1225 * @param pDevIns The device instance. 1223 * @param pThis The shared HDA device state.1224 1226 * @param pStreamShared The HDA stream (shared). 1225 1227 * @param pStreamR3 The HDA stream (ring-3). 1226 1228 */ 1227 DECLINLINE(void) hdaR3StreamDoDmaEpilogue(PPDMDEVINS pDevIns, PHDASTATE pThis, PHDASTREAM pStreamShared, PHDASTREAMR3 pStreamR3) 1228 { 1229 /* 1230 * Clear the (pointless) FIFORDY bit again. 1231 */ 1232 HDA_STREAM_REG(pThis, STS, pStreamShared->u8SD) &= ~HDA_SDSTS_FIFORDY; 1233 1229 DECLINLINE(void) hdaR3StreamDoDmaEpilogue(PPDMDEVINS pDevIns, PHDASTREAM pStreamShared, PHDASTREAMR3 pStreamR3) 1230 { 1234 1231 /* 1235 1232 * We must update this in the epilogue rather than in the prologue … … 1525 1522 * Common epilogue. 1526 1523 */ 1527 hdaR3StreamDoDmaEpilogue(pDevIns, p This, pStreamShared, pStreamR3);1524 hdaR3StreamDoDmaEpilogue(pDevIns, pStreamShared, pStreamR3); 1528 1525 1529 1526 /* … … 1812 1809 * Common epilogue. 1813 1810 */ 1814 hdaR3StreamDoDmaEpilogue(pDevIns, p This, pStreamShared, pStreamR3);1811 hdaR3StreamDoDmaEpilogue(pDevIns, pStreamShared, pStreamR3); 1815 1812 1816 1813 /* -
trunk/src/VBox/Devices/Audio/DevHdaStream.h
r88357 r88572 354 354 void hdaR3StreamReset(PHDASTATE pThis, PHDASTATER3 pThisCC, 355 355 PHDASTREAM pStreamShared, PHDASTREAMR3 pStreamR3, uint8_t uSD); 356 int hdaR3StreamEnable(PHDAST REAM pStreamShared, PHDASTREAMR3 pStreamR3, bool fEnable);356 int hdaR3StreamEnable(PHDASTATE pThis, PHDASTREAM pStreamShared, PHDASTREAMR3 pStreamR3, bool fEnable); 357 357 void hdaR3StreamMarkStarted(PPDMDEVINS pDevIns, PHDASTATE pThis, PHDASTREAM pStreamShared, uint64_t tsNow); 358 358 void hdaR3StreamMarkStopped(PHDASTREAM pStreamShared);
Note:
See TracChangeset
for help on using the changeset viewer.