nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
https://www.nvaccess.org/
Other
2.09k stars 630 forks source link

NVDA does not offer the same audio output devices as Windows. #16162

Open paulber19 opened 7 months ago

paulber19 commented 7 months ago

Steps to reproduce:

Actual behavior:

I use an E7 stereo bluetooth headset with microphone. On my system, and after connecting my headphones, In the "sounds" settings of Windows 10, the audio output devices are: Realtek Digital Output (Realtek High Definition Audio) Headset (E7 Stereo) Speakers (Realtek High Definition Audio)

For a synthesizer, NVDA offers the following audio output devices to choose from: Microsoft Sound Mapper Realtek Digital Output (Realtek Speakers (Realtek High Def Headset (E7 Hands-Free AG Audio) Headset (E7 Stereo)

The "Headset (E7 Hands-Free AG Audio)" device is not in the Windows audio output device list. Since NVDA 2023.2 and wasapi enabled, By selecting the "Headphone (E7 Hands-Free AG Audio)" device for the current synthesizer (OneCore), NVDA speaks normally but the beeps do not work. An error is logged in the log: Failed to initialize audio for tones Traceback (most recent call last): File "tones.pyc", line 24, in initialize File "nvwave.pyc", line 832, in init File "nvwave.pyc", line 875, in open File "nvwave.pyc", line 991, in _setVolumeFromConfig File "nvwave.pyc", line 980, in setVolume File "_ctypes/callproc.c", line 1000, in GetResult OSError: [WinError -2147024809] Invalid parameter If wasapi is disabled, everything is normal

Expected behavior:

Apart from the "Microsoft Sound Mapper", NVDA should not offer the "Headset (E7 Hands-Free AG Audio)" Audio)" device as an audio output device. The beeps should work if the "Headphone (E7 Hands-Free AG Audio)" device is selected for the current synthesizer.

NVDA logs, crash dumps and other attachments:

System configuration

NVDA installed/portable/running from source:

NVDA portable

NVDA version:

All versions after introducing Wasapi: NVDA 2023.2, NVDA 2023.3.3, nvda 2024beta7 and last NVDA alpha. With these versions and Wasapi desactivated, there is no problem.

Windows version:

Windows 10 22H2 (10.0.19045) workstation AMD64

Name and version of other software in use when reproducing the issue:

None

Other information about your system:

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.

Yes

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Yes

paulber19 commented 7 months ago

Since NVDA 2023.2 and wasapi enabled, By selecting the "Headphone (E7 Hands-Free AG Audio)" device for the current synthesizer (OneCore), NVDA speaks normally but the beeps do not work. An error is logged in the log: Failed to initialize audio for tones Traceback (most recent call last): File "tones.pyc", line 24, in initialize File "nvwave.pyc", line 832, in init File "nvwave.pyc", line 875, in open File "nvwave.pyc", line 991, in _setVolumeFromConfig File "nvwave.pyc", line 980, in setVolume File "_ctypes/callproc.c", line 1000, in GetResult OSError: [WinError -2147024809] Invalid parameter If wasapi is disabled, everything is normal.

OzancanKaratas commented 7 months ago

Your NVDA version is out of date. Please update NVDA and test for this issue.

CyrilleB79 commented 7 months ago

@paulber19, please edit your first comment for the following sections:

CyrilleB79 commented 7 months ago

Also cc @jcsteh for the error with WASAPI (see https://github.com/nvaccess/nvda/issues/16162#issuecomment-1937080426).

paulber19 commented 7 months ago

I don't understand why you say that. I tested with the following portable versions of NVDA: -nvda 2023.2,

Le 10/02/2024 20:55, Ozancan Karataş a écrit :

Your NVDA version is out of date. Please update NVDA and test for this issue.

— Reply to this email directly, view it on GitHub https://github.com/nvaccess/nvda/issues/16162#issuecomment-1937106974, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZLFFFS6KQD4DDYK5J2FX3YS7GCZAVCNFSM6AAAAABDCS3WRGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZXGEYDMOJXGQ. You are receiving this because you authored the thread.Message ID: @.***>

CyrilleB79 commented 7 months ago

Thanks. That's much more precise than "all versions" indeed.

And do you confirm that the issue is present in all these versions? With and without WASAPI?

jcsteh commented 7 months ago

Even though we have WASAPI now, NVDA still gets its list of audio devices (as shown in the Settings dialog) from the old WinMM API. We can't change that until the old WinMM (WASAPI disabled) code is removed altogether. At that point, I envisage it will be a lot easier to make the device list more consistent with that shown in Windows settings, etc.

OzancanKaratas commented 7 months ago

See #15781 (comment): @jcsteh, considering this comment, I think we can leave WinMM support behind now. Can we use the solution there instead of managing audio devices from C++ code?