-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
OpusError on macOS arm64 platform (only) #8046
Labels
bug
This is a bug with the library.
Comments
Rapptz
added
bug
This is a bug with the library.
and removed
unconfirmed bug
A bug report that needs triaging
labels
May 17, 2022
Thanks for the detailed bug report. After a lot of debugging, it seems this is an issue with ctypes itself. I've reported an issue upstream if you want to track its progress: python/cpython#92892 |
Cool! Thanks for forwarding to the upstream. |
6 tasks
Rapptz
pushed a commit
that referenced
this issue
May 18, 2022
On arm64 macOS, variadic arguments have special calling convention rules. Therefore, we must specify the required argument types for ctypes to pass the arguments correctly. Apple documentation: https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms#Update-Code-that-Passes-Arguments-to-Variadic-Functions Fix issue #8046
8 tasks
dolfies
pushed a commit
to dolfies/discord.py-self
that referenced
this issue
Mar 28, 2023
On arm64 macOS, variadic arguments have special calling convention rules. Therefore, we must specify the required argument types for ctypes to pass the arguments correctly. Apple documentation: https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms#Update-Code-that-Passes-Arguments-to-Variadic-Functions Fix issue Rapptz#8046
dolfies
pushed a commit
to dolfies/discord.py-self
that referenced
this issue
Mar 29, 2023
On arm64 macOS, variadic arguments have special calling convention rules. Therefore, we must specify the required argument types for ctypes to pass the arguments correctly. Apple documentation: https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms#Update-Code-that-Passes-Arguments-to-Variadic-Functions Fix issue Rapptz#8046
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
When creating an opus.Encoder() instance, an exception of discord.opus.OpusError: invalid argument is thrown
Reproduction Steps
First, install either Python 3.9 or Python 3.10.
$ brew install python $ python3 -m pip install -U "discord.py[voice]"
Then, execute the code in the section below.
Minimal Reproducible Code
Expected Results
Should load
libopus.dylib
and create an Opus encoder instance.Actual Results
Intents
Not applicable
System Information
Checklist
Additional Context
[1/4] This bug only happens on arm64 macOS?
Yes, only on arm64 macOS.
Confirmed no issue on x86_64 macOS or Windows or Linux.
[2/4] Why can't I use Windows or Linux instead?
It's because my music production software is on this platform.
I'm willing to run test code snippets on my machine if you wish.
[3/4] Some more check on libopus
I try to check if libopus is correctly loaded.
Result: yes.
I try to check whether there is an architecture mismatch between Python and libopus.
Result: Both arm64. None are “fat binary”.
I try to check if the request numbers are different on arm64.
Result: The numbers are same with x86_64.
[4/4] Why am I directly calling
discord.opus.Encoder
? It's supposed to be a private API.First, the public API will eventually call into this private API and raise exception. There is no difference.
Second, my bot program has to call into this private API in order to perform some WebRTC-level magic.
The text was updated successfully, but these errors were encountered: