VirtualBox

Changeset 76700 in vbox for trunk


Ignore:
Timestamp:
Jan 8, 2019 10:14:41 AM (6 years ago)
Author:
vboxsync
Message:

Audio/AC97: Added support for adaptive device scheduling rates based on the stream's given Hz rate.

File:
1 edited

Legend:

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

    r76553 r76700  
    19631963    PAUDMIXSINK pMixSink = NULL;
    19641964
    1965     /* Set scheduling hint (if available). */
    1966     if (pThis->uTimerHz)
    1967         Cfg.Device.uSchedulingHintMs = 1000 /* ms */ / pThis->uTimerHz;
    1968 
    19691965    Cfg.Props.cChannels = 2;
    19701966    Cfg.Props.cBytes    = 2 /* 16-bit */;
     
    20442040
    20452041                /*
    2046                  * Set the stream's timer Hz rate.
    2047                  *
    2048                  * Currently we simply apply the global Hz rate.
    2049                  * This might needs tweaking as we add surround support and/or channel striping later. */
    2050                 pStream->State.uTimerHz = pThis->uTimerHz;
     2042                 * Set the stream's timer Hz rate, based on the PCM properties Hz rate.
     2043                 */
     2044                if (pThis->uTimerHz == AC97_TIMER_HZ_DEFAULT) /* Make sure that we don't have any custom Hz rate set we want to enforce */
     2045                {
     2046                    if (Cfg.Props.uHz > 44100) /* E.g. 48000 Hz. */
     2047                        pStream->State.uTimerHz = 200;
     2048                    else /* Just take the global Hz rate otherwise. */
     2049                        pStream->State.uTimerHz = pThis->uTimerHz;
     2050                }
     2051                else
     2052                    pStream->State.uTimerHz = pThis->uTimerHz;
     2053
     2054                /* Set scheduling hint (if available). */
     2055                if (pStream->State.uTimerHz)
     2056                    Cfg.Device.uSchedulingHintMs = 1000 /* ms */ / pStream->State.uTimerHz;
    20512057
    20522058                /*
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