hensm / fx_cast

Chromecast Web Sender SDK implementation for Firefox
https://hensm.github.io/fx_cast/
MIT License
1.85k stars 62 forks source link

I have a Chromecast device, and casting works fine from Chrome, but not from Firefox and fx_cast. #280

Closed hensm closed 10 months ago

hensm commented 10 months ago
          I have a Chromecast device, and casting works fine from Chrome, but not from Firefox and fx_cast.

I'm using Linux mint 21.2 Firefox 116.0.3

Not even casting from Chromecast first makes it show up. Screenshot from 2023-08-29 01-21-23 Screenshot from 2023-08-29 01-22-15 Screenshot from 2023-08-29 01-46-25

I couldn't really find more for logs other than the following (there is some DNSServiceRegister() not being fully supported warning in there):

oscar@oscar-laptop:~$ sudo journalctl -u fx_cast Aug 29 01:00:14 oscar-laptop systemd[1]: Started fx_cast daemon. Aug 29 01:00:14 oscar-laptop fx_cast_bridge[11430]: Starting WebSocket server at ws://localhost:9556... Done! Aug 29 01:39:50 oscar-laptop systemd[1]: Stopping fx_cast daemon... Aug 29 01:39:50 oscar-laptop systemd[1]: fx_cast.service: Main process exited, code=killed, status=9/KILL Aug 29 01:39:50 oscar-laptop systemd[1]: fx_cast.service: Failed with result 'signal'. Aug 29 01:39:50 oscar-laptop systemd[1]: Stopped fx_cast daemon. -- Boot 66426e15011a463faf552ff3272adc76 -- Aug 29 01:40:25 oscar-laptop systemd[1]: Started fx_cast daemon. Aug 29 01:40:26 oscar-laptop fx_cast_bridge[810]: Starting WebSocket server at ws://localhost:9556... Done!

There are also a bunch of entries like this:

Aug 29 01:45:56 oscar-laptop fx_cast_bridge[4570]: WARNING The program 'fx_cast_bridge' uses the Apple Bonjour compatibility layer of Avahi. Aug 29 01:45:56 oscar-laptop fx_cast_bridge[4570]: WARNING Please fix your application to use the native API of Avahi! Aug 29 01:45:56 oscar-laptop fx_cast_bridge[4570]: WARNING For more information see http://0pointer.de/blog/projects/avahi-compat.html Aug 29 01:45:56 oscar-laptop fx_cast_bridge[4570]: WARNING The program 'fx_cast_bridge' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. Aug 29 01:45:56 oscar-laptop fx_cast_bridge[4570]: WARNING Please fix your application to use the native API of Avahi! Aug 29 01:45:56 oscar-laptop fx_cast_bridge[4570]: WARNING For more information see http://0pointer.de/blog/projects/avahi-compat.html Aug 29 01:45:56 oscar-laptop fx_cast_bridge[4583]: WARNING The program 'fx_cast_bridge' uses the Apple Bonjour compatibility layer of Avahi. Aug 29 01:45:56 oscar-laptop fx_cast_bridge[4583]: WARNING Please fix your application to use the native API of Avahi! Aug 29 01:45:56 oscar-laptop fx_cast_bridge[4583]: WARNING For more information see http://0pointer.de/blog/projects/avahi-compat.html Aug 29 01:45:56 oscar-laptop fx_cast_bridge[4583]: WARNING The program 'fx_cast_bridge' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. Aug 29 01:45:56 oscar-laptop fx_cast_bridge[4583]: WARNING Please fix your application to use the native API of Avahi! Aug 29 01:45:56 oscar-laptop fx_cast_bridge[4583]: WARNING For more information see http://0pointer.de/blog/projects/avahi-compat.html

_Originally posted by @oscar-garza-66 in https://github.com/hensm/fx_cast/issues/82#issuecomment-1696800692_

hensm commented 10 months ago

