mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.2k stars 571 forks source link

Shairport device (under RaspiOS Buster Lite on Rpi 3 B+) intermittently invisible to IOS devices #1116

Closed gknepp closed 3 years ago

gknepp commented 3 years ago

Device works great when I can find it, but about half the time it does not appear on IOS devices. The other half it does.

Pi runs happily on Unifi network with USG and 4 APs, network is solid, tried all of the suggestions in "troubleshooting". Wifi power save is off. UFW is not installed on Buster Lite. Sounds is fine when connected. mDNS reflection is enabled on Unifi setup. (Even though I shouldn't need it as all devices are on same subnet.)

Itunes and Tuneblade on wired Windows machine always seem to find the device. IOS devices with various levels of IOS are flaky as described above.

When device is not seen, Discovery app does not show an _raop._tcp. entry for the Shairport device, but other devices (Denon receiver and airport express) do appear.

More specific info follows.

Thanks so much for any help!

Greg

pi@mbr-pi-speakers:~ $ shairport-sync -V
3.3.8rc1-OpenSSL-Avahi-ALSA-metadata-sysconfdir:/usr/local/etc
pi@mbr-pi-speakers:~ $ iwconfig
wlan0     IEEE 802.11  ESSID:"west_sj"
          Mode:Managed  Frequency:2.437 GHz  Access Point: 80:2A:A8:57:EF:DE
          Bit Rate=72.2 Mb/s   Tx-Power=31 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=63/70  Signal level=-47 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

eth0      no wireless extensions.

lo        no wireless extensions.
pi@mbr-pi-speakers:~ $ sudo systemctl status shairport-sync.service
● shairport-sync.service - Shairport Sync - AirPlay Audio Receiver
   Loaded: loaded (/lib/systemd/system/shairport-sync.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2020-12-11 17:34:18 PST; 3 days ago
 Main PID: 483 (shairport-sync)
    Tasks: 13 (limit: 2063)
   CGroup: /system.slice/shairport-sync.service
           └─483 /usr/local/bin/shairport-sync

Discovery output (When device is seen):

mbr-pi-speakers.local:5000
192.168.1.125:5000
fe80::92ab:17e5:8173:283%en0:5000

am = ShairportSync
ch = 2
cn = 0,1
da = true
ek = 1
et = 0,1
fv = 76400.10
md = 0,1,2
pw = false
sf = 0x4
sr = 44100
ss = 16
sv = false
tp = TCP,UDP
txtvers = 1
vn = 65537
vs = 105.1  
mikebrady commented 3 years ago

Thanks for the post. It's a real puzzler, but my suspicion would fall on some kind of network issue.

A Pi 3B+ running Raspberry Pi OS Buster Lite is absolutely fine as a Shairport Sync device. From what you have described, it seems to be working properly. It might be worth running avahi-browse on it when it seems to have disappeared just to check that it is still sending the mDNS advertisement to the network, though it seems as if it must be, since it can always be seen by wired devices.

Since you have 4 APs, then could a scenario arise where the Pi is on one AP and the iOS device on a different one? If so, then I wonder if it is possible that mDNS stuff is not being transferred from AP to AP correctly. If that was the case, then moving the Pi onto the wired network might help, in that there would then be an Ethernet-to-AP connection (which seems to work reliably) as distinct from an AP-to-AP connection.

I have no experience of the Ubiquiti USG, though I use their APs and they are rock solid.

gknepp commented 3 years ago

Thanks so much for the prompt reply Mike!

avahi-browse output is below, apologies for the length - i'm not sure to limit it to what's interesting so you get it all. :-)

Because Discovery also doesn't find the device when IOS devices don't, I suspect it does have something to do with advertising the device.

I think iTunes and Tuneblade might be caching connection information and that's why they can connect when IOS devices don't as they appear to send a query with every connection attempt. Is this possible?

I can connect to ethernet for testing, but it's not a viable long term solution as I don;t have a wired connection near the intended position of the shairport device.

Thanks, Greg

pi@mbr-pi-speakers:~ $ avahi-browse -ar
+  wlan0 IPv6 254477237                                     _teamviewer._tcp     local
+  wlan0 IPv4 254477237                                     _teamviewer._tcp     local
+  wlan0 IPv6 iTunes_Ctrl_0011324287056013                  iTunes Remote Control local
+  wlan0 IPv6 iTunes_Ctrl_0011324287056012                  iTunes Remote Control local
+  wlan0 IPv6 iTunes_Ctrl_0011324287056011                  iTunes Remote Control local
+  wlan0 IPv6 iTunes_Ctrl_0011324287056015                  iTunes Remote Control local
+  wlan0 IPv6 iTunes_Ctrl_0011324287056016                  iTunes Remote Control local
+  wlan0 IPv6 iTunes_Ctrl_0011324287056014                  iTunes Remote Control local
+  wlan0 IPv4 iTunes_Ctrl_E8F4A437635F8949                  iTunes Remote Control local
+  wlan0 IPv4 iTunes_Ctrl_0011324287056013                  iTunes Remote Control local
+  wlan0 IPv4 iTunes_Ctrl_0011324287056012                  iTunes Remote Control local
+  wlan0 IPv4 iTunes_Ctrl_0011324287056011                  iTunes Remote Control local
+  wlan0 IPv4 iTunes_Ctrl_0011324287056015                  iTunes Remote Control local
+  wlan0 IPv4 iTunes_Ctrl_0011324287056016                  iTunes Remote Control local
+  wlan0 IPv4 iTunes_Ctrl_0011324287056014                  iTunes Remote Control local
+  wlan0 IPv4 Family Room                                   _spotify-connect._tcp local
+  wlan0 IPv6 Living Room Speakers                          _airplay._tcp        local
+  wlan0 IPv4 Living Room Speakers                          _airplay._tcp        local
+  wlan0 IPv4 Family Room                                   _airplay._tcp        local
+  wlan0 IPv6 F59A4852EC69@Master Bedroom Speakers          AirTunes Remote Audio local
+  wlan0 IPv6 AC7F3EE7B5B6@Living Room Speakers             AirTunes Remote Audio local
+  wlan0 IPv4 AC7F3EE7B5B6@Living Room Speakers             AirTunes Remote Audio local
+  wlan0 IPv4 0005CDAE82F2@Family Room                      AirTunes Remote Audio local
+  wlan0 IPv4 F59A4852EC69@Master Bedroom Speakers          AirTunes Remote Audio local
=  wlan0 IPv4 Family Room                                   _spotify-connect._tcp local
   hostname = [Family-Room.local]
   address = [192.168.1.220]
   port = [80]
   txt = ["CPath=/spotify" "VERSION=1.0"]
=  wlan0 IPv6 Living Room Speakers                          _airplay._tcp        local
   hostname = [Living-Room-AX.local]
   address = [169.254.204.30]
   port = [7000]
   txt = ["pk=d5fbfd308694f673352bd3422834a794fa8657652bb946d8a1361cc6dc5cac25" "gcgl=0" "gid=3e9ef99c-b9c7-4cc7-8862-12                                                                                                                     1e5bd20abb" "pi=3e9ef99c-b9c7-4cc7-8862-121e5bd20abb" "srcvers=366.0" "protovers=1.1" "serialNumber=C86L9ARFDV2R" "manuf                                                                                                                     acturer=Apple Inc." "model=AirPort10,115" "flags=0x4" "fv=p20.78100.3" "rsf=0x0" "features=0x445D0A00,0x1C340" "deviceid                                                                                                                     =AC:7F:3E:E7:B5:B6" "acl=0"]
=  wlan0 IPv4 Living Room Speakers                          _airplay._tcp        local
   hostname = [Living-Room-AX.local]
   address = [169.254.204.30]
   port = [7000]
   txt = ["pk=d5fbfd308694f673352bd3422834a794fa8657652bb946d8a1361cc6dc5cac25" "gcgl=0" "gid=3e9ef99c-b9c7-4cc7-8862-12                                                                                                                     1e5bd20abb" "pi=3e9ef99c-b9c7-4cc7-8862-121e5bd20abb" "srcvers=366.0" "protovers=1.1" "serialNumber=C86L9ARFDV2R" "manuf                                                                                                                     acturer=Apple Inc." "model=AirPort10,115" "flags=0x4" "fv=p20.78100.3" "rsf=0x0" "features=0x445D0A00,0x1C340" "deviceid                                                                                                                     =AC:7F:3E:E7:B5:B6" "acl=0"]
=  wlan0 IPv4 Family Room                                   _airplay._tcp        local
   hostname = [Family-Room.local]
   address = [192.168.1.220]
   port = [43383]
   txt = ["pk=135529612deeab9c3f7287254dbc15d91c921e117e4ddea505e08fd6537e1cca" "gcgl=0" "gid=72eb7152-b927-4064-abcb-97                                                                                                                     f6464c61ba" "pi=72eb7152-b927-4064-abcb-97f6464c61ba" "srcvers=366.0" "protovers=1.1" "serialNumber=AZA12180302799" "man                                                                                                                     ufacturer=Sound United" "model=AVR-S640H" "flags=0x4" "fv=p20.1.583.161" "rsf=0x0" "features=0x445F8A00,0x1C340" "device                                                                                                                     id=00:05:CD:AE:82:F2" "acl=0"]
=  wlan0 IPv6 AC7F3EE7B5B6@Living Room Speakers             AirTunes Remote Audio local
   hostname = [Living-Room-AX.local]
   address = [169.254.204.30]
   port = [7000]
   txt = ["pk=d5fbfd308694f673352bd3422834a794fa8657652bb946d8a1361cc6dc5cac25" "vs=366.0" "vn=65537" "tp=UDP" "sf=0x4"                                                                                                                      "am=AirPort10,115" "md=2" "fv=p20.78100.3" "ft=0x445D0A00,0x1C340" "et=0,4" "da=true" "cn=0,1"]
=  wlan0 IPv4 AC7F3EE7B5B6@Living Room Speakers             AirTunes Remote Audio local
   hostname = [Living-Room-AX.local]
   address = [169.254.204.30]
   port = [7000]
   txt = ["pk=d5fbfd308694f673352bd3422834a794fa8657652bb946d8a1361cc6dc5cac25" "vs=366.0" "vn=65537" "tp=UDP" "sf=0x4"                                                                                                                      "am=AirPort10,115" "md=2" "fv=p20.78100.3" "ft=0x445D0A00,0x1C340" "et=0,4" "da=true" "cn=0,1"]
=  wlan0 IPv4 0005CDAE82F2@Family Room                      AirTunes Remote Audio local
   hostname = [Family-Room.local]
   address = [192.168.1.220]
   port = [43383]
   txt = ["pk=135529612deeab9c3f7287254dbc15d91c921e117e4ddea505e08fd6537e1cca" "vs=366.0" "vn=65537" "tp=UDP" "sf=0x4"                                                                                                                      "am=AVR-S640H" "md=0,1,2" "fv=p20.1.583.161" "ft=0x445F8A00,0x1C340" "et=0,4" "da=true" "cn=0,1"]
=  wlan0 IPv4 F59A4852EC69@Master Bedroom Speakers          AirTunes Remote Audio local
   hostname = [mbr-pi-speakers.local]
   address = [192.168.1.125]
   port = [5000]
   txt = ["pw=false" "txtvers=1" "ch=2" "cn=0,1" "ek=1" "et=0,1" "sv=false" "da=true" "sr=44100" "ss=16" "md=0,1,2" "vn=                                                                                                                     65537" "tp=TCP,UDP" "vs=105.1" "am=ShairportSync" "fv=76400.10" "sf=0x4"]
=  wlan0 IPv4 254477237                                     _teamviewer._tcp     local
   hostname = [Greg-Knepps-MacBook-Pro.local]
   address = [192.168.1.191]
   port = [2020]
   txt = ["UUID=d51b5f6f-01a8-4f23-a624-5ba93d6d79c6" "Token=Oa4zu9QvwK6i9xFt" "DyngateID=254477237"]
=  wlan0 IPv6 254477237                                     _teamviewer._tcp     local
   hostname = [Greg-Knepps-MacBook-Pro.local]
   address = [192.168.1.191]
   port = [2020]
   txt = ["UUID=d51b5f6f-01a8-4f23-a624-5ba93d6d79c6" "Token=Oa4zu9QvwK6i9xFt" "DyngateID=254477237"]
+  wlan0 IPv6 70-35-10-70.1 Living Room AX                  _sleep-proxy._udp    local
+  wlan0 IPv4 70-35-10-70.1 Living Room AX                  _sleep-proxy._udp    local
+  wlan0 IPv6 H5EICOLCU56d4HhMYoWC5A@rm0yHg9NWSaDWaAFkstkVA _acp-sync._tcp       local
+  wlan0 IPv4 H5EICOLCU56d4HhMYoWC5A@rm0yHg9NWSaDWaAFkstkVA _acp-sync._tcp       local
+  wlan0 IPv6 Living Room AX                                Apple AirPort        local
+  wlan0 IPv4 Living Room AX                                Apple AirPort        local
=  wlan0 IPv6 Living Room AX                                Apple AirPort        local
   hostname = [Living-Room-AX.local]
   address = [169.254.204.30]
   port = [5009]
   txt = ["waMA=AC-7F-3E-E7-B5-B6,raMA=88-1F-A1-44-CE-F8,raM2=88-1F-A1-44-CE-F9,raNm=west_sj,raSt=1,raNA=0,syFl=0x88C,sy                                                                                                                     AP=115,syVs=7.8.1,srcv=78100.3,bjSd=6"]
=  wlan0 IPv4 Living Room AX                                Apple AirPort        local
   hostname = [Living-Room-AX.local]
   address = [169.254.204.30]
   port = [5009]
   txt = ["waMA=AC-7F-3E-E7-B5-B6,raMA=88-1F-A1-44-CE-F8,raM2=88-1F-A1-44-CE-F9,raNm=west_sj,raSt=1,raNA=0,syFl=0x88C,sy                                                                                                                     AP=115,syVs=7.8.1,srcv=78100.3,bjSd=6"]
+  wlan0 IPv4 Family Room                                   _heos-audio._tcp     local
+  wlan0 IPv4 Family Room                                   Web Site             local
=  wlan0 IPv4 Family Room                                   _heos-audio._tcp     local
   hostname = [Family-Room.local]
   address = [192.168.1.220]
   port = [10101]
   txt = ["model=Denon AVR-S640H" "vers=1.583.161" "did=3C424E4F0005CDAE82F2"]
=  wlan0 IPv4 Family Room                                   Web Site             local
   hostname = [Family-Room.local]
   address = [192.168.1.220]
   port = [80]
   txt = ["path=/settings/"]
+  wlan0 IPv6 DS214se_NAS                                   _device-info._tcp    local
+  wlan0 IPv6 DS214se_NAS                                   Microsoft Windows Network local
+  wlan0 IPv6 DS214se_NAS                                   Web Site             local
+  wlan0 IPv6 DS214se_NAS                                   Apple File Sharing   local
=  wlan0 IPv6 iTunes_Ctrl_0011324287056015                  iTunes Remote Control local
   hostname = [DS214se_NAS.local]
   address = [fe80::211:32ff:fe42:8705]
   port = [6015]
   txt = ["Ver=131077" "txtvers=1"]
=  wlan0 IPv6 iTunes_Ctrl_0011324287056011                  iTunes Remote Control local
   hostname = [DS214se_NAS.local]
   address = [fe80::211:32ff:fe42:8705]
   port = [6011]
   txt = ["Ver=131077" "txtvers=1"]
=  wlan0 IPv6 iTunes_Ctrl_0011324287056012                  iTunes Remote Control local
   hostname = [DS214se_NAS.local]
   address = [fe80::211:32ff:fe42:8705]
   port = [6012]
   txt = ["Ver=131077" "txtvers=1"]
=  wlan0 IPv6 iTunes_Ctrl_0011324287056013                  iTunes Remote Control local
   hostname = [DS214se_NAS.local]
   address = [fe80::211:32ff:fe42:8705]
   port = [6013]
   txt = ["Ver=131077" "txtvers=1"]
=  wlan0 IPv6 iTunes_Ctrl_0011324287056014                  iTunes Remote Control local
   hostname = [DS214se_NAS.local]
   address = [fe80::211:32ff:fe42:8705]
   port = [6014]
   txt = ["Ver=131077" "txtvers=1"]
=  wlan0 IPv6 iTunes_Ctrl_0011324287056016                  iTunes Remote Control local
   hostname = [DS214se_NAS.local]
   address = [fe80::211:32ff:fe42:8705]
   port = [6016]
   txt = ["Ver=131077" "txtvers=1"]
+  wlan0 IPv4 DS214se_NAS                                   _device-info._tcp    local
+  wlan0 IPv4 DS214se_NAS                                   Microsoft Windows Network local
+  wlan0 IPv4 DS214se_NAS                                   Web Site             local
+  wlan0 IPv4 DS214se_NAS                                   Apple File Sharing   local
=  wlan0 IPv4 iTunes_Ctrl_0011324287056014                  iTunes Remote Control local
   hostname = [DS214se_NAS.local]
   address = [192.168.1.5]
   port = [6014]
   txt = ["Ver=131077" "txtvers=1"]
=  wlan0 IPv4 iTunes_Ctrl_0011324287056016                  iTunes Remote Control local
   hostname = [DS214se_NAS.local]
   address = [192.168.1.5]
   port = [6016]
   txt = ["Ver=131077" "txtvers=1"]
=  wlan0 IPv4 iTunes_Ctrl_0011324287056015                  iTunes Remote Control local
   hostname = [DS214se_NAS.local]
   address = [192.168.1.5]
   port = [6015]
   txt = ["Ver=131077" "txtvers=1"]
=  wlan0 IPv4 iTunes_Ctrl_0011324287056011                  iTunes Remote Control local
   hostname = [DS214se_NAS.local]
   address = [192.168.1.5]
   port = [6011]
   txt = ["Ver=131077" "txtvers=1"]
=  wlan0 IPv4 iTunes_Ctrl_0011324287056012                  iTunes Remote Control local
   hostname = [DS214se_NAS.local]
   address = [192.168.1.5]
   port = [6012]
   txt = ["Ver=131077" "txtvers=1"]
=  wlan0 IPv4 iTunes_Ctrl_0011324287056013                  iTunes Remote Control local
   hostname = [DS214se_NAS.local]
   address = [192.168.1.5]
   port = [6013]
   txt = ["Ver=131077" "txtvers=1"]
=  wlan0 IPv6 DS214se_NAS                                   _device-info._tcp    local
   hostname = [DS214se_NAS.local]
   address = [fe80::211:32ff:fe42:8705]
   port = [0]
   txt = ["model=Xserve"]
=  wlan0 IPv6 DS214se_NAS                                   Microsoft Windows Network local
   hostname = [DS214se_NAS.local]
   address = [fe80::211:32ff:fe42:8705]
   port = [445]
   txt = []
=  wlan0 IPv6 DS214se_NAS                                   Web Site             local
   hostname = [DS214se_NAS.local]
   address = [fe80::211:32ff:fe42:8705]
   port = [5000]
   txt = ["mac_address=00:11:32:42:87:05" "secure_admin_port=5001" "admin_port=5000" "version_build=25426" "version_mino                                                                                                                     r=2" "version_major=6" "serial=1510M8N715105" "model=DS214se" "vendor=Synology"]
=  wlan0 IPv6 DS214se_NAS                                   Apple File Sharing   local
   hostname = [DS214se_NAS.local]
   address = [fe80::211:32ff:fe42:8705]
   port = [548]
   txt = []
=  wlan0 IPv4 DS214se_NAS                                   _device-info._tcp    local
   hostname = [DS214se_NAS.local]
   address = [192.168.1.5]
   port = [0]
   txt = ["model=Xserve"]
=  wlan0 IPv4 DS214se_NAS                                   Microsoft Windows Network local
   hostname = [DS214se_NAS.local]
   address = [192.168.1.5]
   port = [445]
   txt = []
=  wlan0 IPv4 DS214se_NAS                                   Web Site             local
   hostname = [DS214se_NAS.local]
   address = [192.168.1.5]
   port = [5000]
   txt = ["mac_address=00:11:32:42:87:05" "secure_admin_port=5001" "admin_port=5000" "version_build=25426" "version_mino                                                                                                                     r=2" "version_major=6" "serial=1510M8N715105" "model=DS214se" "vendor=Synology"]
=  wlan0 IPv4 DS214se_NAS                                   Apple File Sharing   local
   hostname = [DS214se_NAS.local]
   address = [192.168.1.5]
   port = [548]
   txt = []
=  wlan0 IPv6 F59A4852EC69@Master Bedroom Speakers          AirTunes Remote Audio local
   hostname = [mbr-pi-speakers.local]
   address = [fe80::92ab:17e5:8173:283]
   port = [5000]
   txt = ["pw=false" "txtvers=1" "ch=2" "cn=0,1" "ek=1" "et=0,1" "sv=false" "da=true" "sr=44100" "ss=16" "md=0,1,2" "vn=                                                                                                                     65537" "tp=TCP,UDP" "vs=105.1" "am=ShairportSync" "fv=76400.10" "sf=0x4"]
+  wlan0 IPv4 HP8300-DESKTOP@TuneBlade                      Web Site             local
=  wlan0 IPv4 iTunes_Ctrl_E8F4A437635F8949                  iTunes Remote Control local
   hostname = [HP8300-Desktop.local]
   address = [192.168.1.149]
   port = [63386]
   txt = ["OSsi=0x1F5" "DbId=929CEC49A3D3838C" "Ver=131077" "txtvers=1"]
=  wlan0 IPv4 HP8300-DESKTOP@TuneBlade                      Web Site             local
   hostname = [HP8300-Desktop.local]
   address = [192.168.1.149]
   port = [51645]
   txt = ["Password=False"]
+  wlan0 IPv6 USGRouter [78:8a:20:44:81:69]                 Workstation          local
=  wlan0 IPv6 USGRouter [78:8a:20:44:81:69]                 Workstation          local
   hostname = [USGRouter.local]
   address = [fe80::7a8a:20ff:fe44:8169]
   port = [9]
   txt = []
+  wlan0 IPv4 USGRouter [78:8a:20:44:81:69]                 Workstation          local
=  wlan0 IPv4 USGRouter [78:8a:20:44:81:69]                 Workstation          local
   hostname = [USGRouter.local]
   address = [192.168.1.1]
   port = [9]
   txt = []
=  wlan0 IPv4 70-35-10-70.1 Living Room AX                  _sleep-proxy._udp    local
   hostname = [Living-Room-AX.local]
   address = [169.254.204.30]
   port = [60858]
   txt = []
=  wlan0 IPv4 H5EICOLCU56d4HhMYoWC5A@rm0yHg9NWSaDWaAFkstkVA _acp-sync._tcp       local
   hostname = [Living-Room-AX.local]
   address = [169.254.204.30]
   port = [5009]
   txt = ["bssinfo=AQA" "ssid=west_sj" "mac=AC:7F:3E:E7:B5:B6" "nm=Living Room AX" "cu=4dde65b7-ee90-555f-a5a9-f20ee14e9                                                                                                                     322"]
=  wlan0 IPv6 70-35-10-70.1 Living Room AX                  _sleep-proxy._udp    local
   hostname = [Living-Room-AX.local]
   address = [169.254.204.30]
   port = [60858]
   txt = []
=  wlan0 IPv6 H5EICOLCU56d4HhMYoWC5A@rm0yHg9NWSaDWaAFkstkVA _acp-sync._tcp       local
   hostname = [Living-Room-AX.local]
   address = [169.254.204.30]
   port = [5009]
   txt = ["bssinfo=AQA" "ssid=west_sj" "mac=AC:7F:3E:E7:B5:B6" "nm=Living Room AX" "cu=4dde65b7-ee90-555f-a5a9-f20ee14e9                                                                                                                     322"]
^CGot SIGINT, quitting.
mikebrady commented 3 years ago

Thanks. It does look as if (a) the Pi is advertising the "AirTunes Remote Audio" service properly and (b) the Pi able to see other devices advertising the same service:

+  wlan0 IPv6 F59A4852EC69@Master Bedroom Speakers          AirTunes Remote Audio local
+  wlan0 IPv6 AC7F3EE7B5B6@Living Room Speakers             AirTunes Remote Audio local
+  wlan0 IPv4 AC7F3EE7B5B6@Living Room Speakers             AirTunes Remote Audio local
+  wlan0 IPv4 0005CDAE82F2@Family Room                      AirTunes Remote Audio local
+  wlan0 IPv4 F59A4852EC69@Master Bedroom Speakers          AirTunes Remote Audio local

So, as far as Shairport Sync is concerned, it does seem to be delivering the advertisement for the service to the network, but it just doesn't seem to be getting through to the iOS devices. Connecting the Pi to Ethernet, albeit temporarily, might help elucidate the problem.

gknepp commented 3 years ago

Here's what I've tried:

Ethernet to Pi USB Wifi Dongle in Pi Static IP address for Pi assigned by network Enabling mDNS multi-cast on Router (Unifi USG) Pi Wifi power save is off Channel change on AP

Intermittent appearance of device is more intermittent than ever, There was a 5 hour period today when nothing would bring it back, including Pi reboots and power cycles of the IOS devices. Then it just randomly started showing up again.

An Airport Express and Denon receiver with Airplay Support ALWAYS show up.

When IOS music apps can't see the device, neither can the Discovery app running on that device. (makes sense) At the same time, (with no IOS visibility) avahi-browse shows devices as above. (That doesn't make sense)

