philippe44 / LMS-Cast

Chromecast to LMS bridge
64 stars 10 forks source link

Cast devices not recognized on 2.2.x #31

Closed millerdev closed 8 months ago

millerdev commented 1 year ago

Until recently I've been running CastBridge v2.1.13 on LMS 8.3.0 on Ubuntu, and everything works well.

However, when I try upgrading to a newer version, 2.2.8 for example, but also tried 2.2.4 and 2.2.6, the bridge does not recognize my cast devices. The log output shows the devices are seen over mDNS, but they do not appear in the config file if I delete and re-generate it, and they do not appear in the Squeezebox list of players either. Here is some sample log output:

Starting Squeeze2cast: /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/CastBridge/Bin/squeeze2cast-linux-x86_64 -Z -b 10.2.1.2 -f /var/log/squeezeboxserver/castbridge.log -d all=debug -x /var/lib/squeezeboxserver/prefs/castbridge.xml
[22:06:06.237578] main:1290 Starting squeeze2cast version: v2.2.8 (Aug 14 2023 @ 13:28:51)
[22:06:06.240793] register_alac:541 using alac to decode alc
[22:06:06.240823] register_mad:433 using mad to decode mp3
[22:06:06.240834] register_faad:647 using faad to decode aac
[22:06:06.240843] register_vorbis:719 using vorbis to decode ogg
[22:06:06.240853] register_pcm:339 using pcm
[22:06:06.240863] register_flac:313 using flac to decode flc
[22:06:06.240872] register_opus:524 using opus to decode ops
[22:06:06.240882] register_m4a_thru:308 using mp4 to aac (ADTS)
[22:06:06.240891] register_flac_thru:213 using flac
[22:06:06.240901] register_thru:107 using thru
[22:06:06.240910] register_soxr:391 using soxr for resampling
[22:06:06.240922] Start:1049 Binding to 10.2.1.2 (http:0)
[22:06:06.241271] mDNSsearchCallback:718 ----------------- round ------------------
[22:06:06.245067] mDNSsearchCallback:718 ----------------- round ------------------
[22:06:06.245092] mDNSsearchCallback:721 host 10.2.1.22, srv 10.2.1.100, name Chromecast-ef52ebbbe29b9d5e2cee3565c2ebd629._googlecast._tcp.local 
[22:06:06.246153] mDNSsearchCallback:718 ----------------- round ------------------
[22:06:06.246166] mDNSsearchCallback:721 host 10.2.1.22, srv 10.2.1.135, name Chromecast-Audio-8aa50dbd865fb42e1b8c627c501e6f72._googlecast._tcp.local 

Note that I have an enterprise-class wireless access point (IP address: 10.2.1.22) that aggregates mDSN broadcasts, and I believe this is thee reason that host and srv differ in the mDNSsearchCallback lines in the logs. The srv addresses are the actual IP addresses of my cast devices. My guess is that this is the source of the problem.

philippe44 commented 1 year ago

Indeed it's the issue. What is your netmask? Normally, I filter out searches that have a different host/srv address but are on the same subnet and I accept other subnets. There was a bug in previous versions and filtering was not working properly.

millerdev commented 1 year ago

What is your netmask?

255.255.255.0

philippe44 commented 1 year ago

So your AP aggregates the mDNS broadcasts which means it filters out incoming ones that it received on its WLAN interfaces and re-broadcasts them on its LAN interface, and this is where aircast sits, right?

If this is the case then that's the issue because I explicitly filter out such re-broadcast as many users have such repeaters that live together with the actual devices and so I was creating multiple "ghosts" players. The logic that works now is that such filtering happens for devices on the same subnet, but if they come from a different one, they are accepted.

philippe44 commented 1 year ago

I've reverted the change I've made before to handle subnet

millerdev commented 1 year ago

Thanks, I'll test it out as soon as I am able.

millerdev commented 8 months ago

Apologies for the very late follow up. It works now that I've upgrade to v3.3.5. Thank you!

philippe44 commented 8 months ago

No worries, it's aways good to know it worked 😄