Changeset 89801 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Jun 21, 2021 12:42:48 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145258
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixBuffer.cpp
r89768 r89801 16 16 */ 17 17 18 /** @page pg_audio_mix _bufferAudio Mixer Buffer19 * 20 * @section sec_audio_mix_buffer_volume Soft Volume Control18 /** @page pg_audio_mixing_buffers Audio Mixer Buffer 19 * 20 * @section pg_audio_mixing_buffers_volume Soft Volume Control 21 21 * 22 22 * The external code supplies an 8-bit volume (attenuation) value in the -
trunk/src/VBox/Devices/Audio/AudioMixBuffer.h
r89800 r89801 25 25 #include <VBox/vmm/pdmaudioifs.h> 26 26 27 /** @defgroup grp_pdm_ifs_audio_mix er_buffers Audio Mixing Buffers27 /** @defgroup grp_pdm_ifs_audio_mixing_buffers Audio Mixing Buffers 28 28 * @ingroup grp_pdm_ifs_audio_mixing 29 29 * -
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r89779 r89801 2 2 /** @file 3 3 * Audio mixing routines for multiplexing audio sources in device emulations. 4 *5 * Overview6 * ========7 *8 * This mixer acts as a layer between the audio connector interface and9 * 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 audio13 * connector interface, abstracting common tasks such as creating and managing14 * various audio sources and sinks. This mixer class is purely optional and can15 * be left out when implementing a new device emulation, using only the audi16 * connector interface instead. For example, the SB16 emulation does not use17 * 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, this20 * audio mixer then can take care of e.g. mixing various inputs/outputs to/from21 * a specific source/sink.22 *23 * How and which audio streams are connected to sinks/sources depends on how24 * the audio mixer has been set up.25 *26 * A sink can connect multiple output streams together, whereas a source27 * does this with input streams. Each sink / source consists of one or more28 * so-called mixer streams, which then in turn have pointers to the actual29 * PDM audio input/output streams.30 *31 * Playback32 * ========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 time36 * in the guest OS vs. real time on the host OS), an output mixing sink37 * needs to make sure that all connected output streams are able to accept38 * 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 convert43 * the audio (output) data supplied from the device emulation into the sink's44 * audio format. As all connected mixing streams in theory could have the same45 * audio format as the mixing sink (parent), this can save processing time when46 * it comes to serving a lot of mixing streams at once. That way only one47 * conversion must be done, instead of each stream having to iterate over the48 * data.49 *50 * Recording51 * =========52 *53 * For input sinks only one mixing stream at a time can be the recording54 * source currently. A recording source is optional, e.g. it is possible to55 * have no current recording source set. Switching to a different recording56 * source at runtime is possible.57 4 */ 58 5 … … 69 16 */ 70 17 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 */ 71 70 72 71 /*********************************************************************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.