philippe44 / AirConnect

Use AirPlay to stream to UPnP/Sonos & Chromecast devices
Other
3.46k stars 217 forks source link

Unable to Connect to "device" #246

Closed brentluna closed 3 years ago

brentluna commented 4 years ago

Running on Ubuntu server aircast-x86-64. Trying to connect to google home devices from iphone.

So I run the script, and get the following output, no other output is printed after this point.

./aircast-x86-64
[00:01:07.598938] main:945 Starting aircast version: v0.2.24.7 (Apr  7 2020 @ 14:44:17)
[00:01:07.599096] main:953 no config file, using defaults
[00:01:07.599213] Start:712 Binding to 192.168.1.23
[00:01:07.752868] AddCastDevice:649 [0x68f380]: adding renderer (Kitchen display)
[00:01:07.752982] AddCastDevice:655 [0x68f380]: creating MAC 68f38a
[00:01:07.753640] AddCastDevice:649 [0x68fd10]: adding renderer (Living Room speaker)
[00:01:07.753887] AddCastDevice:655 [0x68fd10]: creating MAC 68fd1a
[00:01:07.754374] AddCastDevice:649 [0x6906a0]: adding renderer (Bedroom display)
[00:01:07.754425] AddCastDevice:655 [0x6906a0]: creating MAC 6906aa
[00:01:07.754979] AddCastDevice:649 [0x691030]: adding renderer (Home group)
[00:01:07.755011] AddCastDevice:655 [0x691030]: creating MAC 69103a
[00:01:07.760866] AddCastDevice:649 [0x6919c0]: adding renderer (Bedroom speaker)
[00:01:07.760960] AddCastDevice:655 [0x6919c0]: creating MAC 6919ca
[00:01:07.761480] AddCastDevice:649 [0x692350]: adding renderer (Bedroom group)
[00:01:07.761516] AddCastDevice:655 [0x692350]: creating MAC 69235a
[00:01:07.761904] AddCastDevice:649 [0x692ce0]: adding renderer (All)
[00:01:07.761935] AddCastDevice:655 [0x692ce0]: creating MAC 692cea
[00:01:07.938274] AddCastDevice:649 [0x693670]: adding renderer (cCast2)
[00:01:07.938367] AddCastDevice:655 [0x693670]: creating MAC 69367a

I see the devices listed under airplay, however when i select one, it shows a spinning circle for about 10 seconds and then eventaully says Unable to connec to device device_name.

philippe44 commented 4 years ago

Can you describe your network topology?

brentluna commented 4 years ago

@philippe44 the server is connected via Ethernet and the google home devices are connected via WiFi. Is that what you mean?

philippe44 commented 4 years ago

and a bit more. What kind of router and WiFi is that? Are they on the same net or do you have subnets? Some WiFi mesh are doing IGMP snooping which seems to cause problem. If there is nothing else in the log, then it seems to indicate that either the broadcasted address of the virtual AirPlay devices is wrong or there is a firewall that prevents aircast to open a socket to listen to RTSP session requests

brentluna commented 4 years ago

Netgear R6700v3 is the router. I think all the google homes are connected to the 5g band. No mesh system, just the router. I have the 2.4ghz and 5ghz networks but no subnets beyond that.

I tried running the script on my Macbook, that is connected to the 5g wifi, and this is as far the script gets

 ./aircast-osx-multi2 -d all=info
[15:58:53.897574] main:945 Starting aircast version: v0.2.24.7 (Apr  7 2020 @ 14:44:38)
[15:58:53.898064] main:953 no config file, using defaults
[15:58:53.898169] Start:712 Binding to 192.168.1.7
philippe44 commented 4 years ago

So its really looks like something in the router between network segments. I can't tell exactly what, look at multicast and IGMP options for R6700. BTW, it's not a script, it's a C application fully compiled :-)

brentluna commented 4 years ago

There is a Disable IGMP Proxying setting that is checked(enabled) in my settings. Should I uncheck that?

philippe44 commented 4 years ago

Yes, certainly as IGMP proxying is creating issue AFAIK

brentluna commented 4 years ago

Disabling that did not seem to make a difference. Also moved one of the google homes to the 2.4ghz wifi with no change.

philippe44 commented 4 years ago

So I'm running out of ideas at that point. Would need to run wireshark traces of what's happening on the machine trying to AirPlay from. If your macbook sees the virtual devices, try to capture frames between it and the Ubuntu that runs aircast.

brentluna commented 4 years ago

Would it make sense to try a different firmware on my router? Like DD-WRT or Tomato? Not sure if those would give me more flexibility

philippe44 commented 4 years ago

It might - I'm sorry it's difficult to help at that point because it's obviously one of these corner cases that involves WiFi/Network config

brentluna commented 4 years ago

So I installed dd wrt on my router. Messed with some multi cast and IGMP settings. It now works when I run the aircast from my windows desktop (did not before), but I still get the same experience from the ubuntu server.

brentluna commented 4 years ago

I really don't have a lot of network knowledge. I have attached a wireshark capture. I started the capture at the point of me trying to connect to one of the google home devices from itunes on my mac and stopped the capture after itunes gave me a failed to connect dialog. Also, I did filter on a source and destination IP to try and hide some noise, I think i chose the right IPs. I had Airconnect running on the ubuntu server at the time. Is this of any help in diagnosing the problem?

Thanks cast.pcapng.zip

brentluna commented 4 years ago

@philippe44 any other thoughts on this after the wireshark capture? Would it help if i did the same capture while running airconnect on my windows machine, where it seems to work?

philippe44 commented 4 years ago

I don't think the capture contains the exchange between the two. Can you restrict packet capture between where AirConnect runs and the Controller (itunes). If they are both on your mac, you probably need to add a driver that let you capture loopback traffic. I really don't know much about MacOS unfortunately

brentluna commented 4 years ago

So I’m only using OS X to run wire shark and iTunes to try and connect to the chromecast device. Air connect is running on Ubuntu or windows. I’ll try to get a new capture

philippe44 commented 4 years ago

ok, so can you filter just the host to host between Ubuntu and the OSX machines?

jgravois commented 4 years ago

i'm experiencing the same behavior as @brentluna.

aircast-osx-multi running on OSX 10.14.6 Google Home Mini

john@zuzu Downloads $ ./aircast-osx-multi -d all=info
[14:10:53.802622] main:945 Starting aircast version: v0.2.25.0 (May  3 2020 @ 17:41:47)
[14:10:53.803476] main:953 no config file, using defaults
[14:10:53.803648] Start:712 Binding to 192.168.254.12
[14:10:54.403771] AddCastDevice:649 [0x108fbf300]: adding renderer (Nursery speaker)
[14:10:54.404499] AddCastDevice:649 [0x108fbfca8]: adding renderer (Bedroom speaker)
[14:10:54.405175] AddCastDevice:649 [0x108fc0650]: adding renderer (Office speaker)
[14:11:05.568077] rtsp_thread:351 got RTSP connection 10
[14:11:05.574191] rtsp_thread:351 got RTSP connection 11
[14:11:05.578566] rtsp_thread:351 got RTSP connection 12

strangely though, i have no trouble connecting to an existing Sonos device using Sonoair which is apparently uses your code under the hood. 🙏

i'm a network novice as well. i poked around in my router settings and can see that UPnP is enabled but i haven't found a way to manage IGMP proxying yet.

Screen Shot 2020-05-21 at 2 27 15 PM

i'm happy to do more digging if there's any information in particular that would be helpful. either way, thank you for your work on this awesome project. as i said before, i've been enjoying using Airplay with my Sonos speaker flawlessly for some time. 🎹

brentluna commented 4 years ago

@philippe44 Sorry for the delay. I think I accurately set the source and destination IPs on this wireshark capture. Let me know if this is of any help.

Thank you! newcapture.pcapng.zip

brentluna commented 4 years ago

Hey @philippe44 Sorry for pestering you on this. Wondering if you've had a chance to see if that capture I sent a few weeks ago shows anything.

Thanks

Jpunt commented 3 years ago

For your info: I’ve just upgraded my Marshall UX bridge to a Google Nest Audio. I’m running aircast on a Mac and my network is based on Google WiFi.

On my Marshall it all worked, on the Nest Audio i’m getting identical behavior as @brentluna. Maybe it’s something to do with Google home stuff?

philippe44 commented 3 years ago

Can you send a few logs?

Jpunt commented 3 years ago

I'm so sorry, I totally forgot about this. The next day it all worked like a charm! No idea why, because I didn't change any settings.

philippe44 commented 3 years ago

No worries