openairplay/airplay2-receiver

[Windows] Worked a couple times, now repeats error

Opened this issue · 5 comments

The problem

Everything seems to launch fine and then once I actually try to start the stream I keep getting some kind of MAC value error like this
[AudioRealtime]: RTP ChaCha20_Poly1305 decrypt: ValueError('MAC check failed')

Is the best way to try to get it working again blow away the repo or is there some easier fix here that I just dont get?

What commit exhibits the issue?

9b37407

Was there a last known working commit?

9b37407

What type of installation are you running?

virtualenv

With which python3 version do you run Receiver?

3.9.6

OS the receiver runs on

Windows 11

OS the sender runs

Monterey 12.4

Which sender client was used

youtube (from chrome or opera gx same issue)

Command invocation

python ap2-receiver.py -m myap2 -n "{261386AF-A4C2-40D4-9FAB-90956F2AEEFC}"

Please include --debug output which helps to illustrate the problem

stdout.txt

Additional information

No response

deleting repo and trying again did not work. I feel like something is locked to some wrong mac address forever now, I've restarted both computers a few times now, just not sure how to unstuck this.

@systemcrash, @LewdNeko: What do you think?

It's possible Apple are moving away from bitflags. I see this:

NTP is absent from the default flags. Yet Mojave sends NTP (macOS often tries this towards video enabled endpoints, also). It's allowed to do so in its device declaration. Audio should still work. Perhaps something with your output device, as chosen by the python interpreter you run.

I don't yet understand what these lines are - they might or might not indicate a problem, since I don't remember seeing them (I don't run windows):

[comtypes]: Release <POINTER(IMMDeviceEnumerator) ptr=0x21ed5ad2730 at 21ed6dd9ec0>
[comtypes]: Release <POINTER(IMMDevice) ptr=0x21ed374ba90 at 21ed6e01040>
[comtypes]: Release <POINTER(IUnknown) ptr=0x21ed5aef4f0 at 21ed6dd9ec0>
[comtypes]: Release <POINTER(IAudioSessionControl) ptr=0x21ed5b70b80 at 21ed6e011c0>
[comtypes]: Release <POINTER(IAudioSessionControl) ptr=0x21ed5b71420 at 21ed6e010c0>
[comtypes]: Release <POINTER(IAudioSessionControl) ptr=0x21ed5b702e0 at 21ed6e012c0>
[comtypes]: Release <POINTER(IAudioSessionControl) ptr=0x21ed5b71b50 at 21ed6e01340>
[comtypes]: Release <POINTER(IAudioSessionManager2) ptr=0x21ed5aef4f0 at 21ed6e01140>
[comtypes]: Release <POINTER(IAudioSessionEnumerator) ptr=0x21ed5cf9c90 at 21ed6dd9ec0>
[comtypes]: Release <POINTER(IAudioSessionControl) ptr=0x21ed5b70170 at 21ed6e013c0>
[comtypes]: Release <POINTER(IAudioSessionControl2) ptr=0x21ed5b71b58 at 21ed6e012c0>
[comtypes]: Release <POINTER(IAudioSessionControl2) ptr=0x21ed5b702e8 at 21ed6e010c0>
[comtypes]: Release <POINTER(IAudioSessionControl2) ptr=0x21ed5b71428 at 21ed6e011c0>
[comtypes]: Release <POINTER(IAudioSessionControl2) ptr=0x21ed5b70b88 at 21ed6e01040>
[comtypes]: Release <POINTER(IAudioSessionControl2) ptr=0x21ed5b70178 at 21ed6e01340>
[asyncio]: Using proactor: IocpProactor
[comtypes]: Release <POINTER(IMMDevice) ptr=0x136e2aafbe0 at 136e3b87f40>
[comtypes]: Release <POINTER(IUnknown) ptr=0x136e0449070 at 136e3b87ec0>
[comtypes]: Release <POINTER(IAudioSessionControl) ptr=0x136e042dc10 at 136e3b87f40>
[comtypes]: Release <POINTER(IAudioSessionControl) ptr=0x136e042d0b0 at 136e3b881c0>
[comtypes]: Release <POINTER(IAudioSessionControl) ptr=0x136e042da70 at 136e3b88240>
[comtypes]: Release <POINTER(IAudioSessionManager2) ptr=0x136e0449070 at 136e3b88040>
[comtypes]: Release <POINTER(IAudioSessionEnumerator) ptr=0x136e2903b40 at 136e3b87ec0>
[comtypes]: Release <POINTER(IAudioSessionControl) ptr=0x136e042ddb0 at 136e3b88140>
[comtypes]: Release <POINTER(IAudioSessionControl2) ptr=0x136e042da78 at 136e3b881c0>
[comtypes]: Release <POINTER(IAudioSessionControl2) ptr=0x136e042d0b8 at 136e3b87f40>
[comtypes]: Release <POINTER(IAudioSessionControl2) ptr=0x136e042dc18 at 136e3b880c0>
[comtypes]: Release <POINTER(IAudioSessionControl2) ptr=0x136e042ddb8 at 136e3b88240>

Just found and tried this project, and I'm getting similar messages when using remote volume controls. Playback otherwise works fine. I'm on Windows 10. These might be unhandled events.

This might be causing your issue: #79
Hard to verify without testing ;)

@pdisser8 You can test for yourself by changing line 445 of ./ap/connections/audio.py to self.key_and_iv = True if ((sk_len == 16 or sk_len == 24 or sk_len == 32) and session_iv is not None) else False -- Add extra parentheses around sk_len == 16 or sk_len == 24 or sk_len == 32

Thanks, I'll give it a shot. If I still run into issues I'll look at putting this in a container instead.