ckdo / airplay2-receiver

AirPlay 2 receiver - python implementation only for testing
126 stars 7 forks source link

Can't connect to receiver #5

Open spitfire opened 4 years ago

spitfire commented 4 years ago

Neither my iPhone (running iOS 14b2), nor MacBook (macOS 10.15.5) can connect to the receiver. Tried to set it up both on my MacBook and a Raspberry Pi, the results are the same:

python ap2-receiver.py -m MMBP2 -n en11 -nv

Interface: en11 IPv4: 10.100.0.173 IPv6: fe80::d2:4bf4:204c:2461

mDNS service registered Starting RSTP server, press Ctrl-C to exit... serving at port 7000 Got connection with 10.100.0.173:59792 X-Apple-ProtocolVersion: 1 Content-Length: 70 Content-Type: application/x-apple-binary-plist CSeq: 0 DACP-ID: 71DBFEDB9947497B Active-Remote: 4016793210 User-Agent: AirPlay/420.45

GET /info {'qualifier': ['txtAirPlay']} Sending: {'audioLatencies': [{'inputLatencyMicros': 0, 'outputLatencyMicros': 400000, 'type': 100}, {'audioType': 'default', 'inputLatencyMicros': 0, 'outputLatencyMicros': 400000, 'type': 100}, {'audioType': 'media', 'inputLatencyMicros': 0, 'outputLatencyMicros': 400000, 'type': 100}, {'audioType': 'media', 'inputLatencyMicros': 0, 'outputLatencyMicros': 400000, 'type': 102}], 'deviceID': '64:4b:f0:01:f9:90', 'features': 2255099430177280, 'keepAliveLowPower': True, 'keepAliveSendStatsAsBody': True, 'manufacturer': 'Sonos', 'model': 'One', 'name': 'Camera da letto', 'nameIsFactoryDefault': False, 'pi': 'ba5cb8df-7f14-4249-901a-5e748ce57a93', 'protocolVersion': '1.1', 'sdk': 'AirPlay;2.0.2', 'sourceVersion': '366.0', 'statusFlags': 4}

ckdo commented 4 years ago

Hello @spitfire,

Thanks for trying it 👍 Actually it is due to advertised features, latest versions of Airplay do not support anymore the trick that was used in this receiver to bypass auth & encryption. I leave it like this for my convenience, but this receiver also support Fairplay v3 auth & HKP4, so it should work once enabled for you. I'll make a minor change to enable both HKP and Fairplayv3 by default, and let me the ability to alter features with an argument.

About RPi support, you can try but sound on my Rpi3 is for now awful. As far i have seen, it is due to PyAudio lib so I intend to switch to sounddevice lib which seems to solve that troubles for RPi users

ckdo commented 4 years ago

@spitfire,

Fix published on 68a089f

iRayanKhan commented 4 years ago

So I can connect and everything, audio playback is choppy but works, but Connecting the speaker to HomeKit fails due to "Network error". Do I have to enable the flag or is it already enabled?

Edit: For clarity, yes I know about the RPI audio issue.

spitfire commented 4 years ago

Thanks for fixing it up @ckdo, it works for me now! I have noticed a few issues, and I'm not sure whether it would be useful for you if I filed them as issues (since this is not supposed to be a production-like-app: Volume management is disabled when using docker. I can't seem to be a le to connect to the server after I disconnect a device from it Audio is desynchronized (I know this is in the list of known issues) Sometimes I could hear audio stuttering There is no way to select a sound card (or is there?), so I had to mess with modprobe.d options to reorder the sound cards

ckdo commented 4 years ago

Thanks @spitfire,

No prod app you're right, but I intend all pieces of the puzzle to be there, so that anyone may implement/contribute to any other ap2 project (I'm also trying to contribute to https://openairplay.github.io/airplay-spec/ ) About you're issues... a few questions/remark:

spitfire commented 4 years ago