pymumble icon indicating copy to clipboard operation
pymumble copied to clipboard

Issue on macOS with Python 3.11

Open stblassitude opened this issue 1 year ago • 4 comments

File "/Users/XXXXX-G8Eyb2Im/lib/python3.11/site-packages/opuslib/api/ctl.py", line 66, in inner
    raise opuslib.exceptions.OpusError(result_code)
opuslib.exceptions.OpusError: b'invalid argument'

The line that is triggering the error in libopus and hence the exception: soundoutput.py:151

self.encoder.bitrate = self.bandwidth - overhead_per_second

I'm not sure if there is a problem in pymumble or libopus, but the same code with the same Python version on Debian appears to work without issue. I'm a bit stumped.

stblassitude avatar Dec 15 '23 22:12 stblassitude

Kind of out of curiosity, I downgraded my pipenv to 3.9, and now it's working. Still don't understand what the issue is, but at least I can continue working on my code.

stblassitude avatar Dec 15 '23 22:12 stblassitude

The relevant code to trigger the error is very straigtforward:

    mumble = pymumble_py3.Mumble(**server_args)
    mumble.start()
    mumble.is_ready()

stblassitude avatar Dec 15 '23 22:12 stblassitude

Curioser and curioser. After switching to Python 3.9, I didn't get the crash on connecting, but I also didn't get any audio; mumble.sound_output was None. Setting mumble.set_receive_sound(True) before connecting fixed that, but it also brings back the first error.

stblassitude avatar Dec 15 '23 22:12 stblassitude

The debug log output just before the error is

2023-12-15 23:57:29,465-PyMumble-DEBUG-Bandwidth is 50000, downgrading to 30400 due to the protocol overhead

I'm not sure the bandwidth can be chosen arbitrarily, but I don't claim to understand how Opus works.

Simply commenting out the line leads to working code?

stblassitude avatar Dec 15 '23 23:12 stblassitude