xSAVIKx/AndroidScreencast

AndroidScreencast works on Android TV, but not with HDMI sources or actual TV channels on screen

nestukh opened this issue · 2 comments

first, awesome program! Perfect for fixing common android problems for relatives far away (with a nx server on a computer of theirs and a usb cable).

A relative of mine has got an Android TV, it works there as well! But only on android apps or menus (VLC, Youtube, Aptoide TV, android settings, tv settings, etc): the moment you switch to the so called "TV Vision" app (normal tv channels) or to a kodi box (via HDMI), AndroidScreencast hangs and the following message appears, multiple times:

java.io.IOException: EOF
        at com.android.ddmlib.AdbHelper.read(AdbHelper.java:944)
        at com.android.ddmlib.AdbHelper.read(AdbHelper.java:917)
        at com.android.ddmlib.AdbHelper.getFrameBuffer(AdbHelper.java:303)
        at com.android.ddmlib.Device.getScreenshot(Device.java:522)
        at com.github.xsavikx.androidscreencast.api.injector.ScreenCaptureRunnable.getScreenshot(ScreenCaptureRunnable.java:75)
        at com.github.xsavikx.androidscreencast.api.injector.ScreenCaptureRunnable.run(ScreenCaptureRunnable.java:54)
        at java.base/java.lang.Thread.run(Thread.java:834)
18:37:14 [Screen Capturer]     INFO  ScreenCaptureRunnable - Failed to get device screenshot.
18:37:15 [Screen Capturer]     WARN  ScreenCaptureRunnable - IO Exception happened while getting device screenshot. Will try again in 100 ms.

Oddly enough:

  • screencap via adb shell produces an empty png file (literally 0 bytes) in any case with anything on screen.
  • I can send other commands, like adb shell input keyevent 25 (volume down), and they work in any case with anything on screen.

TV is a Philips 43pus7304/12 with Android Pie (adb shell getprop ro.build.version.sdk: 28).
I'm using last version of AndroidScreencast, 0.0.16s, last version of adb via wifi on a computer with debian buster in the local network.

I'm not sure how to debug this, but I can run tests if necessary.

Hello @nestukh!

Thanks for reaching me out. First of all, it's just a great example of app usage!

The screencap utility actually reads the image stream from framebuffer and the same does AndroidScreencast. Most probably, when you cannot get a screenshot with screencap you won't be able to use the app either.

Also, it may be possible, that the TV uses a different buffer for non-apps, e.g. for TV channels, because it may be a security restriction required by TV providers (so that you'd not be able to stream TV content directly).

yes it's most likely as you said. I think that solving this will require some niche android skills (HDMI/TV and low level OS)... sigh, it's a long way.
Anyway, thank you for the fast reply.