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
NVDA freezes when using wasapi #15752
Comments
A log would be helpful. When are you seeing this in real usage? I accept that this shouldn't happen, but the code you've provided (while perhaps helpful to reproduce) is pretty extreme and that situation would never actually occur in real usage. |
It is happening in real usage, but is not always reproduceable. This is a way to 100% reproduce an issue |
Sure. Can you give an example of when this has happened in real usage and how often? It's difficult to prioritise without being able to assess the actual user impact. |
It is randomly reproduceable, for example i was talking and didn't touching a keyboard, some large text came to nvda and this bug was reproduced. I cannot give a specific steps when it can be 100% reproduced. But This way is causing the same set of exceptions. |
Imagine a situation, You are not near the computer, This bug happened, because of something bad in wasapi when speaking large text, you are returning and your disk drive is full of logs caused by this bug. |
I can confirm this. On my system this happens a lot when working with long passages of text, especially when navigating or quickly interrupting speech. The errors are the same. All synths including eSpeak NG are affected. However, I don't now any other ways to predictably reproduce this, except that described above. |
I don't see this anywhere in your log. Also, this sounds more like #15681, which is now fixed. Do you have another log showing this? |
It was only once, when somehow i was able to keep synthesizer talking while logging errors, and with these errors, i discovered a place where None type object has no attribute idle, but now it is not reproduceable anymore. i tried lots of times but no result. It maybe was from another log snippet, but it still was in latest master. |
Sure. I'm not suggesting your issue is not valid. I just want as much information as I can get, because at this point, I have no idea what is causing it. Note that my other pull request is marked as draft until I can verify the fix, just in case you feel I'm not applying the same rigor to your issues as I am to my own. |
If you find some way of reproducing this in core, even with Python console code, please let me know. I'd really rather not dabble with add-ons here, partly because it adds another entire piece to an already very complicated puzzle i have to try to understand in order to diagnose the problem. |
ok, i was able to reproduce it without addons, but it is still not real usage example. I don't know what to do to ensure this is reproduceable everytime i want. import speech def test(amount): test(50) It is happening with espeak also. I have no idea for now how to reproduce it with another way, but it is really boring seeing this. I was not opening an issue, because there were some of them already, and i was hoping this would be fixed with these bugs, but no. |
I wasn't able to reproduce with that snippet unfortunately. Thank you for your efforts, though. I guess you can disable WASAPI for now, since the toggle is still present. If we continue to see more regressions, it might be worth considering flipping this off by default again in the next release or maybe even reverting it altogether. |
Hi James and Beqa,
I cannot reproduce this too.
From: James Teh ***@***.***>
Sent: Tuesday, November 7, 2023 12:48 PM
To: nvaccess/nvda ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [nvaccess/nvda] NVDA freezes when using wasapi (Issue #15752)
I wasn't able to reproduce with that snippet unfortunately. Thank you for your efforts, though.
I guess you can disable WASAPI for now, since the toggle is still present. If we continue to see more regressions, it might be worth considering flipping this off by default again in the next release or maybe even reverting it altogether.
—
Reply to this email directly, view it on GitHub <#15752 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACVCDE5MBHFZBJKB6YKYPD3YDINYZAVCNFSM6AAAAAA7A4XIFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJYGM2DSMBQGA> .
You are receiving this because you are subscribed to this thread. <https://github.com/notifications/beacon/ACVCDE44PDOLCH6IAR2Z7ODYDINYZA5CNFSM6AAAAAA7A4XIFGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTLGCQMQ.gif> Message ID: ***@***.*** ***@***.***> >
|
Hello there! |
@jcsteh reverting or disabling wasapi is not a good solution at all. |
It's not ignoring the problem at all. If WASAPI is causing too many critical issues, no one other than me can fix them, and I don't have sufficient time to diagnose and fix them, it's not really a sustainable situation. |
Adjusting volume of sounds is the only thing because of that I am using wasapi. I would be happy to use winmm, if there would be such possibility in winmm player. Lots of users were waiting to implement of #1409 and reverting of that or continuing to experience this issue is not good at all. |
Another successfull reproduction of this issue. Now with Espeak-NG. Looks like it could be reproduced when typing text or reading text by characters at very fast speed. |
Well, also when before wasapi, I experienced lags when using Bluetooth headsets. Win mm is not acceptable.
|
Well, for now, I cannot fathom how the code can end up in this state. So, until I or someone else can figure it out, we either need to live with this issue or turn it off/revert it so users don't experience the problem. There is literally no other choice. From what I can see:
|
It can be turned off from the settings. Wasapi is still a part of advanced settings, so I don’t see the problem.
|
It looks like a weakref callback might run before |
Then it shouldn't be garbage collected. |
Actually, the correct fix is to just not explicitly remove the key, since it will be implicitly removed by WeakValueDictionary. That's assuming this is the real problem and not just a symptom of some other problem that isn't obvious from these logs. |
I've just pushed a try build which should be done in about an hour. (You'll want to download the .exe file from that page when it appears.) Please test and let me know if that fixes the issue... or what else it does. |
I will checkout your branch now |
Thanks @jcsteh. I can confirm, that bug is not reproduceable anymore with the way i've provided in the issue description |
…nces map in the destructor. (#15754) Fixes #15752. Summary of the issue: Some users sometimes see errors like this in their logs, accompanied by long freezes: ERROR - stderr (15:18:17.518) - MainThread (29504): Exception ignored in: ERROR - stderr (15:18:17.529) - MainThread (29504): <function WasapiWavePlayer.__del__ at 0x0467A6B8> ERROR - stderr (15:18:17.950) - MainThread (29504): Traceback (most recent call last): ERROR - stderr (15:18:18.392) - MainThread (29504): File "nvwave.pyc", line 843, in __del__ ERROR - stderr (15:18:18.830) - MainThread (29504): File "weakref.pyc", line 145, in __delitem__ ERROR - stderr (15:18:18.843) - MainThread (29504): KeyError ERROR - stderr (15:18:18.855) - MainThread (29504): : ERROR - stderr (15:18:19.283) - MainThread (29504): 80057872 Description of user facing changes NVDA no longer sometimes freezes when speaking a large amount of text. Description of development approach Previously, WasapiWavePlayer's __del__ method removed itself from the _instances map. However, a WeakValueDictionary actually removes the reference itself when the object dies. A weakref callback can run before __del__ in some cases, which would mean that the item was already removed, resulting in this KeyError. To fix this, we just don't explicitly remove the item and rely entirely on WeakValueDictionary to do this.
cc @jcsteh
Steps to reproduce:
There is a way of reproducing this when using Newfon or RHVoice synth drivers
install one of the listed addons.
enter the following code in NVDA console
import synthDriverHandler; [synthDriverHandler.setSynth(synthDriverHandler.getSynth().name) for i in range(20)]
Actual behavior:
NVDA is freezing and logging lots of errors.
Player is becoming None and idle cannot be called
Expected behavior:
NVDA should be stable.
NVDA logs, crash dumps and other attachments:
System configuration
NVDA installed/portable/running from source:
Running from source, but reproduceable on 2023.3 Release version
NVDA version:
Master
Windows version:
Windows 10 22h2
Name and version of other software in use when reproducing the issue:
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, 2023.3 behaves the same
If NVDA add-ons are disabled, is your problem still occurring?
Yes, but easily reproduceable with Newfon or RHVoice synth
Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
Yes
The text was updated successfully, but these errors were encountered: