theothernt / AerialViews

A screensaver for Android TV devices including Nvidia Shield, Fire TV, and Chromecast with Google TV. Inspired by Apple TV's video screensaver.
GNU General Public License v3.0
469 stars 35 forks source link

v0.95 - Black screen when used with Fire TV Stick 4k. #8

Closed ghost closed 3 years ago

ghost commented 3 years ago

I sideload your app on my Amazon Fire TV Stick 4k and using ADB I have it set as the default screensaver. I started using version 0.94 to accomplish this and it works great, however when I updated the apk to the new 0.95 version the screensaver stopped working; when it triggers it only shows a black screen. If I download and install 0.94 again it starts working.

I should note at this point that accessing the app still works; I can configure it that way still and I can also test the screensaver from inside the app and that works fine too. All that doesn't work is when the screensaver is actually triggered under normal circumstances. I tried uninstalling the app and reinstalling it to no avail and I've also tried also doing a factory restore of the Fire TV and sideloading the new version again but also did not correct the issue.

Any ideas? It doesn't matter to me at all really as the 0.94 version is stable for me and works nicely so I'll just stick with that if needs must but I figured I'd mention this to you in case it's something you can fix.

theothernt commented 3 years ago

Sorry to hear that latest build isn't working, nothing was specifically changed but the conversion to Kotlin and some tidying up may have broken something. That said, the code that shows the preview/test and the full screensaver should be the same!

If you can, can you tell me if any of the video formats work? also, what version of Android is the Fire TV 4K running?

ghost commented 3 years ago

Hi, thanks for checking this out. I think I've found the issue actually but to answer your questions first I have tried all the video formats and none work, I'm not entirely sure what version of android it uses but it's apparently based on 7.1.2 according to wikipedia.

It occurred to me (not sure why it didn't before) to use logcat and watch the output when the screensaver was supposed to start to see what gets logged and sure enough I got this output after a while:

04-23 20:21:14.377 611 636 I PowerManagerService: Nap time (uid 1000)... 04-23 20:21:14.380 611 636 W DreamManagerService: Dream ComponentInfo{com.amazon.ftv.screensaver/com.amazon.ftv.screensaver.app.services.ScreensaverService:com.codingbuffalo.aerialdream/.AerialDream} does not exist 04-23 20:21:14.381 611 636 W DreamManagerService: Falling back to default dream ComponentInfo{com.codingbuffalo.aerialdream/com.codingbuffalo.aerialdream.AerialDream} 04-23 20:21:14.381 611 636 I DreamManagerService: Entering dreamland. 04-23 20:21:14.381 611 636 I PowerManagerService: Dreaming... 04-23 20:21:14.382 611 629 I DreamController: Starting dream: name=ComponentInfo{com.codingbuffalo.aerialdream/com.codingbuffalo.aerialdream.AerialDream}, isTest=false, canDoze=false, userId=0 04-23 20:21:14.383 611 629 W ActivityManager: Unable to start service Intent { act=android.service.dreams.DreamService flg=0x800000 cmp=com.codingbuffalo.aerialdream/.AerialDream } U=0: not found 04-23 20:21:14.383 611 629 E DreamController: Unable to bind dream service: Intent { act=android.service.dreams.DreamService flg=0x800000 cmp=com.codingbuffalo.aerialdream/.AerialDream } 04-23 20:21:14.383 611 629 I DreamController: Stopping dream: name=ComponentInfo{com.codingbuffalo.aerialdream/com.codingbuffalo.aerialdream.AerialDream}, isTest=false, canDoze=false, userId=0

So I realised that the black screen isn't actually the screensaver; that's just the fire tv turning the screen off after a period of inactivity which it does anyway, the screensaver isn't starting at all because it can't be found for whatever reason according to that log.

To set the screensaver in the settings I used this code;

adb shell settings put secure screensaver_components com.amazon.ftv.screensaver/.app.services.ScreensaverService:com.codingbuffalo.aerialdream/.AerialDream settings put secure screensaver_default_component com.codingbuffalo.aerialdream/.AerialDream

This works for 0.94, but I assume with 0.95 now I need to flesh out the bit after the / if it can't find it, unless something else has changed? I know the actual app name is the same as I found it when I did pm list packages.

Cheers!

theothernt commented 3 years ago

Ahh, I see the problem. I was also wondering why I didn't have the same issue as I run the builds for weeks at a time to make sure they're stable, etc.

I don't have a Fire TV stick - is there no UI to configure a screensaver, or do you prefer the command line method?

Either way, the name of the screensaver intent (ie. the name of the class that's executed) has changed so your command needs to be updated. It's changed to com.codingbuffalo.aerialdream/.ui.screensaver.DreamActivity. So I think the new command is...

adb shell settings put secure screensaver_components com.amazon.ftv.screensaver/.app.services.ScreensaverService:com.codingbuffalo.aerialdream/.ui.screensaver.DreamActivity settings put secure screensaver_default_component com.codingbuffalo.aerialdream/.ui.screensaver.DreamActivity

Let me know if that works for you!

I'll add that to the install instructions in future. Also, the name of the app will change in future!

ghost commented 3 years ago

I use the command line because as far as I know that's the only way to do it. There is technically a UI for the screensaver settings with an an option for changing "current screensaver" but if you select that option it only lists Amazon's own app and nothing else so I'm not entirely sure why they even bothered having it there.

In an case I've made the changes and can confirm your screensaver now works again so case closed there, wasn't a bug afterall just my settings were wrong! Thanks very much for the help anyway, I appreciate it. I'll close this when I comment.