-
-
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
nvWave: Dont close audio device #11531
Conversation
This reverts commit 633435d. Instead of using a timer to close the audio device we will keep it open. The initial requirement for keeping the device open no longer applies see #11505 (comment)
Reformats all usage of WavePlayer construction
To understand when errors are triggered after missing device.
This solves the missing device issue. Does not restore to preferred device when it is reconnected.
Checking if we are using the preferred device is fast: ~0.20 ms Checking if the preferred device is available (enumerating devices until one with appropriate name is found) is slow: ~3ms This may not be a major problem: - It only happens during the idle unbuffered call. IE. the synth is done playing and there is no pending buffer. - It only happens if not using the preferred device. Possible mitigation: start an async task to check for the preferred device, and when the result is available on a subsequent idle unbuffered call, then switch.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
When there is no audio device: - avoid log.error, it only creates more noise in the log (because it can not play the wave file) - handle "default" value from configSpec - don't try to close an empty device handle.
This comment has been minimized.
This comment has been minimized.
If winmm.waveOutPrepareHeader or winmm.waveOutWrite raise an error, but open continues to succeed, infinite recursion was possible. Split error handling out to a helper function to prevent this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the change from log.debugWarning to log.exception in _feedUnbuffered_handleErrors, all is good.
Since all review actions by @michaelDCurran have been completed, do you now plan to merge this PR? |
@codeofdusk Yes, I plan to merge this in shortly. |
I'm getting a lot of errors from garbageHandler about unreachable objects, especially during say all after this got merged. sample log:
I haven't created an issue since I don't have concrete STR. |
@lukaszgo1 A few questions:
|
@michaelDCurran wrote:
No, I don't
eSpeak Polish voice, variant Max rate 56 with rate boost enabled.
Yes, none of them plays any sounds though. All my add-ons just for completeness: addonUpdater
No, error sound plays twice when the info from my previous commend is logged. |
Intends to replace:
Link to issue number:
Fixes #11482
Fixes #11490
Fixes #5172
Fixes #10721
Summary of the issue:
Original issues previously fixed by PR #11024 :
Subsequently, occasional exceptions from nvwave, particularly when switching synthesisers.
Description of how this pull request fixes the issue:
Don't close the device at all.
As per the discussion:
#11505 (comment)
To fix issues with current / preferred device:
_idleUnbuffered
Testing performed:
Logged performance of checking for preferred device.
_idleUnbuffered
and when not using the preferred device.Known issues with pull request:
None
Change log entry:
Section: Bug fixes
Remove change log entry:
Replace it with:
I'm uncomfortable saying that sound is no longer truncated, this still seems to affect certain devices (EG my bluetooth headphones when no other sound is playing). I think this issue should be looked at separately.