VirtualBox

Changeset 73611 in vbox


Ignore:
Timestamp:
Aug 10, 2018 8:51:03 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
124255
Message:

Audio: Renamed the (tweakable) per-driver CFGM options to make it easier remembering them.

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DrvAudio.cpp

    r73593 r73611  
    21832183
    21842184    /* Buffering stuff. */
    2185     CFGMR3QueryU32Def(pNode, "PeriodMs",     &pCfg->uPeriodMs, 0);
    2186     CFGMR3QueryU32Def(pNode, "BufferSizeMs", &pCfg->uBufferSizeMs, 0);
    2187     CFGMR3QueryU32Def(pNode, "PreBufferMs",  &pCfg->uPreBufMs, UINT32_MAX /* No custom value set */);
    2188 
    2189     LogFunc(("pCfg=%p, uPeriodMs=%RU32, uBufferSizeMs=%RU32, uPreBufMs=%RU32\n",
    2190              pCfg, pCfg->uPeriodMs, pCfg->uBufferSizeMs, pCfg->uPreBufMs));
     2185    CFGMR3QueryU32Def(pNode, "PeriodSizeMs",    &pCfg->uPeriodSizeMs, 0);
     2186    CFGMR3QueryU32Def(pNode, "BufferSizeMs",    &pCfg->uBufferSizeMs, 0);
     2187    CFGMR3QueryU32Def(pNode, "PreBufferSizeMs", &pCfg->uPreBufSizeMs, UINT32_MAX /* No custom value set */);
     2188
     2189    LogFunc(("pCfg=%p, uPeriodSizeMs=%RU32, uBufferSizeMs=%RU32, uPreBufSizeMs=%RU32\n",
     2190             pCfg, pCfg->uPeriodSizeMs, pCfg->uBufferSizeMs, pCfg->uPreBufSizeMs));
    21912191
    21922192    return VINF_SUCCESS;
     
    29382938     * Period size
    29392939     */
    2940     if (pDrvCfg->uPeriodMs)
    2941         pCfgReq->Backend.cfPeriod = DrvAudioHlpMilliToFrames(pDrvCfg->uPeriodMs, &pCfgReq->Props);
     2940    if (pDrvCfg->uPeriodSizeMs)
     2941        pCfgReq->Backend.cfPeriod = DrvAudioHlpMilliToFrames(pDrvCfg->uPeriodSizeMs, &pCfgReq->Props);
    29422942    else /* Set default period size. */
    29432943        pCfgReq->Backend.cfPeriod = DrvAudioHlpMilliToFrames(200 /* ms */, &pCfgReq->Props);
    29442944
    29452945    LogRel2(("Audio: Using %s period size (%RU64ms, %RU32 frames) for stream '%s'\n",
    2946              pDrvCfg->uPeriodMs ? "custom" : "default", DrvAudioHlpFramesToMilli(pCfgReq->Backend.cfPeriod, &pCfgReq->Props),
     2946             pDrvCfg->uPeriodSizeMs ? "custom" : "default", DrvAudioHlpFramesToMilli(pCfgReq->Backend.cfPeriod, &pCfgReq->Props),
    29472947             pCfgReq->Backend.cfPeriod, pStream->szName));
    29482948
     
    29622962     * Pre-buffering size
    29632963     */
    2964     if (pDrvCfg->uPreBufMs != UINT32_MAX)
    2965     {
    2966         if (!pDrvCfg->uPreBufMs) /* Pre-buffering is set to disabled. */
     2964    if (pDrvCfg->uPreBufSizeMs != UINT32_MAX)
     2965    {
     2966        if (!pDrvCfg->uPreBufSizeMs) /* Pre-buffering is set to disabled. */
    29672967            LogRel2(("Audio: Using custom pre-buffering (disabled) for stream '%s'\n", pStream->szName));
    2968         pCfgReq->Backend.cfPreBuf = DrvAudioHlpMilliToFrames(pDrvCfg->uPreBufMs, &pCfgReq->Props);
     2968        pCfgReq->Backend.cfPreBuf = DrvAudioHlpMilliToFrames(pDrvCfg->uPreBufSizeMs, &pCfgReq->Props);
    29692969    }
    29702970    else /* Set default pre-buffering size. */
     
    29722972
    29732973    LogRel2(("Audio: Using %s pre-buffering size (%RU64ms, %RU32 frames) for stream '%s'\n",
    2974              pDrvCfg->uPreBufMs != UINT32_MAX ? "custom" : "default", DrvAudioHlpFramesToMilli(pCfgReq->Backend.cfPreBuf, &pCfgReq->Props),
     2974             pDrvCfg->uPreBufSizeMs != UINT32_MAX ? "custom" : "default", DrvAudioHlpFramesToMilli(pCfgReq->Backend.cfPreBuf, &pCfgReq->Props),
    29752975             pCfgReq->Backend.cfPreBuf, pStream->szName));
    29762976
     
    30343034    }
    30353035
    3036     if (   pDrvCfg->uPeriodMs
     3036    if (   pDrvCfg->uPeriodSizeMs
    30373037        && pCfgAcq->Backend.cfPeriod != pCfgReq->Backend.cfPeriod)
    30383038    {
     
    30413041    }
    30423042
    3043     if (   pDrvCfg->uPreBufMs != UINT32_MAX
     3043    if (   pDrvCfg->uPreBufSizeMs != UINT32_MAX
    30443044        && pCfgAcq->Backend.cfPreBuf != pCfgReq->Backend.cfPreBuf)
    30453045    {
  • trunk/src/VBox/Devices/Audio/DrvAudio.h

    r73467 r73611  
    8282     *  This value reflects the time in between each hardware interrupt on the
    8383     *  backend (host) side. */
    84     uint32_t             uPeriodMs;
     84    uint32_t             uPeriodSizeMs;
    8585    /** Configures the (ring) buffer size (in ms). Often is a multiple of uPeriodMs. */
    8686    uint32_t             uBufferSizeMs;
     
    9090     *  Set to 0 to disable pre-buffering completely.
    9191     *  By default set to UINT32_MAX if not set to a custom value. */
    92     uint32_t             uPreBufMs;
     92    uint32_t             uPreBufSizeMs;
    9393    /** The driver's debugging configuration. */
    9494    struct
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r73308 r73611  
    34973497        }
    34983498
    3499         InsertConfigInteger(pCfg, "PeriodMs",
    3500                             i_getAudioDriverValU32(pVirtualBox, pMachine, pszDrvName, "PeriodMs", 0 /* Default */));
     3499        InsertConfigInteger(pCfg, "PeriodSizeMs",
     3500                            i_getAudioDriverValU32(pVirtualBox, pMachine, pszDrvName, "PeriodSizeMs", 0 /* Default */));
    35013501        InsertConfigInteger(pCfg, "BufferSizeMs",
    35023502                            i_getAudioDriverValU32(pVirtualBox, pMachine, pszDrvName, "BufferSizeMs", 0 /* Default */));
    3503         InsertConfigInteger(pCfg, "PreBufferMs",
    3504                             i_getAudioDriverValU32(pVirtualBox, pMachine, pszDrvName, "PreBufferMs", UINT32_MAX /* Default */));
     3503        InsertConfigInteger(pCfg, "PreBufferSizeMs",
     3504                            i_getAudioDriverValU32(pVirtualBox, pMachine, pszDrvName, "PreBufferSizeMs", UINT32_MAX /* Default */));
    35053505
    35063506    PCFGMNODE pLunL1;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette