Changeset 73432 in vbox for trunk/src/VBox
- Timestamp:
- Aug 1, 2018 3:03:03 PM (6 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r73421 r73432 934 934 /* Return how much data we expect since the last write. */ 935 935 cbWritable = DrvAudioHlpNanoToBytes(deltaLastReadWriteNs, &pSink->PCMProps); 936 937 /* Make sure to align the writable size to the stream's frame size. */ 936 938 cbWritable = DrvAudioHlpBytesAlign(cbWritable, &pSink->PCMProps); 937 939 #endif … … 1115 1117 Log3Func(("[%s] No recording source specified, skipping ...\n", pSink->pszName)); 1116 1118 } 1117 else if (!(pStreamRecSource->pConn->pfnStreamGetStatus(pStreamRecSource->pConn, pStreamRecSource->pStream) & PDMAUDIOSTREAMSTS_FLAG_ENABLED)) 1119 else if (!DrvAudioHlpStreamStatusCanRead( 1120 pStreamRecSource->pConn->pfnStreamGetStatus(pStreamRecSource->pConn, pStreamRecSource->pStream))) 1118 1121 { 1119 1122 Log3Func(("[%s] Stream '%s' disabled, skipping ...\n", pSink->pszName, pStreamRecSource->pszName)); … … 1564 1567 1565 1568 uint32_t cfProc = 0; 1569 1570 if (!DrvAudioHlpStreamStatusIsReady(pConn->pfnStreamGetStatus(pMixStream->pConn, pMixStream->pStream))) 1571 continue; 1566 1572 1567 1573 int rc2 = pConn->pfnStreamIterate(pConn, pStream); … … 1721 1727 ("%s: Can't write to a sink which is not an output sink\n", pSink->pszName)); 1722 1728 1723 Log3Func(("[%s] enmOp=%d, cbBuf=%RU32\n", pSink->pszName, enmOp, cbBuf));1724 1725 1729 PAUDMIXSTREAM pMixStream; 1726 1730 RTListForEach(&pSink->lstStreams, pMixStream, AUDMIXSTREAM, Node) 1727 1731 { 1732 if (!DrvAudioHlpStreamStatusCanWrite(pMixStream->pConn->pfnStreamGetStatus(pMixStream->pConn, pMixStream->pStream))) 1733 continue; 1734 1728 1735 PRTCIRCBUF pCircBuf = pMixStream->pCircBuf; 1729 1736 void *pvChunk; -
trunk/src/VBox/Devices/Audio/DevSB16.cpp
r73370 r73432 1555 1555 continue; 1556 1556 1557 if (!DrvAudioHlpStreamStatusCanWrite(pDrv->pConnector->pfnStreamGetStatus(pDrv->pConnector, pDrv->Out.pStream))) 1558 continue; 1559 1557 1560 uint32_t cbWrittenToStream = 0; 1558 1561 rc2 = pDrv->pConnector->pfnStreamWrite(pDrv->pConnector, pDrv->Out.pStream, tmpbuf, cbRead, &cbWrittenToStream); 1559 1562 1560 1563 LogFlowFunc(("\tLUN#%RU8: rc=%Rrc, cbWrittenToStream=%RU32\n", pDrv->uLUN, rc2, cbWrittenToStream)); 1561 1562 /* The primary driver sets the overall pace. */1563 if (pDrv->fFlags & PDMAUDIODRVFLAGS_PRIMARY)1564 {1565 cbWritten = cbWrittenToStream;1566 1567 if (RT_FAILURE(rc2))1568 break;1569 }1570 1564 } 1565 1566 cbWritten = cbRead; /* Always report everything written, as the backends need to keep up themselves. */ 1571 1567 1572 1568 LogFlowFunc(("\tcbToRead=%RU32, cbToWrite=%RU32, cbWritten=%RU32, cbLeft=%RU32\n", -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r73428 r73432 3014 3014 } 3015 3015 3016 uint32_t c fReadable = 0;3016 uint32_t cbReadable = 0; 3017 3017 3018 3018 PPDMAUDIOSTREAM pGstStream = pHstStream->pPair; 3019 3019 if (pGstStream) 3020 cfReadable = AudioMixBufLive(&pGstStream->MixBuf); 3021 3022 Log3Func(("[%s] cfReadable=%RU32 (%zu bytes)\n", pHstStream->szName, cfReadable, 3023 AUDIOMIXBUF_F2B(&pGstStream->MixBuf, cfReadable))); 3024 3025 uint32_t cbReadable = AUDIOMIXBUF_F2B(&pGstStream->MixBuf, cfReadable); 3020 { 3021 uint32_t cfReadable = AudioMixBufLive(&pGstStream->MixBuf); 3022 3023 Log3Func(("[%s] cfReadable=%RU32 (%zu bytes)\n", pHstStream->szName, cfReadable, 3024 AUDIOMIXBUF_F2B(&pGstStream->MixBuf, cfReadable))); 3025 3026 cbReadable = AUDIOMIXBUF_F2B(&pGstStream->MixBuf, cfReadable); 3027 } 3026 3028 3027 3029 rc2 = RTCritSectLeave(&pThis->CritSect); … … 3060 3062 const uint64_t deltaLastReadWriteNs = RTTimeNanoTS() - pHstStream->tsLastReadWrittenNs; 3061 3063 3062 uint32_t cbWritable = DrvAudioHlpNanoToBytes(deltaLastReadWriteNs, &pHstStream->Cfg.Props); 3063 cbWritable = DrvAudioHlpBytesAlign(cbWritable, &pHstStream->Cfg.Props); 3064 3065 Log3Func(("Audio: [%s] cbWritable=%RU32 (%RU64ms)\n", pHstStream->szName, cbWritable, deltaLastReadWriteNs / RT_NS_1MS_64)); 3064 uint32_t cbWritable = 0; 3065 3066 if (DrvAudioHlpStreamStatusCanWrite(pHstStream->fStatus)) 3067 { 3068 cbWritable = DrvAudioHlpNanoToBytes(deltaLastReadWriteNs, &pHstStream->Cfg.Props); 3069 3070 /* Make sure to align the writable size to the stream's frame size. */ 3071 cbWritable = DrvAudioHlpBytesAlign(cbWritable, &pHstStream->Cfg.Props); 3072 } 3073 3074 Log3Func(("[%s] cbWritable=%RU32 (%RU64ms)\n", pHstStream->szName, cbWritable, deltaLastReadWriteNs / RT_NS_1MS_64)); 3066 3075 3067 3076 rc2 = RTCritSectLeave(&pThis->CritSect); … … 3086 3095 AssertRC(rc2); 3087 3096 3088 PDMAUDIOSTREAMSTS st rmSts= PDMAUDIOSTREAMSTS_FLAG_NONE;3097 PDMAUDIOSTREAMSTS stsStream = PDMAUDIOSTREAMSTS_FLAG_NONE; 3089 3098 3090 3099 PPDMAUDIOSTREAM pHstStream = drvAudioGetHostStream(pStream); 3091 3100 if (pHstStream) 3092 3101 { 3093 strmSts = pHstStream->fStatus; 3102 /* If the connector is ready to operate, also make sure to ask the backend. */ 3103 stsStream = pHstStream->fStatus; 3104 if (DrvAudioHlpStreamStatusIsReady(stsStream)) 3105 stsStream = pThis->pHostDrvAudio->pfnStreamGetStatus(pThis->pHostDrvAudio, pHstStream->pvBackend); 3106 3094 3107 #ifdef LOG_ENABLED 3095 char *psz HstSts = dbgAudioStreamStatusToStr(pHstStream->fStatus);3096 Log3Func(("[%s] %s\n", pHstStream->szName, psz HstSts));3097 RTStrFree(psz HstSts);3108 char *pszStreamSts = dbgAudioStreamStatusToStr(stsStream); 3109 Log3Func(("[%s] %s\n", pHstStream->szName, pszStreamSts)); 3110 RTStrFree(pszStreamSts); 3098 3111 #endif 3099 3112 } … … 3102 3115 AssertRC(rc2); 3103 3116 3104 return st rmSts;3117 return stsStream; 3105 3118 } 3106 3119
Note:
See TracChangeset
for help on using the changeset viewer.