VirtualBox

Ignore:
Timestamp:
May 11, 2016 9:13:40 AM (9 years ago)
Author:
vboxsync
Message:

Audio/AC97: Lowered timer to 100Hz and start/stop it only if needed. Should improve overall performance.

File:
1 edited

Legend:

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

    r60925 r60934  
    5151static int audioMixerSinkUpdateVolume(PAUDMIXSINK pSink, const PPDMAUDIOVOLUME pVolMaster);
    5252static void audioMixerSinkRemoveStreamInternal(PAUDMIXSINK pSink, PAUDMIXSTREAM pStream);
     53static int audioMixerSinkUpdateInternal(PAUDMIXSINK pSink);
    5354
    5455static void audioMixerStreamDestroyInternal(PAUDMIXSTREAM pStream);
     
    516517}
    517518
    518 int AudioMixerSinkUpdate(PAUDMIXSINK pSink)
     519void AudioMixerSinkTimerUpdate(PAUDMIXSINK pSink, uint64_t cTicksPerSec, uint64_t cTicksElapsed, uint32_t *pcbData)
     520{
     521    uint32_t cSamplesMin  = (uint32_t)((2 * cTicksElapsed * pSink->PCMProps.uHz + cTicksPerSec) / cTicksPerSec / 2);
     522    uint32_t cbSamplesMin = cSamplesMin << pSink->PCMProps.cShift;
     523
     524    LogFlowFunc(("%s: cbSamplesMin=%RU32\n", pSink->pszName, cbSamplesMin));
     525
     526    audioMixerSinkUpdateInternal(pSink);
     527
     528    if (pcbData)
     529        *pcbData = cbSamplesMin;
     530}
     531
     532static int audioMixerSinkUpdateInternal(PAUDMIXSINK pSink)
    519533{
    520534    AssertPtrReturn(pSink, VERR_INVALID_POINTER);
     
    532546            || cSamplesLive)
    533547        {
    534             Log3Func(("cbIn=%RU32, cbOut=%RU32, cSamplesLive=%RU32, rc2=%Rrc\n", cbIn, cbOut, cSamplesLive, rc2));
     548            Log3Func(("%s: cbIn=%RU32, cbOut=%RU32, cSamplesLive=%RU32, rc2=%Rrc\n",
     549                      pSink->pszName, cbIn, cbOut, cSamplesLive, rc2));
    535550        }
    536551#endif
     
    551566
    552567    return VINF_SUCCESS;
     568}
     569
     570int AudioMixerSinkUpdate(PAUDMIXSINK pSink)
     571{
     572    return audioMixerSinkUpdateInternal(pSink);
    553573}
    554574
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