VirtualBox

Changeset 89801 in vbox for trunk/src/VBox/Devices/Audio


Ignore:
Timestamp:
Jun 21, 2021 12:42:48 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145258
Message:

pdmaudioifs.h,AudioMix*h: Documentation. bugref:9890

Location:
trunk/src/VBox/Devices/Audio
Files:
3 edited

Legend:

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

    r89768 r89801  
    1616 */
    1717
    18 /** @page pg_audio_mix_buffer   Audio Mixer Buffer
    19  *
    20  * @section sec_audio_mix_buffer_volume     Soft Volume Control
     18/** @page pg_audio_mixing_buffers   Audio Mixer Buffer
     19 *
     20 * @section pg_audio_mixing_buffers_volume     Soft Volume Control
    2121 *
    2222 * The external code supplies an 8-bit volume (attenuation) value in the
  • trunk/src/VBox/Devices/Audio/AudioMixBuffer.h

    r89800 r89801  
    2525#include <VBox/vmm/pdmaudioifs.h>
    2626
    27 /** @defgroup grp_pdm_ifs_audio_mixer_buffers   Audio Mixing Buffers
     27/** @defgroup grp_pdm_ifs_audio_mixing_buffers   Audio Mixing Buffers
    2828 * @ingroup grp_pdm_ifs_audio_mixing
    2929 *
  • trunk/src/VBox/Devices/Audio/AudioMixer.cpp

    r89779 r89801  
    22/** @file
    33 * Audio mixing routines for multiplexing audio sources in device emulations.
    4  *
    5  * Overview
    6  * ========
    7  *
    8  * This mixer acts as a layer between the audio connector interface and
    9  * the actual device emulation, providing mechanisms for audio sources (input)
    10  * and audio sinks (output).
    11  *
    12  * Think of this mixer as kind of a high(er) level interface for the audio
    13  * connector interface, abstracting common tasks such as creating and managing
    14  * various audio sources and sinks. This mixer class is purely optional and can
    15  * be left out when implementing a new device emulation, using only the audi
    16  * connector interface instead.  For example, the SB16 emulation does not use
    17  * this mixer and does all its stream management on its own.
    18  *
    19  * As audio driver instances are handled as LUNs on the device level, this
    20  * audio mixer then can take care of e.g. mixing various inputs/outputs to/from
    21  * a specific source/sink.
    22  *
    23  * How and which audio streams are connected to sinks/sources depends on how
    24  * the audio mixer has been set up.
    25  *
    26  * A sink can connect multiple output streams together, whereas a source
    27  * does this with input streams. Each sink / source consists of one or more
    28  * so-called mixer streams, which then in turn have pointers to the actual
    29  * PDM audio input/output streams.
    30  *
    31  * Playback
    32  * ========
    33  *
    34  * For output sinks there can be one or more mixing stream attached.
    35  * As the host sets the overall pace for the device emulation (virtual time
    36  * in the guest OS vs. real time on the host OS), an output mixing sink
    37  * needs to make sure that all connected output streams are able to accept
    38  * all the same amount of data at a time.
    39  *
    40  * This is called synchronous multiplexing.
    41  *
    42  * A mixing sink employs an own audio mixing buffer, which in turn can convert
    43  * the audio (output) data supplied from the device emulation into the sink's
    44  * audio format. As all connected mixing streams in theory could have the same
    45  * audio format as the mixing sink (parent), this can save processing time when
    46  * it comes to serving a lot of mixing streams at once. That way only one
    47  * conversion must be done, instead of each stream having to iterate over the
    48  * data.
    49  *
    50  * Recording
    51  * =========
    52  *
    53  * For input sinks only one mixing stream at a time can be the recording
    54  * source currently. A recording source is optional, e.g. it is possible to
    55  * have no current recording source set. Switching to a different recording
    56  * source at runtime is possible.
    574 */
    585
     
    6916 */
    7017
     18/** @page pg_audio_mixer    Audio Mixer
     19 *
     20 * Overview
     21 * ========
     22 *
     23 * This mixer acts as a layer between the audio connector interface and the
     24 * actual device emulation, providing mechanisms for audio input sinks (sometime
     25 * referred to as audio sources) and audio output sinks.
     26 *
     27 * Think of this mixer as kind of a higher level interface for the audio device
     28 * to use in steado of PDMIAUDIOCONNECTOR, where it works with sinks rather than
     29 * individual PDMAUDIOSTREAM instances.
     30 *
     31 * How and which audio streams are connected to the sinks depends on how the
     32 * audio mixer has been set up by the device.  Though, generally, each driver
     33 * chain (LUN) has a mixer stream for each sink.
     34 *
     35 * An output sink can connect multiple output streams together, whereas an input
     36 * sink (source) does this with input streams.  Each of these mixer stream will
     37 * in turn point to actual PDMAUDIOSTREAM instances.
     38 *
     39 * A mixing sink employs an own audio mixing buffer in a standard format (32-bit
     40 * signed) with the virtual device's rate and channel configuration.  The mixer
     41 * streams will convert to/from this as they write and read from it.
     42 *
     43 *
     44 * Playback
     45 * ========
     46 *
     47 * For output sinks there can be one or more mixing stream attached.
     48 *
     49 * The backends are the consumers here and if they don't get samples when then
     50 * need them we'll be having cracles, distortion and/or bits of silence in the
     51 * actual output.  The guest runs independently at it's on speed (see @ref
     52 * sec_pdm_audio_timing for more details) and we're just inbetween trying to
     53 * shuffle the data along as best as we can.  If one or more of the backends
     54 * for some reason isn't able to process data at a nominal speed (as defined by
     55 * the others), we'll try detect this, mark it as bad and disregard it when
     56 * calculating how much we can write to the backends in a buffer update call.
     57 *
     58 * This is called synchronous multiplexing.
     59 *
     60 *
     61 * Recording
     62 * =========
     63 *
     64 * For input sinks (sources) we blend the samples of all mixing streams
     65 * together, however ignoring silent ones to avoid too much of a hit on the
     66 * volume level.  It is otherwise very similar to playback, only the direction
     67 * is different and we don't multicast but blend.
     68 *
     69 */
    7170
    7271/*********************************************************************************************************************************
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