Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Libraries getting lost on Amazon Fire devices #844

Open
Molasar49 opened this issue Mar 16, 2023 · 136 comments
Open

[Bug]: Libraries getting lost on Amazon Fire devices #844

Molasar49 opened this issue Mar 16, 2023 · 136 comments
Assignees
Labels
bug Something isn't working Important Bug severity

Comments

@Molasar49
Copy link

Molasar49 commented Mar 16, 2023

Problem description

After initial scraping (SMBv1 share on Apple Time Capsule), both Movies and TV Shows display correctly. However, if browsing another app on the Fire device and returning to Nova Player, libraries are gone. I have to exit Nova or press 'Home', wait a couple of minutes, then launch Nova again, and the libraries will appear again. 'Recently Played' and 'Recently Added' also sometimes appear, sometimes disappear.

v6.0.67 was the last version to work correctly on FireCube 4K Gen2.
v6.0.65 and above work inconsistently on FireStick 4K Max.

Have done a complete factory reset on the FireStick 4K Max, and clean-installed Nova (v6.0.65 and above) and same problem.

Steps to reproduce the issue

  1. Setup SMBv1 share on Nova
  2. Wait until initial scrape. Libraries populated correctly.
  3. Play any movie or tv show.
  4. Return until exit from Nova and on OS home screen.
  5. Wait a few minutes or use any other app.
  6. Launch Nova.

At this point, Movies and TV Shows display generic icons and no movies or tv shows appear.

  1. Return until exit from Nova and on OS home screen.
  2. Wait a few minutes or use any other app.
  3. Launch Nova.

At this point, Movies and TV Shows display populated icons and movies and tv shows fully appear.

If I repeat the same steps again (exit, wait, launch), then libraries are gone again, etc., etc. This behavior cycles.

I have changed Initial Scan on App Startup on and off to no effect.

Cleared cache and data to no avail.

Expected behavior

Libraries should stay populated.

Your phone/tablet/androidTV model

Firecube 4K Gen2, Firestick 4k Max

Operating system version

Fire OS 7.6.2.4

Application version and app store

v6.0.97 from Amazon App Store

Additional system information

v6.0.67 was the last version to work correctly on FireCube 4K Gen2.
v6.0.65 and above work inconsistently on FireStick 4K Max. Haven't tried earlier versions.

Debug logs

No response

@Molasar49 Molasar49 added the bug Something isn't working label Mar 16, 2023
@Molasar49 Molasar49 changed the title [Bug]: Library getting lost on Fire devices [Bug]: Libraries getting lost on Fire devices Mar 16, 2023
@Molasar49 Molasar49 changed the title [Bug]: Libraries getting lost on Fire devices [Bug]: Libraries getting lost on Amazon Fire devices Mar 16, 2023
@courville
Copy link
Contributor

It seems that your problem is not fire device specific but most probably linked to time capsule SMB1 server since it works on my side on a Synology NAS.

@Pentaphon
Copy link

Pentaphon commented Mar 16, 2023

I've seen this too on my Fire TV 4K stick, but it never happens on my most used device, the Onn 4K. The person using it complains that the "movies are gone" and I have to revert everything back to normal. It's happened...probably 3 times in the past year? I'm using a Windows PC as a Samba server aka my main office PC, and it provides the video for all the screens in the house.

@Molasar49
Copy link
Author

Molasar49 commented Mar 16, 2023

The curious thing about this is that it happens on the Firecube using v6.0.97. I have reverted to every version until v6.0.67, where it does not happen (which, to my mind, discards the Time Capsule as the culprit). Same thing happens with the Firestick 4K Max, except that v6.0.67 happens sporadically on that one. I'm just guessing here, but I think it has more to do with Nova's database than the Time Capsule...

Also, this happens every single time I repeat the steps in the original post, no matter if it's 2-3 minutes apart or 1-2 hours, etc., it happens all the same.

@courville
Copy link
Contributor

courville commented Mar 16, 2023

OK I will test. And thanks for pointing out that this would be a regression after v6.0.67. I will check all the code modifications.
Note to self 6.0.67 is "Sun May 22 16:44:03 2022 +0200"

@Molasar49
Copy link
Author

Molasar49 commented Mar 16, 2023

Thanks. If you need logs or anything and point me out how to go about getting them, I'd be happy to help. I can also post a (private) video (on Youtube or whatever) to show you what's going on, if it helps.