All hosts are on the same subnet (192.168.1.xxx).

From the Pi console and the Unifi network controller, the Pi looks connected and happy with a strong wifi signal and good throughput. When connected, the device sounds great, No drops or crackles.

I'm running out of ideas of things to try.

mikebrady commented 3 years ago

Thanks. There are a few interesting things in the avahi-browse log. The Family Room does not advertise any IPv6 information. Secondly, if you look at the entries for Living Room Speakers, two things look a little bit strange. First, on IPv6 and iPv4, it only advertises an IPv4 address. This might be legitimate. Secondly, the IPv4 addresses are self-assigned (169.254...) rather than (192.168...). This might also be legitimate, but it puts it in a different category to the Pi, which is both advertising an IPv6 address and a 192.168... address.

So it still looks like some kind of network configuration issue to me, I've got to say.

LarsFronius commented 3 years ago

Hmm, same here. @gknepp one thing we have in common is actually that we have a unifi setup. I wonder if some setting there could be the culprit? Any chance you updated some components recently?

I am running shairport-sync 3.3.8 and until recently it was working perfectly on all devices. Now mostly only my Macs can lookup the shairport, but it disappeared mostly from iOS (14.3).

gknepp commented 3 years ago

Hi Lars,

I update Unifi firmware regularly, but haven't made any configuration changes in some time. I have a USG router and 4 AP's, all running the same firmware. (3 on one network, one on a second)

