cachapa / AerialDream

A screensaver for Android inspired on the one from the Apple TV
GNU General Public License v3.0
116 stars 27 forks source link

Sony TV w/ Android 7: crashes on 4k video / 2nd video / randomly #27

Closed senthor closed 4 years ago

senthor commented 4 years ago

Hi, I really enjoy Aerial Dream, it used to work perfectly on my old Android 6 TV (1080p only). Now, on a new model, I experience some crashes, and can't get the issue solved. Using latest version from Google Play.

I'd really like to enjoy the screensaver on my new TV, ideally in 4k :) Any ideas?

cachapa commented 4 years ago

This seems to be a codec issue. I would guess that the 1080p videos you're having success with are the older ones which use better supported codecs.

They might have changed the codecs in the later ones (even for 1080p) to one which isn't supported on every Android TV device, causing the randomness you're seeing.

Unfortunately there's not much we can do about that. Aerial Dream doesn't - and can't - do video decoding by itself. It needs to be delegated to the system because it then happens in hardware. If the codecs aren't supported then you either have to hope it gets fixed in future updates, or probably more realistically, use another device.

I'm seriously considering dropping Apple as a source of videos altogether and move to something like YouTube playlists (some of which also feature the Apple videos).

In any case this bug is a duplicate of existing issues, so I'm closing it.

senthor commented 4 years ago

Thanks for the quick response! I just checked again. Issue persists regardless of which years of content I enable; crashes even with only original aerials. Additionally, I checked the codecs being used with VLC, all 1080p files seem to use H.264, while 4k uses H.265 (SDR) or Dolby Vision (HDR). All of these codecs are supported by the device; and using different apps (e.g. Phobos Apple, https://play.google.com/store/apps/details?id=ru.gelin.android.phobosapple), no crashes occur and H.265 aerials are included. So, I'm pretty sure it's not (only) a codec issue.

cachapa commented 4 years ago

Thanks for the reply. It's actually comforting to know that the problem isn't the codecs. I quickly checked their implementation and it seems we're using the same player, so it might just be something I messed up un my setup.

I'll reopen the ticket so I can track it here.

jcouton commented 4 years ago

If that can help, I ran into the same behavior (stuck on loading screen when using 4K videos) on a xiaomi mi box tv S. Then I switched to a Nvidia Shield Pro 2019 and everything is working fine.

cachapa commented 4 years ago

Ok, in that case then it must be the fact that Aerial Dream tries to load two videos simultaneously so one can fade smoothly into the next. I don't know why it would only fail randomly, but it might actually explain why it happens more reliably with 4k videos: they require more processing and video memory.

The Nvidia Shield is a top-of-the-line device and is probably able to handle those situations better. I have one and that's what makes this issue so hard to debug.

It might make sense to change the transitions so only one video is playing at any time and avoid that problem altogether. That would require a major rewrite though, so it's hard to plan for it.

jcouton commented 4 years ago

Would it be possible to check the amount of video memory in order to block the 4k option if there is not enough to handle 2 videos? That's not fixing the problem but it might prevent people from having it (while working on fixing it)

senthor commented 4 years ago

I had a look at it again and have to correct myself: Phobos Apple only uses 2015 screensavers, so H.264 only, sorry. Aerials other than the original ones (on sylvan instead of phobos) use HEVC. Still, my device (Sony XG90) does support all codecs and has hardware support for H.265. To test this, I created a short playlist of example video files of all tvOS iterations to manually play; however, I'm no regular Android user and have only managed to play it using VLC, which is using its own decoder, I guess. Do you know of any app that uses the same playback framework as Aerial Dream and supports m3u files? If yes, I could test again if codecs or the general streaming setup are issues.

# tvOS 10: http://a1.phobos.apple.com/us/r1000/000/Features/atv/AutumnResources/videos/entries.json
http://a1.phobos.apple.com/us/r1000/000/Features/atv/AutumnResources/videos/comp_GL_G004_C010_v03_6Mbps.mov
# tvOS 11: https://sylvan.apple.com/Aerials/2x/entries.json -O $RES_PATH/tvos11.json
https://sylvan.apple.com/Aerials/2x/Videos/LA_A006_C008_2K_SDR_HEVC.mov
https://sylvan.apple.com/Aerials/2x/Videos/LA_A006_C008_2K_HDR_HEVC.mov
https://sylvan.apple.com/Aerials/2x/Videos/LA_A006_C008_4K_SDR_HEVC.mov
https://sylvan.apple.com/Aerials/2x/Videos/LA_A006_C008_4K_HDR_HEVC.mov
# tvOS 12: https://sylvan.apple.com/Aerials/resources.tar
https://sylvan.apple.com/Videos/comp_DB_D011_C010_PSNK_DENOISE_v19_SDR_PS_20180914_SDR_2K_AVC.mov
https://sylvan.apple.com/Aerials/2x/Videos/comp_DB_D011_C010_PSNK_DENOISE_v19_SDR_PS_20180914_SDR_2K_HEVC.mov
https://sylvan.apple.com/Aerials/2x/Videos/comp_DB_D011_C010_PSNK_DENOISE_v19_HDR_PS_20180914_HDR_2K_HEVC.mov
https://sylvan.apple.com/Aerials/2x/Videos/comp_DB_D011_C010_PSNK_DENOISE_v19_SDR_PS_20180914_SDR_4K_HEVC.mov
https://sylvan.apple.com/Aerials/2x/Videos/comp_DB_D011_C010_PSNK_DENOISE_v19_HDR_PS_20180914_HDR_4K_HEVC.mov
# tvOS 13: https://sylvan.apple.com/Aerials/resources-13.tar
https://sylvan.apple.com/Videos/SE_A016_C009_SDR_20190717_3m30s_SDR_2K_AVC.mov
https://sylvan.apple.com/Aerials/2x/Videos/SE_A016_C009_SDR_20190717_3m30s_SDR_2K_HEVC.mov
https://sylvan.apple.com/Aerials/2x/Videos/SE_A016_C009_HDR_20190717_3m30s_HDR_2K_HEVC.mov
https://sylvan.apple.com/Aerials/2x/Videos/SE_A016_C009_SDR_20190717_3m30s_SDR_4K_HEVC.mov
https://sylvan.apple.com/Aerials/2x/Videos/SE_A016_C009_HDR_20190717_3m30s_HDR_4K_HEVC.mov

Also, note that Apple includes 1080p H.264 legacy versions (url-1080-H264) of its newer videos on tvOS 12 and 13. Maybe these could be used by Aerial Dream as a fallback solution?

AlexDemzz commented 4 years ago

same problem here with a mi box s, i hope a fix will come soon

cachapa commented 4 years ago

I'm closing this issue and following this in #30