- Timestamp:
- Jul 27, 2017 2:40:37 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmaudioifs.h
r68132 r68138 22 22 * You may elect to license modified versions of this file under the 23 23 * terms and conditions of either the GPL or the CDDL or both. 24 */ 25 26 /** 27 * == Audio architecture overview 28 * 29 * The audio architecture mainly consists of two PDM interfaces, PDMAUDIOCONNECTOR 30 * and PDMIHOSTAUDIO. 31 * 32 * The PDMAUDIOCONNECTOR interface is responsible of connecting a device emulation, such 33 * as SB16, AC'97 and HDA to one or multiple audio backend(s). Its API abstracts audio 34 * stream handling and I/O functions, device enumeration and so on. 35 * 36 * The PDMIHOSTAUDIO interface must be implemented by all audio backends to provide an 37 * abstract and common way of accessing needed functions, such as transferring output audio 38 * data for playing audio or recording input from the host. 39 * 40 * A device emulation can have one or more LUNs attached to it, whereas these LUNs in turn 41 * then all have their own PDMIAUDIOCONNECTOR, making it possible to connect multiple backends 42 * to a certain device emulation stream (multiplexing). 43 * 44 * An audio backend's job is to record and/or play audio data (depending on its capabilities). 45 * It highly depends on the host it's running on and needs very specific (host-OS-dependent) code. 46 * The backend itself only has very limited ways of accessing and/or communicating with the 47 * PDMIAUDIOCONNECTOR interface via callbacks, but never directly with the device emulation or 48 * other parts of the audio sub system. 49 * 50 * 51 * == Mixing 52 * 53 * The AUDIOMIXER API is optionally available to create and manage virtual audio mixers. 54 * Such an audio mixer in turn then can be used by the device emulation code to manage all 55 * the multiplexing to/from the connected LUN audio streams. 56 * 57 * Currently only input and output stream are supported. Duplex stream are not supported yet. 58 * 59 * This also is handy if certain LUN audio streams should be added or removed during runtime. 60 * 61 * To create a group of either input or output streams the AUDMIXSINK API can be used. 62 * 63 * For example: The device emulation has one hardware output stream (HW0), and that output 64 * stream shall be available to all connected LUN backends. For that to happen, 65 * an AUDMIXSINK sink has to be created and attached to the device's AUDIOMIXER object. 66 * 67 * As every LUN has its own AUDMIXSTREAM object, adding all those objects to the 68 * just created audio mixer sink will do the job. 69 * 70 * Note: The AUDIOMIXER API is purely optional and is not used by all currently implemented 71 * device emulations (e.g. SB16). 72 * 73 * 74 * == Data processing 75 * 76 * Audio input / output data gets handed-off to/from the device emulation in an unmodified 77 * - that is, raw - way. The actual audio frame / sample conversion is done via the PDMAUDIOMIXBUF API. 78 * 79 * This concentrates the audio data processing in one place and makes it easier to test / benchmark 80 * such code. 81 * 82 * A PDMAUDIOFRAME is the internal representation of a single audio frame, which consists of a single left 83 * and right audio sample in time. Only mono (1) and stereo (2) channel(s) currently are supported. 84 * 85 * 86 * == Diagram 87 * 88 * +-------------------------+ 89 * +-------------------------+ +-------------------------+ +-------------------+ 90 * |PDMAUDIOSTREAM | |PDMAUDIOCONNECTOR | + ++|LUN | 91 * |-------------------------| |-------------------------| | |||-------------------| 92 * |PDMAUDIOMIXBUF |+------>|PDMAUDIOSTREAM Host |+---|-|||PDMIAUDIOCONNECTOR | 93 * |PDMAUDIOSTREAMCFG |+------>|PDMAUDIOSTREAM Guest | | |||AUDMIXSTREAM | 94 * | | |Device capabilities | | ||| | 95 * | | |Device configuration | | ||| | 96 * | | | | | ||| | 97 * | | +|PDMIHOSTAUDIO | | ||| | 98 * | | ||+-----------------------+| | ||+-------------------+ 99 * +-------------------------+ |||Backend storage space || | || 100 * ||+-----------------------+| | || 101 * |+-------------------------+ | || 102 * | | || 103 * +---------------------+ | | || 104 * |PDMIHOSTAUDIO | | | || 105 * |+--------------+ | | +-------------------+ | || +-------------+ 106 * ||DirectSound | | | |AUDMIXSINK | | || |AUDIOMIXER | 107 * |+--------------+ | | |-------------------| | || |-------------| 108 * | | | |AUDMIXSTREAM0 |+---|-||----->|AUDMIXSINK0 | 109 * |+--------------+ | | |AUDMIXSTREAM1 |+---|-||----->|AUDMIXSINK1 | 110 * ||PulseAudio | | | |AUDMIXSTREAMn |+---|-||----->|AUDMIXSINKn | 111 * |+--------------+ |+----------+ +-------------------+ | || +-------------+ 112 * | | | || 113 * |+--------------+ | | || 114 * ||Core Audio | | | || 115 * |+--------------+ | | || 116 * | | | || 117 * | | | ||+----------------------------------+ 118 * | | | |||Device (SB16 / AC'97 / HDA) | 119 * | | | |||----------------------------------| 120 * +---------------------+ | |||AUDIOMIXER (Optional) | 121 * | |||AUDMIXSINK0 (Optional) | 122 * | |||AUDMIXSINK1 (Optional) | 123 * | |||AUDMIXSINKn (Optional) | 124 * | ||| | 125 * | |+|LUN0 | 126 * | ++|LUN1 | 127 * +--+|LUNn | 128 * | | 129 * | | 130 * | | 131 * +----------------------------------+ 24 132 */ 25 133
Note:
See TracChangeset
for help on using the changeset viewer.