Changeset 87585 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Feb 3, 2021 4:41:18 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 142614
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r87253 r87585 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));1008 1006 break; 1009 1007 } … … 2334 2332 #define QUERY_CONFIG(a_InOut) \ 2335 2333 /* PCM stuff. */ \ 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); \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); \ 2341 2339 \ 2342 2340 /* Buffering stuff. */ \ 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 */);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 */); 2346 2344 2347 2345 if (enmDir == PDMAUDIODIR_IN) -
trunk/src/VBox/Devices/Audio/HDAStream.cpp
r87583 r87585 29 29 #include <VBox/vmm/pdmdev.h> 30 30 #include <VBox/vmm/pdmaudioifs.h> 31 32 #include <math.h> /* Needed for roundl(). */33 31 34 32 #include "DrvAudio.h" … … 548 546 const double cTicksPerByte = cTicksPerHz / (double)pStreamShared->State.cbTransferChunk; 549 547 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 = roundl(cTicksPerByte); /** @todo r=andy Do we have rounding in IPRT? */551 pStreamShared->State.cTicksPerByte = HDA_ROUND_NEAREST(cTicksPerByte); 552 552 Assert(pStreamShared->State.cTicksPerByte); 553 553 … … 555 555 556 556 /* Calculate timer ticks per transfer. */ 557 pStreamShared->State.cTransferTicks = roundl(cTransferTicks);557 pStreamShared->State.cTransferTicks = HDA_ROUND_NEAREST(cTransferTicks); 558 558 Assert(pStreamShared->State.cTransferTicks); 559 560 #undef HDA_ROUND_NEAREST 559 561 560 562 LogRel2(("HDA: Stream #%RU8 is using %uHz device timer (%RU64 virtual ticks / Hz), stream Hz=%RU32, " … … 2110 2112 2111 2113 #endif /* IN_RING3 */ 2112
Note:
See TracChangeset
for help on using the changeset viewer.