Describe the bug
The bug is as particular as the title is - from a Pixel 3a running Android 11, Chromecast video will not work (to a Vizio smart tv). That very same device is able to cast to an audio-only device (Google Home) just fine. Other devices can cast to the smart tv using the Jellyfin app just fine.
To Reproduce
Logs
There are no system logs in the Jellyfin dashboard for the above events, nor any from the Jellyfin container.
I could not find how to access logs on Android - happy to grab them if they are available somewhere.
System (please complete the following information):
Additional context
Did you try with the unstable chromecast receiver? (Settings -> Playback -> Chromecast version)
Yes, same result with the nightly chromecast receiver - although, the nightly version has never worked for me on any devices.
I have the same problem with a Pixel 3 phone. It used to work, but I think it broke in a phone update. Every other app on the device is able to use Chromecast.
I also tried both stable and unstable chromecast versions, and I tried to reinstall the app. Using Chrome with the web player does work fine with Chromecast.
Same problem with my Pixel 2 running Android 11.
Changing to nightly makes no difference
I got an update from FDroid today and it stopped working completely. Chromecast isn't detected in the latest version, but it worked in previous version.
Currently installed version is 2.2.3
F-Droid version does not support casting
but it did
Today was the first time our app was published to the F-Droid repositories and it does not include casting.
See the blog for more info: https://jellyfin.org/posts/android-on-fdroid/
Didnt you have own fdroid repo I imported over a year ago?
I'm 100% sure I installed it from fdroid before.
No. We were included in IzzyOnDroid for a few months but it always included the same no-cast version as we just published. You might have sideloaded the app yourself.
Just to bump this, I'm still encountering this issue on 10.7 stable
I am also seeing this issue on my Oneplus 5T & 3T
Server version: 10.7
Android app version: 2.2.3
Android version: Android 9, 10.
I have tried the stable and unstable versions of the Chromecast receiver within the app. I have no issues if I cast from either phone via a browser, only the Jellyfin application has issues. The Chromecast does not appear as an option to cast to.
This was a real pain, but I got it working. Part of the problem is chromecast and not using dhcp dns servers so using a local hostname is tricky, and partly Jellyfin not returning a usable LocalAddress when running in containers on separate networks.
The first part is not technically a jellyfin issue, but it you want it to play nice with chromecast getting a valid ssl cert to work using a locally routable url is not so easy for the average user. I now understand why plex set it up the way they did creating unique dns names XXXX.plex.direct for each server which they run as a dynamic dns for you on a valid wildcard cert.
In my setup I wanted to use a local only hostname (ie jellyfin.my-domain.com) using the valid wildcard cert for my public domain name (*.my-domain.com) installed on my nginx reverse proxy (kubernetes nginx-ingress issued by letsencrypt) . So I created a jellyfin.my-domain.com on my local dns server but chromecast doesn't use the dns server assigned via DHCP so I had to override all queries to google dns servers (8.8.8.8 and 8.8.4.4) so that chromecast could resolve jellyfin.my-domain.com to my reverse proxy local ip address.
**The real silly part is how stubborn the jellyfin server is at determining its own LocalAddress url. Checking the output of https://jellyfin.my-domain.com/System/Info/Public the LocalAddress returns the container ip inside the container network which is not routable outside those networks.
Version 10.7.0-1 of jellyfin server even asked for the server url first thing as part of setup, but its not returned by /System/Info/Public None of the network settings seem to override this value. So I had resort to a nginx re-write to return "LocalAddress":"https://jellyfin.my-domain.com"**
location ~* /System/Info/Public {
add_header Content-Type "application/json; charset=utf8";
return 200 '{"LocalAddress": "https://jellyfin.my-domain.com","ServerName":"Jellyfin Server","Version":"10.7.0","ProductName":"Jellyfin Server","OperatingSystem":"Linux","Id":"XXXXXXXX","StartupWizardCompleted":true}';
}
At a minimum the jellyfin server should have a working config value that overrides the LocalAddress. I understand not wanting to create a dynamic dns server like plex so dealing with dns and certs is left up to users, but this will really prevent wide spread adoption if chromecast doesn't work "out-of-the-box".
This was a real pain, but I got it working. Part of the problem is chromecast and not using dhcp dns servers so using a local hostname is tricky, and partly Jellyfin not returning a usable LocalAddress when running in containers on separate networks.
I had the same issue on Jellyfin 10.6.2 with all my clients until I did a very similar workaround to what you suggested. AFAIK, though, the Jellyfin Chromecast client doesn't use the LocalAddress field since 10.7, since this workaround is no longer needed in my setup.
That said, did your fix solve the issue on Android 11? Because that's the only client giving me issues. The app can play content fine, and can _find_ Chromecast devices (the casting dialogue opens and lists all the devices in my network), but clicking any of them just opens a loader and never displays content on the device. All my other clients (Google Chrome, Android 10, mpv shim) are able to cast just fine.
(FYI: I have a split horizon DNS on my internal network, so DHCP DNS returns a proper internal IP for jellyfin, and then I forward all outbound traffic on port 53 to my firewall's DNS server, so Google's DNS shouldn't play a factor here)
Jellyfin Chromecast client doesn't use the
LocalAddressfield since 10.7, since this workaround is no longer needed in my setup.
And you are correct! I removed the nginx re-write for the LocalAddress and chromecast is still working on both my Android 11 phone and chrome browser on my desktop. I figured I needed that as my first attempt was setting up 10.6.4.
I also have a split horizon dns as the jellyfin hostname and ip are only available in my home network (192.168.X.X). Are you positive that the chromecast isn't getting out to 8.8.8.8 and failing to resolve or returning a public ip? I have pfSense as my router/dns/firewall and set it up like this https://docs.netgate.com/pfsense/en/latest/recipes/dns-redirect.html
FWIW, I have the _exact_ same setup as the original submitter (pixel 3a, android 11, jellyfin 10.7). I'm not using a reverse proxy or anything complex like that. I simply have jellyfin running in a docker container on my local network. I observe the same symptom that all of the cast devices on my network are selectable, but picking any of them gives the spinner for a very long time. No other obvious activity happens.
I also have a split horizon dns as the jellyfin hostname and ip are only available in my home network (192.168.X.X). Are you positive that the chromecast isn't getting out to 8.8.8.8 and failing to resolve or returning a public ip? I have pfSense as my router/dns/firewall and set it up like this https://docs.netgate.com/pfsense/en/latest/recipes/dns-redirect.html
Bizarre, I've also got pfSense as my firewall and I'm using the same rule. I'm only redirecting port 53, though, so I suppose it could be connecting by DoT or DoH, but everything I've read leads me to believe that Android 10 - which works totally fine with Chromecast - has the same DoT/DoH support as Android 11.
FWIW, I have the exact same setup as the original submitter (pixel 3a, android 11, jellyfin 10.7). I'm not using a reverse proxy or anything complex like that. I simply have jellyfin running in a docker container on my local network. I observe the same symptom that all of the cast devices on my network are selectable, but picking any of them gives the spinner for a very long time. No other obvious activity happens.
@EvilDrW what device are you trying to cast to? It's a long-shot, but perhaps that's the commonality here? I'm trying to cast to a Vizio smart TV where it just spins and has no other obvious activity.
Otherwise, does anyone know how to get logs for the Android app? I feel like that would be an easier way to get the answer here.
@dpraul, I've tried casting to a 1st gen chromecast and a chromecast ultra, both with the same result. I've pulled the source and will try to run the debug build and look at the logcat... like you I haven't found that anything useful is being logged by default.
It actually sounds like the issues I am having are a bit different to what is being discussed now.
I have a Jellyfin server v10.7 running in a docker container behind an Nginx reverse proxy. Casting only seems to be an issue from the Android app.
# Testing (All tested from the same local network):
Casting from PC browser Chrome = OK
Casting from PC browser Firefox = OK
Casting from Android 9 & 10 Phone browser Chrome = OK
Casting from Android 9 & 10 Phone browser Firefox = OK
Casting from Android app v2.3 (Chromecast stable)= The Chromecast does not appear as an option to 'Cast to'
Casting from Android app v2.3 (Chromecast unstable)= The Chromecast does not appear as an option to 'Cast to'
This to me sounds like the issue is specific to the Android app, as I have no issues casting from any other platform.
I seem to have resolved my issue by clearing the Android app cache and storage. After re-logging in, the Chromecast is appearing as an option to cast to, and the casting itself is working without issue.
I seem to have resolved my issue by clearing the Android app cache and storage. After re-logging in, the Chromecast is appearing as an option to cast to, and the casting itself is working without issue.
It's intermittent issue for me. Restarting app or chromecast fixes it too, but it always works when streaming from browser, sometimes doesn't work when streaming from android.
I spent a few hours trying to figure out why this doesn't work, but I'm no Google Cast expert, so I didn't find any smoking guns... for any devs watching, what I observed was that none of the SessionListener's events are firing in ChromecastConnection.java's listenForConnection. When it goes to requestSession, the MediaRouteChooserDialog is created, but when you tap to choose a route... nothing happens?
I tried going through the Cast docs but didn't find anything obviously wrong. If someone can give me some pointers, I'll be happy to dig further, but right now I'm at a loss.