@courville
Copy link
Contributor

@Molasar49, is this correct to say that you do not have the problem on all your fire devices with v6.0.64?
I do not make sense why it should work with v6.0.67 on FireCube 4K Gen2 and v6.0.65 not working on FireStick 4K Max.
I will try to reproduce with the FireStick 4K Max.

@Molasar49
Copy link
Author

Molasar49 commented Mar 16, 2023

@courville I installed v6.0.65-20220508 on Firestick 4K Max, but it showed artifacts during playback, so I uninstalled (before checking the issue posted above) and reinstalled v6.0.67-20220605. This version shows the issue posted above. I tried v6.0.71-20220623 and v6.0.97 (the one you sent me previously and also downloaded from the App Store) and they all show the same issue (on the Firestick 4K Max). I went as far as restoring to factory settings, updating the OS and ONLY installing those Nova versions, and same problem persists.

So I headed over to the FireCube 4K Gen2 and notice that only v6.0.67 works correctly - all newer versions show the same behavior. When launching on FireCube, v6.0.67 shows generic Movies and TV Shows icons but immediately recovers (split-second later), showing "customized" icons before I get a chance to do anything and all works fine.

I don't know why v6.0.67 works on FireCube but not on Firestick Max. With Firestick, I sometimes get a Recently Played movie, which plays fine, but going into 'Movies', the library is empty - which makes me think it's not an SMBv1 or Time Capsule issue, but a Nova database issue - just my (educated) guess (since I used to be a full-time .NET developer).

I was meaning to copy some of my movies from the Time Capsule to a Windows Server share and observe the behavior. Would that help in some way?

What is strange (on Firestick) is that launching shows the behavior, returning to Home (OS) and relaunching seems to make Nova recover and populate library. Returning to Home (OS) and relaunching shows the issue, etc., etc. Going back and forth populates, then empty, then populated, then empty, etc. There seems to be no scanning involved - it's just as if it reads it's database, then it doesn't, then it reads it, then it doesn't, etc. (just guessing here). There is hardly any delay. It's just there or it isn't (if that makes any sense).

@courville
Copy link
Contributor

Thanks for the detailed behavior analysis. I ruled out the SMB1 timecapsule issue.
I tried to reproduce on Firestick 4K Max on latest release and SMB2 share on a synology and unfortunately it works as expected on my side. I do not have this split second of generic icon at all.

What I propose since you have the issue systematically, is to stick with latest release and try to get logs. I will share shortly a debug build with more logs around nova db and scraping. If you can capture adb logs with this release it would help (https://github.com/nova-video-player/aos-AVP/wiki/Debugging, adb connect adb logcat etc...).

@Molasar49
Copy link
Author

@courville, So, you recommend I uninstall v6.0.67 and install v6.0.97 on Firestick Max and capture logs, or wait until the debug build?

@courville
Copy link
Contributor

@Molasar49 please use this build: https://drive.google.com/file/d/1-HoPfztgctk7Kro1lHJt1dY-W5MxWYai/view?usp=sharing
Capture adb logcat logs (it will be verbose thus if you find a way to record the logs in a text file it would be better).
You can share the results with me via email (zip files) software at courville dot org.
Thanks in advance for your help (and patience) on this issue.

@Molasar49
Copy link
Author

@courville Ok, will proceed with this right now. And on the contrary, thank you for your time and effort!

@courville
Copy link
Contributor

Do not hesitate to request help.

@Molasar49
Copy link
Author

@courville Wow! This version works! The only thing I notice is that it's displaying generic Movies and TV Shows icons (after successful full scan), other than that, works as expected. I captured the logs. Do you wish me to send them over?

@Molasar49
Copy link
Author

Oh wait! When I disconnected adb, same problem!!!!

@Molasar49
Copy link
Author

Molasar49 commented Mar 16, 2023

Capturing new log right now. Recently Played shows 1 movie and it plays correctly. Libraries are empty. After a few minutes, Recently Added and Recently Played are gone too, but now showing populated libraries (and generic icons). Will play around a bit and send over logs.

@courville
Copy link
Contributor

Damn, yes please send the logs and I will analyze tomorrow.
Also one thing if you manage to do it is to dump nova media database before the full lib gets populated back (check "Get a dump of nova media database" section in the https://github.com/nova-video-player/aos-AVP/wiki/Debugging wiki).
If you could send me both versions (normal, and empty) via email, it would be nice too.

@Molasar49
Copy link
Author

@courville Done. Also sent a link on the email to a video capture with my phone showing the issue. Hope it helps.

@courville
Copy link
Contributor

Thanks for taking the time to investigate and for sharing the logs and the media dbs at different stages and an explanatory video.
I need to spend more time on the analysis.
What I can see from the media db is that all the videos are there and I see no scanning retrigered.
What I suspects now is that some loaders are stuck for some reasons that do not deliver the right information to the various fragments.
Let's dig in further.

@courville courville self-assigned this Mar 17, 2023
@courville courville added the Important Bug severity label Mar 17, 2023
@courville
Copy link
Contributor

I will revert the changes made around the 6.0.67 and share a new build with you tonight. I will add logs only on these parts and I will kindly request that you capture logs from nova only via for linux/macos adb shell 'logcat --pid=$(pidof -s org.courville.nova)' and adb shell "logcat --pid=$(pidof -s org.courville.nova)" most probably for windows.

@Molasar49
Copy link
Author

Thanks. Will be away for Sabbath but will continue after that. Thanks again!

@courville
Copy link
Contributor

@Molasar49, I will share an experimental build soon for you to test. What is not entirely logic on my side looking at the code changes is that you state that it works with v6.0.67 but not with v6.0.68. Do you confirm this statement?

@courville
Copy link
Contributor

OK re-reading the full thread, issue happens with v6.0.67 but less frequently but not with v6.0.65. It is thus between v6.0.65 and v6.0.67 that the issue has been introduced and it far more visible after v6.0.67.
The change I target is the throttling that I removed that could on the fire devices (for unknown reasons) to get all the loaders stuck.

@courville
Copy link
Contributor

courville commented Mar 19, 2023

Note to self: might be related to #141, #605, #134 (check with in Video tig --follow ./src/main/java/com/archos/mediacenter/video/browser/loader/)

  • 19/5/27-28: introduce in VideoLoader custom ThreadPoolExecutor(1, 1, 10, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(5200)); exceeding thread pool using tvshow by date causing crash #141 (4.3+?)
  • 19/10/02: introduce 2s throttling in global VideoLoader to reduce E/SQLiteLog: (9) statement aborts messages E/SQLiteLog issue #134 (5.1+)
  • 21/7/11: use default VideoLoader ModernAsyncTask Executor to try to improve latency (not conclusive?) (6.0.10+)
  • 22/2/15: disable 2s throttling in global VideoLoader (6.0.45+)
  • 22/4/4: introduce throttling in all loaders dependent on Videoloader
  • 22/4/4: get back to VideoLoader custom ThreadPoolExecutor(1, 1, 10, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(5200)); with 5s throttling (6.0.57+)
  • 22/5/8: rework throttling infra of 5s for VideoLoaders (6.0.65+)
  • 22/5/13: disable throttling for one day... and centralize throttling for loaders dependent on VideoLoader on which throttling is to be applied (6.0.65+)
  • 22/5/14: enabled throttling E/SQLiteLog issue #134 (6.0.65+)
  • 22/11/12: VideoLoader LinkedBlockingQueue has increased size from 5200 to max to address [Bug]: App hanging/crashing when browsing Episodes by date #605 (6.0.82+)
  • 22/11/12: MoviesSelectionLoader with threadPool of 1 is introduced to avoid blinking in VideoByFragment but penalizing the other loaders that get back to ModernAsyncTask parameters except size of LinkedBlockingQueue (6.0.82+)
  • 22/11/21: VideoLoader introduce a 1h throttle delay for MoviesByLoader (6.0.86+)
  • 23/1/7: VideoLoader disable throttling and give up on 1h throttle delay since causing videos not to loading in EpisodesByDate/MoviesBy(Year|Genre) (6.0.93+)

Github releases dates:

  • 22/5/8: 6.0.65
  • 22/5/15: 6.0.66
  • 22/6/5: 6.0.67

Comment: AsyncTaskLoader relies on ModernTaskLoader now and uses ThreadPoolExecutor(5, 128, 1, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(10), tocheck).

@courville
Copy link
Contributor

@Molasar49 could you please test this new build and report if it is any better https://drive.google.com/file/d/1-HoPfztgctk7Kro1lHJt1dY-W5MxWYai/view?usp=sharing ?

It has VideoLoader throttling enabled for all related loaders and relies on ThreadPoolExecutor(1, 1, 10, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(5200));. However throttling is disabled in VideoSelectionLoader and it relies on default ThreadPoolExecutor(5, 128, 10, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(10)).

@courville
Copy link
Contributor

@Molasar49 after and only after testing above build, if it is still nok, it would be nice if you could provide feedback on this build where the default android ThreadPoolExecutors are used for the loaders (throttling is still enabled): https://drive.google.com/file/d/1-2FOkcJks9SYLNzvtZg7ludju0tuvRxN/view?usp=sharing

@Molasar49
Copy link
Author

Molasar49 commented Mar 27, 2023

Can confirm: With "flash cycles" (totally unnatural), I can consistently get generic library icons. However, all else is correct. Just my opinion this is not a flaw, as a "flash cycle" is nothing short of unnatural. Even a near 0.5s cycle causes no problems (i.e.: restores icons to customized).

@courville
Copy link
Contributor

Thus it means that somehow my last change makes the worst build (TEST5) stable for the 'library not populated' issue.

For the generic icon issue: I will work on it on the next step. For now I made the app recover when crashing during buildAllMoviesBoxTask and I have a design issue regarding icons not generated after first scrap.

Anyhow, this would be a fantastic progress if you do not get anymore the 'library not populated' issue.

@Molasar49
Copy link
Author

Molasar49 commented Mar 27, 2023

Up to this point, no matter what I threw at it (including flash cycles), I could NOT get it to fail (i.e.: empty libraries)...

Will continue a bit more cycles and then proceed to set "Re-scan on app start" to Yes, and continue tests. If it succeeds, will test TEST8 on Firestick 4K Max.

@courville
Copy link
Contributor

courville commented Mar 27, 2023

If it works, it means that in reality the global issue is a huge race condition which frequency of occurence is influenced by the loaders strategy but not linked to the loaders itself. I will thus revert the original strategy for better efficiency.

Note that I can reproduce the generic box icons: easier then to fix.

Thanks again for all the effort in thorough testing!

@Molasar49
Copy link
Author

Happy to report TEST8 is a winner on Firecube 4K Gen2 Wired with Re-scan on app startup set to "No". Will now set to "Yes" and continue tests...

@Molasar49
Copy link
Author

Molasar49 commented Mar 27, 2023

Extremely happy to report TEST8 is a WINNER on Firecube 4K Gen2 Wired! Could not make it lose libraries no matter what I threw at it (including using Home key instead of Return, randomly). Works as expected.

Will run TEST8 trials on Firestick 4K Max Wifi after lunch and report back.

@courville
Copy link
Contributor

courville commented Mar 27, 2023

TEST9 should now always build iconBoxes except for initial first scraping at first install (otherwise it is the same as TEST8).

@Molasar49
Copy link
Author

@courville About to initiate tests (TEST8) on Firestick. Do you wish me to continue, or jump right into TEST9 (on Firecube, etc.)?

@courville
Copy link
Contributor

courville commented Mar 27, 2023

@Molasar49 just finish TEST8 (pretty please) and then you can take TEST9 for your everyday use.

@Molasar49
Copy link
Author

@courville Gotcha. Initiating now...

@Molasar49
Copy link
Author

Molasar49 commented Mar 27, 2023

TEST8 (on Firestick 4K Max Wifi)

Note: Will assume generic library icons on initial scan finish is correct behavior and should regenerate on first cycle.

  1. Uninstalled previous version.
  2. Reboot (to provide for a clean test).
  3. Wait 2 minutes for device to "settle" (finish loading any background processes).
  4. Install. All permissions granted (as usual).
  5. Preferences>About shows v6.1.3 (20230327.1852)
  6. Re-scan on app startup is set to "No" (default).
  7. Initial scan in progress...
    a) Recently Added populated during initial scan.
  8. Initial scan finished. 2 minute "settling period" elapsed.
    a) All correct.
  9. 1 cycle (Return->Home (1s pause)->Relaunch.
    a) Recently Added populated.
    b) Movies and TV Shows icons generic.
    c) Movies libraries gone!!!
  10. Return->Home (3s pause)->Relaunch.
    a) Recently Added gone!!!
    b) Movies and TV Shows icons customized.
    c) Movies libraries populated.

