Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the status on Google Cast implementation? #580

Open
ale-reyes opened this issue Jul 17, 2018 · 28 comments
Open

What's the status on Google Cast implementation? #580

ale-reyes opened this issue Jul 17, 2018 · 28 comments

Comments

@ale-reyes
Copy link

I checked the wiki and the implementation page hasn't been updated in two years, so I thought I'd ask.

@ArchangeGabriel
Copy link
Contributor

@armill made some PRs, like #528. But currently @mar-v-in seems quite busy, so the project is a bit stalled. And I’m not sure anyone else is able to say whether those PRs are OK or not.

@benwaffle
Copy link

#79

@cubagithub
Copy link

#79 is Closed.
Can anyone use cast function natively? I can't use it on Android 11 + MicroG using a FireTV or Chromecast.
signal-2021-03-02-183150_002
signal-2021-03-02-183150_003
signal-2021-03-02-183150_001

@ThaChillera
Copy link

@cubagithub I'm having the exact same issues with microg's lineageOS for Fairphone 3 on Android 11.

Started looking on the web, was surprised to learn that microG supposedly already supports casting (somewhat). In my experience 0 cast functionality is supported.

@RobertoWa
Copy link

i can connect successfully my smartphone (los 18.1 microg) to my notebook (windows 10) via screen casting.

@ThaChillera
Copy link

ThaChillera commented Oct 24, 2021 via email

@RobertoWa
Copy link

first of all u should be verify, that cast is working generelly.

@ThaChillera
Copy link

ThaChillera commented Oct 24, 2021 via email

@ale5000-git
Copy link
Member

ale5000-git commented Oct 31, 2021

Fortunately on some ROMs the removal of Miracast (Wifi Display) is reverted.

@hollowshiroyuki
Copy link

hollowshiroyuki commented Jul 19, 2022

Hi, I have the same issue using the unofficial Lineage MicroG on a Pixel 3 :
Lineage Version : 19-20220622-microG-blueline (Android 12)
MicroG Version : 0.2.24.214816

Weirdly VLC works, the device appears in the list and can play videos. As a lot of people in #79.

Is https://github.com/TeamVanced/Vanced/issues/688#issuecomment-992102591 relevant ?

The chromecast was tested with an unmodified Xiaomi Note 10 too and worked correctly.

@matteopessina
Copy link

Any news on this feature?

I did not managed to cast Netflix, Display+ directly to chromecast.
I am using /e/OS 1.6-202212208238947, with microg 0.2.25.223616-9 on OnePlus8 IN2013.

I tried debugging the Google sample cast sender application https://github.com/googlecast/CastVideos-android.
On an old Huawei P10 with stock rom it works, while on os with microg it shows the following logcat
cast-logcat.txt

The most interesting part is the following:

/GmsDynamiteLoaderImpl: No such module known: com.google.android.gms.cast.framework.dynamite
/GmsDynamiteLoaderImpl: returning temp fix module version for com.google.android.gms.cast.framework.dynamite. Cast API wil not be functional!

@mattszcz
Copy link

The following information seems like it holds the clue to solving the Chromecast casting issue:

With old versions of YT Vanced (15.43.32) and Vanced Micro G (0.2.22.212658) I'm able to cast to my non-smart TV using chromecast. So I don't get why using chromecast would not work with revanced (tried with a newer version of YT and the same 0.2.22.212658 Micro G version).

Source: https://www.reddit.com/r/revancedapp/comments/wi4whv/casting_to_chromecast/iosvuag

@benjamingwynn
Copy link

The Gnome team recently got Chromecast working, perhaps something useful could be found in this PR? https://gitlab.gnome.org/GNOME/gnome-network-displays/-/merge_requests/171

@bertin0
Copy link

bertin0 commented Apr 22, 2023

The Gnome team recently got Chromecast working, perhaps something useful could be found in this PR? https://gitlab.gnome.org/GNOME/gnome-network-displays/-/merge_requests/171

