Changeset 88230 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Mar 22, 2021 9:55:26 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 143421
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 20 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r88028 r88230 74 74 #include "AudioMixer.h" 75 75 #include "AudioMixBuffer.h" 76 #include "DrvAudio .h"76 #include "DrvAudioCommon.h" 77 77 78 78 #include <VBox/vmm/pdm.h> -
trunk/src/VBox/Devices/Audio/DevHda.cpp
r88229 r88230 59 59 #include "DevHdaStreamMap.h" 60 60 61 #include "DrvAudio .h"61 #include "DrvAudioCommon.h" 62 62 63 63 -
trunk/src/VBox/Devices/Audio/DevHdaCodec.cpp
r88228 r88230 39 39 40 40 #include "VBoxDD.h" 41 #include "DrvAudio.h"42 41 #include "AudioMixer.h" 43 42 #include "DevHdaCodec.h" -
trunk/src/VBox/Devices/Audio/DevHdaCommon.cpp
r88228 r88230 24 24 #include <iprt/assert.h> 25 25 #include <iprt/errcore.h> 26 #include <iprt/time.h> 26 27 27 28 #include <VBox/AssertGuest.h> … … 29 30 #define LOG_GROUP LOG_GROUP_DEV_HDA 30 31 #include <VBox/log.h> 31 32 #include "DrvAudio.h"33 32 34 33 #include "DevHda.h" -
trunk/src/VBox/Devices/Audio/DevHdaStream.cpp
r88228 r88230 31 31 #include <VBox/vmm/pdmaudioinline.h> 32 32 33 #include "DrvAudio .h"33 #include "DrvAudioCommon.h" 34 34 35 35 #include "DevHda.h" -
trunk/src/VBox/Devices/Audio/DevHdaStreamMap.cpp
r88228 r88230 30 30 #include <iprt/string.h> 31 31 32 #include "DrvAudio .h"32 #include "DrvAudioCommon.h" 33 33 34 34 #include "DevHdaStreamChannel.h" -
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r88057 r88230 41 41 #include "AudioMixBuffer.h" 42 42 #include "AudioMixer.h" 43 #include "DrvAudio .h"43 #include "DrvAudioCommon.h" 44 44 45 45 -
trunk/src/VBox/Devices/Audio/DevSB16.cpp
r88028 r88230 63 63 #include "AudioMixBuffer.h" 64 64 #include "AudioMixer.h" 65 #include "DrvAudio .h"65 #include "DrvAudioCommon.h" 66 66 67 67 -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r88219 r88230 44 44 #include <stdlib.h> 45 45 46 #include "DrvAudio .h"46 #include "DrvAudioCommon.h" 47 47 #include "AudioMixBuffer.h" 48 49 50 /********************************************************************************************************************************* 51 * Structures and Typedefs * 52 *********************************************************************************************************************************/ 53 typedef enum 54 { 55 AUD_OPT_INT, 56 AUD_OPT_FMT, 57 AUD_OPT_STR, 58 AUD_OPT_BOOL 59 } audio_option_tag_e; 60 61 typedef struct audio_option 62 { 63 const char *name; 64 audio_option_tag_e tag; 65 void *valp; 66 const char *descr; 67 int *overridenp; 68 int overriden; 69 } audio_option; 70 71 #ifdef VBOX_WITH_STATISTICS 72 /** 73 * Structure for keeping stream statistics for the 74 * statistic manager (STAM). 75 */ 76 typedef struct DRVAUDIOSTATS 77 { 78 STAMCOUNTER TotalStreamsActive; 79 STAMCOUNTER TotalStreamsCreated; 80 STAMCOUNTER TotalFramesRead; 81 STAMCOUNTER TotalFramesWritten; 82 STAMCOUNTER TotalFramesMixedIn; 83 STAMCOUNTER TotalFramesMixedOut; 84 STAMCOUNTER TotalFramesLostIn; 85 STAMCOUNTER TotalFramesLostOut; 86 STAMCOUNTER TotalFramesOut; 87 STAMCOUNTER TotalFramesIn; 88 STAMCOUNTER TotalBytesRead; 89 STAMCOUNTER TotalBytesWritten; 90 /** How much delay (in ms) for input processing. */ 91 STAMPROFILEADV DelayIn; 92 /** How much delay (in ms) for output processing. */ 93 STAMPROFILEADV DelayOut; 94 } DRVAUDIOSTATS, *PDRVAUDIOSTATS; 95 #endif 96 97 /** 98 * Audio driver configuration data, tweakable via CFGM. 99 */ 100 typedef struct DRVAUDIOCFG 101 { 102 /** PCM properties to use. */ 103 PDMAUDIOPCMPROPS Props; 104 /** Whether using signed sample data or not. 105 * Needed in order to know whether there is a custom value set in CFGM or not. 106 * By default set to UINT8_MAX if not set to a custom value. */ 107 uint8_t uSigned; 108 /** Whether swapping endianess of sample data or not. 109 * Needed in order to know whether there is a custom value set in CFGM or not. 110 * By default set to UINT8_MAX if not set to a custom value. */ 111 uint8_t uSwapEndian; 112 /** Configures the period size (in ms). 113 * This value reflects the time in between each hardware interrupt on the 114 * backend (host) side. */ 115 uint32_t uPeriodSizeMs; 116 /** Configures the (ring) buffer size (in ms). Often is a multiple of uPeriodMs. */ 117 uint32_t uBufferSizeMs; 118 /** Configures the pre-buffering size (in ms). 119 * Time needed in buffer before the stream becomes active (pre buffering). 120 * The bigger this value is, the more latency for the stream will occur. 121 * Set to 0 to disable pre-buffering completely. 122 * By default set to UINT32_MAX if not set to a custom value. */ 123 uint32_t uPreBufSizeMs; 124 /** The driver's debugging configuration. */ 125 struct 126 { 127 /** Whether audio debugging is enabled or not. */ 128 bool fEnabled; 129 /** Where to store the debugging files. */ 130 char szPathOut[RTPATH_MAX]; 131 } Dbg; 132 } DRVAUDIOCFG, *PDRVAUDIOCFG; 133 134 /** 135 * Audio driver instance data. 136 * 137 * @implements PDMIAUDIOCONNECTOR 138 */ 139 typedef struct DRVAUDIO 140 { 141 /** Friendly name of the driver. */ 142 char szName[64]; 143 /** Critical section for serializing access. */ 144 RTCRITSECT CritSect; 145 /** Shutdown indicator. */ 146 bool fTerminate; 147 /** Our audio connector interface. */ 148 PDMIAUDIOCONNECTOR IAudioConnector; 149 /** Pointer to the driver instance. */ 150 PPDMDRVINS pDrvIns; 151 /** Pointer to audio driver below us. */ 152 PPDMIHOSTAUDIO pHostDrvAudio; 153 /** List of audio streams. */ 154 RTLISTANCHOR lstStreams; 155 #ifdef VBOX_WITH_AUDIO_ENUM 156 /** Flag indicating to perform an (re-)enumeration of the host audio devices. */ 157 bool fEnumerateDevices; 158 #endif 159 /** Audio configuration settings retrieved from the backend. */ 160 PDMAUDIOBACKENDCFG BackendCfg; 161 /** Commonly used scratch buffer. */ 162 void *pvScratchBuf; 163 /** Size (in bytes) of commonly used scratch buffer. */ 164 size_t cbScratchBuf; 165 #ifdef VBOX_WITH_STATISTICS 166 /** Statistics for the statistics manager (STAM). */ 167 DRVAUDIOSTATS Stats; 168 #endif 169 struct 170 { 171 /** Whether this driver's input streams are enabled or not. 172 * This flag overrides all the attached stream statuses. */ 173 bool fEnabled; 174 /** Max. number of free input streams. 175 * UINT32_MAX for unlimited streams. */ 176 uint32_t cStreamsFree; 177 #ifdef VBOX_WITH_AUDIO_CALLBACKS 178 RTLISTANCHOR lstCB; 179 #endif 180 /** The driver's input confguration (tweakable via CFGM). */ 181 DRVAUDIOCFG Cfg; 182 } In; 183 struct 184 { 185 /** Whether this driver's output streams are enabled or not. 186 * This flag overrides all the attached stream statuses. */ 187 bool fEnabled; 188 /** Max. number of free output streams. 189 * UINT32_MAX for unlimited streams. */ 190 uint32_t cStreamsFree; 191 #ifdef VBOX_WITH_AUDIO_CALLBACKS 192 RTLISTANCHOR lstCB; 193 #endif 194 /** The driver's output confguration (tweakable via CFGM). */ 195 DRVAUDIOCFG Cfg; 196 } Out; 197 } DRVAUDIO, *PDRVAUDIO; 198 199 /** Makes a PDRVAUDIO out of a PPDMIAUDIOCONNECTOR. */ 200 #define PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface) \ 201 ( (PDRVAUDIO)((uintptr_t)pInterface - RT_UOFFSETOF(DRVAUDIO, IAudioConnector)) ) 48 202 49 203 -
trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp
r88047 r88230 43 43 #include <stdlib.h> 44 44 45 #include "DrvAudio .h"45 #include "DrvAudioCommon.h" 46 46 #include "AudioMixBuffer.h" 47 47 -
trunk/src/VBox/Devices/Audio/DrvAudioCommon.h
r88229 r88230 16 16 */ 17 17 18 #ifndef VBOX_INCLUDED_SRC_Audio_DrvAudio _h19 #define VBOX_INCLUDED_SRC_Audio_DrvAudio _h18 #ifndef VBOX_INCLUDED_SRC_Audio_DrvAudioCommon_h 19 #define VBOX_INCLUDED_SRC_Audio_DrvAudioCommon_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 32 32 #include <VBox/vmm/pdm.h> 33 33 #include <VBox/vmm/pdmaudioifs.h> 34 35 typedef enum36 {37 AUD_OPT_INT,38 AUD_OPT_FMT,39 AUD_OPT_STR,40 AUD_OPT_BOOL41 } audio_option_tag_e;42 43 typedef struct audio_option44 {45 const char *name;46 audio_option_tag_e tag;47 void *valp;48 const char *descr;49 int *overridenp;50 int overriden;51 } audio_option;52 53 #ifdef VBOX_WITH_STATISTICS54 /**55 * Structure for keeping stream statistics for the56 * statistic manager (STAM).57 */58 typedef struct DRVAUDIOSTATS59 {60 STAMCOUNTER TotalStreamsActive;61 STAMCOUNTER TotalStreamsCreated;62 STAMCOUNTER TotalFramesRead;63 STAMCOUNTER TotalFramesWritten;64 STAMCOUNTER TotalFramesMixedIn;65 STAMCOUNTER TotalFramesMixedOut;66 STAMCOUNTER TotalFramesLostIn;67 STAMCOUNTER TotalFramesLostOut;68 STAMCOUNTER TotalFramesOut;69 STAMCOUNTER TotalFramesIn;70 STAMCOUNTER TotalBytesRead;71 STAMCOUNTER TotalBytesWritten;72 /** How much delay (in ms) for input processing. */73 STAMPROFILEADV DelayIn;74 /** How much delay (in ms) for output processing. */75 STAMPROFILEADV DelayOut;76 } DRVAUDIOSTATS, *PDRVAUDIOSTATS;77 #endif78 79 /**80 * Audio driver configuration data, tweakable via CFGM.81 */82 typedef struct DRVAUDIOCFG83 {84 /** PCM properties to use. */85 PDMAUDIOPCMPROPS Props;86 /** Whether using signed sample data or not.87 * Needed in order to know whether there is a custom value set in CFGM or not.88 * By default set to UINT8_MAX if not set to a custom value. */89 uint8_t uSigned;90 /** Whether swapping endianess of sample data or not.91 * Needed in order to know whether there is a custom value set in CFGM or not.92 * By default set to UINT8_MAX if not set to a custom value. */93 uint8_t uSwapEndian;94 /** Configures the period size (in ms).95 * This value reflects the time in between each hardware interrupt on the96 * backend (host) side. */97 uint32_t uPeriodSizeMs;98 /** Configures the (ring) buffer size (in ms). Often is a multiple of uPeriodMs. */99 uint32_t uBufferSizeMs;100 /** Configures the pre-buffering size (in ms).101 * Time needed in buffer before the stream becomes active (pre buffering).102 * The bigger this value is, the more latency for the stream will occur.103 * Set to 0 to disable pre-buffering completely.104 * By default set to UINT32_MAX if not set to a custom value. */105 uint32_t uPreBufSizeMs;106 /** The driver's debugging configuration. */107 struct108 {109 /** Whether audio debugging is enabled or not. */110 bool fEnabled;111 /** Where to store the debugging files. */112 char szPathOut[RTPATH_MAX];113 } Dbg;114 } DRVAUDIOCFG, *PDRVAUDIOCFG;115 116 /**117 * Audio driver instance data.118 *119 * @implements PDMIAUDIOCONNECTOR120 */121 typedef struct DRVAUDIO122 {123 /** Friendly name of the driver. */124 char szName[64];125 /** Critical section for serializing access. */126 RTCRITSECT CritSect;127 /** Shutdown indicator. */128 bool fTerminate;129 /** Our audio connector interface. */130 PDMIAUDIOCONNECTOR IAudioConnector;131 /** Pointer to the driver instance. */132 PPDMDRVINS pDrvIns;133 /** Pointer to audio driver below us. */134 PPDMIHOSTAUDIO pHostDrvAudio;135 /** List of audio streams. */136 RTLISTANCHOR lstStreams;137 #ifdef VBOX_WITH_AUDIO_ENUM138 /** Flag indicating to perform an (re-)enumeration of the host audio devices. */139 bool fEnumerateDevices;140 #endif141 /** Audio configuration settings retrieved from the backend. */142 PDMAUDIOBACKENDCFG BackendCfg;143 /** Commonly used scratch buffer. */144 void *pvScratchBuf;145 /** Size (in bytes) of commonly used scratch buffer. */146 size_t cbScratchBuf;147 #ifdef VBOX_WITH_STATISTICS148 /** Statistics for the statistics manager (STAM). */149 DRVAUDIOSTATS Stats;150 #endif151 struct152 {153 /** Whether this driver's input streams are enabled or not.154 * This flag overrides all the attached stream statuses. */155 bool fEnabled;156 /** Max. number of free input streams.157 * UINT32_MAX for unlimited streams. */158 uint32_t cStreamsFree;159 #ifdef VBOX_WITH_AUDIO_CALLBACKS160 RTLISTANCHOR lstCB;161 #endif162 /** The driver's input confguration (tweakable via CFGM). */163 DRVAUDIOCFG Cfg;164 } In;165 struct166 {167 /** Whether this driver's output streams are enabled or not.168 * This flag overrides all the attached stream statuses. */169 bool fEnabled;170 /** Max. number of free output streams.171 * UINT32_MAX for unlimited streams. */172 uint32_t cStreamsFree;173 #ifdef VBOX_WITH_AUDIO_CALLBACKS174 RTLISTANCHOR lstCB;175 #endif176 /** The driver's output confguration (tweakable via CFGM). */177 DRVAUDIOCFG Cfg;178 } Out;179 } DRVAUDIO, *PDRVAUDIO;180 181 /** Makes a PDRVAUDIO out of a PPDMIAUDIOCONNECTOR. */182 #define PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface) \183 ( (PDRVAUDIO)((uintptr_t)pInterface - RT_UOFFSETOF(DRVAUDIO, IAudioConnector)) )184 34 185 35 /** @name Audio calculation helper methods. … … 224 74 #define AUDIO_MAKE_FOURCC(c0, c1, c2, c3) RT_H2LE_U32_C(RT_MAKE_U32_FROM_U8(c0, c1, c2, c3)) 225 75 226 #endif /* !VBOX_INCLUDED_SRC_Audio_DrvAudio _h */76 #endif /* !VBOX_INCLUDED_SRC_Audio_DrvAudioCommon_h */ 227 77 -
trunk/src/VBox/Devices/Audio/DrvHostAudioAlsa.cpp
r88226 r88230 60 60 #include <alsa/control.h> /* For device enumeration. */ 61 61 62 #include "DrvAudio.h"63 62 #include "VBoxDD.h" 64 63 -
trunk/src/VBox/Devices/Audio/DrvHostAudioCoreAudio.cpp
r88226 r88230 25 25 #include <VBox/vmm/pdmaudiohostenuminline.h> 26 26 27 #include "DrvAudio.h"28 27 #include "VBoxDD.h" 29 28 -
trunk/src/VBox/Devices/Audio/DrvHostAudioDSound.cpp
r88226 r88230 33 33 #include <VBox/vmm/pdmaudiohostenuminline.h> 34 34 35 #include "DrvAudio.h"36 35 #include "VBoxDD.h" 37 36 #ifdef VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT -
trunk/src/VBox/Devices/Audio/DrvHostAudioDebug.cpp
r88226 r88230 29 29 #include <VBox/vmm/pdmaudioinline.h> 30 30 31 #include "DrvAudio .h"31 #include "DrvAudioCommon.h" 32 32 #include "VBoxDD.h" 33 33 -
trunk/src/VBox/Devices/Audio/DrvHostAudioNull.cpp
r88226 r88230 55 55 #include <VBox/vmm/pdmaudioinline.h> 56 56 57 #include "DrvAudio.h"58 57 #include "VBoxDD.h" 59 58 -
trunk/src/VBox/Devices/Audio/DrvHostAudioOss.cpp
r88226 r88230 31 31 #include <VBox/vmm/pdmaudioinline.h> 32 32 33 #include "DrvAudio.h"34 33 #include "VBoxDD.h" 35 34 -
trunk/src/VBox/Devices/Audio/DrvHostAudioPulseAudio.cpp
r88226 r88230 37 37 #include <pulse/pulseaudio.h> 38 38 39 #include "DrvAudio.h"40 39 #include "VBoxDD.h" 41 40 -
trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp
r88226 r88230 25 25 #include <VBox/vmm/pdmaudioinline.h> 26 26 27 #include "DrvAudio .h"27 #include "DrvAudioCommon.h" 28 28 #include "VBoxDD.h" 29 29 -
trunk/src/VBox/Devices/Audio/VBoxMMNotificationClient.h
r83239 r88230 37 37 #include <Mmdeviceapi.h> 38 38 39 #include "DrvAudio.h"40 39 41 40 class VBoxMMNotificationClient : IMMNotificationClient -
trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp
r88112 r88230 31 31 32 32 #include "../AudioMixBuffer.h" 33 #include "../DrvAudio .h"33 #include "../DrvAudioCommon.h" 34 34 35 35
Note:
See TracChangeset
for help on using the changeset viewer.