I disabled one of the 3 APs to see if the behavior changed and it didn't.

The Shairport device recently stopped showing up entirely rather than intermittently. I had to reboot the Pi to see it again.

Thanks for weighing in and do report back if you find a solution. I'll do likewise.

LarsFronius commented 3 years ago

Hmm, I've found a small thing on the Unifi side which I am monitoring as to whether it improves the situation. Maybe you want to try with me @gknepp: There is a site wide setting "AUTO-OPTIMIZE NETWORK", which claims to "Block multicast and broadcast traffic for high density WiFi networks". I don't know what is considered high density WiFi network, but blocking multicast would effectively block shairport as well.

Screenshot 2021-01-12 at 18 24 16

I have for now opted out of the feature and turned it off and for now the shairport is visible.

gknepp commented 3 years ago

Hi Lars,

FYI - I just checked and this feature has been OFF on my network and I'm still having the issue.

Greg

bronco21016 commented 3 years ago

In your Unifi Controller go to settings for your Wireless networks and try disabling “ Enable multicast enhancement (IGMPv3)”.

I’ve been having AirPlay and Chromecast issues for a few weeks now and this setting is the only thing that seems to reliably fix it. I’m not sure if it coincided with a firmware update or not. I haven’t had a chance to dig into the timeline yet. My controller software hasn’t been updated in quite some time.