Seems interesting but i think that they only implemented the functionality to cast a stream from the device to the chromecast (like sharing your screen), not directly from the internet to the chromecast. I just realised that my rom also has this functionality implemented, but I'm not sure whether that goes through the chromecast or the miracast/wfd api.

@minimoonleaf
Copy link

以下信息似乎包含解決 Chromecast 投射問題的線索:

使用舊版本的 YT Vanced (15.43.32) 和 Vanced Micro G (0.2.22.212658),我可以使用 chromecast 投射到我的非智能電視。所以我不明白為什麼使用 chromecast 不能與 revanced 一起使用(嘗試使用較新版本的 YT 和相同的 0.2.22.212658 Micro G 版本)。

來源:https ://www.reddit.com/r/revancedapp/comments/wi4whv/casting_to_chromecast/iosvuag

The older version can support MicroG. Why the new MicroG can't support chromecast ? I'm also curious to know why it can't support Chromecast?

@bertin0
Copy link

bertin0 commented Apr 24, 2023

以下信息似乎包含解決 Chromecast 投射問題的線索:

使用舊版本的 YT Vanced (15.43.32) 和 Vanced Micro G (0.2.22.212658),我可以使用 chromecast 投射到我的非智能電視。所以我不明白為什麼使用 chromecast 不能與 revanced 一起使用(嘗試使用較新版本的 YT 和相同的 0.2.22.212658 Micro G 版本)。

來源:https ://www.reddit.com/r/revancedapp/comments/wi4whv/casting_to_chromecast/iosvuag

The older version can support MicroG. Why the new MicroG can't support chromecast ? I'm also curious to know why it can't support Chromecast?

Because there is the old Chromecast API v1 and the newer V2. Microg has v1 implemented but not V2. The old vanced version uses the old Chromecast v1 API, while the newer revanced uses V2. Ig one way for the revanced devs to fix this would be to force the newer app to use the older API but I'm not sure how feasible that is. Also it's not within the scope for microg devs.

@kroese
Copy link

kroese commented Apr 24, 2023

@bertin0 As far as I know the newer Revanced can also use v1. Because I can cast with Revanced without problem to my older v1 devices. It's just the newer v2 devices that don't show up in the list when you press the cast button.

So I think the only reason why Revanced doesn't force v1 commands for v2 devices is simply because v2 devices do not accept v1 commands.

@minimoonleaf
Copy link

Because there is the old Chromecast API v1 and the newer V2. Microg has v1 implemented but not V2. The old vanced version uses the old Chromecast v1 API, while the newer revanced uses V2. Ig one way for the revanced devs to fix this would be to force the newer app to use the older API but I'm not sure how feasible that is. Also it's not within the scope for microg devs.

So is there no one developing chromecast V2 API applications now? Why is ReVanced completely unable to use chromecast now? If there are still APIs that support V1 or V2, shouldn’t the function be normal?

@trmdi
Copy link

trmdi commented May 9, 2023

May I ask an unrelated question: Why can't my phone find Youtube on my Android Tv Box? Does it still use the DIAL protocol or another one?

@Quanalogy
Copy link

以下信息似乎包含解決 Chromecast 投射問題的線索:

使用舊版本的 YT Vanced (15.43.32) 和 Vanced Micro G (0.2.22.212658),我可以使用 chromecast 投射到我的非智能電視。所以我不明白為什麼使用 chromecast 不能與 revanced 一起使用(嘗試使用較新版本的 YT 和相同的 0.2.22.212658 Micro G 版本)。

來源:https ://www.reddit.com/r/revancedapp/comments/wi4whv/casting_to_chromecast/iosvuag

The older version can support MicroG. Why the new MicroG can't support chromecast ? I'm also curious to know why it can't support Chromecast?

Because there is the old Chromecast API v1 and the newer V2. Microg has v1 implemented but not V2. The old vanced version uses the old Chromecast v1 API, while the newer revanced uses V2. Ig one way for the revanced devs to fix this would be to force the newer app to use the older API but I'm not sure how feasible that is. Also it's not within the scope for microg devs.

Do you have any insights into how big the assignment of implementing the v2 api is in the current state?
I'm wondering if there might be any blockers outside simply supporting the api?
Do you know if it is a gigantic api that is expected years to develop or what might be the reason for this v2 api not being implemented yet?

Might there already be some development on this or does it need to be done from scratch?

@Tthecreator
Copy link

Hi,

How is everyone doing.
I'm using MicroG, and get frequent complaints from my Girlfriend if she has to turn on the casting, instead of me.

I will see if I can take a look at this.

Currently, I have a plan to take some of the code from VLC (which has a complete open source implementation) and see if that somehow can be used or translated for MicroG. First, I'll be starting off seeing if I can get mDNS to work. Then, see if and how I could start a stream.

I will also hope to not run into license issues.

@Tthecreator
Copy link

Update:

Okay, seems like I got a know-how of the Chromecast protocol. That seems easy enough right now.
And I didn't need VLC after all.

Anyways, the really big challenge for me at this moment is to understand how this will integrate into microg. The problem is that (I think) the cast-framework is linked into the application and still black-box proprietary. Meanwhile, our implementation in the cast core, doesn´t seem to work. But I can't tell what the communication should look like.
In CastMediaRouteController, there is an onSelect() function that is not implemented. I cannot see any other calls to our framework concerning casting. I therefore suspect that this call needs to trigger another call or callback somehow somewhere in order for the framework and app code to continue making the connection. But it is in no way clear to me what that is. I've tried to just setup the connection to the chromecast. I can see communication happen (I have a MITM setup), but none that are specific to my youtube app that I'm testing with. Also, in Youtube, the cast button works just fine, but in other apps it either remains grayed-out or invisible. Another strange behavior I don't know why it's doing that.

So wish me luck. And if anyone is available to help me, that would also be great.

@matteopessina
Copy link

@Tthecreator I could help on this BUT before starting reasoning and implementing a PR, I would like to have a feedback on it by the owner of the project @mar-v-in.
It would be great also to have a little guidance too, just to know where to put the hands on.

@Tthecreator
Copy link

@matteopessina
It seems that Adam Mills or @emlove may have more knowledge on the matter as well. Perhaps they can tune in.

@mar-v-in
Copy link
Member

Hi. I haven't really worked on Cast and don't know a lot about it.

@AnyMelz
Copy link

AnyMelz commented Oct 6, 2023

Hello everyone,
after a bit of search I found some information which could help getting started. @Tthecreator mentioned, that the implementaion of CastMediaRouteController.onSelect() is missing. The CastMediaRouteController extends the MediaRouteProvider.RouteController. So I looked for this parent class and found this guide.
There is also an explanation of the onSelect-Method. Hope, this helps!

@Tthecreator
Copy link

Hi @AnyMelz At the time, I had found the same information. But I was still puzzled.
The problem is that there are a few different layers of communication:
Cast device <--TCP--> Play services framework <-- Some IPC?? --> Play services library (linked in App I think) <-- Java function calls --> An actual App.

The framework takes over a lot of the responsibility from the app. See: https://developers.google.com/cast/docs/android_sender/integrate#app_flow.

It has been made really opaque to me what exactly is happening, or what is supposed to happen. What communication is supposed to go where? It's not like Google provides and extensive sequence diagram of what happens (except for the app to lib part maybe.) That makes things really hard to trace. So in the end back then after spending almost a week of my summer holiday on this, I gave up. I could try again sometime when I feel confident again. Maybe I'm just missing an 'eureka moment'.

@Tthecreator
Copy link

Tthecreator commented Oct 14, 2023

Does anyone know what this means:

Service not supported: GetServiceRequest{serviceId=UNKNOWN(161), gmsVersion=232800000, packageName='com.google.android.youtube', extras=Bundle[EMPTY_PARCEL]}

Okay, I vaguely know what it means, but what is this service supposed to do??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests