Changeset 87436 in vbox
- Timestamp:
- Jan 26, 2021 4:59:29 PM (4 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r87329 r87436 1469 1469 uSD, cTicksToNext / 1000, cTicksElapsed / 1000, pStreamShared->State.cTransferPendingInterrupts)); 1470 1470 1471 cTicksToNext = 0;1471 cTicksToNext = pStreamShared->State.cTransferTicks; 1472 1472 } 1473 1473 … … 4596 4596 * Validate and read configuration. 4597 4597 */ 4598 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "TimerHz|PosAdjustEnabled|PosAdjustFrames|DebugEnabled|DebugPathOut", ""); 4599 4600 int rc = pHlp->pfnCFGMQueryU16Def(pCfg, "TimerHz", &pThis->uTimerHz, HDA_TIMER_HZ_DEFAULT /* Default value, if not set. */); 4598 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "BufSizeInMs|BufSizeOutMs|TimerHz|PosAdjustEnabled|PosAdjustFrames|DebugEnabled|DebugPathOut", ""); 4599 4600 /* Note: Error checking of this value happens in hdaR3StreamSetUp(). */ 4601 int rc = pHlp->pfnCFGMQueryU16Def(pCfg, "BufSizeInMs", &pThis->cbCircBufInMs, RT_MS_1SEC /* Default value, if not set. */); 4602 if (RT_FAILURE(rc)) 4603 return PDMDEV_SET_ERROR(pDevIns, rc, 4604 N_("HDA configuration error: failed to read input buffer size (ms) as unsigned integer")); 4605 4606 /* Note: Error checking of this value happens in hdaR3StreamSetUp(). */ 4607 rc = pHlp->pfnCFGMQueryU16Def(pCfg, "BufSizeOutMs", &pThis->cbCircBufOutMs, RT_MS_1SEC /* Default value, if not set. */); 4608 if (RT_FAILURE(rc)) 4609 return PDMDEV_SET_ERROR(pDevIns, rc, 4610 N_("HDA configuration error: failed to read output buffer size (ms) as unsigned integer")); 4611 4612 rc = pHlp->pfnCFGMQueryU16Def(pCfg, "TimerHz", &pThis->uTimerHz, HDA_TIMER_HZ_DEFAULT /* Default value, if not set. */); 4601 4613 if (RT_FAILURE(rc)) 4602 4614 return PDMDEV_SET_ERROR(pDevIns, rc, -
trunk/src/VBox/Devices/Audio/DevHDA.h
r82968 r87436 122 122 /** The device timer Hz rate. Defaults to HDA_TIMER_HZ_DEFAULT. */ 123 123 uint16_t uTimerHz; 124 /** Buffer size (in ms) of the internal input FIFO buffer. 125 * The actual buffer size in bytes will depend on the actual stream configuration. */ 126 uint16_t cbCircBufInMs; 127 /** Buffer size (in ms) of the internal output FIFO buffer. 128 * The actual buffer size in bytes will depend on the actual stream configuration. */ 129 uint16_t cbCircBufOutMs; 124 130 /** Padding for alignment. */ 125 uint16_t au16Padding3[3];131 uint16_t u16Padding3; 126 132 /** Last updated wall clock (WALCLK) counter. */ 127 133 uint64_t u64WalClk; -
trunk/src/VBox/Devices/Audio/DrvAudio.h
r87179 r87436 195 195 uint32_t DrvAudioHlpCalcBitrate(uint8_t cBits, uint32_t uHz, uint8_t cChannels); 196 196 uint32_t DrvAudioHlpCalcBitrate(const PPDMAUDIOPCMPROPS pProps); 197 uint32_t DrvAudioHlpBytesAlign( uint32_t cbSize, const PPDMAUDIOPCMPROPS pProps);198 bool DrvAudioHlpBytesIsAligned( uint32_t cbSize, const PPDMAUDIOPCMPROPS pProps);197 uint32_t DrvAudioHlpBytesAlign(size_t cbSize, const PPDMAUDIOPCMPROPS pProps); 198 bool DrvAudioHlpBytesIsAligned(size_t cbSize, const PPDMAUDIOPCMPROPS pProps); 199 199 uint32_t DrvAudioHlpBytesToFrames(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps); 200 200 uint64_t DrvAudioHlpBytesToMilli(uint32_t cbBytes, const PPDMAUDIOPCMPROPS pProps); -
trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp
r82968 r87436 1181 1181 * @param pProps PCM properties to align size to. 1182 1182 */ 1183 uint32_t DrvAudioHlpBytesAlign( uint32_t cbSize, const PPDMAUDIOPCMPROPS pProps)1183 uint32_t DrvAudioHlpBytesAlign(size_t cbSize, const PPDMAUDIOPCMPROPS pProps) 1184 1184 { 1185 1185 AssertPtrReturn(pProps, 0); … … 1198 1198 * @param pProps PCM properties to use for checking the alignment. 1199 1199 */ 1200 bool DrvAudioHlpBytesIsAligned( uint32_t cbSize, const PPDMAUDIOPCMPROPS pProps)1200 bool DrvAudioHlpBytesIsAligned(size_t cbSize, const PPDMAUDIOPCMPROPS pProps) 1201 1201 { 1202 1202 AssertPtrReturn(pProps, 0); -
trunk/src/VBox/Devices/Audio/HDAStream.cpp
r87427 r87436 361 361 } 362 362 363 /* By default we allocate an internal buffer of 100ms. */ 364 rc = RTCircBufCreate(&pStreamR3->State.pCircBuf, 365 DrvAudioHlpMilliToBytes(100 /* ms */, &pCfg->Props)); /** @todo Make this configurable. */ 363 const size_t cbCircBufDefault = DrvAudioHlpMilliToBytes(RT_MS_1SEC, &pCfg->Props); 364 365 size_t cbCircBuf = DrvAudioHlpMilliToBytes( hdaGetDirFromSD(uSD) == PDMAUDIODIR_IN 366 ? pThis->cbCircBufInMs : pThis->cbCircBufOutMs, &pCfg->Props); 367 368 ASSERT_GUEST_LOGREL_MSG_STMT(cbCircBuf, 369 ("Ring buffer size for stream #%RU8 is invalid (%zu), setting to default\n", uSD, cbCircBuf), 370 cbCircBuf = cbCircBufDefault); 371 ASSERT_GUEST_LOGREL_MSG_STMT(DrvAudioHlpBytesIsAligned(cbCircBuf, &pCfg->Props), 372 ("Ring buffer size for stream #%RU8 is misaligned (%zu), setting to default\n", uSD, cbCircBuf), 373 cbCircBuf = cbCircBufDefault); 374 375 if (cbCircBuf != cbCircBufDefault) 376 LogRel2(("HDA: Stream #%RU8 is using a custom ring buffer size of %RU64ms (%zu bytes)\n", 377 uSD, DrvAudioHlpBytesToMilli(cbCircBuf, &pCfg->Props), cbCircBuf)); 378 379 rc = RTCircBufCreate(&pStreamR3->State.pCircBuf, cbCircBuf); 366 380 AssertRCReturn(rc, rc); 367 381 -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r87395 r87436 2962 2962 const uint64_t uTimerHz = strTmp.toUInt64(); 2963 2963 2964 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/Audio/Device/BufSizeInMs", &strTmp); 2965 const uint64_t uBufSizeInMs = strTmp.toUInt64(); 2966 2967 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/Audio/Device/BufSizeOutMs", &strTmp); 2968 const uint64_t uBufSizeOutMs = strTmp.toUInt64(); 2969 2964 2970 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/Audio/Debug/Enabled", &strTmp); 2965 2971 const bool fDebugEnabled = strTmp.equalsIgnoreCase("true") || strTmp.equalsIgnoreCase("1"); … … 2996 3002 if (uTimerHz) 2997 3003 InsertConfigInteger(pCfg, "TimerHz", uTimerHz); 3004 if (uBufSizeInMs) 3005 InsertConfigInteger(pCfg, "BufSizeInMs", uBufSizeInMs); 3006 if (uBufSizeOutMs) 3007 InsertConfigInteger(pCfg, "BufSizeOutMs", uBufSizeOutMs); 2998 3008 InsertConfigInteger(pCfg, "DebugEnabled", fDebugEnabled); 2999 3009 if (strDebugPathOut.isNotEmpty()) … … 3031 3041 if (uTimerHz) 3032 3042 InsertConfigInteger(pCfg, "TimerHz", uTimerHz); 3043 if (uBufSizeInMs) 3044 InsertConfigInteger(pCfg, "BufSizeInMs", uBufSizeInMs); 3045 if (uBufSizeOutMs) 3046 InsertConfigInteger(pCfg, "BufSizeOutMs", uBufSizeOutMs); 3033 3047 InsertConfigInteger(pCfg, "DebugEnabled", fDebugEnabled); 3034 3048 if (strDebugPathOut.isNotEmpty())
Note:
See TracChangeset
for help on using the changeset viewer.