Changeset 89638 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 11, 2021 10:03:42 PM (4 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHda.cpp
r89611 r89638 4646 4646 ""); 4647 4647 4648 /* Note: Error checking of this value happens in hdaR3StreamSetUp(). */ 4649 int rc = pHlp->pfnCFGMQueryU16Def(pCfg, "BufSizeInMs", &pThis->cbCircBufInMs, 0 /* Default value, if not set. */); 4648 /** @devcfgm{hda,BufSizeInMs,uint16_t,0,2000,0,ms} 4649 * The size of the DMA buffer for input streams expressed in milliseconds. */ 4650 int rc = pHlp->pfnCFGMQueryU16Def(pCfg, "BufSizeInMs", &pThis->cMsCircBufIn, 0); 4650 4651 if (RT_FAILURE(rc)) 4651 4652 return PDMDEV_SET_ERROR(pDevIns, rc, 4652 N_("HDA configuration error: failed to read input buffer size (ms) as unsigned integer")); 4653 4654 /* Note: Error checking of this value happens in hdaR3StreamSetUp(). */ 4655 rc = pHlp->pfnCFGMQueryU16Def(pCfg, "BufSizeOutMs", &pThis->cbCircBufOutMs, 0 /* Default value, if not set. */); 4653 N_("HDA configuration error: failed to read 'BufSizeInMs' as 16-bit unsigned integer")); 4654 if (pThis->cMsCircBufIn > 2000) 4655 return PDMDEV_SET_ERROR(pDevIns, VERR_OUT_OF_RANGE, 4656 N_("HDA configuration error: 'BufSizeInMs' is out of bound, max 2000 ms")); 4657 4658 /** @devcfgm{hda,BufSizeOutMs,uint16_t,0,2000,0,ms} 4659 * The size of the DMA buffer for output streams expressed in milliseconds. */ 4660 rc = pHlp->pfnCFGMQueryU16Def(pCfg, "BufSizeOutMs", &pThis->cMsCircBufOut, 0); 4656 4661 if (RT_FAILURE(rc)) 4657 4662 return PDMDEV_SET_ERROR(pDevIns, rc, 4658 N_("HDA configuration error: failed to read output buffer size (ms) as unsigned integer")); 4659 4660 rc = pHlp->pfnCFGMQueryU16Def(pCfg, "TimerHz", &pThis->uTimerHz, HDA_TIMER_HZ_DEFAULT /* Default value, if not set. */); 4663 N_("HDA configuration error: failed to read 'BufSizeOutMs' as 16-bit unsigned integer")); 4664 if (pThis->cMsCircBufOut > 2000) 4665 return PDMDEV_SET_ERROR(pDevIns, VERR_OUT_OF_RANGE, 4666 N_("HDA configuration error: 'BufSizeOutMs' is out of bound, max 2000 ms")); 4667 4668 /** @todo uTimerHz isn't used for anything anymore. */ 4669 rc = pHlp->pfnCFGMQueryU16Def(pCfg, "TimerHz", &pThis->uTimerHz, HDA_TIMER_HZ_DEFAULT); 4661 4670 if (RT_FAILURE(rc)) 4662 4671 return PDMDEV_SET_ERROR(pDevIns, rc, 4663 4672 N_("HDA configuration error: failed to read Hertz (Hz) rate as unsigned integer")); 4664 4665 4673 if (pThis->uTimerHz != HDA_TIMER_HZ_DEFAULT) 4666 4674 LogRel(("HDA: Using custom device timer rate (%RU16Hz)\n", pThis->uTimerHz)); … … 4680 4688 N_("HDA configuration error: Out of range: 0 <= InitialDelayMs < 256: %u"), pThis->msInitialDelay); 4681 4689 4690 /** @todo fPosAdjustEnabled is not honored anymore. */ 4682 4691 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "PosAdjustEnabled", &pThis->fPosAdjustEnabled, true); 4683 4692 if (RT_FAILURE(rc)) 4684 4693 return PDMDEV_SET_ERROR(pDevIns, rc, 4685 4694 N_("HDA configuration error: failed to read position adjustment enabled as boolean")); 4686 4687 4695 if (!pThis->fPosAdjustEnabled) 4688 4696 LogRel(("HDA: Position adjustment is disabled\n")); 4689 4697 4698 /** @todo cPosAdjustFrames is not consulted anymore. */ 4690 4699 rc = pHlp->pfnCFGMQueryU16Def(pCfg, "PosAdjustFrames", &pThis->cPosAdjustFrames, HDA_POS_ADJUST_DEFAULT); 4691 4700 if (RT_FAILURE(rc)) 4692 4701 return PDMDEV_SET_ERROR(pDevIns, rc, 4693 4702 N_("HDA configuration error: failed to read position adjustment frames as unsigned integer")); 4694 4695 4703 if (pThis->cPosAdjustFrames) 4696 4704 LogRel(("HDA: Using custom position adjustment (%RU16 audio frames)\n", pThis->cPosAdjustFrames)); 4697 4705 4706 /** @todo fTransferHeuristicsEnabled is not used anymore. */ 4698 4707 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "TransferHeuristicsEnabled", &pThis->fTransferHeuristicsEnabled, true); 4699 4708 if (RT_FAILURE(rc)) 4700 4709 return PDMDEV_SET_ERROR(pDevIns, rc, 4701 4710 N_("HDA configuration error: failed to read data transfer heuristics enabled as boolean")); 4702 4703 4711 if (!pThis->fTransferHeuristicsEnabled) 4704 4712 LogRel(("HDA: Data transfer heuristics are disabled\n")); … … 4713 4721 return PDMDEV_SET_ERROR(pDevIns, rc, 4714 4722 N_("HDA configuration error: failed to read debugging output path flag as string")); 4715 4716 4723 if (pThisCC->Dbg.fEnabled) 4717 4724 LogRel2(("HDA: Debug output will be saved to '%s'\n", pThisCC->Dbg.pszOutPath)); -
trunk/src/VBox/Devices/Audio/DevHda.h
r89406 r89638 122 122 * @sa InitialDelayMs config value. */ 123 123 uint16_t msInitialDelay; 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 /** Config: Internal input DMA buffer size override, specified in milliseconds. 125 * Zero means default size according to buffer and stream config. 126 * @sa BufSizeInMs config value. */ 127 uint16_t cMsCircBufIn; 128 /** Config: Internal output DMA buffer size override, specified in milliseconds. 129 * Zero means default size according to buffer and stream config. 130 * @sa BufSizeOutMs config value. */ 131 uint16_t cMsCircBufOut; 130 132 /** The start time of the wall clock (WALCLK), measured on the virtual sync clock. */ 131 133 uint64_t tsWalClkStart; -
trunk/src/VBox/Devices/Audio/DevHdaStream.cpp
r89562 r89638 707 707 uSD, cbCircBuf, PDMAudioPropsBytesToMilli(&pCfg->Props, cbCircBuf))); 708 708 709 uint32_t msCircBufCfg = hdaGetDirFromSD(uSD) == PDMAUDIODIR_IN ? pThis->c bCircBufInMs : pThis->cbCircBufOutMs;709 uint32_t msCircBufCfg = hdaGetDirFromSD(uSD) == PDMAUDIODIR_IN ? pThis->cMsCircBufIn : pThis->cMsCircBufOut; 710 710 if (msCircBufCfg) /* Anything set via CFGM? */ 711 711 {
Note:
See TracChangeset
for help on using the changeset viewer.