Initiating random cycles... (all cycles using "Return" and "Select/Enter" key on remote). Firestick is 12ft. aprox away from AP, clear line of sight. AP is wired to unmanaged switch, wired to managed switch, wired to Time Capsule, all 1Gb (ethernet wired) speed.

@Molasar49
Copy link
Author

Molasar49 commented Mar 27, 2023

Just failed again...

  1. Return->Home (random medium pause)->Relaunch.
    a) Recently Added populated
    b) Had played a random movie before cycle. Recently Played gone!
    c) Movies and TV Shows icons generic.
    d) Movies library empty!
    e) TV Shows library empty!
  2. Return->Home (random 5s-ish pause)->Relaunch.
    a) Recently Added gone!
    b) Recently Played gone!
    c) Movies and TV Shows icons generic!
    d) Movies library empty!
    e) TV Shows library empty!

@Molasar49
Copy link
Author

Just for the sake of completeness, checked Network stats (OS). Shows:

Frequency: 5220MHz
Channel: 44
Signal strength: High (-41 dBm)
Noise: Low (-90 dBm)
Signal to Noise Ratio: High (49)

Ran integrated OS speed test. Shows:
Internet Speed (91.60 Mbps) - I have a 200Mbps up/down symmetrical link.

Continuing with tests...

@Molasar49
Copy link
Author

Molasar49 commented Mar 27, 2023

  1. Return->Home (random pause)->Relaunch.
    a) Recently Added populated
    b) Recently Played gone!
    c) Movies and TV Shows icons generic!
    d) Movies library empty!
    e) TV Shows library empty!

Since Recently Added is populated, picked a random title, and it played correctly. However, on return, Recently Played is still gone...

@Molasar49
Copy link
Author

Molasar49 commented Mar 27, 2023

  1. Return->Home (random pause)->Relaunch.
    a) Everything is gone!

@courville This is clearly failing (easily) on Firestick 4K Max. What do you wish me to do?

@Molasar49
Copy link
Author

Molasar49 commented Mar 27, 2023

  1. Return->Home (random medium pause)->Relaunch.
    a) Recently Added populated
    b) Recently Played gone!
    c) Movies and TV Shows icons generic!
    d) Movies library empty!
    e) TV Shows library empty!

Rebooting AP and managed switch for the sake of completeness and continue test. Will report back.

@Molasar49
Copy link
Author

Molasar49 commented Mar 27, 2023

Rebooted Firestick last. Cycles in progress... looks promising...

Whoops... just failed again :(

Also, sometimes still losing Recently Added and Recently Played.

Just hit another fail (empty libraries) after a random 8s-ish pause.

Yet another fail (empty libraries) after random (20s-ish) cycle...

TEST8 is definitely a no-go on Firestick 4K Max Wifi... :(

After another random cycle, libraries icons customized and both libraries populated, but both Recents gone, which (to my mind at least) should rule out connectivity issues. Any movie plays fine. When both libraries are empty but Recents are populated, any title from Recents also plays fine. Would I be correct to assume this (not a connectivity or SMB issue)?

@Molasar49
Copy link
Author

Molasar49 commented Mar 27, 2023

Again, for the sake of completeness, uninstalled TEST8 and installed TEST3 (without rebooting) - Firestick 4K Max.

After 1 hour of intense, UNRELENTING POUNDING (well beyond the scope of normal use), I did manage to make it fail about 4 times, but it was VERY hard to do so...

Going to extremes, have relocated Firestick to a location where I can use the ethernet adapter (included) and wire it to the same switch where the Firecube is connected. Wifi is now turned OFF. Using a computer monitor (HP) as test screen.

Will reinitiate TEST8 tests and report back...

@Molasar49
Copy link
Author

Molasar49 commented Mar 27, 2023

TEST8 (on Firestick 4K Max Wired)

Note: Will assume generic library icons on initial scan finish is correct behavior and should regenerate on first cycle.

  1. Uninstalled previous version.
  2. Reboot (to provide for a clean test).
  3. Wait 2 minutes for device to "settle" (finish loading any background processes).
  4. Install. All permissions granted (as usual).
  5. Preferences>About shows v6.1.3 (20230327.1852)
  6. Re-scan on app startup is set to "No" (default).
  7. Initial scan in progress...
    a) Recently Added populated during initial scan.
  8. Initial scan finished. 2 minute "settling period" elapsed.
    a) All correct.
  9. 1 cycle (Return->Home (1s pause)->Relaunch.
    a) All correct.
  10. Played random movie.
    a) Recently Played populated.
    b) All correct.
  11. Return->Home (random short pause)->Relaunch.
    a) Recently Added populated
    b) Recently Played gone!
    c) Movies and TV Shows icons generic!
    d) Movies library empty!
    e) TV Shows library empty!
  12. Return->Home (random short pause)->Relaunch.
    a) Recently Added gone!
    b) Recently Played gone!
    c) Movies and TV Shows icons customized.
    d) Movies library populated.
    e) TV Shows library populated.
  13. Return->Home (random medium pause)->Relaunch.
    a) Recently Added populated
    b) Recently Played gone!
    c) Movies and TV Shows icons generic!
    d) Movies library empty!
    e) TV Shows library empty!

Can definitely say without any further tests that the above results pretty much discard wifi issues as the Firestick is now ethernet wired to the same (unmanaged) 100Mbps switch as the Firecube 4K Gen2.

@Molasar49
Copy link
Author

Molasar49 commented Mar 27, 2023

  1. Return->Home (random medium pause)->Relaunch.
    a) Everything gone!
    b) Apple Time Capsule shortcut visible in Network->Indexed folders.
    c) Opened shortcut and all media visible (mp4 and/or mkv files).
    d) Upon return, everything is still missing (i.e.: Recently Added / Played gone, generic icons, libraries empty).
  2. Return->Home (random medium pause)->Relaunch.
    a) Everything gone!
  3. Return->Home (random short pause)->Relaunch.
    a) Recently Added gone!
    b) Recently Played gone!
    c) Movies and TV Shows library icons customized.
    d) Movies library populated.
    e) TV Shows library populated.
  4. Return->Home (random long-ish pause)->Relaunch.
    a) Recently Added populated
    b) Recently Played gone!
    c) Movies and TV Shows library icons generic.
    d) Movies library empty!
    e) TV Shows library empty!

@courville I think this shows (sufficient) erratic behavior on Firestick 4K Max Wired (discarding wifi issues) to be declared a definite fail for TEST8. I have no idea why the difference in behavior between Cube and Stick...

Please let me know if you wish any other tests, etc.

@Molasar49
Copy link
Author

Molasar49 commented Mar 27, 2023

Switched to another port on the Dell ethernet switch (as I just saw the SPD/LNK/ACT LED -maybe- a bit dimmed on the previous port).

Both SPD/LNK/ACT (blinking) and FDX/HDX LEDs fully bright. Continuing tests...

  1. Return->Home (random long-ish pause)->Relaunch.
    a) All correct.
    b) Played another random movie.
    c) All correct.

@Molasar49
Copy link
Author

Molasar49 commented Mar 27, 2023

Well, that was short-lived.

Just got it to fail after a random pause.

  1. Return->Home (random short-ish pause)->Relaunch.
    a) Recently Added populated
    b) Recently Played gone!
    c) Movies and TV Shows library icons generic.
    d) Movies library empty!
    e) TV Shows library empty!
  2. Return->Home (random short-ish pause)->Relaunch.
    a) Recently Added gone!
    b) Recently Played gone!
    c) Movies and TV Shows library icons customized.
    d) Movies library populated
    e) TV Shows library populated
  3. Return->Home (random short-ish pause)->Relaunch.
    a) All correct.
  4. Return->Home (random medium-ish pause)->Relaunch.
    a) Recently Added populated
    b) Recently Played gone!
    c) Movies and TV Shows library icons generic!
    d) Movies library gone!
    e) TV Shows library gone!
  5. Return->Home (random short-ish pause)->Relaunch.
    a) Everything gone!
  6. Return->Home (random long-ish pause)->Relaunch.
    a) Everything gone!

I think we can safely assume the observed failures are not wifi related (or even connectivity related), nor even Apple Time Capsule (sleeping) related, as TEST8 does not fail on Firecube.

I didn't POUND it (TEST8) relentlessly on the Cube, but I can if you want to. Please let me know. As a note, these latter (wired) tests weren't merciless either; about the same as on the Cube. I am now moving the Stick back to its original place (wifi).

@courville
Copy link
Contributor

courville commented Mar 28, 2023

Hi, thanks again for all the tests, even if this is disappointing. Thus conclusion is that all the releases are failing ultimately even the best of all TEST3 :-(
At this point, I think it always failed somehow but hardly noticeable (nothing that a back and relaunch could fix).
Perhaps this is linked to AsyncTask being deprecated https://developer.android.com/reference/android/os/AsyncTask for a good reason:

AsyncTask was intended to enable proper and easy use of the UI thread. However, the most common use case was for integrating into UI, and that would cause Context leaks, missed callbacks, or crashes on configuration changes. It also has inconsistent behavior on different versions of the platform, swallows exceptions from doInBackground, and does not provide much utility over using Executors directly.

At this point, I would be tempted to comply and try out the proposed java.util.concurrent or Kotlin concurrency utilities (livedata etc.) but this is far more work.

@Molasar49
Copy link
Author

Molasar49 commented Mar 28, 2023

@courville Yes, I reinstalled TEST3 on Firestick (while it was still wired) and I made it fail quite frequently with just a bit of trying... :(

I don't know why it's that much more noticeable on the Stick than on the Cube... Maybe because the hardware is more capable or faster on the Cube... no idea...

@courville
Copy link
Contributor

@Molasar49 thanks for the confirmation of my hunch. I guess the difference of behavior is linked to a core race condition that is indeed put in evidence depending on the hardware capabilities and patterns.

@courville
Copy link
Contributor

Since this is not a loader issue: get safely back to ThreadPoolExecutor(1, 1, 10, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(5200)) since using a smaller queue makes application crash while scanning large video collection entering the MoviesByYearFragment for instance:

E/AndroidRuntime(17769): java.util.concurrent.RejectedExecutionException: Task androidx.loader.content.ModernAsyncTask$3@da21126 rejected from java.util.concurrent.ThreadPoolExecutor@a523ef2[Running, pool size = 4, active threads = 4, queued tasks = 256, completed tasks = 360]
E/AndroidRuntime(17769): 	at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2086)
E/AndroidRuntime(17769): 	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:848)
E/AndroidRuntime(17769): 	at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1394)
E/AndroidRuntime(17769): 	at androidx.loader.content.ModernAsyncTask.executeOnExecutor(ModernAsyncTask.java:452)
E/AndroidRuntime(17769): 	at androidx.loader.content.AsyncTaskLoader.executePendingTask(AsyncTaskLoader.java:228)
E/AndroidRuntime(17769): 	at androidx.loader.content.AsyncTaskLoader.dispatchOnCancelled(AsyncTaskLoader.java:241)
E/AndroidRuntime(17769): 	at androidx.loader.content.AsyncTaskLoader$LoadTask.onCancelled(AsyncTaskLoader.java:94)
E/AndroidRuntime(17769): 	at androidx.loader.content.ModernAsyncTask.finish(ModernAsyncTask.java:488)
E/AndroidRuntime(17769): 	at androidx.loader.content.ModernAsyncTask$InternalHandler.handleMessage(ModernAsyncTask.java:507)
E/AndroidRuntime(17769): 	at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(17769): 	at android.os.Looper.loop(Looper.java:223)
E/AndroidRuntime(17769): 	at android.app.ActivityThread.main(ActivityThread.java:7668)
E/AndroidRuntime(17769): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(17769): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/AndroidRuntime(17769): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Conclusion: one could benefit of multithread but since a long LinkedBlockingQueue is required not to get a crash this will not help because multithreads kicks in when queue is full...

See nova-video-player/aos-Video@c9636f0

@Pentaphon
Copy link

@Molasar49 has this issue been resolved for you?

@Molasar49
Copy link
Author

Molasar49 commented May 2, 2023

Have done no tests on any newer versions as it was my understanding that this wasn't getting fixed any time soon (i.e., there was no indication to test out any newer versions). I am still on version v6.1.3 (20230327.1852). Have not updated to any newer version. I had a sense that the issue would be addressed much later (since it appears to involve a lot of rework). Has anything changed regarding this issue in later versions? Will be happy to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Important Bug severity
Projects
None yet
Development

No branches or pull requests

3 participants