LarsFronius commented 3 years ago

Disabled it @bronco21016 - thanks for the tip. For now the shairport is appearing again 👀

bronco21016 commented 3 years ago

I wish I understood more about why it works that way. I just know I’ve been having a nightmare with this so I started toggling every switch related to mDNS/IGMP.

gknepp commented 3 years ago

Bronco - Interesting. I too just found the IGMPv3 switch. It was off while I had the issue. I turned it on yesterday and have not had the issue since. The opposite of your experience. I will report back in a couple of days.

bronco21016 commented 3 years ago

Further reading indicates that if your switch is not compatible then the system should fall back to IGMPv2. I’m wondering if there was a firmware update and it doesn’t fall back gracefully?

LarsFronius commented 3 years ago

@gknepp I can confirm that IGMPv3 switch turned on is definitely the better option on my end too. This week has been good on the shairport side so far :)

bronco21016 commented 3 years ago

I’ve had it off all week and it’s been in and out. I’m going to make another attempt at having it on.

It’s incredibly frustrating when it won’t show up and your toddler is screaming at you for “princess songs” haha.

brycied00d commented 3 years ago

I just commented on https://github.com/mikebrady/shairport-sync/issues/1101#issuecomment-770069610 but it seems like this issue is more active, and perhaps even more relevant to my experience. The cliff's notes for me (all the details are spelled out in the other issue comment):

