Skip to content

Gracefully ignore NVDANotInitializedError when scheduling WASAPI idle check.#15145

Merged
seanbudd merged 1 commit into
nvaccess:masterfrom
jcsteh:idleNotInit
Jul 16, 2023
Merged

Gracefully ignore NVDANotInitializedError when scheduling WASAPI idle check.#15145
seanbudd merged 1 commit into
nvaccess:masterfrom
jcsteh:idleNotInit

Conversation

@jcsteh

@jcsteh jcsteh commented Jul 14, 2023

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #15143.

Summary of the issue:

When playing the start sound, NVDA can fail with this error:

  File "nvwave.pyc", line 975, in _scheduleIdleCheck
  File "core.pyc", line 928, in callLater
core.NVDANotInitializedError: Cannot schedule callable, wx.App is not initialized

Description of user facing changes

Fixed the error.

Description of development approach

Feeding WASAPI audio schedules an idle check, which uses core.callLater. That will fail if the wx.App isn't initialised yet.

We now just catch this and ignore it. playWaveFile closes the stream after playing anyway, so this first idle check isn't important.

Testing strategy:

I'm not able to reproduce this on my system. This is likely because of timing differences. This problem is a race condition between the main thread and the playWaveFile thread.

I tested that NVDA starts without problems. However, we'll need the user who reported this (@ultrasound1372) to provide feedback on a try build to be sure that this works.

Known issues with pull request:

None.

Change log entries:

None, since this regression never landed in a release.

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • Security precautions taken.

@jcsteh

jcsteh commented Jul 15, 2023

Copy link
Copy Markdown
Contributor Author

@@ultrasound1372, could you please test this build and report whether it fixes the issue for you? Note that this isn't a signed build, so you won't be able to access administrator apps with it.

@ultrasound1372

Copy link
Copy Markdown

This does appear to fix it, I can now hear the start-up sound as normal when running as a fresh portable.

@jcsteh jcsteh marked this pull request as ready for review July 15, 2023 02:07
@jcsteh jcsteh requested a review from a team as a code owner July 15, 2023 02:07
@jcsteh jcsteh requested a review from seanbudd July 15, 2023 02:07
@seanbudd seanbudd merged commit 605046a into nvaccess:master Jul 16, 2023
@nvaccessAuto nvaccessAuto added this to the 2023.2 milestone Jul 16, 2023
@seanbudd seanbudd mentioned this pull request Jul 21, 2023
6 tasks
seanbudd added a commit that referenced this pull request Jul 25, 2023
Changes to handle #15150
Follow up to #14697, #14896, #15038, #15097, #15145

Summary of the issue:
WASAPI usage is known to cause intermittent crashing in #15150.
Generally, WASAPI code has not been proven to be stable.
Due to this, it should not be enabled by default in 2023.2.
WASAPI can be re-enabled by default once it is proven to be stable.

Description of user facing changes
Disable WASAPI by default, preventing intermittent crashing #15150

Description of development approach
Turn the WASAPI checkbox into a feature flag, so that it can easily be re-enabled in future.

Testing strategy:
Manual testing
Upgrading the profile: Test starting NVDA with the WASAPI config value set to "True/False" instead of a "enabled/disabled/default".

Test the various controls related to WASAPI - ensure they are saved, applied and respected correctly.
@jcsteh jcsteh deleted the idleNotInit branch May 25, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: #15097 breaks playback of start-up sound

4 participants