[App] Cast Receiver app for Android

Search This thread

HomerSp

Retired Recognized Developer
Jan 5, 2010
621
591
Stockholm
I confirmed USB Debugging is enabled. Wouldn't this be required to even make the connection?
I'm not sure, I mostly use adb over a USB connection. But you are probably right.
Did you say you had the same problem using a Note running cm? Would you be able to connect it through usb to your computer and run those adb commands? Make sure you run adb disconnect first.
 

rkirmeier

Senior Member
Jun 18, 2010
383
72
I'm not sure, I mostly use adb over a USB connection. But you are probably right.
Did you say you had the same problem using a Note running cm? Would you be able to connect it through usb to your computer and run those adb commands? Make sure you run adb disconnect first.

Yes, same issue on the Note 12.2. I'll try it on the note tonight.
 

HomerSp

Retired Recognized Developer
Jan 5, 2010
621
591
Stockholm
Yes, same issue on the Note 12.2. I'll try it on the note tonight.
You could get the log from the device without using adb as well, just start the log (using catlog or similar), go in to Settings > Apps > All > Android Media Shell and click Force stop. Then go to Settings > Date & time and uncheck and check automatic date & time (or if it's already unchecked, just check it). That should start the service, so give it a minute or two to settle, then stop the log and upload it here :)
 

rkirmeier

Senior Member
Jun 18, 2010
383
72
You could get the log from the device without using adb as well, just start the log (using catlog or similar), go in to Settings > Apps > All > Android Media Shell and click Force stop. Then go to Settings > Date & time and uncheck and check automatic date & time (or if it's already unchecked, just check it). That should start the service, so give it a minute or two to settle, then stop the log and upload it here :)

I killed it but it's not starting back up automatically. I tried the unchecking and checking the automatic date & time option.

I then opened a terminal and ran the command but get an error back. Any other ideas?
 

Attachments

  • 2014-10-16-10-47-09.txt
    96.7 KB · Views: 33
  • startservice.jpg
    startservice.jpg
    47.2 KB · Views: 347

Perks

Member
Dec 18, 2009
49
11
Awesome work

I'll test it later today, but I'm not sure it will work, as I have a tronsmart Vega, which has the same SoC than the n8h that rkirmeier is having troubles with

Just one question, Do you guys know if this works trough Ethernet connection?

Sent from my Nexus 4 using Tapatalk
 

rkirmeier

Senior Member
Jun 18, 2010
383
72
The service was not started correctly, check the spelling please (you spelled android with two n's ;) )

I was browsing the log and noticed that too. I thought it worked as I didn't get any error back. Looks like it worked this time as I can see the app/service running now. New log attached...
 

steso90

Senior Member
Jan 15, 2014
252
51
Sweden
Nexus 9
Huawei Nexus 6P
dont fit the tv screen

Hello ! When I cast my screen from my moto g to my TV the picture is a little outside off the TV screen . Is there any fix for it ? I have tested it on diffrent tvs but with same result.
My moto g is 1st gen
 

HomerSp

Retired Recognized Developer
Jan 5, 2010
621
591
Stockholm
Hello ! When I cast my screen from my moto g to my TV the picture is a little outside off the TV screen . Is there any fix for it ? I have tested it on diffrent tvs but with same result.
My moto g is 1st gen
What device are you using as a receiver? There's not really much I can do from the Cast Receiver app, you would have to change the overscan/underscan settings of the TV, or on your receiver if the ROM allows it.

Also, I may have a fix for devices not connecting properly to the receiver. I'm just waiting for @rkirmeier to test an apk for me.
 
Last edited:
  • Like
Reactions: Perks

steso90

Senior Member
Jan 15, 2014
252
51
Sweden
Nexus 9
Huawei Nexus 6P
Im really sorry because i posted in the wrong section, but i have problems with casting my screen to my Nexus 7 2012. Its like it begins to start then it goes back. The TV scaling problem i also hade was when i cast my screen from my moto g to my chromecast.

Sorry for my bad english
 

death2all110

Senior Member
Sep 21, 2010
515
296
Illinois
The devices not connecting to the receiver properly is currently being addressed. As for the Moto G to Chromecast issue, all you can do is adjust overscan/underscan if supported by your rom and/or tv. And your english is better than some others I've seen around here ;) No problem though!
 

HomerSp

Retired Recognized Developer
Jan 5, 2010
621
591
Stockholm
Thanks to @rkirmeier I was able to solve the receiver not working for everyone :)

The dropbox links in the first post will now point to the new apk's, so just download the apk's and follow the install instructions and it should be working.
 
  • Like
Reactions: death2all110

DA6030

Senior Member
Oct 3, 2007
286
130
Works great on Nexus Q running CM11

This works great on my Nexus Q (installed using root method)!!

The only unexpected behavior is that all the cast-enabled apps on the receiving device can see the locally-running Cast Receiver. In other words, YouTube, Play Music, etc. all prompt me to cast my Nexus Q (receiving device) to itself. Does the ADT-1 do something special to prevent "self-casting"? Is there an easy way to disable the cast sender on the receiving device? Does that make sense?
 
  • Like
Reactions: mannberg

Top Liked Posts

  • There are no posts matching your filters.
  • 46
    UPDATE 27th November 2014
    I have added an Xposed module for the clients below that will work around the issue with Google Play services 6.5 :)

    UPDATE 25th November 2014
    Google have released Google Play services 6.5 which has strengthened security, effectively making this app useless (clients will be unable to connect). Until Google either loosen the security (which is unlikely to happen), or someone somehow were able to get a hold of the private keys from the chromecast/Android TV this app will no longer work and will no longer be updated.
    Thank you all for your support!

    Hi everyone! I've decided to finally release my modified Cast Receiver app from the ADT-1 for Android that will work on most devices (though not sure what the minimum api requirement is).
    If you don't know what this is it's basically a chromecast receiver for your Android; I use it on my Android mini PC that's hooked up to my TV.

    Downloads
    Last updated Nov 05 2014.
    Recovery install (requires KitKat or newer, or the Xposed module below)
    https://docs.google.com/uc?export=download&id=0B4FOzj4b2EYiaU5WSWRxeC02Tzg

    Signed
    https://docs.google.com/uc?export=download&id=0B4FOzj4b2EYiVDR1a1o0WFVSWjg

    System install (requires KitKat or newer, or the Xposed module below)
    https://docs.google.com/uc?export=download&id=0B4FOzj4b2EYiNFJGUE1acGZTeFE
    https://docs.google.com/uc?export=download&id=0B4FOzj4b2EYiOTRoanlyX19pVmc

    If you are not rooted and can only install it as a regular apk, use the signed version. Note however that casting the screen from another Android device will not work due to a signature mismatch (Google Play Services checks the signatures of the app before allowing screencasting).
    If you are rooted you should go for the recovery/system install option, as that will allow screencasting to work.

    Xposed module for receiver
    If you want to be able to use the system install version on devices older than KitKat you can use the following Xposed module:
    https://docs.google.com/uc?export=download&id=0B4FOzj4b2EYiZEFrN1RqLTRFdkk

    Xposed module for client
    Version 6.5 and newer of Google Play services makes it impossible to connect to the receiver due to some added security. This Xposed module works around that:
    https://docs.google.com/uc?export=download&id=0B4FOzj4b2EYiWG1tU3NfYWwwV00

    Install
    Recovery install
    No special instructions needed, simply copy SYSTEM-CastReceiver.zip to the internal storage (or sdcard) on your device and flash it through your recovery (follow the instructions for your specific recovery).

    Signed
    Simply install the apk as you would with any apk, either through adb:
    Code:
    adb install -r AndroidMediaShell-signed.apk
    or by installing it from your sdcard.

    System install
    You will need rooted adb for this to work correctly.

    If you come from an old install, you can safely remove the old lib first:
    Code:
    adb remount && adb shell rm /system/lib/libmedia_shell_content_view.so

    Once that's done, run:
    Code:
    adb remount && adb push libcast_shell_android.so /system/lib/ && adb shell chmod 0644 /system/lib/libcast_shell_android.so
    adb remount && adb push AndroidMediaShell.apk /system/priv-app/ && adb shell chmod 0644 /system/priv-app/AndroidMediaShell.apk
    (Change priv-app to app on devices older than 4.4)

    Running
    Amazon Fire TV
    Because the Whisperplay app implements a DIAL protocol of its own on port 8008, which the Cast Receiver app also uses and that causes a conflict between the two apps.
    To get the app running correctly you need to rename WhisperplayCore.apk:
    Code:
    adb shell mv /system/app/WhisperplayCore.apk /system/app/WhisperplayCore.apk.bak
    once that's done, reboot and follow the instructions below.

    For the receiver to start you can simply reboot provided you are using the system install. If you are using the signed version you need to run:
    Code:
    adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -n com.google.android.apps.mediashell/.AutoStartListener

    After that it will run automatically in the background after each reboot, so you will be good to go!
    Keep in mind that it might take a few minutes for the receiver to show up in the cast list, if it doesn't show after 10 minutes, try rebooting the device.
    https://drive.google.com/file/d/0B4FOzj4b2EYiNFRfVDhtZXZGcjg/view?usp=sharing

    Supported Apps
    Currently not every app is supported. The ones I've tried are:
    YouTube - Working
    Google Play Music - Working
    Google Play Movies & TV - Working
    Google+ - Working
    Google Photos - Working
    Screen Cast - Working (if you follow the instructions above)
    Chrome for computer - Working
    Netflix - NOT Working (I'm looking into this)
    Plex - Working
    Chrome for Android - Workinghttps://drive.google.com/file/d/0B4FOzj4b2EYiWVlDTWNGOEw3UTg/view?usp=sharing

    Those are the ones I've tried, others may or may not work.
    Whether the app will work may also depend on what device you are running the cast receiver on, as well as the region you are in.

    FAQ
    My device doesn't show up in the official Chromecast app
    This is a known "problem" that also affects the ADT-1. There is nothing I can do about it in the Cast Receiver app, only Google can fix it by modifying the Chromecast app. Screen casting etc should work though, it's only the Devices screen that doesn't show any devices.

    The receiver doesn't work on my Amazon Fire TV
    Please read the instructions under the Running category.

    I can't find the receiver device in the cast list
    Give it a few minutes. If that doesn't work, try backing out of the app, and enter it again. If it still doesn't show, post a new reply to this thread with a log from logcat.

    App X doesn't work
    Get me a log when you try to initiate the connection, keeping in mind that some apps may be easier to fix than others. And some may be next to impossible due to them being regional.

    How?
    I've had some people ask how this was done, so I've written up a list of the changes and a brief summary here:
    https://docs.google.com/document/d/1tXnjDdurdoJ4ufulzaqGpuaNpLLt6LGAUk22MO2jta4/edit?usp=sharing
    You can get a patch of the smali changes here:
    https://drive.google.com/file/d/0B4FOzj4b2EYiTHZBRGVUWmlSV1U/view?usp=sharing
    And a bsdiff of the lib changes here:
    https://drive.google.com/file/d/0B4FOzj4b2EYiNFRfVDhtZXZGcjg/view?usp=sharing
    The source code of the Xposed receiver module can be found here:
    https://github.com/HomerSp/XposedCastReceiverFix
    The source code of the Xposed client module can be found here:
    https://github.com/HomerSp/XposedCastClientFix
    And finally here is the code I used while testing the receiver, and writing the MediaDrm and JmDNS code:
    https://github.com/HomerSp/CastTest

    Changelog
    Nov 05, 2014
    * Fixed receiver not working while connected to ethernet (may be restricted to the Fire TV)

    Oct 29, 2014
    * Fixed app not working on API level 15 (tested by me on a real device).
    * Disabled logging to file - this should significantly reduce the size of the data that's used by the app.

    Oct 26, 2014
    * Updated to new 5.0 preview from the ADT-1.
    * Lowered API level to 15 on the signed version, keep in mind that this is untested by me. This also includes disabling some DRM API calls that were added in API level 18, so Play Movies will not work on API 17 or lower.

    Oct 17, 2014
    * Fixed receiver not always starting correctly due to device not being provisioned, thanks to @rkirmeier!

    Oct 10, 2014
    * First version!

    Finally I would like to give out a big thank you to @death2all110 for doing extensive testing for me, as well as providing me with the system dump from the ADT-1. I couldn't have done this without him! :)

    Enjoy! :D
    7
    The Xposed module approach sounds good as well, or are you thinking that's not as feasible now?
    I've written an Xposed module that allows the client to connect. I'm just in the process of testing it at the moment, so I will upload it in the coming days (probably tomorrow).
    7
    Good news, everyone! (yes, actual good news)
    Thanks to @death2all110 I was able to get Netflix up and running! :D There are still some things I'd like to fix before releasing it, but Netflix support is coming!
    5
    If you need help with Netflix you know where to find me!
    4
    I am wrapping up a test version, and will post in a separate thread here in xda forums.