VirtualBox

Ignore:
Timestamp:
Jun 18, 2021 2:02:38 PM (3 years ago)
Author:
vboxsync
Message:

Audio: Size the mixer buffer for sinks according to the scheulding hint. This should typically reduce the buffer size from the fixed size of 100ms we've used so far, helping to reduce latency build up. Also, 100ms might not have been enough for some configurations. bugref:9890

File:
1 edited

Legend:

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

    r89768 r89779  
    17951795    AssertPtrReturn(pMixSink, VERR_INVALID_POINTER);
    17961796
    1797     if (!AudioHlpStreamCfgIsValid(pCfg))
    1798         return VERR_INVALID_PARAMETER;
    1799 
    1800     int rc = AudioMixerSinkSetFormat(pMixSink, &pCfg->Props);
    1801     if (RT_FAILURE(rc))
    1802         return rc;
    1803 
    1804     PSB16DRIVER pDrv;
    1805     RTListForEach(&pThis->lstDrv, pDrv, SB16DRIVER, Node)
    1806     {
    1807         int rc2 = sb16AddDrvStream(pDevIns, pMixSink, pCfg, pDrv);
    1808         if (RT_FAILURE(rc2))
    1809             LogFunc(("Attaching stream failed with %Rrc\n", rc2));
    1810 
    1811         /* Do not pass failure to rc here, as there might be drivers which aren't
    1812          * configured / ready yet. */
    1813     }
     1797    int rc;
     1798    if (AudioHlpStreamCfgIsValid(pCfg))
     1799    {
     1800        rc = AudioMixerSinkSetFormat(pMixSink, &pCfg->Props, pCfg->Device.cMsSchedulingHint);
     1801        if (RT_SUCCESS(rc))
     1802        {
     1803            PSB16DRIVER pDrv;
     1804            RTListForEach(&pThis->lstDrv, pDrv, SB16DRIVER, Node)
     1805            {
     1806                int rc2 = sb16AddDrvStream(pDevIns, pMixSink, pCfg, pDrv);
     1807                if (RT_FAILURE(rc2))
     1808                    LogFunc(("Attaching stream failed with %Rrc\n", rc2));
     1809
     1810                /* Do not pass failure to rc here, as there might be drivers which aren't
     1811                 * configured / ready yet. */
     1812            }
     1813        }
     1814    }
     1815    else
     1816        rc = VERR_INVALID_PARAMETER;
    18141817
    18151818    LogFlowFuncLeaveRC(rc);
Note: See TracChangeset for help on using the changeset viewer.

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