GmsCore icon indicating copy to clipboard operation
GmsCore copied to clipboard

What's the status on Google Cast implementation?

Open ale-reyes opened this issue 5 years ago • 10 comments

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

ale-reyes avatar Jul 17 '18 18:07 ale-reyes

@armill made some PRs, like https://github.com/microg/android_packages_apps_GmsCore/pull/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.

ArchangeGabriel avatar Jul 18 '18 22:07 ArchangeGabriel

#79

benwaffle avatar Jul 19 '18 19:07 benwaffle

#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

cubagithub avatar Mar 02 '21 07:03 cubagithub

@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.

ThaChillera avatar Oct 24 '21 08:10 ThaChillera

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

RobertoWa avatar Oct 24 '21 09:10 RobertoWa

But that isn't Google cast, right? Or am I misunderstanding something

On 24 October 2021 11:14:42 CEST, RobertoWa @.***> wrote:

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

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/microg/GmsCore/issues/580#issuecomment-950289461

ThaChillera avatar Oct 24 '21 09:10 ThaChillera

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

RobertoWa avatar Oct 24 '21 09:10 RobertoWa

How would I verify this? I thought Cast was just the Chromecast standard, since miracast has been removed from Android afaik

On Sun, 2021-10-24 at 02:23 -0700, RobertoWa wrote:

first of all u should be verify, that cast is working generelly. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

ThaChillera avatar Oct 24 '21 20:10 ThaChillera

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

ale5000-git avatar Oct 31 '21 11:10 ale5000-git

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 https://github.com/microg/GmsCore/issues/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.

hollowshiroyuki avatar Jul 19 '22 18:07 hollowshiroyuki

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!

matteopessina avatar Dec 29 '22 23:12 matteopessina

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

mattszcz avatar Jan 17 '23 23:01 mattszcz

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

benjamingwynn avatar Apr 22 '23 15:04 benjamingwynn

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.

bertin0 avatar Apr 22 '23 16:04 bertin0

以下信息似乎包含解決 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?

minimoonleaf avatar Apr 24 '23 03:04 minimoonleaf

以下信息似乎包含解決 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.

bertin0 avatar Apr 24 '23 18:04 bertin0

@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.

kroese avatar Apr 24 '23 18:04 kroese

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?

minimoonleaf avatar Apr 25 '23 15:04 minimoonleaf

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?

trmdi avatar May 09 '23 03:05 trmdi

以下信息似乎包含解決 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?

Quanalogy avatar May 26 '23 21:05 Quanalogy

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 avatar Jul 11 '23 19:07 Tthecreator

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.

Tthecreator avatar Jul 13 '23 17:07 Tthecreator

@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.

matteopessina avatar Jul 14 '23 11:07 matteopessina

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

Tthecreator avatar Jul 15 '23 09:07 Tthecreator

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

mar-v-in avatar Jul 15 '23 13:07 mar-v-in

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!

AnyMelz avatar Oct 06 '23 15:10 AnyMelz

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 avatar Oct 14 '23 13:10 Tthecreator

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??

Tthecreator avatar Oct 14 '23 21:10 Tthecreator