What this issue here got me to do was install Discovery and look at that on my iPad. Lo, there's a LOT of services "missing"! So it seems like somewhere between the hardwired network and WiFi devices, some mDNS announcements are being filtered out.

The services/devices that are listed in Discovery are a Hue hub, a Sonos AirPlay service, and two Chromecast devices. The devices that are missing is quite a bit longer and includes Spotify Connect devices, OSX machine records (ssh, sftp, rfb), a couple of HTTP services, shairport-sync (obviously), other Sonos announcements (_sonos._tcp) and more. That represents a mix of wired and wireless devices both, connected at various points throughout my home network, and thus ruling out any single network switch or connection path. Additionally, given that some devices with multiple announced services (eg: _sonos._tcp and _airplay._tcp) have only one of their services that reaches the iPad rules out individual devices and network path issues. Even anything I avahi-publish doesn't consistently appear. My iPad just went to sleep and when I woke it back up, there were a couple more services there weren't there before. There appears to be no rhyme nor reason to what's "getting through" to the iPad and what's not.

Additionally, I tested with iTunes over WiFi (same AP, same network as the iPad) and the shairport-sync service appeared on it 100% of the time, and "Bonjour Browser" (old computer so it can't run "Discover) also seemed to list all the same services as I could see on my desktop (avahi-discover), so I'd initially ruled-out any issues with mDNS traffic being filtered between the announcer and receiver.

Current Unifi settings:

Here's hoping we can sort this out.

brycied00d commented 3 years ago

Update: After rebooting the UAP (after making the above changes), IT WORKS! Discovery on the iPad appears to show all expected mDNS-announced services, and more importantly, the shairport-sync is listed under the AirPlay devices, and my iPad has finally successfully connected to it. :tada:

Now to figure out which of the two Unifi settings it was that did it, or maybe it was the reboot...

bronco21016 commented 3 years ago

I'm wondering if it was the Reboot.

I went to set IGMPv3 back to on but the server that hosts my UniFi controller had a separate issue. In the process, my discovery URL was messed up but it resulted in the UAP being rebooted a handful of times as I sorted out the issues.

Now, since the reboot, with IGMPv3 ON, I've had zero issues.

mikebrady commented 3 years ago

So, overall it looks like a Unifi USG-related issue?

bronco21016 commented 3 years ago

Yea, this appears to be a networking issue related to Unifi. Thanks for letting us clutter your inbox while we did some troubleshooting.

brycied00d commented 3 years ago

Also sounds like a couple more ideas for TROUBLESHOOTING.md:

If shairport-sync doesn't show up in the list:

gknepp commented 3 years ago

Folks,

I'm encouraged by the progress here, (Thanks for all the research and info Brycie.) but given the intermittent nature of the problem (Assuming we all have the same one) I'm not convinced we have it solved yet. I've seen it work flawlessly for several days, then just drop out again at the most inconvenient time.

My settings have been the same as Brycie's for some time and I'm still seeing the issue. I do have have multiple AP's. The Shairport device and the IOS device are sometimes connected to different AP's on the same network. Maybe that's a factor for me. I'll try rebooting all the AP's and the USG router. I will report back after a time so we can know that it works (or doesn't) long term.

