Changeset 95364 in vbox
- Timestamp:
- Jun 24, 2022 4:51:21 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 151958
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/settings.h
r94981 r95364 1427 1427 std::list<xml::ElementNode*> *pllElementsWithUuidAttributes); 1428 1428 1429 static bool isAudioDriverAllowedOnThisHost(AudioDriverType_T drv);1429 static bool isAudioDriverAllowedOnThisHost(AudioDriverType_T enmDrvType); 1430 1430 static AudioDriverType_T getHostDefaultAudioDriver(); 1431 1431 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r95140 r95364 2159 2159 switch (enmDrvType) 2160 2160 { 2161 case AudioDriverType_Default: 2162 if (details == VMINFO_MACHINEREADABLE) 2163 pszDrv = "default"; 2164 else 2165 pszDrv = Info::tr("Default"); 2166 break; 2161 2167 case AudioDriverType_Null: 2162 2168 if (details == VMINFO_MACHINEREADABLE) … … 2164 2170 else 2165 2171 pszDrv = Info::tr("Null"); 2166 break;2167 case AudioDriverType_WinMM:2168 if (details == VMINFO_MACHINEREADABLE)2169 pszDrv = "winmm";2170 else2171 pszDrv = "WINMM";2172 break;2173 case AudioDriverType_DirectSound:2174 if (details == VMINFO_MACHINEREADABLE)2175 pszDrv = "dsound";2176 else2177 pszDrv = "DSOUND";2178 2172 break; 2179 2173 case AudioDriverType_OSS: … … 2194 2188 else 2195 2189 pszDrv = "PulseAudio"; 2190 break; 2191 case AudioDriverType_WinMM: 2192 if (details == VMINFO_MACHINEREADABLE) 2193 pszDrv = "winmm"; 2194 else 2195 pszDrv = "WINMM"; 2196 break; 2197 case AudioDriverType_DirectSound: 2198 if (details == VMINFO_MACHINEREADABLE) 2199 pszDrv = "dsound"; 2200 else 2201 pszDrv = "DirectSound"; 2202 break; 2203 case AudioDriverType_WAS: 2204 if (details == VMINFO_MACHINEREADABLE) 2205 pszDrv = "was"; 2206 else 2207 pszDrv = "Windows Audio Session (WAS)"; 2196 2208 break; 2197 2209 case AudioDriverType_CoreAudio: -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r95178 r95364 844 844 switch (enmAudio) 845 845 { 846 case AudioDriverType_Null: psz = List::tr("Null"); break; 847 case AudioDriverType_WinMM: psz = "WinMM"; break; 848 case AudioDriverType_OSS: psz = "OSS"; break; 849 case AudioDriverType_ALSA: psz = "ALSA"; break; 850 case AudioDriverType_DirectSound: psz = "DirectSound"; break; 851 case AudioDriverType_CoreAudio: psz = "CoreAudio"; break; 852 case AudioDriverType_MMPM: psz = "MMPM"; break; 853 case AudioDriverType_Pulse: psz = "Pulse"; break; 854 case AudioDriverType_SolAudio: psz = "SolAudio"; break; 846 case AudioDriverType_Default: psz = List::tr("Default"); break; 847 case AudioDriverType_Null: psz = List::tr("Null"); break; 848 case AudioDriverType_OSS: psz = "OSS"; break; 849 case AudioDriverType_ALSA: psz = "ALSA"; break; 850 case AudioDriverType_Pulse: psz = "PulseAudio"; break; 851 case AudioDriverType_WinMM: psz = "WinMM"; break; 852 case AudioDriverType_DirectSound: psz = "DirectSound"; break; 853 case AudioDriverType_WAS: psz = "Windows Audio Session"; break; 854 case AudioDriverType_CoreAudio: psz = "CoreAudio"; break; 855 case AudioDriverType_SolAudio: psz = "SolAudio"; break; 856 case AudioDriverType_MMPM: psz = "MMPM"; break; 855 857 default: psz = List::tr("Unknown"); 856 858 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r95140 r95364 2576 2576 * saved state. The GUI also might learn this trick if it doesn't use it 2577 2577 * already. */ 2578 2579 2578 /* disable? */ 2580 2579 if (!RTStrICmp(ValueUnion.psz, "none")) 2581 2580 { 2582 2581 CHECK_ERROR(audioAdapter, COMSETTER(Enabled)(false)); 2582 } 2583 else if (!RTStrICmp(ValueUnion.psz, "default")) 2584 { 2585 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_Default)); 2586 CHECK_ERROR(audioAdapter, COMSETTER(Enabled)(true)); 2583 2587 } 2584 2588 else if (!RTStrICmp(ValueUnion.psz, "null")) … … 2598 2602 { 2599 2603 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_DirectSound)); 2604 CHECK_ERROR(audioAdapter, COMSETTER(Enabled)(true)); 2605 } 2606 else if (!RTStrICmp(ValueUnion.psz, "was")) 2607 { 2608 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_was)); 2600 2609 CHECK_ERROR(audioAdapter, COMSETTER(Enabled)(true)); 2601 2610 } -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendCOM.cpp
r94595 r95364 530 530 switch (type) 531 531 { 532 case KAudioDriverType_Default: return QApplication::translate("UICommon", "Default", "AudioDriverType"); 532 533 case KAudioDriverType_Null: return QApplication::translate("UICommon", "Null Audio", "AudioDriverType"); 533 case KAudioDriverType_WinMM: return QApplication::translate("UICommon", "Windows Multimedia", "AudioDriverType");534 534 case KAudioDriverType_OSS: return QApplication::translate("UICommon", "OSS Audio", "AudioDriverType"); 535 535 case KAudioDriverType_ALSA: return QApplication::translate("UICommon", "ALSA Audio", "AudioDriverType"); 536 case KAudioDriverType_Pulse: return QApplication::translate("UICommon", "PulseAudio", "AudioDriverType"); 537 case KAudioDriverType_WinMM: return QApplication::translate("UICommon", "Windows Multimedia", "AudioDriverType"); 536 538 case KAudioDriverType_DirectSound: return QApplication::translate("UICommon", "Windows DirectSound", "AudioDriverType"); 539 case KAudioDriverType_WAS: return QApplication::translate("UICommon", "Windows Audio Session", "AudioDriverType"); 537 540 case KAudioDriverType_CoreAudio: return QApplication::translate("UICommon", "Core Audio", "AudioDriverType"); 538 541 // case KAudioDriverType_MMPM: 539 case KAudioDriverType_Pulse: return QApplication::translate("UICommon", "PulseAudio", "AudioDriverType");540 542 case KAudioDriverType_SolAudio: return QApplication::translate("UICommon", "Solaris Audio", "AudioDriverType"); 541 543 default: AssertMsgFailed(("No text for %d", type)); break; … … 548 550 { 549 551 QHash<QString, KAudioDriverType> list; 550 list.insert(QApplication::translate("UICommon", "Null Audio", "AudioDriverType"), KAudioDriverType_Null); 551 list.insert(QApplication::translate("UICommon", "Windows Multimedia", "AudioDriverType"), KAudioDriverType_WinMM); 552 list.insert(QApplication::translate("UICommon", "OSS Audio", "AudioDriverType"), KAudioDriverType_OSS); 553 list.insert(QApplication::translate("UICommon", "ALSA Audio", "AudioDriverType"), KAudioDriverType_ALSA); 554 list.insert(QApplication::translate("UICommon", "Windows DirectSound", "AudioDriverType"), KAudioDriverType_DirectSound); 555 list.insert(QApplication::translate("UICommon", "Core Audio", "AudioDriverType"), KAudioDriverType_CoreAudio); 552 list.insert(QApplication::translate("UICommon", "Default", "AudioDriverType"), KAudioDriverType_Default); 553 list.insert(QApplication::translate("UICommon", "Null Audio", "AudioDriverType"), KAudioDriverType_Null); 554 list.insert(QApplication::translate("UICommon", "OSS Audio", "AudioDriverType"), KAudioDriverType_OSS); 555 list.insert(QApplication::translate("UICommon", "ALSA Audio", "AudioDriverType"), KAudioDriverType_ALSA); 556 list.insert(QApplication::translate("UICommon", "PulseAudio", "AudioDriverType"), KAudioDriverType_Pulse); 557 list.insert(QApplication::translate("UICommon", "Windows Multimedia", "AudioDriverType"), KAudioDriverType_WinMM); 558 list.insert(QApplication::translate("UICommon", "Windows DirectSound", "AudioDriverType"), KAudioDriverType_DirectSound); 559 list.insert(QApplication::translate("UICommon", "Windows Audio Session", "AudioDriverType"), KAudioDriverType_WAS); 560 list.insert(QApplication::translate("UICommon", "Core Audio", "AudioDriverType"), KAudioDriverType_CoreAudio); 556 561 // list.insert(..., KAudioDriverType_MMPM); 557 list.insert(QApplication::translate("UICommon", "PulseAudio", "AudioDriverType"), KAudioDriverType_Pulse); 558 list.insert(QApplication::translate("UICommon", "Solaris Audio", "AudioDriverType"), KAudioDriverType_SolAudio); 562 list.insert(QApplication::translate("UICommon", "Solaris Audio", "AudioDriverType"), KAudioDriverType_SolAudio); 559 563 if (!list.contains(strType)) 560 564 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r95274 r95364 23014 23014 <enum 23015 23015 name="AudioDriverType" 23016 uuid=" 4bcc3d73-c2fe-40db-b72f-0c2ca9d68496"23016 uuid="32b4acfd-79ab-4b7e-9a1c-92e99f4e000b" 23017 23017 > 23018 23018 <desc> … … 23020 23020 </desc> 23021 23021 23022 <const name="Null" value="0"> 23022 <const name="Default" value="0"> 23023 <desc>Use the default audio driver automatically determined for the host 23024 that this VirtualBox instance is running on. 23025 Useful for VMs which need to run on different host OSes. 23026 <note> 23027 Currently not implemented yet; the Null audio driver will be used instead. 23028 </note> 23029 </desc> 23030 </const> 23031 <!-- When changing the enum anyway, keep the enum grouped per platforms, starting 23032 from oldest audio stack to newest one (if possible). --> 23033 <const name="Null" value="1"> 23023 23034 <desc>Null value, also means "dummy audio driver".</desc> 23024 </const>23025 <const name="WinMM" value="1">23026 <desc>Windows multimedia (Windows hosts only, not supported at the moment).</desc>23027 23035 </const> 23028 23036 <const name="OSS" value="2"> … … 23032 23040 <desc>Advanced Linux Sound Architecture (Linux hosts only).</desc> 23033 23041 </const> 23034 <const name="DirectSound" value="4"> 23042 <const name="Pulse" value="4"> 23043 <desc>PulseAudio (Linux hosts only).</desc> 23044 </const> 23045 <const name="WinMM" value="5"> 23046 <desc>Windows multimedia (Windows hosts only, not supported at the moment).</desc> 23047 </const> 23048 <const name="DirectSound" value="6"> 23035 23049 <desc>DirectSound (Windows hosts only).</desc> 23036 23050 </const> 23037 <const name="CoreAudio" value="5"> 23051 <const name="WAS" value="7"> 23052 <desc>Windows Audio Session (Windows hosts only).</desc> 23053 </const> 23054 <const name="CoreAudio" value="8"> 23038 23055 <desc>CoreAudio (Mac hosts only).</desc> 23039 23056 </const> 23040 <const name="MMPM" value=" 6">23057 <const name="MMPM" value="9"> 23041 23058 <desc>Reserved for historical reasons.</desc> 23042 23059 </const> 23043 <const name="Pulse" value="7"> 23044 <desc>PulseAudio (Linux hosts only).</desc> 23045 </const> 23046 <const name="SolAudio" value="8"> 23047 <desc>Solaris audio (Solaris hosts only, not supported at the moment).</desc> 23060 <const name="SolAudio" value="10"> 23061 <desc>Reserved for historical reasons.</desc> 23048 23062 </const> 23049 23063 </enum> -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r95256 r95364 75 75 #include <VBox/err.h> 76 76 #include <VBox/param.h> 77 #include <VBox/settings.h> /* For MachineConfigFile::getHostDefaultAudioDriver(). */ 77 78 #include <VBox/vmm/pdmapi.h> /* For PDMR3DriverAttach/PDMR3DriverDetach. */ 78 79 #include <VBox/vmm/pdmusb.h> /* For PDMR3UsbCreateEmulatedDevice. */ … … 3200 3201 AudioDriverType_T enmAudioDriver; 3201 3202 hrc = audioAdapter->COMGETTER(AudioDriver)(&enmAudioDriver); H(); 3203 3204 /* The "Default" audio driver needs special treatment, as we need to figure out which driver to use 3205 * by default on the current platform. */ 3206 bool const fUseDefaultDrv = enmAudioDriver == AudioDriverType_Default; 3207 3208 AudioDriverType_T const enmDefaultAudioDriver = settings::MachineConfigFile::getHostDefaultAudioDriver(); 3209 3210 if (fUseDefaultDrv) 3211 { 3212 enmAudioDriver = enmDefaultAudioDriver; 3213 if (enmAudioDriver == AudioDriverType_Null) 3214 LogRel(("Audio: Warning: No default driver detected for current platform -- defaulting to Null audio backend\n")); 3215 } 3216 3202 3217 switch (enmAudioDriver) 3203 3218 { 3219 case AudioDriverType_Default: /* Can't happen, but handle it anyway. */ 3220 RT_FALL_THROUGH(); 3204 3221 case AudioDriverType_Null: 3205 3222 pszAudioDriver = "NullAudio"; … … 3212 3229 # endif 3213 3230 case AudioDriverType_DirectSound: 3214 /* Use the windows audio session (WAS) API rather than Direct Sound on windows3231 /* Use the Windows Audio Session (WAS) API rather than Direct Sound on Windows 3215 3232 versions we've tested it on (currently W7+). Since Vista, Direct Sound has 3216 3233 been emulated on top of WAS according to the docs, so better use WAS directly. 3217 3234 3218 Set extradata value "VBoxInternal2/Audio/WindowsDrv" "dsound" to no use WasAPI. */ 3219 pszAudioDriver = "DSoundAudio"; 3235 Set extradata value "VBoxInternal2/Audio/WindowsDrv" "dsound" to no use WasAPI. 3236 3237 Keep this hack for backwards compatibility (introduced < 7.0). 3238 */ 3220 3239 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/Audio/WindowsDrv", &strTmp); H(); 3221 if ( RTSystemGetNtVersion() >= RTSYSTEM_MAKE_NT_VERSION(6,1,0)3240 if ( enmDefaultAudioDriver == AudioDriverType_WAS 3222 3241 && ( strTmp.isEmpty() 3223 3242 || strTmp.equalsIgnoreCase("was") 3224 3243 || strTmp.equalsIgnoreCase("wasapi")) ) 3244 { 3245 /* Nothing to do here, fall through to WAS driver. */ 3246 } 3247 else 3248 { 3249 pszAudioDriver = "DSoundAudio"; 3250 break; 3251 } 3252 RT_FALL_THROUGH(); 3253 case AudioDriverType_WAS: 3254 if (enmDefaultAudioDriver == AudioDriverType_WAS) /* WAS supported? */ 3225 3255 pszAudioDriver = "HostAudioWas"; 3256 else if (enmDefaultAudioDriver == AudioDriverType_DirectSound) 3257 { 3258 LogRel(("Audio: Warning: Windows Audio Session (WAS) not supported, defaulting to DirectSound backend\n")); 3259 pszAudioDriver = "DSoundAudio"; 3260 } 3226 3261 break; 3227 3262 #endif /* RT_OS_WINDOWS */ … … 3230 3265 /* Should not happen, as the Solaris Audio backend is not around anymore. 3231 3266 * Remove this sometime later. */ 3232 LogRel(("Audio: W ARNING: Solaris Audio is deprecated, please switch to OSS!\n"));3267 LogRel(("Audio: Warning: Solaris Audio is deprecated, please switch to OSS!\n")); 3233 3268 LogRel(("Audio: Automatically setting host audio backend to OSS\n")); 3234 3269 … … 3261 3296 AssertFailedBreak(); 3262 3297 } 3298 3299 if (fUseDefaultDrv) 3300 LogRel(("Audio: Detected default audio driver type is '%s'\n", pszAudioDriver)); 3263 3301 } 3264 3302 -
trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp
r94714 r95364 1793 1793 static const AudioDriverType_T aAudioDriverTypes[] = 1794 1794 { 1795 AudioDriverType_Default, 1795 1796 #ifdef RT_OS_WINDOWS 1796 1797 # if 0 /* deprecated for many years now */ 1797 1798 AudioDriverType_WinMM, 1798 1799 # endif 1800 AudioDriverType_WAS, 1799 1801 AudioDriverType_DirectSound, 1800 1802 #endif -
trunk/src/VBox/Main/xml/Settings.cpp
r95338 r95364 4605 4605 // settings before 1.3 used lower case so make sure this is case-insensitive 4606 4606 strTemp.toUpper(); 4607 if (strTemp == "NULL") 4607 if (strTemp == "DEFAULT") 4608 aa.driverType = AudioDriverType_Default; 4609 else if (strTemp == "NULL") 4608 4610 aa.driverType = AudioDriverType_Null; 4611 else if (strTemp == "WAS") 4612 aa.driverType = AudioDriverType_WAS; 4609 4613 else if (strTemp == "WINMM") 4610 4614 aa.driverType = AudioDriverType_WinMM; … … 4621 4625 else if (strTemp == "COREAUDIO") 4622 4626 aa.driverType = AudioDriverType_CoreAudio; 4623 else if (strTemp == "MMPM") 4627 else if (strTemp == "MMPM") /* Deprecated; only kept for backwards compatibility. */ 4624 4628 aa.driverType = AudioDriverType_MMPM; 4625 4629 else … … 7314 7318 switch (hw.audioAdapter.driverType) 7315 7319 { 7320 case AudioDriverType_Default: pcszDriver = "Default"; break; 7316 7321 case AudioDriverType_WinMM: pcszDriver = "WinMM"; break; 7317 7322 case AudioDriverType_DirectSound: pcszDriver = "DirectSound"; break; 7323 case AudioDriverType_WAS: pcszDriver = "WAS"; break; 7324 case AudioDriverType_ALSA: pcszDriver = "ALSA"; break; 7325 case AudioDriverType_OSS: pcszDriver = "OSS"; break; 7326 case AudioDriverType_Pulse: pcszDriver = "Pulse"; break; 7327 case AudioDriverType_CoreAudio: pcszDriver = "CoreAudio"; break; 7318 7328 case AudioDriverType_SolAudio: pcszDriver = "SolAudio"; break; 7319 case AudioDriverType_ALSA: pcszDriver = "ALSA"; break;7320 case AudioDriverType_Pulse: pcszDriver = "Pulse"; break;7321 case AudioDriverType_OSS: pcszDriver = "OSS"; break;7322 case AudioDriverType_CoreAudio: pcszDriver = "CoreAudio"; break;7323 7329 case AudioDriverType_MMPM: pcszDriver = "MMPM"; break; 7324 7330 default: /*case AudioDriverType_Null:*/ pcszDriver = "Null"; break; … … 8236 8242 * the current host platform. For example, this would return false 8237 8243 * for AudioDriverType_DirectSound when compiled on a Linux host. 8238 * @param drv AudioDriverType_* enum to test. 8239 * @return true only if the current host supports that driver. 8244 * 8245 * @return \c true if the current host supports the driver, \c false if not. 8246 * @param enmDrvType AudioDriverType_* enum to test. 8240 8247 */ 8241 8248 /*static*/ 8242 bool MachineConfigFile::isAudioDriverAllowedOnThisHost(AudioDriverType_T drv) 8243 { 8244 switch (drv) 8245 { 8249 bool MachineConfigFile::isAudioDriverAllowedOnThisHost(AudioDriverType_T enmDrvType) 8250 { 8251 switch (enmDrvType) 8252 { 8253 case AudioDriverType_Default: 8254 RT_FALL_THROUGH(); 8246 8255 case AudioDriverType_Null: 8247 8256 #ifdef RT_OS_WINDOWS 8257 case AudioDriverType_WAS: 8258 /* We only support WAS on systems we tested so far (Vista+). */ 8259 if (RTSystemGetNtVersion() < RTSYSTEM_MAKE_NT_VERSION(6,1,0)) 8260 break; 8261 RT_FALL_THROUGH(); 8248 8262 case AudioDriverType_DirectSound: 8249 8263 #endif … … 8275 8289 * or ALSA are actually supported on the first call. 8276 8290 * 8291 * When more than one supported audio stack is available, choose the most suited 8292 * (probably newest in most cases) one. 8293 * 8277 8294 * @return Default audio driver type for this host platform. 8278 8295 */ … … 8281 8298 { 8282 8299 #if defined(RT_OS_WINDOWS) 8300 if (RTSystemGetNtVersion() >= RTSYSTEM_MAKE_NT_VERSION(6,1,0)) 8301 return AudioDriverType_WAS; 8283 8302 return AudioDriverType_DirectSound; 8284 8303 … … 8301 8320 if (RTLdrIsLoadable("libasound.so.2")) 8302 8321 s_enmLinuxDriver = AudioDriverType_ALSA; 8303 else8304 8322 # endif /* VBOX_WITH_AUDIO_ALSA */ 8305 s_enmLinuxDriver = AudioDriverType_OSS; 8323 # ifdef VBOX_WITH_AUDIO_OSS 8324 else 8325 s_enmLinuxDriver = AudioDriverType_OSS; 8326 # endif /* VBOX_WITH_AUDIO_OSS */ 8306 8327 } 8307 8328 return s_enmLinuxDriver;
Note:
See TracChangeset
for help on using the changeset viewer.