Changeset 88195 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Mar 18, 2021 4:35:14 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 143353
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r88194 r88195 1400 1400 if (pStreamShared->State.fRunning) 1401 1401 { 1402 hdaR3StreamEnable(pStreamShared, pStreamR3, false /* fEnable */); 1403 ASMAtomicWriteBool(&pStreamShared->State.fRunning, false); 1402 int rc2 = hdaR3StreamEnable(pStreamShared, pStreamR3, false /* fEnable */); 1403 AssertRC(rc2); Assert(!pStreamShared->State.fRunning); 1404 pStreamShared->State.fRunning = false; 1404 1405 } 1405 1406 1406 1407 /* Make sure to remove the run bit before doing the actual stream reset. */ 1407 HDA_STREAM_REG(pThis, CTL, uSD) &= ~HDA_SDCTL_RUN; 1408 HDA_STREAM_REG(pThis, CTL, uSD) &= ~HDA_SDCTL_RUN; /** @todo r=bird: Isn't this utterly pointless? */ 1408 1409 hdaR3StreamReset(pThis, pThisCC, pStreamShared, pStreamR3, uSD); 1409 1410 … … 2858 2859 LogFlowFuncEnter(); 2859 2860 2861 /* 2862 * Make sure all streams have stopped as these have both timers and 2863 * asynchronous worker threads that would race us if we delay this work. 2864 */ 2865 for (size_t idxStream = 0; idxStream < RT_ELEMENTS(pThis->aStreams); idxStream++) 2866 { 2867 PHDASTREAM const pStreamShared = &pThis->aStreams[idxStream]; 2868 hdaStreamLock(pStreamShared); 2869 # ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO 2870 hdaR3StreamAsyncIOLock(&pThisCC->aStreams[idxStream]); 2871 # endif 2872 2873 /* We're doing this unconditionally, hope that's not problematic in any way... */ 2874 int rc = hdaR3StreamEnable(pStreamShared, &pThisCC->aStreams[idxStream], false /* fEnable */); 2875 AssertLogRelMsg(RT_SUCCESS(rc) && !pStreamShared->State.fRunning, 2876 ("Disabling stream #%u failed: %Rrc, fRunning=%d\n", idxStream, rc, pStreamShared->State.fRunning)); 2877 pStreamShared->State.fRunning = false; 2878 2879 /* Remove the RUN bit from SDnCTL in case the stream was in a running state before. */ 2880 HDA_STREAM_REG(pThis, CTL, idxStream) &= ~HDA_SDCTL_RUN; /** @todo r=bird: Isn't this utterly pointless? */ 2881 hdaR3StreamReset(pThis, pThisCC, pStreamShared, &pThisCC->aStreams[idxStream], (uint8_t)idxStream); 2882 2883 # ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO 2884 hdaR3StreamAsyncIOUnlock(&pThisCC->aStreams[idxStream]); 2885 # endif 2886 hdaStreamUnlock(pStreamShared); 2887 } 2888 2889 /* 2890 * Reset registers. 2891 */ 2860 2892 HDA_REG(pThis, GCAP) = HDA_MAKE_GCAP(HDA_MAX_SDO, HDA_MAX_SDI, 0, 0, 1); /* see 6.2.1 */ 2861 2893 HDA_REG(pThis, VMIN) = 0x00; /* see 6.2.2 */ … … 2934 2966 /* Clear our internal response interrupt counter. */ 2935 2967 pThis->u16RespIntCnt = 0; 2936 2937 for (size_t idxStream = 0; idxStream < RT_ELEMENTS(pThis->aStreams); idxStream++)2938 {2939 /** @todo r=bird: insufficient locking here, I think... May race stream timer2940 * and AIO threads. We should probably do this a lot earlier too. */2941 int rc2 = hdaR3StreamEnable(&pThis->aStreams[idxStream], &pThisCC->aStreams[idxStream], false /* fEnable */);2942 if (RT_SUCCESS(rc2))2943 {2944 /* Remove the RUN bit from SDnCTL in case the stream was in a running state before. */2945 HDA_STREAM_REG(pThis, CTL, idxStream) &= ~HDA_SDCTL_RUN;2946 hdaR3StreamReset(pThis, pThisCC, &pThis->aStreams[idxStream], &pThisCC->aStreams[idxStream], (uint8_t)idxStream);2947 }2948 }2949 2968 2950 2969 /* Clear stream tags <-> objects mapping table. */
Note:
See TracChangeset
for help on using the changeset viewer.