-
Notifications
You must be signed in to change notification settings - Fork 60
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
Update with latest version 0.2.11 #8
Open
evandrocoan
wants to merge
37
commits into
jleb:master
Choose a base branch
from
evandroforks:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This adds an optional parameter specifying whether an input overflow exception should be raised (or ignored). Previously, a code comment conflicted with actual implementation, by suggesting that overflows are ignored when in fact they are always surfaced. Furthermore, detecting an overflow condition was flawed. This change allows the user to decide whether exceptions are thrown, for API parity with pa_write_stream. Thanks to Tony Jacobson for the report and patch!
Previously IOErrors raised had strerror and errno arguments swapped, which this change fixes. Thanks to Sami Liedes for the report!
On macOS/OSX, CoreAudio may require a device-level lock for certain operations, e.g., opening a stream or delivering audio data to a callback. If the lock acquisition order between the device lock and the Python GIL is inconsistent, deadlock might occur. Michael Graczyk identified one such instance, where: - an input stream, running in thread A, acquires the device lock, followed by the GIL, in order to call the user's Python input callback handler; - that callback makes a call that releases the GIL (e.g., I/O) - thread B acquires the GIL and opens a PyAudio stream, eventually invoking Pa_OpenStream. Note that prior to this patch, calling Pa_OpenStream did _not_ release the GIL. - While holding the GIL, Pa_OpenStream attempts to acquire the device lock. - Meanwhile, thread A (still holding the device lock) attempts to reacquire the GIL (e.g., once the I/O call is complete). This commit: (a) updates the implementation to release the GIL before calling Pa_OpenStream and Pa_StartStream. Hopefully this change will bring the code closer to the discipline of always acquiring the device lock before the GIL. Thanks Michael for the patch! (b) adds a unit test to reproduce the problem (on CoreAudio systems). Many thanks again to Michael Graczyk for identifying the issue and contributing the fix!
Also trivial formatting fixes.
This commit adds logic to release the GIL for these PortAudio routines: Pa_IsStreamStopped Pa_IsStreamActive Pa_GetStreamTime Pa_GetStreamCpuLoad Pa_GetStreamWriteAvailable Pa_GetStreamReadAvailable Pa_Initialize Pa_Terminate
Many thanks to Blaise Potard for spotting the issue and submitting a patch!
# Conflicts: # src/_portaudiomodule.c # src/pyaudio.py
and forward, postfix wont be used anymore.
I think this has been blocking my use of pyaudio on my systems with newer libraries. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
git clone https://people.csail.mit.edu/hubert/git/pyaudio.git