Changeset 73380 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jul 27, 2018 9:12:35 AM (6 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r73370 r73380 653 653 if (RT_SUCCESS(rc)) 654 654 { 655 rc = RTCircBufCreate(&pMixStream->pCircBuf, DrvAudioHlpMsToBytes( &pSink->PCMProps, 100 /* ms */)); /** @todo Make this configurable. */655 rc = RTCircBufCreate(&pMixStream->pCircBuf, DrvAudioHlpMsToBytes(100 /* ms */, &pSink->PCMProps)); /** @todo Make this configurable. */ 656 656 AssertRC(rc); 657 657 } … … 859 859 #else 860 860 /* Return how much data we can deliver since the last read. */ 861 cbReadable = DrvAudioHlpMsToBytes( &pSink->PCMProps, RTTimeMilliTS() - pSink->tsLastReadWrittenMs);861 cbReadable = DrvAudioHlpMsToBytes(RTTimeMilliTS() - pSink->tsLastReadWrittenMs, &pSink->PCMProps); 862 862 #endif 863 863 } … … 897 897 #else 898 898 /* Return how much data we expect since the last write. */ 899 cbWritable = DrvAudioHlpMsToBytes( &pSink->PCMProps, RTTimeMilliTS() - pSink->tsLastReadWrittenMs);899 cbWritable = DrvAudioHlpMsToBytes(RTTimeMilliTS() - pSink->tsLastReadWrittenMs, &pSink->PCMProps); 900 900 #endif 901 901 } -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r73370 r73380 667 667 668 668 /* If no own pre-buffer is set, let the backend choose. */ 669 uint32_t msPreBuf = DrvAudioHlpFramesToMs( &pCfgHost->Props, CfgHostAcq.Backend.cfPreBuf);669 uint32_t msPreBuf = DrvAudioHlpFramesToMs(CfgHostAcq.Backend.cfPreBuf, &pCfgHost->Props); 670 670 LogRel2(("Audio: Pre-buffering size of stream '%s' is %RU32ms (%RU32 frames)\n", 671 671 pHstStream->szName, msPreBuf, CfgHostAcq.Backend.cfPreBuf)); 672 672 673 673 /* Make sure the configured buffer size by the backend at least can hold the configured latency. */ 674 const uint32_t msPeriod = DrvAudioHlpFramesToMs( &pCfgHost->Props, CfgHostAcq.Backend.cfPeriod);674 const uint32_t msPeriod = DrvAudioHlpFramesToMs(CfgHostAcq.Backend.cfPeriod, &pCfgHost->Props); 675 675 676 676 LogRel2(("Audio: Period size of stream '%s' is %RU32ms (%RU32 frames)\n", … … 685 685 } 686 686 687 uint32_t msBufferSize = DrvAudioHlpFramesToMs( &pCfgHost->Props, CfgHostAcq.Backend.cfBufferSize);687 uint32_t msBufferSize = DrvAudioHlpFramesToMs(CfgHostAcq.Backend.cfBufferSize, &pCfgHost->Props); 688 688 689 689 LogRel2(("Audio: Buffer size of stream '%s' is %RU32ms (%RU32 frames)\n", … … 993 993 if (cbFree < cbBuf) /* No space left on host side? Bail out. */ 994 994 LogRel2(("Audio: Lost audio frames (%RU32) due to full host stream '%s', expect stuttering audio output\n", 995 DrvAudioHlpBytesToFrames( &pHstStream->Cfg.Props, cbBuf - cbFree), pHstStream->szName));995 DrvAudioHlpBytesToFrames(cbBuf - cbFree, &pHstStream->Cfg.Props), pHstStream->szName)); 996 996 997 997 uint32_t cbToWrite = RT_MIN(cbBuf, cbFree); … … 1044 1044 { 1045 1045 Log3Func(("[%s] Buffer: Last written %RU64ms, writing %RU32 frames (%RU64ms), now filled with %RU64ms -- %RU8%%\n", 1046 pHstStream->szName, tsDeltaWrittenMs, cfGstWritten, DrvAudioHlpFramesToMs( &pHstStream->Cfg.Props, cfGstWritten),1047 DrvAudioHlpFramesToMs( &pHstStream->Cfg.Props, AudioMixBufUsed(&pHstStream->MixBuf)),1046 pHstStream->szName, tsDeltaWrittenMs, cfGstWritten, DrvAudioHlpFramesToMs(cfGstWritten, &pHstStream->Cfg.Props), 1047 DrvAudioHlpFramesToMs(AudioMixBufUsed(&pHstStream->MixBuf), &pHstStream->Cfg.Props), 1048 1048 AudioMixBufUsed(&pHstStream->MixBuf) * 100 / AudioMixBufSize(&pHstStream->MixBuf))); 1049 1049 … … 1599 1599 Log3Func(("[%s] Buffer: Last played %RU64ms, filled with %RU64ms (%RU8%%) total, " 1600 1600 "(cfLive=%RU32, fThresholdReached=%RTbool)\n", 1601 pHstStream->szName, tsDeltaPlayedCapturedMs, DrvAudioHlpFramesToMs( &pHstStream->Cfg.Props, cfLive),1601 pHstStream->szName, tsDeltaPlayedCapturedMs, DrvAudioHlpFramesToMs(cfLive, &pHstStream->Cfg.Props), 1602 1602 uLivePercent, cfLive, pHstStream->fThresholdReached)); 1603 1603 #endif … … 1645 1645 cfToPlay = pHstStream->Cfg.Backend.cfPeriod; 1646 1646 else 1647 cfToPlay = DrvAudioHlpMsToFrames( &pHstStream->Cfg.Props, tsDeltaPlayedCapturedMs);1647 cfToPlay = DrvAudioHlpMsToFrames(tsDeltaPlayedCapturedMs, &pHstStream->Cfg.Props); 1648 1648 1649 1649 Log3Func(("[%s] Buffer: fJustStarted=%RTbool, cfLive=%RU32, cfToPlay=%RU32\n", … … 3256 3256 */ 3257 3257 if (pDrvCfg->uPeriodMs) 3258 pCfgReq->Backend.cfPeriod = DrvAudioHlpMsToFrames( &pCfgReq->Props, pDrvCfg->uPeriodMs);3258 pCfgReq->Backend.cfPeriod = DrvAudioHlpMsToFrames(pDrvCfg->uPeriodMs, &pCfgReq->Props); 3259 3259 else /* Set default period size. */ 3260 pCfgReq->Backend.cfPeriod = DrvAudioHlpMsToFrames( &pCfgReq->Props, 50 /* ms */);3260 pCfgReq->Backend.cfPeriod = DrvAudioHlpMsToFrames(50 /* ms */, &pCfgReq->Props); 3261 3261 3262 3262 LogRel2(("Audio: Using %s period size (%RU32ms, %RU32 frames) for stream '%s'\n", 3263 pDrvCfg->uPeriodMs ? "custom" : "default", DrvAudioHlpFramesToMs( &pCfgReq->Props, pCfgReq->Backend.cfPeriod),3263 pDrvCfg->uPeriodMs ? "custom" : "default", DrvAudioHlpFramesToMs(pCfgReq->Backend.cfPeriod, &pCfgReq->Props), 3264 3264 pCfgReq->Backend.cfPeriod, pHstStream->szName)); 3265 3265 … … 3268 3268 */ 3269 3269 if (pDrvCfg->uBufferSizeMs) 3270 pCfgReq->Backend.cfBufferSize = DrvAudioHlpMsToFrames( &pCfgReq->Props, pDrvCfg->uBufferSizeMs);3270 pCfgReq->Backend.cfBufferSize = DrvAudioHlpMsToFrames(pDrvCfg->uBufferSizeMs, &pCfgReq->Props); 3271 3271 else /* Set default buffer size. */ 3272 pCfgReq->Backend.cfBufferSize = DrvAudioHlpMsToFrames( &pCfgReq->Props, 200 /* ms */);3272 pCfgReq->Backend.cfBufferSize = DrvAudioHlpMsToFrames(200 /* ms */, &pCfgReq->Props); 3273 3273 3274 3274 LogRel2(("Audio: Using %s buffer size (%RU32ms, %RU32 frames) for stream '%s'\n", 3275 pDrvCfg->uBufferSizeMs ? "custom" : "default", DrvAudioHlpFramesToMs( &pCfgReq->Props, pCfgReq->Backend.cfBufferSize),3275 pDrvCfg->uBufferSizeMs ? "custom" : "default", DrvAudioHlpFramesToMs(pCfgReq->Backend.cfBufferSize, &pCfgReq->Props), 3276 3276 pCfgReq->Backend.cfBufferSize, pHstStream->szName)); 3277 3277 … … 3283 3283 if (!pDrvCfg->uPreBufMs) /* Pre-buffering is set to disabled. */ 3284 3284 LogRel2(("Audio: Using custom pre-buffering (disabled) for stream '%s'\n", pHstStream->szName)); 3285 pCfgReq->Backend.cfPreBuf = DrvAudioHlpMsToFrames( &pCfgReq->Props, pDrvCfg->uPreBufMs);3285 pCfgReq->Backend.cfPreBuf = DrvAudioHlpMsToFrames(pDrvCfg->uPreBufMs, &pCfgReq->Props); 3286 3286 } 3287 3287 else /* Set default pre-buffering size. */ … … 3289 3289 3290 3290 LogRel2(("Audio: Using %s pre-buffering size (%RU32ms, %RU32 frames) for stream '%s'\n", 3291 pDrvCfg->uPreBufMs != UINT32_MAX ? "custom" : "default", DrvAudioHlpFramesToMs( &pCfgReq->Props, pCfgReq->Backend.cfPreBuf),3291 pDrvCfg->uPreBufMs != UINT32_MAX ? "custom" : "default", DrvAudioHlpFramesToMs(pCfgReq->Backend.cfPreBuf, &pCfgReq->Props), 3292 3292 pCfgReq->Backend.cfPreBuf, pHstStream->szName)); 3293 3293 … … 3298 3298 { 3299 3299 LogRel(("Audio: Error for stream '%s': Buffer size (%RU32ms) must not be smaller than the period size (%RU32ms)\n", 3300 pHstStream->szName, DrvAudioHlpFramesToMs( &pCfgReq->Props, pCfgReq->Backend.cfBufferSize),3301 DrvAudioHlpFramesToMs( &pCfgReq->Props, pCfgReq->Backend.cfPeriod)));3300 pHstStream->szName, DrvAudioHlpFramesToMs(pCfgReq->Backend.cfBufferSize, &pCfgReq->Props), 3301 DrvAudioHlpFramesToMs(pCfgReq->Backend.cfPeriod, &pCfgReq->Props))); 3302 3302 return VERR_INVALID_PARAMETER; 3303 3303 } … … 3309 3309 { 3310 3310 LogRel(("Audio: Error for stream '%s': Pre-buffering size (%RU32ms) must not be bigger than the buffer size (%RU32ms)\n", 3311 pHstStream->szName, DrvAudioHlpFramesToMs( &pCfgReq->Props, pCfgReq->Backend.cfPreBuf),3312 DrvAudioHlpFramesToMs( &pCfgReq->Props, pCfgReq->Backend.cfBufferSize)));3311 pHstStream->szName, DrvAudioHlpFramesToMs(pCfgReq->Backend.cfPreBuf, &pCfgReq->Props), 3312 DrvAudioHlpFramesToMs(pCfgReq->Backend.cfBufferSize, &pCfgReq->Props))); 3313 3313 return VERR_INVALID_PARAMETER; 3314 3314 } … … 3348 3348 { 3349 3349 LogRel2(("Audio: Custom buffer size overwritten by backend for stream '%s' (now %RU64ms, %RU32 frames)\n", 3350 pHstStream->szName, DrvAudioHlpFramesToMs( &pCfgAcq->Props, pCfgAcq->Backend.cfBufferSize), pCfgAcq->Backend.cfBufferSize));3350 pHstStream->szName, DrvAudioHlpFramesToMs(pCfgAcq->Backend.cfBufferSize, &pCfgAcq->Props), pCfgAcq->Backend.cfBufferSize)); 3351 3351 } 3352 3352 … … 3355 3355 { 3356 3356 LogRel2(("Audio: Custom period size overwritten by backend for stream '%s' (now %RU64ms, %RU32 frames)\n", 3357 pHstStream->szName, DrvAudioHlpFramesToMs( &pCfgAcq->Props, pCfgAcq->Backend.cfPeriod), pCfgAcq->Backend.cfPeriod));3357 pHstStream->szName, DrvAudioHlpFramesToMs(pCfgAcq->Backend.cfPeriod, &pCfgAcq->Props), pCfgAcq->Backend.cfPeriod)); 3358 3358 } 3359 3359 … … 3362 3362 { 3363 3363 LogRel2(("Audio: Custom pre-buffering size overwritten by backend for stream '%s' (now %RU64ms, %RU32 frames)\n", 3364 pHstStream->szName, DrvAudioHlpFramesToMs( &pCfgAcq->Props, pCfgAcq->Backend.cfPreBuf), pCfgAcq->Backend.cfPreBuf));3364 pHstStream->szName, DrvAudioHlpFramesToMs(pCfgAcq->Backend.cfPreBuf, &pCfgAcq->Props), pCfgAcq->Backend.cfPreBuf)); 3365 3365 } 3366 3366 -
trunk/src/VBox/Devices/Audio/DrvAudio.h
r73379 r73380 186 186 uint32_t DrvAudioHlpBytesAlign(uint32_t cbSize, const PPDMAUDIOPCMPROPS pProps); 187 187 bool DrvAudioHlpBytesIsAligned(uint32_t cbSize, const PPDMAUDIOPCMPROPS pProps); 188 uint32_t DrvAudioHlpBytesToFrames( const PPDMAUDIOPCMPROPS pProps, uint32_t cbBytes);189 uint64_t DrvAudioHlpBytesToMs( const PPDMAUDIOPCMPROPS pProps, uint32_t cbBytes);190 uint32_t DrvAudioHlpFramesToBytes( const PPDMAUDIOPCMPROPS pProps, uint32_t cFrames);191 uint64_t DrvAudioHlpFramesToMs( const PPDMAUDIOPCMPROPS pProps, uint32_t cFrames);192 uint32_t DrvAudioHlpMsToBytes( const PPDMAUDIOPCMPROPS pProps, uint32_t uMs);193 uint32_t DrvAudioHlpMsToFrames( const PPDMAUDIOPCMPROPS pProps, uint32_t uMs);188 uint32_t DrvAudioHlpBytesToFrames(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps); 189 uint64_t DrvAudioHlpBytesToMs(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps); 190 uint32_t DrvAudioHlpFramesToBytes(uint32_t cFrames, const PPDMAUDIOPCMPROPS pProps); 191 uint64_t DrvAudioHlpFramesToMs(uint32_t cFrames, const PPDMAUDIOPCMPROPS pProps); 192 uint32_t DrvAudioHlpMsToBytes(uint32_t uMs, const PPDMAUDIOPCMPROPS pProps); 193 uint32_t DrvAudioHlpMsToFrames(uint32_t uMs, const PPDMAUDIOPCMPROPS pProps); 194 194 /** @} */ 195 195 -
trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp
r73379 r73380 137 137 138 138 Assert(pPCMProps->cBits); 139 size_t cbToClear = DrvAudioHlpFramesToBytes( pPCMProps, cFrames);139 size_t cbToClear = DrvAudioHlpFramesToBytes(cFrames, pPCMProps); 140 140 Assert(cbBuf >= cbToClear); 141 141 … … 167 167 uint16_t s = 0x8000; 168 168 169 for (uint32_t i = 0; i < DrvAudioHlpBytesToFrames( pPCMProps, (uint32_t)cbToClear); i++)169 for (uint32_t i = 0; i < DrvAudioHlpBytesToFrames((uint32_t)cbToClear, pPCMProps); i++) 170 170 p[i] = s; 171 171 … … 180 180 uint32_t s = 0x80000000; 181 181 182 for (uint32_t i = 0; i < DrvAudioHlpBytesToFrames( pPCMProps, (uint32_t)cbToClear); i++)182 for (uint32_t i = 0; i < DrvAudioHlpBytesToFrames((uint32_t)cbToClear, pPCMProps); i++) 183 183 p[i] = s; 184 184 … … 1103 1103 * 1104 1104 * @return Calculated audio frames for given bytes. 1105 * @param cbBytes Bytes to convert to audio frames. 1105 1106 * @param pProps PCM properties to calulate frames for. 1106 * @param cbBytes Bytes to convert to audio frames. 1107 */ 1108 uint32_t DrvAudioHlpBytesToFrames(const PPDMAUDIOPCMPROPS pProps, uint32_t cbBytes) 1107 */ 1108 uint32_t DrvAudioHlpBytesToFrames(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps) 1109 1109 { 1110 1110 AssertPtrReturn(pProps, 0); … … 1117 1117 * 1118 1118 * @return uint64_t Calculated time (in ms). 1119 * @param cbBytes Amount of bytes to calculate time for. 1119 1120 * @param pProps PCM properties to calculate amount of bytes for. 1120 * @param cbBytes Amount of bytes to calculate time for. 1121 */ 1122 uint64_t DrvAudioHlpBytesToMs(const PPDMAUDIOPCMPROPS pProps, uint32_t cbBytes) 1121 */ 1122 uint64_t DrvAudioHlpBytesToMs(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps) 1123 1123 { 1124 1124 AssertPtrReturn(pProps, 0); … … 1139 1139 * 1140 1140 * @return Calculated bytes for given audio frames. 1141 * @param cFrames Amount of audio frames to calculate bytes for. 1141 1142 * @param pProps PCM properties to calculate bytes for. 1142 * @param cFrames Amount of audio frames to calculate bytes for. 1143 */ 1144 uint32_t DrvAudioHlpFramesToBytes(const PPDMAUDIOPCMPROPS pProps, uint32_t cFrames) 1143 */ 1144 uint32_t DrvAudioHlpFramesToBytes(uint32_t cFrames, const PPDMAUDIOPCMPROPS pProps) 1145 1145 { 1146 1146 AssertPtrReturn(pProps, 0); … … 1156 1156 * 1157 1157 * @return uint64_t Calculated time (in ms). 1158 * @param cFrames Amount of audio frames to calculate time for. 1158 1159 * @param pProps PCM properties to calculate time (in ms) for. 1159 * @param cFrames Amount of audio frames to calculate time for. 1160 */ 1161 uint64_t DrvAudioHlpFramesToMs(const PPDMAUDIOPCMPROPS pProps, uint32_t cFrames) 1160 */ 1161 uint64_t DrvAudioHlpFramesToMs(uint32_t cFrames, const PPDMAUDIOPCMPROPS pProps) 1162 1162 { 1163 1163 AssertPtrReturn(pProps, 0); … … 1176 1176 * 1177 1177 * @return uint32_t Calculated amount of bytes. 1178 * @param uMs Time (in ms) to calculate amount of bytes for. 1178 1179 * @param pProps PCM properties to calculate amount of bytes for. 1179 * @param uMs Time (in ms) to calculate amount of bytes for. 1180 */ 1181 uint32_t DrvAudioHlpMsToBytes(const PPDMAUDIOPCMPROPS pProps, uint32_t uMs) 1180 */ 1181 uint32_t DrvAudioHlpMsToBytes(uint32_t uMs, const PPDMAUDIOPCMPROPS pProps) 1182 1182 { 1183 1183 AssertPtrReturn(pProps, 0); … … 1193 1193 * 1194 1194 * @return uint32_t Calculated amount of audio frames. 1195 * @param uMs Time (in ms) to calculate amount of bytes for. 1195 1196 * @param pProps PCM properties to calculate amount of bytes for. 1196 * @param uMs Time (in ms) to calculate amount of bytes for. 1197 */ 1198 uint32_t DrvAudioHlpMsToFrames(const PPDMAUDIOPCMPROPS pProps, uint32_t uMs) 1197 */ 1198 uint32_t DrvAudioHlpMsToFrames(uint32_t uMs, const PPDMAUDIOPCMPROPS pProps) 1199 1199 { 1200 1200 AssertPtrReturn(pProps, 0); … … 1204 1204 return 0; 1205 1205 1206 return DrvAudioHlpMsToBytes( pProps, uMs) / cbFrame;1206 return DrvAudioHlpMsToBytes(uMs, pProps) / cbFrame; 1207 1207 } 1208 1208 -
trunk/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp
r73371 r73380 1290 1290 req.freq = pCfgReq->Props.uHz; 1291 1291 req.nchannels = pCfgReq->Props.cChannels; 1292 req.period_size = DrvAudioHlpMsToFrames( &pCfgReq->Props, 50 /* ms */); /** @todo Make this configurable. */1292 req.period_size = DrvAudioHlpMsToFrames(50 /* ms */, &pCfgReq->Props); /** @todo Make this configurable. */ 1293 1293 req.buffer_size = req.period_size * 2; /** @todo Make this configurable. */ 1294 1294 req.threshold = req.period_size; … … 1739 1739 Log2Func(("cfDelay=%RI32, enmState=%d, rc=%d\n", cfDelay, enmState, rc)); 1740 1740 1741 return DrvAudioHlpFramesToBytes( &pStreamALSA->pCfg->Props, cfDelay);1741 return DrvAudioHlpFramesToBytes(cfDelay, &pStreamALSA->pCfg->Props); 1742 1742 } 1743 1743 -
trunk/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp
r73370 r73380 1298 1298 return VERR_GENERAL_FAILURE; /** @todo Fudge! */ 1299 1299 1300 const size_t cbBufSize = DrvAudioHlpFramesToBytes( &pCAStream->pCfg->Props, pCAStream->pCfg->Backend.cfPeriod);1300 const size_t cbBufSize = DrvAudioHlpFramesToBytes(pCAStream->pCfg->Backend.cfPeriod, &pCAStream->pCfg->Props); 1301 1301 1302 1302 /* -
trunk/src/VBox/Devices/Audio/DrvHostDSound.cpp
r73370 r73380 674 674 */ 675 675 bd.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_LOCSOFTWARE; 676 bd.dwBufferBytes = DrvAudioHlpFramesToBytes( &pCfgReq->Props, pCfgReq->Backend.cfBufferSize);676 bd.dwBufferBytes = DrvAudioHlpFramesToBytes(pCfgReq->Backend.cfBufferSize, &pCfgReq->Props); 677 677 678 678 DSLOG(("DSound: Requested playback buffer is %RU64ms (%ld bytes)\n", 679 pCfgReq->Backend.cfBufferSize, DrvAudioHlpBytesToMs( &pCfgReq->Props, bd.dwBufferBytes), bd.dwBufferBytes));679 pCfgReq->Backend.cfBufferSize, DrvAudioHlpBytesToMs(bd.dwBufferBytes, &pCfgReq->Props), bd.dwBufferBytes)); 680 680 681 681 hr = IDirectSound8_CreateSoundBuffer(pThis->pDS, &bd, &pDSB, NULL); … … 719 719 720 720 DSLOG(("DSound: Acquired playback buffer is %RU64ms (%ld bytes)\n", 721 DrvAudioHlpBytesToMs( &pCfgReq->Props, bc.dwBufferBytes), bc.dwBufferBytes));721 DrvAudioHlpBytesToMs(bc.dwBufferBytes, &pCfgReq->Props), bc.dwBufferBytes)); 722 722 723 723 DSLOG(("DSound: Acquired playback format:\n" … … 908 908 909 909 if ( pStreamDS->Out.fFirstTransfer 910 && pStreamDS->Out.cbTransferred >= DrvAudioHlpFramesToBytes( &pStreamDS->Cfg.Props, pStreamDS->Cfg.Backend.cfPreBuf))910 && pStreamDS->Out.cbTransferred >= DrvAudioHlpFramesToBytes(pStreamDS->Cfg.Backend.cfPreBuf, &pStreamDS->Cfg.Props)) 911 911 { 912 912 hr = directSoundPlayStart(pThis, pStreamDS); … … 1271 1271 bd.dwSize = sizeof(bd); 1272 1272 bd.lpwfxFormat = &wfx; 1273 bd.dwBufferBytes = DrvAudioHlpFramesToBytes( &pCfgReq->Props, pCfgReq->Backend.cfBufferSize);1273 bd.dwBufferBytes = DrvAudioHlpFramesToBytes(pCfgReq->Backend.cfBufferSize, &pCfgReq->Props); 1274 1274 1275 1275 DSLOG(("DSound: Requested capture buffer is %RU64ms (%ld bytes)\n", 1276 pCfgReq->Backend.cfBufferSize, DrvAudioHlpBytesToMs( &pCfgReq->Props, bd.dwBufferBytes), bd.dwBufferBytes));1276 pCfgReq->Backend.cfBufferSize, DrvAudioHlpBytesToMs(bd.dwBufferBytes, &pCfgReq->Props), bd.dwBufferBytes)); 1277 1277 1278 1278 LPDIRECTSOUNDCAPTUREBUFFER pDSCB; … … 1327 1327 1328 1328 DSLOG(("DSound: Acquired capture buffer is %RU64ms (%ld bytes)\n", 1329 DrvAudioHlpBytesToMs( &pCfgReq->Props, bc.dwBufferBytes), bc.dwBufferBytes));1329 DrvAudioHlpBytesToMs(bc.dwBufferBytes, &pCfgReq->Props), bc.dwBufferBytes)); 1330 1330 1331 1331 DSLOG(("DSound: Capture format:\n" … … 2210 2210 { 2211 2211 const uint64_t diffLastTransferredMs = RTTimeMilliTS() - pStreamDS->Out.tsLastTransferred; 2212 const uint64_t uLastTranserredChunkMs = DrvAudioHlpBytesToMs( &pStreamDS->Cfg.Props, pStreamDS->Out.cbLastTransferred);2212 const uint64_t uLastTranserredChunkMs = DrvAudioHlpBytesToMs(pStreamDS->Out.cbLastTransferred, &pStreamDS->Cfg.Props); 2213 2213 if ( uLastTranserredChunkMs 2214 2214 && diffLastTransferredMs < uLastTranserredChunkMs) -
trunk/src/VBox/Devices/Audio/DrvHostDebugAudio.cpp
r73370 r73380 121 121 if (pCfgAcq) 122 122 { 123 pCfgAcq->Backend.cfPeriod = DrvAudioHlpMsToFrames( &pCfgReq->Props, 1000 /* ms */);123 pCfgAcq->Backend.cfPeriod = DrvAudioHlpMsToFrames(1000 /* ms */, &pCfgReq->Props); 124 124 pCfgAcq->Backend.cfBufferSize = pCfgAcq->Backend.cfPeriod * 2; /* Use "double buffering". */ 125 125 } … … 163 163 if (pCfgAcq) 164 164 { 165 pCfgAcq->Backend.cfPeriod = DrvAudioHlpBytesToFrames( &pCfgReq->Props, 50 /* ms */);165 pCfgAcq->Backend.cfPeriod = DrvAudioHlpBytesToFrames(50 /* ms */, &pCfgReq->Props); 166 166 pCfgAcq->Backend.cfBufferSize = pCfgAcq->Backend.cfPeriod * 2; /* Use "double buffering". */ 167 167 } -
trunk/src/VBox/Devices/Audio/HDAStream.cpp
r73370 r73380 207 207 208 208 /* By default we allocate an internal buffer of 100ms. */ 209 rc = RTCircBufCreate(&pStream->State.pCircBuf, DrvAudioHlpMsToBytes( &pCfg->Props, 100 /* ms */)); /** @todo Make this configurable. */209 rc = RTCircBufCreate(&pStream->State.pCircBuf, DrvAudioHlpMsToBytes(100 /* ms */, &pCfg->Props)); /** @todo Make this configurable. */ 210 210 AssertRCReturn(rc, rc); 211 211
Note:
See TracChangeset
for help on using the changeset viewer.