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

Voice Synthesizer crackling when CPU load high, any way to improve this? #7769

Open
jmuheim opened this issue Nov 17, 2017 · 28 comments
Open
Labels
component/audio NVDA's audio output (nvWave, issues with usb audio etc).

Comments

@jmuheim
Copy link

jmuheim commented Nov 17, 2017

I'm running NVDA in a virtual Windows 7 machine through VMware Fusion on a Macbook Pro.

Everything works very well, but as soon as I have high CPU load on my Mac (e.g. when doing desktop sharing through Skype), the voice of NVDA begins to crackle heavily. When switching between applications (e.g. between Firefox and IE), sometimes it takes seconds until NVDA has announced the change.

The interesting thing is: listening to an mp3 file within the virtual machine doesn't produce the same amount of crackling. So I guess there's a bottleneck somewhere, because although my Macbook Pro is 3 years old already, it never really feels "out of performance" in any other way (it has 16gb RAM).

So is there a way to optimise this? I already tried different synthesisers (SAPI5, Svox Pico), but it's the same for all of them. Maybe there are commercial ones that work better? Or can I activate some hardware support to improve performance so my CPU doesn't have to "lever" the whole task?

Thank you.

@Brian1Gaff
Copy link

Brian1Gaff commented Nov 17, 2017 via email

@jmuheim
Copy link
Author

jmuheim commented Nov 17, 2017

Thanks for your comment. My machine has an SSD, several CPUs and lots of RAM, so I think there is another bottleneck for this problem, not a computer performance one.

@PratikP1
Copy link

I'm seeing this behavior with Windows 10 and OneCore voices as well. I have a top of the line processor, 32 GB of ram and SSD. While I'm not seeing the extreme performance hit that @jmuheim described, I do occasionally see prolonged performance issues with speech when the processor is busy.

@zstanecic
Copy link
Contributor

zstanecic commented Nov 17, 2017 via email

@ehollig
Copy link
Collaborator

ehollig commented Nov 20, 2017

Have you tried dedicating more ram to the virtual machine?

@jmuheim
Copy link
Author

jmuheim commented Nov 21, 2017

@ehollig Sure I did. Up to 6GB of my 16GB.

On my friend's much newer Macbook Pro, it works much better: still a bit of crackling sometimes, but in general it's fine.

@feerrenrut
Copy link
Contributor

My immediate thought is that this is due to a performance bottleneck for the VM. An MP3 has different requirements, for instance, the whole file can be loaded into memory ahead of playback time. Speech from NVDA has a limit (latency of the speech) for how much of the audio can be buffered. If the OS is limiting how many cycles NVDA gets, then the next portion of speech can not be prepared in time resulting in audible artefacts. I haven't looked into this, but perhaps the size of this buffer could be increased, this would however increase latency.

@jmuheim
Copy link
Author

jmuheim commented Dec 12, 2017

An option to increase the buffer size would be very useful to me. Otherwise I would have to buy a new Macbook Pro only because of NVDA's voice... seems a bit over the top to me, haha!

@feerrenrut
Copy link
Contributor

My last comment was pure speculation about what might cause the problem, however it would be a great place to start. If this improved things I would suggest leaving this as a hidden config option.

@Adriani90
Copy link
Collaborator

@jmuheim idd you try to increase the buffer and see if the issue still occurs? Actually something like this is really hard to investigate in my opinion because you really need a full understanding of the system, which drivers and programs are actually running etc. Does this also happen with Narator or other screen readers?

@michaelDCurran michaelDCurran added the component/audio NVDA's audio output (nvWave, issues with usb audio etc). label Jan 26, 2019
@Adriani90
Copy link
Collaborator

cc: @hozosch maybe this is the reason why you experience crackling voice on some synthesizers?

@hozosch
Copy link

hozosch commented Jan 12, 2020

This person had this problem with all speech synths. I'm only having it with espeak. Windows is installed as a physical system, not a vm. And I only get a little bit of crackling when NVDA scrolls during say all.

@bhavyashah
Copy link

@Adriani90 You recommended in #7769 (comment) that @jmuheim try increasing their buffer. Could you please provide instructions as to how that can be done?

@Adriani90
Copy link
Collaborator

I have found out that on a virtual machine the addon bluetooth audio from @mltony solves this crackling voice problem. It sounds just very clean when the silence is played in the background.

@jmuheim
Copy link
Author

jmuheim commented Oct 29, 2020

You mean this?

https://github.com/mltony/nvda-bluetooth-audio

Just to understand correctly: even when not using Bluetooth in any way, does it still solve the crackling problems?

@Adriani90
Copy link
Collaborator

Adriani90 commented Oct 30, 2020 via email

@feerrenrut
Copy link
Contributor

Thanks for that update @Adriani90, that is very useful to know. I'll be interested to know if @jmuheim can replicate your results with VMware Fusion on a Macbook Pro. Since this may be VM host specific, @Adriani90 could you tell us which software you are using?

@hozosch
Copy link

hozosch commented Nov 9, 2020

For me, it doesn't fix the problem on my Windows XP VM in VMware player 16, but one thing you can do and which will work is having windows media player running in the background with a file to play, and pausing the file.

@Adriani90
Copy link
Collaborator

@hozosch actually this is what the addon does as well. When you pause the mediaplayer, a silence is played the whole time which holds the sound card awake. The same thing is done via this addon. Are you accessing the VM directly? Or via a remote connection?

@feerrenrut I am using Citrix Xen Desktop, with that the IT in our company created a virtual machine. Installing the bluetooth audio addon on the VM solves definitely crackling problems. However, it might be different when using the NVDA remote addon. You have to switch off the synthesizer on the VM while controling it with the NVDA remote addon, and the bluetooth audio addon needs to be installed on both NVDA locally and on the VM itself.

@hozosch
Copy link

hozosch commented Nov 13, 2020

I'm using the VM directly. I really tried to use the bluetooth audio addon, but it didn't solve the problem. The VM is Windows XP, so the latest NVDA version I can use is 2017.3. Does the addon only start to work if there's a bluetooth device connected? That would explain why it doesn't work on the VM.

@Adriani90
Copy link
Collaborator

Adriani90 commented Nov 13, 2020 via email

@hozosch
Copy link

hozosch commented Nov 13, 2020

Well, there's no compatibility information on the website for this addon and when I installed it in Windows XP, it said that the addon is enabled and I could even access its settings, but the crackling didn't stop.

@jmuheim
Copy link
Author

jmuheim commented Nov 16, 2020

@feerrenrut wrote:

I'll be interested to know if @jmuheim can replicate your results with VMware Fusion on a Macbook Pro.

I just installed the plugin (https://github.com/mltony/nvda-bluetooth-audio), and it indeed works much better now. It's not perfect, but definitely way better (maybe 10% of the crackling compared to before installing it). I'm using Windows 10 on VMware Fusion 10.6.1, on a pretty old Macbook Pro 2014 (16GB RAM).

Thanks so much for fixing this problem for me so many years later! It makes me feel that I'll be able to use my good ol' Macbook for another year or so... 😄

@bhavyashah
Copy link

bhavyashah commented Dec 13, 2020 via email

@mltony
Copy link
Contributor

mltony commented Dec 13, 2020

There's one more thing to try - try increasing priority of NVDA process. Run this command in Administrator command line:

wmic process where name="nvda.exe" CALL setpriority 256

I am actually wondering why there is still no option to run NVDA in higher priority. I might want to implement it in one of my add-ons.

@Adriani90
Copy link
Collaborator

@jmuheim could you please test with NVDA last alpha version and add-ons disabled if this issue is still occuring? This would be very appreciated.

The last alpha for testing purposes can be downloaded here:
https://www.nvaccess.org/files/nvda/snapshots/

@jcsteh
Copy link
Contributor

jcsteh commented Jul 18, 2023

The new WASAPI audio output code in NVDA alphas might help here.

@Adriani90
Copy link
Collaborator

Testing with NVDA 2023.2 on a virtual client in Citrix environment without nVDA remote addon, the NVDA voice is still crackling with WASAPI enabled when the NVDA voice from the virtual machine is used.
It seems the bluetooth audio addon created by @mltony fixes this, although i don't have any bluetooth headset connected. I am using a cable headset or the speakers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/audio NVDA's audio output (nvWave, issues with usb audio etc).
Projects
None yet
Development

No branches or pull requests