Changeset 87586 in vbox
- Timestamp:
- Feb 3, 2021 4:44:18 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 142615
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r87585 r87586 938 938 pStream->szName, DrvAudioHlpAudDirToStr(pStream->enmDir))); 939 939 940 /*AssertMsg(DrvAudioHlpBytesIsAligned(cbBuf, &pStream->Guest.Cfg.Props),941 ("Stream '%s' got a non-frame-aligned write (%RU32 bytes)\n", pStream->szName, cbBuf)); */940 AssertMsg(DrvAudioHlpBytesIsAligned(cbBuf, &pStream->Guest.Cfg.Props), 941 ("Stream '%s' got a non-frame-aligned write (%RU32 bytes)\n", pStream->szName, cbBuf)); 942 942 943 943 uint32_t cbWrittenTotal = 0; … … 1004 1004 || !cfGstWritten) 1005 1005 { 1006 AssertMsgFailed(("[%s] Write failed: cbToWrite=%RU32, cfWritten=%RU32, rc=%Rrc\n", 1007 pStream->szName, cbToWrite, cfGstWritten, rc)); 1006 1008 break; 1007 1009 } … … 2332 2334 #define QUERY_CONFIG(a_InOut) \ 2333 2335 /* PCM stuff. */ \ 2334 CFGMR3QueryU8Def (pNode, " xPCMSampleBit" #a_InOut, &pCfg->Props.cbSample, 0); \2335 CFGMR3QueryU32Def(pNode, " xPCMSampleHz" #a_InOut, &pCfg->Props.uHz, 0); \2336 CFGMR3QueryU8Def (pNode, " xPCMSampleSigned" #a_InOut, &pCfg->uSigned, UINT8_MAX /* No custom value set */); \2337 CFGMR3QueryU8Def (pNode, " xPCMSampleSwapEndian" #a_InOut, &pCfg->uSwapEndian, UINT8_MAX /* No custom value set */); \2338 CFGMR3QueryU8Def (pNode, " xPCMSampleChannels" #a_InOut, &pCfg->Props.cChannels, 0); \2336 CFGMR3QueryU8Def (pNode, "PCMSampleBit" #a_InOut, &pCfg->Props.cbSample, 0); \ 2337 CFGMR3QueryU32Def(pNode, "PCMSampleHz" #a_InOut, &pCfg->Props.uHz, 0); \ 2338 CFGMR3QueryU8Def (pNode, "PCMSampleSigned" #a_InOut, &pCfg->uSigned, UINT8_MAX /* No custom value set */); \ 2339 CFGMR3QueryU8Def (pNode, "PCMSampleSwapEndian" #a_InOut, &pCfg->uSwapEndian, UINT8_MAX /* No custom value set */); \ 2340 CFGMR3QueryU8Def (pNode, "PCMSampleChannels" #a_InOut, &pCfg->Props.cChannels, 0); \ 2339 2341 \ 2340 2342 /* Buffering stuff. */ \ 2341 CFGMR3QueryU32Def(pNode, " xPeriodSizeMs" #a_InOut, &pCfg->uPeriodSizeMs, 0); \2342 CFGMR3QueryU32Def(pNode, " xBufferSizeMs" #a_InOut, &pCfg->uBufferSizeMs, 0); \2343 CFGMR3QueryU32Def(pNode, " xPreBufferSizeMs" #a_InOut, &pCfg->uPreBufSizeMs, UINT32_MAX /* No custom value set */);2343 CFGMR3QueryU32Def(pNode, "PeriodSizeMs" #a_InOut, &pCfg->uPeriodSizeMs, 0); \ 2344 CFGMR3QueryU32Def(pNode, "BufferSizeMs" #a_InOut, &pCfg->uBufferSizeMs, 0); \ 2345 CFGMR3QueryU32Def(pNode, "PreBufferSizeMs" #a_InOut, &pCfg->uPreBufSizeMs, UINT32_MAX /* No custom value set */); 2344 2346 2345 2347 if (enmDir == PDMAUDIODIR_IN) -
trunk/src/VBox/Devices/Audio/HDAStream.cpp
r87585 r87586 29 29 #include <VBox/vmm/pdmdev.h> 30 30 #include <VBox/vmm/pdmaudioifs.h> 31 32 #include <math.h> /* Needed for roundl(). */ 31 33 32 34 #include "DrvAudio.h" … … 546 548 const double cTicksPerByte = cTicksPerHz / (double)pStreamShared->State.cbTransferChunk; 547 549 548 #define HDA_ROUND_NEAREST(a_X) ((a_X) >= 0 ? (uint32_t)((a_X) + 0.5) : (uint32_t)((a_X) - 0.5)) /** @todo r=andy Do we have rounding in IPRT? */549 550 550 /* Calculate the timer ticks per byte for this stream. */ 551 pStreamShared->State.cTicksPerByte = HDA_ROUND_NEAREST(cTicksPerByte);551 pStreamShared->State.cTicksPerByte = roundl(cTicksPerByte); /** @todo r=andy Do we have rounding in IPRT? */ 552 552 Assert(pStreamShared->State.cTicksPerByte); 553 553 … … 555 555 556 556 /* Calculate timer ticks per transfer. */ 557 pStreamShared->State.cTransferTicks = HDA_ROUND_NEAREST(cTransferTicks);557 pStreamShared->State.cTransferTicks = roundl(cTransferTicks); 558 558 Assert(pStreamShared->State.cTransferTicks); 559 560 #undef HDA_ROUND_NEAREST561 559 562 560 LogRel2(("HDA: Stream #%RU8 is using %uHz device timer (%RU64 virtual ticks / Hz), stream Hz=%RU32, " … … 2112 2110 2113 2111 #endif /* IN_RING3 */ 2112
Note:
See TracChangeset
for help on using the changeset viewer.