Thanks, Greg

gknepp commented 3 years ago

No joy folks.....

With Unifi settings = Brycie's, I rebooted my 3 Unifi APs and USG Router. Shairport device was seen with no problem. 3 hours later, the Shairport device is "gone" from mDNS, although, it is clearly on the network.

The device shows up using avahi-browse on the Shairport host, buti s not seen by the Discovery app or any other apps (Spotify,TuneIn Radio, Apple Music) on IOS when connected to any of the AP's.

Mike - I know you were favoring this being a network issue, but I have 2 other Airplay devices (Denon Receiver and Airport Express) which are ALWAYS seen by ALL IOS apps.

To me, this speaks to something being different in Shairport.

Partial avahi-browse results on Shairport host: (rpi 3+):

= wlan0 IPv4 F59A4852EC69@Master Bedroom Speakers AirTunes Remote Audi o local hostname = [mbr-pi-speakers.local] address = [192.168.1.125] port = [5000] txt = ["pw=false" "txtvers=1" "ch=2" "cn=0,1" "ek=1" "et=0,1" "sv=false" "da= true" "sr=44100" "ss=16" "md=0,1,2" "vn=65537" "tp=TCP,UDP" "vs=105.1" "am=Shair portSync" "fv=76400.10" "sf=0x4"] = wlan0 IPv6 F59A4852EC69@Master Bedroom Speakers AirTunes Remote Audi o local hostname = [mbr-pi-speakers.local] address = [fe80::92ab:17e5:8173:283] port = [5000] txt = ["pw=false" "txtvers=1" "ch=2" "cn=0,1" "ek=1" "et=0,1" "sv=false" "da= true" "sr=44100" "ss=16" "md=0,1,2" "vn=65537" "tp=TCP,UDP" "vs=105.1" "am=Shair portSync" "fv=76400.10" "sf=0x4"]

