於 4 年 前 建立
#20025 new enhancement
DirectSound Device on windows host not found, no sound on host OS, independent of guest OS
回報者: | Garfield | 負責人: | |
---|---|---|---|
元件: | audio | 版本: | VirtualBox 5.2.42 |
關鍵字: | no sound on Host OS, DirectSound Device not settable from list of devices in user interface | 副本: | |
Guest type: | all | Host type: | Windows |
描述
In VBox.log the following occurs during Direct Sound Initialisation on Windows 7 32-bit host, independent of guest OS, the improvement is applicable to all Windows hosts versions:
00:00:02.768338 Audio: Initializing DirectSound audio driver 00:00:02.796743 DSound: DirectSound not available: REGDB_E_CLASSNOTREG 00:00:02.796782 Audio: Initialization of host driver 'DSoundAudio' failed with VERR_NOT_SUPPORTED 00:00:02.797158 Audio: Initializing NULL driver 00:00:02.797183 VM: Raising runtime error 'HostAudioNotResponding' (fFlags=0x0) 00:00:02.797189 Console: VM runtime error: fatal=false, errorID=HostAudioNotResponding message="Host audio backend initialization has failed. Selecting the NULL audio backend with the consequence that no sound is audible"
In DrvHostDSound.cpp, line 2253 the intialisation happens on a fixed audio device interface ID (of what I can see, I am not 100% sure, just looks like it). Rather build an "enum" list of sound devices in the computer. These audio devices can have any IDs. Make that list available in the user interface by audio device name (two lists for Sound In and Sound Out). The user can then select the audio device he/she wants to use, one for sound in, and the other for sound out. So then it does not have to be the default audio device. The user can have several audio devices, e.g. Intel HD Audio, Creative audio, NVidia Sound, etc on the Windows host.
The default audio device fails on my machine, since I have a Creative Audio Product, which has a non-standard GUID.
Attached I have the user interface of the audio tab (there is no device selectable, only a default WindowsDirectSound Device. That's no good. Make a list of direct sound audio devices available in the computer, and expose that list to the user interface. That way, the user can select the audio device to use (does not have to be default, then).
The issue is here, /src/VBox/Devices/Audio/DrvHostDSound.cpp, line 2253:
static DECLCALLBACK(int) drvHostDSoundInit(PPDMIHOSTAUDIO pInterface) {
PDRVHOSTDSOUND pThis = PDMIHOSTAUDIO_2_DRVHOSTDSOUND(pInterface); LogFlowFuncEnter();
int rc;
/* Verify that IDirectSound is available. */ LPDIRECTSOUND pDirectSound = NULL; HRESULT hr = CoCreateInstance(CLSID_DirectSound, NULL, CLSCTX_ALL, IID_IDirectSound, (void )&pDirectSound); if (SUCCEEDED(hr)) {
IDirectSound_Release(pDirectSound);
rc = VINF_SUCCESS;
dsoundUpdateStatusInternal(pThis);
} else {
DSLOGREL(("DSound: DirectSound not available: %Rhrc\n", hr)); rc = VERR_NOT_SUPPORTED;
}
The IID_IDirectSound should be an enum list with all audio devices attached to the host computer, make that list available in the user interface, so the user can select an audio device of his choice by device name.
It would be nice to also get that feature on the Virtual Box 5.2 for 32-bit Windows hosts, which I am currently using.
Picture of Direct Sound User Interface