- Timestamp:
- Aug 16, 2016 10:14:46 AM (8 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r63529 r63534 545 545 AudioMixBufDestroy(&pHstStream->MixBuf); 546 546 547 if (CfgHostAcq.cSample s)548 { 549 LogFlowFunc(("[%s] cSamples=%RU32\n", pHstStream->szName, CfgHostAcq.cSample s* 4));550 551 rc2 = AudioMixBufInit(&pHstStream->MixBuf, pHstStream->szName, &PCMProps, CfgHostAcq.cSample s* 4);547 if (CfgHostAcq.cSampleBufferSize) 548 { 549 LogFlowFunc(("[%s] cSamples=%RU32\n", pHstStream->szName, CfgHostAcq.cSampleBufferSize * 4)); 550 551 rc2 = AudioMixBufInit(&pHstStream->MixBuf, pHstStream->szName, &PCMProps, CfgHostAcq.cSampleBufferSize * 4); 552 552 AssertRC(rc2); 553 553 } … … 567 567 AudioMixBufDestroy(&pGstStream->MixBuf); 568 568 569 if (CfgHostAcq.cSample s)570 { 571 LogFlowFunc(("[%s] cSamples=%RU32\n", pGstStream->szName, CfgHostAcq.cSample s* 2));572 573 rc2 = AudioMixBufInit(&pGstStream->MixBuf, pGstStream->szName, &PCMProps, CfgHostAcq.cSample s* 2);569 if (CfgHostAcq.cSampleBufferSize) 570 { 571 LogFlowFunc(("[%s] cSamples=%RU32\n", pGstStream->szName, CfgHostAcq.cSampleBufferSize * 2)); 572 573 rc2 = AudioMixBufInit(&pGstStream->MixBuf, pGstStream->szName, &PCMProps, CfgHostAcq.cSampleBufferSize * 2); 574 574 AssertRC(rc2); 575 575 } … … 579 579 #endif 580 580 581 if (CfgHostAcq.cSample s)581 if (CfgHostAcq.cSampleBufferSize) 582 582 { 583 583 if (pCfgGuest->enmDir == PDMAUDIODIR_IN) -
trunk/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp
r63481 r63534 1359 1359 break; 1360 1360 1361 pCfgAcq->uHz = obt.freq;1362 pCfgAcq->cChannels = obt.nchannels;1363 pCfgAcq->enmFormat = enmFormat;1364 pCfgAcq->enmEndianness = enmEnd;1365 pCfgAcq->cSample s= obt.samples * 4;1361 pCfgAcq->uHz = obt.freq; 1362 pCfgAcq->cChannels = obt.nchannels; 1363 pCfgAcq->enmFormat = enmFormat; 1364 pCfgAcq->enmEndianness = enmEnd; 1365 pCfgAcq->cSampleBufferSize = obt.samples * 4; 1366 1366 1367 1367 PDMAUDIOPCMPROPS Props; … … 1422 1422 break; 1423 1423 1424 pCfgAcq->uHz = obt.freq;1425 pCfgAcq->cChannels = obt.nchannels;1426 pCfgAcq->enmFormat = enmFormat;1427 pCfgAcq->enmEndianness = enmEnd;1428 pCfgAcq->cSample s= obt.samples;1424 pCfgAcq->uHz = obt.freq; 1425 pCfgAcq->cChannels = obt.nchannels; 1426 pCfgAcq->enmFormat = enmFormat; 1427 pCfgAcq->enmEndianness = enmEnd; 1428 pCfgAcq->cSampleBufferSize = obt.samples; 1429 1429 1430 1430 PDMAUDIOPCMPROPS Props; -
trunk/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp
r63529 r63534 1562 1562 1563 1563 if (pCfgAcq) 1564 pCfgAcq->cSample s= cSamples;1564 pCfgAcq->cSampleBufferSize = cSamples; 1565 1565 } 1566 1566 else … … 1882 1882 1883 1883 if (pCfgAcq) 1884 pCfgAcq->cSample s= cSamples;1884 pCfgAcq->cSampleBufferSize = cSamples; 1885 1885 } 1886 1886 else -
trunk/src/VBox/Devices/Audio/DrvHostDSound.cpp
r63532 r63534 1462 1462 1463 1463 if (pCfgAcq) 1464 pCfgAcq->cSample s= pThis->cfg.cbBufferOut >> pDSoundStream->Props.cShift;1464 pCfgAcq->cSampleBufferSize = pThis->cfg.cbBufferOut >> pDSoundStream->Props.cShift; 1465 1465 1466 1466 /* Try to open playback in case the device is already there. */ … … 1714 1714 1715 1715 if (pCfgAcq) 1716 pCfgAcq->cSample s= pThis->cfg.cbBufferIn >> pDSoundStream->Props.cShift;1716 pCfgAcq->cSampleBufferSize = pThis->cfg.cbBufferIn >> pDSoundStream->Props.cShift; 1717 1717 1718 1718 /* Try to open capture in case the device is already there. */ -
trunk/src/VBox/Devices/Audio/DrvHostDebugAudio.cpp
r63532 r63534 138 138 { 139 139 if (pCfgAcq) 140 pCfgAcq->cSample s= _1K;140 pCfgAcq->cSampleBufferSize = _1K; 141 141 } 142 142 … … 183 183 { 184 184 if (pCfgAcq) 185 pCfgAcq->cSample s= pDbgStream->Out.cMaxSamplesInPlayBuffer;185 pCfgAcq->cSampleBufferSize = pDbgStream->Out.cMaxSamplesInPlayBuffer; 186 186 } 187 187 -
trunk/src/VBox/Devices/Audio/DrvHostNullAudio.cpp
r63529 r63534 221 221 { 222 222 if (pCfgAcq) 223 pCfgAcq->cSample s= _1K;223 pCfgAcq->cSampleBufferSize = _1K; 224 224 } 225 225 … … 244 244 { 245 245 if (pCfgAcq) 246 pCfgAcq->cSample s= pNullStream->cMaxSamplesInPlayBuffer;246 pCfgAcq->cSampleBufferSize = pNullStream->cMaxSamplesInPlayBuffer; 247 247 } 248 248 else -
trunk/src/VBox/Devices/Audio/DrvHostOSSAudio.cpp
r63529 r63534 711 711 pStrm->cbBuf = cbBuf; 712 712 713 pCfgAcq->cSample s= cSamples;713 pCfgAcq->cSampleBufferSize = cSamples; 714 714 } 715 715 } … … 833 833 } 834 834 #endif 835 pCfgAcq->cSample s= cSamples;835 pCfgAcq->cSampleBufferSize = cSamples; 836 836 } 837 837 -
trunk/src/VBox/Devices/Audio/DrvHostPulseAudio.cpp
r63529 r63534 684 684 pStrm->pDrv = pThis; 685 685 686 pCfgAcq->cSample s= cbBuf >> Props.cShift;686 pCfgAcq->cSampleBufferSize = cbBuf >> Props.cShift; 687 687 } 688 688 else … … 733 733 pPAStrm->pu8PeekBuf = NULL; 734 734 735 pCfgAcq->uHz = pPAStrm->SampleSpec.rate;736 pCfgAcq->cChannels = pPAStrm->SampleSpec.channels;737 pCfgAcq->cSample s= RT_MIN(pPAStrm->BufAttr.fragsize * 10, pPAStrm->BufAttr.maxlength) >> Props.cShift;735 pCfgAcq->uHz = pPAStrm->SampleSpec.rate; 736 pCfgAcq->cChannels = pPAStrm->SampleSpec.channels; 737 pCfgAcq->cSampleBufferSize = RT_MIN(pPAStrm->BufAttr.fragsize * 10, pPAStrm->BufAttr.maxlength) >> Props.cShift; 738 738 } 739 739 -
trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp
r63529 r63534 102 102 { 103 103 if (pCfgAcq) 104 pCfgAcq->cSample s= _4K; /** @todo Make this configurable. */104 pCfgAcq->cSampleBufferSize = _4K; /** @todo Make this configurable. */ 105 105 } 106 106 … … 125 125 { 126 126 if (pCfgAcq) 127 pCfgAcq->cSample s= _4K; /** @todo Make this configurable. */127 pCfgAcq->cSampleBufferSize = _4K; /** @todo Make this configurable. */ 128 128 } 129 129 -
trunk/src/VBox/Main/src-client/DrvAudioVideoRec.cpp
r63362 r63534 212 212 int live = smin; 213 213 214 if (live < 0 || live > hw->cSample s)214 if (live < 0 || live > hw->cSampleBufferSize) 215 215 { 216 LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSample s));216 LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSampleBufferSize)); 217 217 return 0; 218 218 } … … 228 228 229 229 live = audio_pcm_hw_get_live_out2 (hw, &nb_live); 230 if (live < 0 || live > hw->cSample s)231 { 232 LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSample s));230 if (live < 0 || live > hw->cSampleBufferSize) 231 { 232 LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSampleBufferSize)); 233 233 return 0; 234 234 } … … 257 257 { 258 258 int live = hw->cTotalSamplesCaptured - audio_pcm_hw_find_min_in (hw); 259 if (live < 0 || live > hw->cSample s)260 { 261 LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSample s));259 if (live < 0 || live > hw->cSampleBufferSize) 260 { 261 LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSampleBufferSize)); 262 262 return 0; 263 263 } … … 383 383 384 384 PVIDEORECAUDIOOUT pVRDEVoiceOut = (PVIDEORECAUDIOOUT)pHostVoiceOut; 385 pHostVoiceOut->cSample s= _4K; /* 4096 samples * 4 = 16K bytes total. */385 pHostVoiceOut->cSampleBufferSize = _4K; /* 4096 samples * 4 = 16K bytes total. */ 386 386 387 387 return drvAudioVideoRecPcmInitInfo(&pVRDEVoiceOut->pHostVoiceOut.Props, pCfg); … … 394 394 395 395 PVIDEORECAUDIOIN pVRDEVoice = (PVIDEORECAUDIOIN)pHostVoiceIn; 396 pHostVoiceIn->cSample s= _4K; /* 4096 samples * 4 = 16K bytes total. */396 pHostVoiceIn->cSampleBufferSize = _4K; /* 4096 samples * 4 = 16K bytes total. */ 397 397 398 398 return drvAudioVideoRecPcmInitInfo(&pVRDEVoice->pHostVoiceIn.Props, pCfg); … … 418 418 419 419 /* How much space is available in the mix buffer. Use the smaller size of the too. */ 420 cSamplesRingBuffer = RT_MIN(cSamplesRingBuffer, (uint32_t)(pVRDEVoice->pHostVoiceIn.cSample s-420 cSamplesRingBuffer = RT_MIN(cSamplesRingBuffer, (uint32_t)(pVRDEVoice->pHostVoiceIn.cSampleBufferSize - 421 421 audio_pcm_hw_get_live_in (&pVRDEVoice->pHostVoiceIn))); 422 422 … … 430 430 /* How much is left? Split request at the end of our samples buffer. */ 431 431 size_t cSamplesToRead = RT_MIN(cSamplesRingBuffer - cSamplesRead, 432 (uint32_t)(pVRDEVoice->pHostVoiceIn.cSample s- pVRDEVoice->pHostVoiceIn.offSamplesWritten));432 (uint32_t)(pVRDEVoice->pHostVoiceIn.cSampleBufferSize - pVRDEVoice->pHostVoiceIn.offSamplesWritten)); 433 433 size_t cbToRead = cSamplesToRead * sizeof(PDMAUDIOSAMPLE); 434 434 LogFlowFunc(("Try reading %zu samples (%zu bytes)\n", cSamplesToRead, cbToRead)); … … 462 462 463 463 pVRDEVoice->pHostVoiceIn.offSamplesWritten = (pVRDEVoice->pHostVoiceIn.offSamplesWritten + cSamplesToRead) 464 % pVRDEVoice->pHostVoiceIn.cSample s;464 % pVRDEVoice->pHostVoiceIn.cSampleBufferSize; 465 465 466 466 /* How much have we reads so far. */ … … 502 502 pHostVoiceOut->Props.uHz, pHostVoiceOut->Props.cChannels, 503 503 pHostVoiceOut->Props.cBits, pHostVoiceOut->Props.fSigned, 504 pHostVoiceOut->cSample s, format));504 pHostVoiceOut->cSampleBufferSize, format)); 505 505 506 506 pVRDEVoiceOut->old_ticks = now; 507 507 int cSamplesToSend = RT_MIN(live, cSamplesPlayed); 508 508 509 if (pHostVoiceOut->cOffSamplesRead + cSamplesToSend > pHostVoiceOut->cSample s)509 if (pHostVoiceOut->cOffSamplesRead + cSamplesToSend > pHostVoiceOut->cSampleBufferSize) 510 510 { 511 511 /* send the samples till the end of pHostStereoSampleBuf */ 512 512 pDrv->pConsoleVRDPServer->SendAudioSamples(&pHostVoiceOut->paSamples[pHostVoiceOut->cOffSamplesRead], 513 (pHostVoiceOut->cSample s- pHostVoiceOut->cOffSamplesRead), format);513 (pHostVoiceOut->cSampleBufferSize - pHostVoiceOut->cOffSamplesRead), format); 514 514 /*pHostStereoSampleBuff already has the samples which exceeded its space. They have overwriten the old 515 515 * played sampled starting from offset 0. So based on the number of samples that we had to play, … … 517 517 */ 518 518 pDrv->pConsoleVRDPServer->SendAudioSamples(&pHostVoiceOut->paSamples[0], 519 (cSamplesToSend - (pHostVoiceOut->cSample s-519 (cSamplesToSend - (pHostVoiceOut->cSampleBufferSize - 520 520 pHostVoiceOut->cOffSamplesRead)), 521 521 format); … … 527 527 } 528 528 529 pHostVoiceOut->cOffSamplesRead = (pHostVoiceOut->cOffSamplesRead + cSamplesToSend) % pHostVoiceOut->cSample s;529 pHostVoiceOut->cOffSamplesRead = (pHostVoiceOut->cOffSamplesRead + cSamplesToSend) % pHostVoiceOut->cSampleBufferSize; 530 530 531 531 *pcSamplesPlayed = cSamplesToSend; … … 584 584 pVRDEVoice->cbRateBufferAllocated = 0; 585 585 586 pVRDEVoice->pHostVoiceIn.cSample s= 2048;586 pVRDEVoice->pHostVoiceIn.cSampleBufferSize = 2048; 587 587 /* Initialize the hardware info section with the audio settings */ 588 588 … … 591 591 /* Create the internal ring buffer. */ 592 592 RTCircBufCreate(&pVRDEVoice->pRecordedVoiceBuf, 593 pVRDEVoice->pHostVoiceIn.cSample s* sizeof(PDMAUDIOSAMPLE));593 pVRDEVoice->pHostVoiceIn.cSampleBufferSize * sizeof(PDMAUDIOSAMPLE)); 594 594 595 595 if (!RT_VALID_PTR(pVRDEVoice->pRecordedVoiceBuf)) … … 600 600 601 601 ASMAtomicWriteU32(&pVRDEVoice->status, CA_STATUS_INIT); 602 return pDrv->pConsoleVRDPServer->SendAudioInputBegin(NULL, pVRDEVoice, pHostVoiceIn->cSample s,602 return pDrv->pConsoleVRDPServer->SendAudioInputBegin(NULL, pVRDEVoice, pHostVoiceIn->cSampleBufferSize, 603 603 pHostVoiceIn->Props.uHz, 604 604 pHostVoiceIn->Props.cChannels, pHostVoiceIn->Props.cBits);
Note:
See TracChangeset
for help on using the changeset viewer.