http://bugs.winehq.org/show_bug.cgi?id=58204
Bug ID: 58204 Summary: Winecfg Audio tab doesn't enumerate drivers or show output devices, but test button works. Product: Wine Version: 10.7 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: hibbsncc1701@gmail.com Distribution: ---
Created attachment 78512 --> http://bugs.winehq.org/attachment.cgi?id=78512 Screenshot of winecfg audio tab UI bug.
Under Wine-10.7 (specifically the winehq-devel packages for Debian), the winecfg Audio tab doesn't seem to be functional even in a clean wine prefix.
There is no drop down for selecting audio drivers, and the currently selected driver says "(None)".
The output and input device selection drop down boxes all say "(System Default)" with no other options given.
The speaker configuration is completely blank, and speakers drop down is empty and disabled.
The only thing that does seem to work is the "Test Sound" button which does play a test sound, when clicked.
Manually selecting an audio driver (such as winealsa) using the helpful registry key (HKCU->Software->Wine->Audio) does appear to work, but results in no visible changes to winecfg. (The change can only be observed from WINEDEBUG="+mmdevapi"'s console output.)
Even when shutting down pulseaudio / pipewire (systemctl stop and systemctl disable), which _should_ just leave us with alsa, there are no visible changes in winecfg, and the test button still works.
http://bugs.winehq.org/show_bug.cgi?id=58204
--- Comment #1 from Patrick Hibbs hibbsncc1701@gmail.com --- Created attachment 78513 --> http://bugs.winehq.org/attachment.cgi?id=78513 Console output with WINEDEBUG="+mmdevapi"
http://bugs.winehq.org/show_bug.cgi?id=58204
Patrick Hibbs hibbsncc1701@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |programs
http://bugs.winehq.org/show_bug.cgi?id=58204
--- Comment #2 from Patrick Hibbs hibbsncc1701@gmail.com --- Created attachment 78544 --> http://bugs.winehq.org/attachment.cgi?id=78544 POC patch to fix audio tab
OK looking at this some more....
programs/winecfg/audio.c uses the result of the get_driver_name() function to determine if an audio driver has been loaded, but that function uses a call to IMMDeviceEnumerator_GetDevice() with a "Wine info device" device name to make that determination.
Grepping through the entire wine tree for "Wine info device" returned no results except for the single use of it in winecfg already mentioned. A grep for the "'W', 'i', 'n', 'e'" string, and manually reading through all of mmdevapi's and winealsa.drv's source files found no use at all.
Adding an ERR() call to the FAILED(hr) check for IMMDeviceEnumerator_GetDevice() resulted in it being printed every time the audio tab was opened regardless of audio driver settings.
Replacing that IMMDeviceEnumerator_GetDevice() call with a call to IMMDeviceEnumerator_GetDefaultAudioEndpoint(devenum, eRender, eConsole, &device), gets an instant segfault when opening the audio tab in winecfg.
This is due to DEVPKEY_Device_Driver not being defined, and the call to IPropertyStore_GetValue() returning a false positive. (That's due to dlls/mmdevapi/devenum.c masking the ERROR_FILE_NOT_FOUND from RegGetValueW(), setting the value to VT_EMPTY, and returning S_OK on line 284.) Resulting in a null deref on the returned string value.
A quick grep of the wine source tree for DEVPKEY_Device_Driver only resulted in the use in programs/winecfg/audio.c, and include/devpkey.h. Checking for the GUID only found results in include/devpkey.h and include/propkey.h.
Manually defining DEVPKEY_Device_Driver during MMDevice_Create() (apparently the other code in that function only considers the first driver listed in the DriverFuncs array), makes the audio tab UI work again. (We have valid audio devices listed in the Defaults section drop downs and under Speaker configuration.)
I've attached a patch to fix it against (as of this posting) current git, but I'm not sure if this is the proper way to fix it.
http://bugs.winehq.org/show_bug.cgi?id=58204
Sean C. Farley sean-freebsd@farley.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sean-freebsd@farley.org
--- Comment #3 from Sean C. Farley sean-freebsd@farley.org --- This issue also occurs with the wineoss driver on FreeBSD 14.3-STABLE with Wine 10.8 and Wine 10.9.
The patch does appear to fix it.