At the same time as these results, "Master Bedroom Speakers" are a no-show on any IOS app.

Greg

alainse commented 3 years ago

Hi there,

We encountered the exact same issue using shairport 3.3.6 and 3.3.7 on our devices.

Testing on my own network this version of shairport was rock solid and always visible, but on other configurations/networks it was frequently disappearing from the network... then back again after a few minutes/hours.

When playing from a device, shairport was also not anymore visible from others.

Then, we tried to run an old version of shairport (2.8.4) on the same configuration and this version was perfectly stable in all our tests networks: always visible and always working.

So it looks like there is something changed between 2.8.4 and 3.3.6 that leads to this instability on some networks.

Hope it helps!

mikebrady commented 3 years ago

Thanks for the information. It is really puzzling. Would you be kind enough the post the version strings please — the response from:

$ shairport-sync -V

Thanks.

bronco21016 commented 3 years ago

To me the common thread has been Ubiquiti gear. This issue has come and gone for all mDNS devices on my network over the last couple of months. For example Chromecast devices have been even more problematic than shairport devices.

So I’ve been focusing mostly on googling around Ubiquiti and finally came up with this....

https://community.ui.com/questions/UniFi-AP-AC-PRO-Not-Crossing-mDNS-Multicast-Broadcast-between-2-4GHz-and-5GHz-Networks/a415d946-0e00-4d5f-bf3b-734a717a1c1c#answer/6420ed88-a73e-4e98-8b47-10d425355f8d

