-
-
Notifications
You must be signed in to change notification settings - Fork 651
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
Python 3 versions of NVDA produce a scratch in the speech when finishing the end of a line #10185
Comments
1. Can you provide which synth you used to reproduce this?
This only happens with espeak and no other voice does that.
Even the beta version of RHVoice cannot do that.
|
O yes, so it seems, as I'm indeed using espeak, that it's an issue in the portation of espeak to python 3. Maybe we should open an issue on espeak NG? |
But I'm using that on English on the Alpha branch and have had no such
issues, so maybe its only when in another language?
|
For me, it also happesn in English, for instance if you read one line
and it finished reading it.
|
Hmm, very strange. maybe its hardware related or something to do with the
speech refactoring rather than Python 3. I'm using a Behringer USB sound
device here.
One would have thought that it would be an odd fault to only occur in some
circumstances. It makes me wonder if it occurs with no speech or another
synth, say Sappi 5?
|
It doesn’t have to do anything with speech refactor
|
Well, I have been using it all morning with docs in word and other
applications and apart from the occasional click one gets when a sound is
interrupted by the user, ie the sudden fall of a DC level so to speak,
normal reading with the Quincy voice works as it should do at least on my
window 7 64 machine.
Brian
|
This comment has been minimized.
This comment has been minimized.
I should point out that it only happens with the compiled snapshots. I tested the prototype from source as well, and there, it didn't scratch, at least from what I can remember. |
The thought that this may be caused by speech refactor isn't strange at all, there have been major changes on how speech synthesizers process speech as well as how say all works. |
I'm now running 2019.3 beta 1 installed on windows 10 18363, and I still have that problem. It's whenever NVDA scrolls, and sometimes when it finishes a sentence. I think it's a speech refactor problem, because I was using an inofficial eloquence driver ported to python3 as well once, which also did it. |
Hi!
Please try it with some official synth, especially sapi 4 or 5, and RH Voice or vocalizer
|
I primarily use Espeak, and it still happens with this synth. In sapi4 and 5 it doesn't happen, I don't have the money to buy vocalizer. |
Can you try on a different Laptop or PC? Can you reproduce it? Do you use multiple Sound Cards? It might be a Sound issue from your Sound Card. Try also with different Headsets or Speakers. |
I don't have any other OS or PC to test with. When I opened the issue, I had windows 7 on this machine I'm using now, and there it was also reproduceable. I also don't have any other sound card except the internal one with the realtec driver installed. Espeak is the only synth with which this happens, if we exclude that inofficial synth. |
So… it is a problem of espeak
|
I notice this issue on my machine also (with espeak). I'm suspicious of the way that we send audio to the sound device, there are much newer API's for this. It will require some investigation. |
I'm labeling this as |
@hozosch could you please test with last alpha? Is this still reproducible? |
This has the same cause (and thus the same investigation is required) as I describe in #11061 (comment). |
So it has! Well, as I expected, I can still reproduce it with the latest alpha version. |
NVDA's existing audio output code (nvwave) is largely very old and uses WinMM, a very old legacy Windows audio API. It is also written in pure Python, contains quite a few threading locks necessitated by WinMM, and parts of it have become rather difficult to reason about. There are several known stability and audio glitching issues that are difficult to solve with the existing code. Description of user facing changes At the very least, this fixes audio glitches at the end of some utterances as described in #10185 and #11061. I haven't noticed a significant improvement in responsiveness on my system, but my system is also very powerful. It's hard to know whether the stability issues (e.g. #11169) are fixed or not. Time will tell as I run with this more. Description of development approach 1. The bulk of the WASAPI implementation is written in C++. The WASAPI interfaces are easy to access in C++ and difficult to access in Python. In addition, this allows for the best possible performance, given that we regularly and continually stream audio data. 2. The WinMM code fired callbacks by waiting for the previous chunk to finish playing before sending the next chunk, which could result in buffer underruns (glitches) if callbacks were close together (Python 3 versions of NVDA produce a scratch in the speech when finishing the end of a line #10185 and Texts with multiple line spacings are voiced with NVDA + down arrow and voices crack #11061). In contrast, the WASAPI code uses the audio playback clock to fire callbacks independent of data buffering, eliminating glitches caused by callbacks. 3. The WinMM WavePlayer class is renamed to WinmmWavePlayer. The WASAPI version is called WasapiWavePlayer. Rather than having a common base class, this relies on duck-typing. I figured it didn't make sense to have a base class given that WasapiWavePlayer will likely replace WinmmWavePlayer altogether at some point. 4. WavePlayer is set to one of these two classes during initialisation based on a new advanced configuration setting. WASAPI defaults to disabled. 5. WasapiWavePlayer.feed can take a ctypes pointer and size instead of a Python bytes object. This avoids the overhead of additional memory copying and Python objects in cases where we are given a direct pointer to memory anyway, which is true for most (if not all) speech synthesisers. 6. For compatibility, WinmmWavePlayer.feed supports a ctypes pointer as well, but it just converts it to a Python bytes object. 7. eSpeak and oneCore have been updated to pass a ctypes pointer to WavePlayer.feed. 8. When playWaveFile is used asynchronously, it now feeds audio on the background thread, rather than calling feed on the current thread. This is necessary because the WASAPI code blocks once the buffer (400 ms) is full, rather than having variable sized buffers. Even with the WinMM code, playWaveFile code could block for a short time (nvwave.playWaveFile not fully async #10413). This should improve that also. 9. WasapiWavePlayer supports associating a stream with a specific audio session, which allows that session to be separately configurable in the system Volume Mixer. NVDA tones and wave files have been split into a separate "NVDA sounds" session. WinmmWavePlayer has a new setSessionVolume method that can be used to set the volume of a session. This at least partially addresses Ability to adjust volume of sounds #1409.
Reopening since WASAPI is not enabled by default anymore (#15172). |
I also noticed that this happens only at speeds faster than the default 30. I will need to make a more extensive test with vasapi enabled. |
Reintroduces #14697 Closes #10185 Closes #11061 Closes #11615 Summary of the issue: WASAPI usage should be reenabled by default on alpha so wider testing can occur Description of user facing changes WASAPI is re-enabled - refer to #14697 for benefits Description of development approach change feature flag default value to enabled
Steps to reproduce:
Open a dokument
Press NVDA+A for "say all"
Actual behavior:
You will find that NVDA scratches sometimes. Mostly at the end of a line, either a line you did with enter, or the automatic line change if one long line is too big for the screen.
Expected behavior:
NVDA shouldn't scratch a single time
System configuration
NVDA installed/portable/running from source:
portable
NVDA version:
alpha-18574,56f5fcd2
Windows version:
7 professional sp1 64 bit
Name and version of other software in use when reproducing the issue:
doesn't matter here
Other information about your system:
Other questions
Does the issue still occur after restarting your PC?
yes
Have you tried any other versions of NVDA? If so, please report their behaviors.
No. The latest stable obviously doesn't do that, since it's still running on python 2. However, I didn't try it with the threshold or any other version there may be on a different branch running python 3.
The text was updated successfully, but these errors were encountered: