philippe44 / AirConnect

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

unRAID / Docker / Router issue? #375

Closed dmz94 closed 2 years ago

dmz94 commented 2 years ago

First – many thanks for creating AirConnect. It is EXACTLY what I need and I can see from spending the morning trying to get it to work how popular and widely used it is. I am stuck and cannot get it to work – I am close. I am not sure if I should post here (probably not) as it is not an issue with AirConnect – it is probably “pilot error” on my part. But perhaps if I get it sorted this will help someone else.

I want to use AirConnect to enable my apple devices to communicate with two Chromecasts. These devices can see the “built in” AirPlay inside one of my newer TVs. But the two Chromecasts are not showing up via AIrConnect. Everything is on the sae LAN .

My Setup: I am running the docker from @1activegeek (big thanks!). I am running on unRAID. I have some log information below but it seems incomplete. I am making sure I am running in “host mode”. When I get to the console inside the docker, I can see it picks up the two Chromecasts.

I am happy to gather more data or answer additional questions....

My router is an ASUS RT-AC68U running Merlin. I suspect my issues is with the router. I have enabled IGMP Snooping and have the multicast rate set to “auto”. I have not messed with the IPTV settings in the LAN as I do not think that is applicable (“Enable multicast routing”).

I suspect I need to open my ports up a certain way but cannot quite figure out the settings? This is mentioned in the README but I do not quite get what needs to be done here?

If anyone has tips or advice, I would appreciate it. I know folks have this running on unRAID using the docker. And I suspect others also run Merlin on an ASUS router. Thoughts and ideas appreciated. I have been googling and trying things for hours with no joy – Thanks!

=== Docker Build Command ===

root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='AirConnect' --net='host' -e TZ="Europe/London" -e HOST_OS="Unraid" '1activegeek/airconnect' dc1a24076d88b6025092138ba4d524472dddfb535e24af2a3ef0fb7b743b58e7

=== output from inside the aircast docker ===

# aircast-x86-64 -d all=debug
[11:57:08.082066] main:974 Starting aircast version: v0.2.51.1 (Sep 30 2021 @ 23:17:26)
[11:57:08.082133] main:982 no config file, using defaults
[11:57:08.082196] Start:732 Binding to 192.168.1.115
[11:57:08.085686] mDNSsearchCallback:405 ----------------- round ------------------
[11:57:08.085706] mDNSsearchCallback:409 [ACTIVE] host 192.168.1.163, srv 192.168.1.163, name Chromecast-3d3dd397552c1a893757d339e7c6f812._googlecast._tcp.local 
[11:57:08.085719] AddCastDevice:669 [0x693ff0]: adding renderer (Loft TV)
[11:57:08.085734] AddCastDevice:675 [0x693ff0]: creating MAC 693ffa
[11:57:08.085890] bind_socket:791 socket binding 10 on port 59001
[11:57:08.085975] mDNSsearchCallback:405 ----------------- round ------------------
[11:57:08.085983] mDNSsearchCallback:409 [ACTIVE] host 192.168.1.208, srv 192.168.1.208, name Chromecast-e6c5eb45487f51f27ce3e0eb325e6c35._googlecast._tcp.local 
[11:57:08.085991] AddCastDevice:669 [0x694988]: adding renderer (Family room TV)
[11:57:08.086002] AddCastDevice:675 [0x694988]: creating MAC 694992
[11:57:08.086110] bind_socket:791 socket binding 12 on port 53357
exit
[11:57:12.612044] main:1091 stopping Cast devices ...
[11:57:12.612064] Stop:774 terminate search thread ...
[11:57:12.643353] Stop:779 flush renderers ...
[11:57:12.643673] DeleteCastDevice:512 [0x693ff0]: Cast device stopped
[11:57:12.643861] DeleteCastDevice:512 [0x694988]: Cast device stopped
[11:57:13.144429] Stop:787 terminate main thread ...
[11:57:13.144470] main:1093 all done
# 

=== unRAID logs ===

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...
usermod: no changes

-------------------------------------
_ ()
| | ___ _ __
| | / __| | | / \
| | \__ \ | | | () |
|_| |___/ |_| \__/

Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid: 911
User gid: 911
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-install: executing...
Checking for valid arch options
Proceeding with x86-64 arch
--2021-10-26 11:48:29-- https://raw.githubusercontent.com/philippe44/AirConnect/master/bin/airupnp-x86-64
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.109.133, 185.199.108.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 694040 (678K) [application/octet-stream]
Saving to: ‘/bin/airupnp-x86-64’

0K .......... .......... .......... .......... .......... 7% 5.18M 0s
50K .......... .......... .......... .......... .......... 14% 5.16M 0s
100K .......... .......... .......... .......... .......... 22% 6.60M 0s
150K .......... .......... .......... .......... .......... 29% 6.83M 0s
200K .......... .......... .......... .......... .......... 36% 7.03M 0s
250K .......... .......... .......... .......... .......... 44% 6.85M 0s
300K .......... .......... .......... .......... .......... 51% 6.81M 0s
350K .......... .......... .......... .......... .......... 59% 4.90M 0s
400K .......... .......... .......... .......... .......... 66% 6.56M 0s
450K .......... .......... .......... .......... .......... 73% 6.67M 0s
500K .......... .......... .......... .......... .......... 81% 6.57M 0s
550K .......... .......... .......... .......... .......... 88% 7.19M 0s
600K .......... .......... .......... .......... .......... 95% 6.75M 0s
650K .......... .......... ....... 100% 6.35M=0.1s

2021-10-26 11:48:29 (6.30 MB/s) - ‘/bin/airupnp-x86-64’ saved [694040/694040]

--2021-10-26 11:48:29-- https://raw.githubusercontent.com/philippe44/AirConnect/master/bin/aircast-x86-64
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.109.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 596440 (582K) [application/octet-stream]
Saving to: ‘/bin/aircast-x86-64’

0K .......... .......... .......... .......... .......... 8% 5.39M 0s
50K .......... .......... .......... .......... .......... 17% 4.32M 0s
100K .......... .......... .......... .......... .......... 25% 6.88M 0s
150K .......... .......... .......... .......... .......... 34% 6.85M 0s
200K .......... .......... .......... .......... .......... 42% 7.12M 0s
250K .......... .......... .......... .......... .......... 51% 6.96M 0s
300K .......... .......... .......... .......... .......... 60% 6.31M 0s
350K .......... .......... .......... .......... .......... 68% 6.49M 0s
400K .......... .......... .......... .......... .......... 77% 5.05M 0s
450K .......... .......... .......... .......... .......... 85% 6.61M 0s
500K .......... .......... .......... .......... .......... 94% 8.18M 0s
550K .......... .......... .......... .. 100% 6.64M=0.09s

2021-10-26 11:48:30 (6.22 MB/s) - ‘/bin/aircast-x86-64’ saved [596440/596440]

[cont-init.d] 30-install: exited 1.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2021-10-26 11:48:30,425 CRIT Supervisor running as root (no user in config file)
2021-10-26 11:48:30,428 INFO supervisord started with pid 288
2021-10-26 11:48:31,430 INFO spawned: 'airupnp-x86-64' with pid 293
2021-10-26 11:48:31,431 INFO spawned: 'aircast-x86-64' with pid 294
2021-10-26 11:48:32,488 INFO success: airupnp-x86-64 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-10-26 11:48:32,488 INFO success: aircast-x86-64 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
1activegeek commented 2 years ago

Knowing that you can see the logs indicating it's picking up the devices tells me the container is "working", but your apple devices are not seeing the targets. If you are in Host mode for the container, that should map on unRAID to a local port on the box, so it should be fine from a network reachability standpoint (aka no special ports). What is likely happening, is the mDNS service on your network isn't properly propagating the details the iOS devices need to identify the target. I'm not sure if that is an unRAID thing (possibly, it's been awhile since I've run it myself), it could be on the Router config, and/or it could be from the iOS devices being on wireless vs wired (still a router config scenario).

Just to clarify as I think I made an assumption here - are you only using Wifi on iOS devices? Do you have a Mac desktop/laptop enabled device to try? Or an ethernet adapter for iPad that can be used to test local network connectivity AirPlay targeting? Can help rule out if it's something specific to a wifi network and/or related to the Wifi.

dmz94 commented 2 years ago

@1activegeek - Thanks for the above and thanks for the docker! I do think it is a network / router issue as well

You have made the correct assumptions - I am using an iPhone and an iPad and they are on wireless. They can both see the TV that has AirPlay built in but no ChromCasts. I do not have an iOS laptop or desktop. I do not have an lighting/ethernet dongle...But could potentially see if friends have one I could borrow?

What ports need to be open in the router - if any - for AirConnect?

1activegeek commented 2 years ago

Is the TV on Wifi or hardwired? If Wifi, and (I assume the chrome casts are also wifi) - it could be possible the devices are not properly able to see/use mDNS of devices on the local physical ethernet network (I know wifi is connected to it, but there are separation layers of course) vs the Wifi. If on Ethernet, I'd probably be a bit more stumped as the actual airplay "target" should be the docker container on the host that would then parrot or replicate the sound to the chrome cast.

dmz94 commented 2 years ago

TVs are hardwired. Chromecasts are also on ethernet. UnRAID is on ethernet.

I will unhook one later today and see if that works when the TV and CC are on the WiFi.

Clipboard01 .

dmz94 commented 2 years ago

Pulled the TV and Chromecast off the ethernet. Added to Wifi (and confirmed they were on WiFi).

Still did not show up.

1activegeek commented 2 years ago

Interesting - one because I wasn't even aware there were Chromecast devices with ethernet! 😆 But if all those devices are on local LAN, and the iOS devices are only on Wifi, then just the fact that the TV shows up on the phone, but not the Chromecast immediately makes it a bit weird. I'm not sure I have much more thought on what could be wrong. It seems correct - it may have to come down to running some TCPDumps off the router to identify what the traffic looks like and see if the AirPlay targets are properly being advertised. If not, then there may be something wrong on the container side for advertising the targets vs being able to reach out and find the Chromecasts.

I'm sure you likely did, but take a poke around on closed issues on my container repo on GH, and/or the unRAID forums. I feel like I do remember someone specifically having a similar type of issue and there was something they had restricting the unRAID box from properly advertising the targets even with Host mode. I have this slight bit of deja-vu to a similar scenario, but for the life of me I can't fully remember what it was, where I read it, or how it was fixed. 😞

philippe44 commented 2 years ago

Try to use a mDNS listener to see if he sees the proxied devices. Then use mine here https://github.com/philippe44/mDNS-SD as well to see if it spots them.

dmz94 commented 2 years ago

I downloaded this handy tool and here are the results:

I am trying to build your tool but having issues. I have not coded in 20+ years. It builds fine for W10 using Embarcadero C++ but crashed when I run it. I note there is a DLL - I cannot seem to add that to W10 and do not know how to build it into the app? And I cannot find the error messages to see why it is crashing.

screen 1

screen 2

screen 3

philippe44 commented 2 years ago

You don't need to build my tool, all binaries are there. Re what your current tool is finding, it seems that the AirConnect devices are found

dmz94 commented 2 years ago

I have downloaed the Windows binary. It does not run on my Win10 machine. I also downloaded the DLL and tried to load that and that odes not work either. Maybe I am downloading it incorrectly....will try again.

philippe44 commented 2 years ago

If you have all DLLs downloaded but still missing an extra one (I think it might happen on Win10), it should tell you which one is missing

dmz94 commented 2 years ago

I have tried on two different W10 machines. When I run the executable - I see a "flash" like the app is trying to run but it then disappears. Is there a version for Android or iOS? I could also create a VM in unRAID and run it on a flavor of Linux?

philippe44 commented 2 years ago

Oh, you should run it in a command box, not just by clicking it

dmz94 commented 2 years ago

OK - that works - Thanks! But what should I put in for the parameters to get useful information to debug this please? Thanks!

philippe44 commented 2 years ago

"mdnssd-win _raop._tcp" to start with

dmz94 commented 2 years ago

Here is what it says...

Loft TV+ and Family Room TV+ are the two Chromecasts (probably obvious).

using interface 192.168.1.154
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 0s ACTIVE
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 0s EXPIRED
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 0s ACTIVE
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 0s EXPIRED
------------------------------
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 3s EXPIRED
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 3s EXPIRED
------------------------------
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 3s EXPIRED
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 3s EXPIRED
------------------------------
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 3s EXPIRED
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 3s EXPIRED
------------------------------
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 3s EXPIRED
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 3s EXPIRED
------------------------------
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 3s EXPIRED
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 3s EXPIRED
------------------------------
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 4s EXPIRED
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 4s EXPIRED
------------------------------
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 4s EXPIRED
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 4s EXPIRED
------------------------------
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 7s EXPIRED
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 7s EXPIRED
------------------------------
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 8s EXPIRED
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 8s EXPIRED
------------------------------
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 10s EXPIRED
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 10s EXPIRED
------------------------------
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 10s EXPIRED
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 10s EXPIRED
------------------------------
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 10s EXPIRED
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 10s EXPIRED
------------------------------
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 10s EXPIRED
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 10s EXPIRED
------------------------------
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 10s EXPIRED
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 10s EXPIRED
philippe44 commented 2 years ago

Sorry, I meant "mdnssd-win _raop._tcp.local". Services should not be expired

dmz94 commented 2 years ago

Here you go....192.168.1.115 is the unRAID server where the AirConnect docker is running.

C:\WINDOWS\system32>C:\Users\dzack\Desktop\mDNS-SD-2\bin\mdnssd-win.exe _raop._tcp.local
using interface 192.168.1.154
[192.168.1.115] 192.168.1.115   37649   CCCCAB24D084@Loft TV+._raop._tcp.local 0s ACTIVE
[192.168.1.115] 192.168.1.115   34115   CCCCCCE4B35F@Family room TV+._raop._tcp.local 0s ACTIVE

philippe44 commented 2 years ago

So everything is as expected for a computer connected to your network the way this Win10 machine is. Have you double checked the Ethernet-Wifi filtering and things like IGMP snooping & multicast?

dmz94 commented 2 years ago

"Have you double checked the Ethernet-Wifi filtering and things like IGMP snooping & multicast?"

As best as I can. I am on an ASUS RT-AC68U running Merlin. I can post in the Merlin group if you can explain what you mean by the above? I am pretty sure i have IGMP and multicast on. Not sure what "Ethernet-Wifi filtering" is?

I am also concerned about my ports - what ports should be open, if any, on the router?

philippe44 commented 2 years ago

See https://github.com/philippe44/AirConnect#misc-tips

dmz94 commented 2 years ago

See https://github.com/philippe44/AirConnect#misc-tips

@philippe44 - for grins, I went back and tried to see if this worked. It ALMOST works now.

It shows up on the TV (via the Chromecast). I can see a video window (but it is black but a pause icon appears briefly) and I can here the sound of the stream but it is very soft. This is a lot further in the process than before.

Now that it is doing this, any ideas or pointers on getting the actual video working and the volume level higher? Thanks!

PXL_20220130_161046232

PXL_20220130_161036809

PXL_20220130_161020823

dmz94 commented 2 years ago

It appears I am being an idiot and this is AUDIO only. Doh!!

Bummer but it now works (at least the audio). I wonder what changed on my network or the docker over the past few months.

Thanks!