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

Speaking long string freezes NVDA #4669

Closed
nvaccessAuto opened this issue Dec 5, 2014 · 17 comments
Closed

Speaking long string freezes NVDA #4669

nvaccessAuto opened this issue Dec 5, 2014 · 17 comments
Labels
bug component/speech p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority

Comments

@nvaccessAuto
Copy link

Reported by tspivey on 2014-12-05 06:32
Problem:
Long strings will freeze NVDA when spoken.

Normally this wouldn't occur, but sometimes when editing files (in scintilla-based editors with word wrap disabled),
they come up.

STR:

s1 = 'test '*5000
s2 = 'a'*5000
ui.message(s)

More details:

t1 = time.time();tmp = characterProcessing.processSpeechSymbols("en", s1, 300);print time.time() - t1
s1: 0.043S, rounded
s2: 0.005S, rounded
processText eventually processes the dictionary, this can be slow on such large strings.
t1 = time.time();tmp = speechDictHandler.processText(s1);print time.time() - t1
s1: 0.015S
s2: 2.0S
With a real speech dictionary of 14 entries (11 default + 3 voice), s1 takes ~11.4S and s2 takes 2.4.
s2 doesn't increase much. Maybe one of my regexes is slow.

I admit, s2 is a corner case, and I'm probably not going to encounter it outside of testing.
S1 is pretty long, 25k. I've accidentally hit longer, though. HTML files with no newlines.
When NVDA freezes, it's difficult to get it back up again.

Possible solutions:

  1. Beep or otherwise speak a message for long lines and ignore them.
    I don't like this one, because we have to define long line. Ignoring s2, 10k? That's nothing if I don't have a speech dictionary and just use builtin, and depends on its size.
    I'm not even yet considering how long it takes the synth to start speaking.
  2. Split long lines into chunks.
    Slightly better, if we can figure out what'll tipically work for not freezing things for too long, and what a long line is. We still have to define that
    If done right, the line should speak quickly, albeit with a few extra pauses and possibly broken speech dictionary regexes. I don't think I'd bother listening to the entire thing;
    tipically I'd realize "long line", and turn on word wrap to go through it properly.
@nvaccessAuto
Copy link
Author

Comment 1 by jteh on 2014-12-05 06:44
The question is whether it'd still take the same amount of time (or at least an unreasonably long time) if the string were split. If so, option 2 only works if you can cancel the first string before the second is sent. Right now, that certainly isn't possible, though it might (and that's a big might) be possible once speech is refactored.

I'm wondering whether we should just truncate the string and send the first n characters. We could maybe announce that the text was truncated. That kinda sucks, but it's far better than freezing or speaking nothing. It's also perfectly reasonable: sighted users have to scroll to see the rest of the text.

IMO, 10k really is quite insane. Even 1k is insane; a non-screen reader user can't read that much on one line.

@nvaccessAuto
Copy link
Author

Comment 2 by camlorn on 2014-12-05 19:10
yeah. I've seen this too, all be it rarely enough I've never bothered reporting. I think truncation is reasonable: the sighted user can't read a 1k line, but their eyes don't lock up and require restarting, either. The only problem is that NVDA may need to provide a method of actually scrolling in those cases. Maybe.

@josephsl
Copy link
Collaborator

Hi,

This was brought up last night when someone sent a long string over Remote Support session that resulted in clients crashing.

Thanks.

@Adriani90

This comment has been minimized.

@Adriani90

This comment has been minimized.

@Adriani90

This comment has been minimized.

@tspivey
Copy link
Collaborator

tspivey commented May 5, 2019

Here is a test case. Wait 10 seconds or so and be prepared for your machine to become unusable. Tested with OneCore, Firefox and Chrome.

@Adriani90

This comment has been minimized.

@Adriani90 Adriani90 reopened this May 5, 2019
@feerrenrut feerrenrut added the p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority label May 6, 2019
@feerrenrut

This comment has been minimized.

@akalaiva
Copy link

akalaiva commented Apr 2, 2020

I notice this same issue with a long string of text or large content inserted into a div.

@VantageKR
Copy link

Have been experiencing NVDA simply not reading long lines anymore, when using gvim via a plugin that interfaces with gvim via OLE automation. This worked perfectly before this most recent version of NVDA. Have also experienced NVDA hanging when say the Windows console outputs a lot of text - this did not happen before. Unfortunately, reverting to an older NVDA does not solve this problem, but I'm unable to determine why this is the case. Another issue with the latest NVDA is that the error tree in the DBeaver database IDE, which is based on Eclipse, does not voice anymore. So, really unsure why things have gotten so terrible. I've tried disabling all add ons, tried different synts: problems persist.

@thgcode
Copy link
Contributor

thgcode commented Mar 5, 2022

`I'm having this same issue on NVDA 2021.3.3, I created some artificial test cases to reproduce but it occurs on real programs:

  1. Open NVDA Python Console.

  2. Paste this code and be prepared for the crash:

import speech;speech.speak("a" * 128 * 1024)

  1. However, if you try speaking the string directly on the synthesizer (eSpeak in my case), it works:
    import synthDriverHandler;import time;synth = synthDriverHandler.getSynth();synth.speak("a" * 128 * 1024);time.sleep(2)

@thgcode
Copy link
Contributor

thgcode commented Mar 5, 2022

As a follow up, I think I found one of the problems. If you try to give the text to the speechDictHandler.processText function, it is taking a lot of time to complete. If this function is disabled (replacing it with a lambda for example), NVDA still lags, but returns in seconds.

@thgcode
Copy link
Contributor

thgcode commented Mar 5, 2022

It seems there is a particular regexp on the builtin.dic NVDA dictionary file is causing the problem. I'm not sure of which one but I tested removing the file from my installation and it spoke the long string.

@Neurrone
Copy link

Neurrone commented Mar 6, 2022

Hi, I've just stumbled across this as well in #13432.

I'd like to request a prioritization of this issue, because of how it is much more severe than a normal crash. I had to restart the entire computer to get speech back. Its also something that an end user can't really do anything about e.g, the only way you know the file has the potential to crash NVDA is by looking at it first, which then causes said crash.

@Adriani90
Copy link
Collaborator

cc: @michaelDCurran

@feerrenrut
Copy link
Contributor

I'm going to close this and re-open #13432, since that is newer, uses the issue template and based on a real world use case, rather than python console input. Reviewing the comments here I note #4669 (comment) which seems to have been overlooked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug component/speech p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority
Projects
None yet
Development

No branches or pull requests

9 participants