I found this 4 days ago and after disabling the wireless uplink/mesh options on my single UAP, the issue has not come up again. Prior “fixes” that I thought I found, mentioned earlier, typically only lasted a day or two at most.

I haven’t done the digging yet but it seems a recent firmware update enabled this stuff by default. Either way it seems Ubiquiti needs some work on their software.

It’s of course possible there are two separate issues as well and I would be happy to contribute to troubleshooting with guidance.

mikebrady commented 3 years ago

That does look interesting, @bronco21016. I was asking for the version strings in the faint hope that problems might be due to using tinysvcmdns instead of Avahi for the implementation of the mDNS service on Shairport Sync. But you might have found something more relevant alright.

alainse commented 3 years ago

Hi,

Sorry for the lack of response: I am not at the office on friday.

I'll give you the version strings as soon as possible, but I can already say we are not using avahi (not available on our platform) and we are using tinysvcmdns.

Regarding the Ubiquiti problem, it may be an issue, but in our case we tried with two exact same devices plugged on the same switch - one running Shairport 2.8.4 and the other one running 3.3.7: the 2.8.4 was always online, but the 3.3.7 was not always visible.

mikebrady commented 3 years ago

No worries -- take your time, thanks.

LarsFronius commented 3 years ago

There's a new AP firmware (4.3.28.11361) that I am just upgrading to. According to the changelog there's a bugfix for multicast packet drops on gen2 APs when used with a third-party DHCP. At least on my end with an AC Lite and using the built in DHCP server of my router, that sounds like a fairly spot on bugfix. I am giving it a try.

Bugfixes

gknepp commented 3 years ago

I think Bronco's workaround solved my problem, which started this thread! (Thanks Bronco!) I've also had no issues since trying the workaround.

Bronco found there is an apparent Unifi bug in which mDNS communication is unreliable between devices on the 2.4 GHz and 5 GHz bands when mesh WiFi mode is enabled. (even if there is only 1 AP.) (See below for comments on a possible fix in new AP firmware)

This fits my scenario. My Raspberry Pi running Shairport is always on the 2.4 Ghz band. My IOS devices can bounce between the 2.4 and 5 Ghz bands. This would explain the intermittent nature of my problem. When the phone is on 2.4 Ghz, life is good. When it's on 5 Ghz, no joy.

The workaround as Bronco noted is in Unifi Controller sw. In rev 6.0.45, go to settings>site>services. UNCHECK the "enable wireless uplink" checkbox. I imagine there is an app based equivalent. Your mileage may vary with different versions Unifi Controller.

The bad news is that this obviously won't work if you need your WiFi in mesh mode. I have 4 APs and all have hard wired backhaul (uplinks) so I don't need mesh mode. But it appears to be on by default in the Unifi software. If you need mesh mode, one thing to try might be leaving mesh mode on but forcing all devices to the same radio frequency, either through Unifi (eg turn off the AP 5 Ghz radios?) or doing the same in individual devices. This is kind of extreme though and I haven't tried it. Skimming the Unifi forums, it appears this bug has been around for some time now and it's not clear to me whether a formal bug report has been filed or not. This also fits my scenario as I tried Shairport some time ago (at least a year?) and threw in the towel after much debugging with no progress.

Late breaking - I'll also try the new Unifi firmware that Lars points to. However, the bug description specifically mentions the problem is with non-Unifi DHCP servers and mine is in the Unifi USG Router, so I'm not expecting too much help for my config.

Greg

gknepp commented 3 years ago

Solution: Unifi AP firmware 4.3.28.11361

I tried the Unifi update as suggested by Lars (Thanks!) and turned wireless uplinks back on. I've had no issues for several days, so I think my problem is solved. I'll probably turn the wireless uplinks off again as I don't need them in my config.

I'll close this thread shortly unless someone speaks out wanting it to stay open for further debugging of a similar problem.

gknepp commented 3 years ago

Solved: Upgrade to Unifi AP firmware 4.3.28.11361

As Mike had initially guessed, this appears to have been a network issue, caused by bug in Unifi AP firmware.

If you can't upgrade for some reason, a workaround as Bronco noted is in Unifi Controller sw. In rev 6.0.45, go to settings>site>services. UNCHECK the "enable wireless uplink" checkbox. I imagine there is an app based equivalent. Your mileage may vary with different versions Unifi Controller.

Thanks to all for the help in debugging this tough nut to crack!

Greg

jgladch commented 3 years ago

Thanks for this thread. I've been experiencing a similar issue with a similar network setup and this has helped me narrow down the list of issues. Unfortunately, in my case, I need "wireless uplink" enabled and the APs on my network are already on the latest firmwares, so maybe I'm having a slightly different problem.