Repository: nvaccess/nvda

Issue:
nvwave/output devices enumeration: first output device is an empty string in Windows 10 Version 2004 and later
Hi,

Reported on Twitter and subsequently confirmed:

### Steps to reproduce:
With Windows 10 Version 2004 (May 2020 Update) installed, open NVDA's synthesizer dialog (Control+NVDA+S). Then see which devices are listed under output device combo box.

### Actual behavior:
An empty string is displayed at the top.

### Expected behavior:
A default output device name (such as Microsoft Sound Mapper) is shown.

### System configuration
#### NVDA installed/portable/running from source:
Installed and portable

#### NVDA version:
2020.1, 2020.2 beta 2, alpha-20514

#### Windows version:
Windows 10 Version 20H2 beta (build 19042.330)

#### Name and version of other software in use when reproducing the issue:
None

#### Other information about your system:
Multiple sound devices present (internal sound card, wireless headset)

### Other questions
#### Does the issue still occur after restarting your computer?
Yes

#### Have you tried any other versions of NVDA? If so, please report their behaviors.
Versions listed above exhibit the same problem

#### If addons are disabled, is your problem still occurring?
Yes

#### Did you try to run the COM registry fixing tool in NVDA menu / tools?
Not applicable

### Additional context:
This issue occurs in Version 2004 and later (Version 1909 did return the correct name for the first selected output device). This suggests something going on with device capabilities functions found in winmm.dll which are used to build output device names.

Thanks.


Discussion:
I was able to reproduce this with 2019.3.X as well.

Confirmed with latest snapshot. TO clarify, there is no Windows Sound Mapper option, so if Windows was providing that placeholder name in the past, it is not now. Looked in latest TeamTalk, and it is exhibiting similar behavior, with placeholder text of input and output for the default.
So if Windows is providing a blank, NVDA may need to supply its own text of default, which can probably be assumed if the device name is blank and also first in the list.
Hi,

Note: this issue only affects 2004 and 20H2 - Microsoft Sound Mapper is listed in build 20161 (dev).

Thanks.
Hello everyone. I was the one who originally reported the bug. Just as an experiment, I turned on Narrator while in the NVDA synthesizer dialog and even Narrator was not able to read the Microsoft sound mapper item. Not sure if that means anything but figured I'd put that out there.
Hi, upon further investigation, it was determined that this is Windows release specific and affects all programs wishing to enumerate wave output devices. The good news is that it will be fixed in a future Windows 10 update. Once I finish looking at language issues (that is, making sure the setting in question is language independent), I’ll submit a pull request targeting alpha snapshots. Thanks.

 

From: agtheblade <notifications@github.com> 
Sent: Tuesday, July 7, 2020 4:57 PM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Joseph Lee <joseph.lee22590@gmail.com>; Author <author@noreply.github.com>
Subject: Re: [nvaccess/nvda] nvwave/output devices enumeration: first output device is an empty string in Windows 10 Version 2004 and later (#11349)

 

Hello everyone. I was the one who originally reported the bug. Just as an experiment, I turned on Narrator while in the NVDA synthesizer dialog and even Narrator was not able to read the Microsoft sound mapper item. Not sure if that means anything but figured I'd put that out there.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <https://github.com/nvaccess/nvda/issues/11349#issuecomment-655199956> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AB4AXEA6NEVOM2PCNJBWQNDR2OY5BANCNFSM4OTA2LAA> .


Hi,

It appears the term "Microsoft Sound Mapper" has been localized in other languages. Therefore this must be an alpha-level change.

Thanks.

Resolving patch:
diff --git a/source/gui/settingsDialogs.py b/source/gui/settingsDialogs.py
--- a/source/gui/settingsDialogs.py
+++ b/source/gui/settingsDialogs.py
@@ -965,6 +965,10 @@ def makeSettings(self, settingsSizer):
 		# headphones, etc.
 		deviceListLabelText = _("Audio output  &device:")
 		deviceNames=nvwave.getOutputDeviceNames()
+		# #11349: On Windows 10 20H1 and 20H2, Microsoft Sound Mapper returns an empty string.
+		if not deviceNames[0]:
+			# Translators: name for default (Microsoft Sound Mapper) audio output device.
+			deviceNames[0] = _("Microsoft Sound Mapper")
 		self.deviceList = settingsSizerHelper.addLabeledControl(deviceListLabelText, wx.Choice, choices=deviceNames)
 
 		try:


Test patch: