nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
https://www.nvaccess.org/
Other
2.1k stars 634 forks source link

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

Open jmuheim opened 6 years ago

jmuheim commented 6 years ago

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 commented 6 years ago

I've noticed this on a machine running 7 natively but it only has to be running progress bleeps while its populating a folder and saying the percentages. I think its worse in Espeak for some reason though. I put this down to the low memory on that machine only 4 gigs as apposed to 8 on this machine this also has an ssd not a clunky mechanical hard drive too.

Brian

bglists@blueyonder.co.uk Sent via blueyonder. Please address personal email to:- briang1@blueyonder.co.uk, putting 'Brian Gaff' in the display name field.


jmuheim commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

well, that’s the same with vocalizer expressive premium high, but not compact,

on windows 10 64 bit hdd disk

W dniu 17.11.2017 o 18:53, PratikP1 pisze:

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 https://github.com/jmuheim described, I do occasionally see prolonged performance issues with speech when the processor is busy.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nvaccess/nvda/issues/7769#issuecomment-345315649, or mute the thread https://github.com/notifications/unsubscribe-auth/AKohkygKZLjHK9DR61RdWd6zHs4pWZEEks5s3cgigaJpZM4Qhs-A.

ehollig commented 6 years ago

Have you tried dedicating more ram to the virtual machine?

jmuheim commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago

@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?

Adriani90 commented 4 years ago

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

hozosch commented 4 years ago

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 commented 4 years ago

@Adriani90 You recommended in https://github.com/nvaccess/nvda/issues/7769#issuecomment-453747579 that @jmuheim try increasing their buffer. Could you please provide instructions as to how that can be done?

Adriani90 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Yes, it does.

Von meinem iPhone gesendet

Am 30.10.2020 um 00:06 schrieb Joshua Muheim notifications@github.com:

 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?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

feerrenrut commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

No, you don‘t need a bluetoooth device. In this case I guess maybe the addon is not backwards compatible until 2017.3

Von meinem iPhone gesendet

Am 13.11.2020 um 06:25 schrieb hozosch notifications@github.com:

 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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

hozosch commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

I have the Bluetooth Audio add-on installed on my copy of NVDA. On a Surface Laptop 3 with 16 gb RAM and an I7 10th gen processor, CPU usage is at 100%, and NVDA is struggling and crackling. I currently have audio outputted through my laptop's built-in speakers so there is no involvement of any external device. I have experienced this crackling often on my Dell Latitude laptop with 8 gb RAM and an I5 processor as well, notably when downloading from the web using Firefox. NVDA should have some way of making room for itself even when the laptop resources are under strain.

On 11/16/20, Joshua Muheim notifications@github.com wrote:

@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... 😄

--

You are receiving this because you commented.

Reply to this email directly or view it on GitHub:

https://github.com/nvaccess/nvda/issues/7769#issuecomment-728097911

-- Best Regards Bhavya Shah Stanford University | Class of 2024 E-mail Address: bhavya.shah125@gmail.com LinkedIn: https://www.linkedin.com/in/bhavyashah125/

mltony commented 3 years ago

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 commented 1 year ago

@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 commented 1 year ago

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

Adriani90 commented 1 year ago

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.