@oscar-garza-66 I split this out into a new issue since this doesn't really fit in that existing issue.

What kind of device are you trying to cast to specifically? There have been a few times before where people report this and they're not actually using a Chromecast device, but something like a Fire TV or a built-in smart TV version of YouTube which isn't supported right now.

Could you try avahi-browse -rv _googlecast._tcp from a terminal report what shows up?

oscar-garza-66 commented 10 months ago
oscar@oscar-laptop:~$ avahi-browse -rv _googlecast._tcp
Server version: avahi 0.8; Host name: oscar-laptop.local
E Ifce Prot Name                                          Type                 Domain
+ wlp3s0 IPv4 Chromecast-Ultra-9bf24c0dcee2781c573ef8929512caa9 _googlecast._tcp     local
= wlp3s0 IPv4 Chromecast-Ultra-9bf24c0dcee2781c573ef8929512caa9 _googlecast._tcp     local
   hostname = [9bf24c0d-cee2-781c-573e-f8929512caa9.local]
   address = [192.168.1.4]
   port = [8009]
   txt = ["rs=YouTube" "nf=1" "bs=FA8FCA7BECFE" "st=1" "ca=201221" "fn=Living Room TV" "ic=/setup/icon.png" "md=Chromecast Ultra" "ve=05" "rm=" "cd=F1F401F771E1F3E7D534A5D4DD415026" "id=9bf24c0dcee2781c573ef8929512caa9"]
: Cache exhausted
: All for now
oscar-garza-66 commented 10 months ago

I can ping the IP but not the name, could this be a problem?

oscar@oscar-laptop:~$ ping 192.168.1.4
PING 192.168.1.4 (192.168.1.4) 56(84) bytes of data.
64 bytes from 192.168.1.4: icmp_seq=1 ttl=64 time=7.23 ms
64 bytes from 192.168.1.4: icmp_seq=2 ttl=64 time=6.78 ms
^C
--- 192.168.1.4 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 6.778/7.002/7.227/0.224 ms
oscar@oscar-laptop:~$ ping 9bf24c0d-cee2-781c-573e-f8929512caa9.local
ping: 9bf24c0d-cee2-781c-573e-f8929512caa9.local: Temporary failure in name resolution
oscar-garza-66 commented 10 months ago

Ok, so as a test I added the hostname to my hosts file and now it is working... it just not a great solution as I would have to update the file every time the IP changes

oscar-garza-66 commented 10 months ago

Alright, your request led me down the mdns rabbit hole, it seems it was not being used on my machine.. I removed the entry from the /etc/hosts file and instead saw that mDNS was not being used in /etc/nsswitch.conf

I changed this line: hosts: files dns which basically means check hosts file, then DNS to this: hosts: files mdns4_minimal dns which means check hosts file, mDNS, then DNS

It appears that the .local name now resolves without having to specify it in the hosts file!

oscar@oscar-laptop:~$ ping 9bf24c0d-cee2-781c-573e-f8929512caa9.local
PING 9bf24c0d-cee2-781c-573e-f8929512caa9.local (192.168.1.4) 56(84) bytes of data.
64 bytes from 192.168.1.4 (192.168.1.4): icmp_seq=1 ttl=64 time=8.48 ms
64 bytes from 192.168.1.4 (192.168.1.4): icmp_seq=2 ttl=64 time=6.32 ms
^C

hopefully this might help someone else that runs into the issue

hensm commented 10 months ago

Ah, it’s that one again. Arch, I’m guessing? Yeah, the mdns module used by the bridge resolves .local names via the NSS. It’s come up a few times before, so there’s a note in the README and on the FAQs page, but even I always forget about it.

Glad you got it working.

oscar-garza-66 commented 10 months ago

I'm using the latest release of linux mint, so debian. Thanks for the help!

hensm commented 10 months ago

Oh yeah, you did mention that in the original comment, haha. I ought to make the warning more prominent if it's not limited to just Arch, then.