Closed m13253 closed 2 years ago
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: https://github.com/python/cpython/issues/92892
Cool! Thanks for forwarding to the upstream.
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.
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.