VirtualBox

Ignore:
Timestamp:
Apr 9, 2021 12:55:19 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143685
Message:

Audio: Eliminated the DrvAudio mixing buffers for output streams on devices without their own mixer. Changed the prebuffering to not default to the whole backend buffer size, but only 2/3 of it, so that there is room for a bit of incoming data from the device once we start playing. We don't want to have that gather in the device mixer or internal DMA buffers. This code needs some more testing and work, only tested on linux against ALSA. bugref:9890

File:
1 edited

Legend:

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

    r88357 r88433  
    9191    /** The statistics prefix. */
    9292    char                   *pszStatPrefix;
    93     /** The streams's critical section. */
    94     RTCRITSECT              CritSect;
    9593    /** Sink this stream is attached to. */
    9694    PAUDMIXSINK             pSink;
     
    103101    /** Pointer to PDM audio stream this mixer stream handles. */
    104102    PPDMAUDIOSTREAM         pStream;
     103    /** Mixing buffer peeking state & config. */
     104    AUDIOMIXBUFPEEKSTATE    PeekState;
    105105    /** Last read (recording) / written (playback) timestamp (in ns). */
    106106    uint64_t                tsLastReadWrittenNs;
    107     /** The stream's circular buffer for temporarily
    108      *  holding (raw) device audio data. */
    109     PRTCIRCBUF              pCircBuf;
    110     /** Stats: Number of bytes used in the circular buffer. */
    111     uint32_t                StatsCircBufUsed;
    112     /** Stats: Size of circular buffer. */
    113     uint32_t                StatsCircBufSize;
     107    /** The streams's critical section. */
     108    RTCRITSECT              CritSect;
    114109} AUDMIXSTREAM, *PAUDMIXSTREAM;
    115110
     
    124119#define AUDMIXSINK_STS_PENDING_DISABLE       RT_BIT(1)
    125120/** Dirty flag.
    126  *  For output sinks this means that there is data in the
    127  *  sink which has not been played yet.
    128  *  For input sinks this means that there is data in the
    129  *  sink which has been recorded but not transferred to the
    130  *  destination yet. */
     121 * - For output sinks this means that there is data in the sink which has not
     122 *   been played yet.
     123 * - For input sinks this means that there is data in the sink which has been
     124 *   recorded but not transferred to the destination yet. */
    131125#define AUDMIXSINK_STS_DIRTY                 RT_BIT(2)
    132126
    133127/**
    134128 * Audio mixer sink direction.
     129 * @todo r=bird: use PDMAUDIODIR instead.
    135130 */
    136131typedef enum AUDMIXSINKDIR
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