Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAPI 4 synthesizer not loading anymore #17516

Open
Mohamed00 opened this issue Dec 13, 2024 · 0 comments
Open

SAPI 4 synthesizer not loading anymore #17516

Mohamed00 opened this issue Dec 13, 2024 · 0 comments
Labels
component/speech p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority release/blocking this issue blocks the milestone release triaged Has been triaged, issue is waiting for implementation.

Comments

@Mohamed00
Copy link

Steps to reproduce:

  1. Install the latest NVDA alpha.
  2. Load SAPI 4.

Actual behavior:

SAPI 4 doesn't load.

Expected behavior:

SAPI 4 should load.

NVDA logs, crash dumps and other attachments:

Log fragment when loading SAPI 4.
ERROR - synthDriverHandler.setSynth (11:44:19.579) - MainThread (11820):
setSynth failed for sapi4
Traceback (most recent call last):
File "synthDriverHandler.pyc", line 483, in setSynth
File "synthDriverHandler.pyc", line 446, in getSynthInstance
File "synthDrivers\sapi4.pyc", line 127, in init
File "synthDrivers\sapi4.pyc", line 236, in _set_voice
ctypes.ArgumentError: argument 1: TypeError: wrong type
DEBUGWARNING - synthDrivers.sapi4.SynthDriverBufSink.IUnknown_Release (11:44:19.649) - MainThread (11820):
ITTSBufNotifySink::Release called too many times by engine

System configuration

NVDA installed/portable/running from source:

Installed.

NVDA version:

alpha-34782,82fefa5a.

Windows version:

Windows 11, Version 24H2 (OS Build 26100.2605).

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

N/A.

Other information about your system:

N/A.

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, the last version where this worked was alpha-34772,c3e899a8.

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.

@SaschaCowley SaschaCowley added component/speech p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority release/blocking this issue blocks the milestone release triaged Has been triaged, issue is waiting for implementation. labels Dec 16, 2024
SaschaCowley added a commit that referenced this issue Jan 6, 2025
…ferred output device (#17547)

Closes #17497

Summary of the issue:
NVDA currently stores the friendly name of the user's preferred audio output device.

Description of user facing changes
None.

Description of development approach
In `nvdaHelper/local/wasapi.cpp`, rewrote `getPreferredDevice` to fetch the preferred device directly via `MMDeviceEnumerator.GetDevice`.
Added manual checks that the fetched device is a render device, and that its status is active, since these conditions were guaranteed to be met since the previous code only iterated over devices which met those prerequisites.
Renamed `deviceName` to `endpointId`.

In `source/mmwave.py`, added a parameter to `_getOutputDevices` to return a value representing the system default output device.
Also made the type hints more self-documenting by using a `NamedTuple`.

In `source/gui/settingsDialogs.py`, used `nvwave._getOutputDevices` rather than `nvwave.getOutputDeviceNames` to fetch the available output devices.
When saving, used the selection index of `AudioSettingsPanel.deviceList` to index into the tuple of IDs to get the value to save to config.

In `source/config/configSpec.py`, moved the `outputDevice` key from `speech` to `audio`, and incremented the schema version to 14. Added an associated profile upgrade function in `profileUpgradeSteps.py`, and tests for same in `tests/unit/test_config.py`. Updated all occurrences of this config key that I am aware of to point to the new location.

In `source/synthDrivers/sapi5.py`, rewrote the device selection logic again to work with endpoint IDs.

Testing strategy:
Built from source and ensured that changing output devices works as expected.
Ensured that saving the config worked, and that the output device was selected correctly when restarting NVDA.

Tested activating SAPI5 with different output devices selected.

Known issues with pull request:
SAPI4 still doesn't work (#17516 ), this will be fixed in a future PR.

Endpoint ID strings are not human-readable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/speech p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority release/blocking this issue blocks the milestone release triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

No branches or pull requests

2 participants