-
-
Notifications
You must be signed in to change notification settings - Fork 968
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
Music app issues when playing video in Firefox on Android #825
Comments
InfiniTime probably shouldn't freeze because of this, but Gadgetbridge should avoid causing this as well. |
I could easily reproduce the issue and analyze it : DisplayTask is not looping anymore because it's stuck in According to this, this is an expected behavior in LVGL7 which was improved in LVGL8 (see last comment. While analyzing this issue, I found 2 new issues :
I can see 2 options for this issue:
@Avamander @Riksu9000 Do you have any opinion about this? |
I had a similar issue when I converted to using LVGL tasks for Refresh. This is what I wrote in #497
This may not be 100% accurate, since the behaviour is a bit confusing and not well documented. Nevertheless setting the priority to low in Motion app for example produces a very similar issue as seen here. There's also the Dice app PR #565, which allows rolling up to 100 d100 dice, which produces a very long label which also lags the screen, but that doesn't cause any problems either. I tried removing the Refresh task in Music, and it still got stuck. Then I simply hard coded two labels to contain very long text and that produces this issue. The issue is simply that LVGL can't handle drawing two long scrolling labels at the same time. I would really prefer to upgrade to LVGL 8, since we seem to be stumbling across more and more issues with version 7, but I can see that it wouldn't be so simple. If we are going to stick with v7 for a while longer, it's probably worth patching this issue, but if we instead were to start focusing on upgrading, then a simple fix to limit the displayed characters would be the best option in my opinion. |
Thanks for this analysis, @Riksu9000 ! According to the code, the refresh task is already set to In any case, I think that we should limit the size of the strings copied from the BLE notification. Heap is not infinite, and this could potentially prevent a few strange bugs when the companion app sends really big strings as track or album name. This would also provide us a short term solution for this issue. I also tested these changes in lv_task.c:
And they seem to work fine, even with strings longer than 40 characters. It simply counts the number of tasks that are already present in the list, and limit the number of iterations to that number of tasks. This way, it ensures that it won't loop forever is tasks are added while it's executing other tasks. I did a few test and couldn't see any negative side effects (yet). |
…This should work around this bug : #825 and prevent heap over-allocation.
…the lowest priority (0). Both display and system tasks are also set on priority 0. In cases where any other task takes too much time to execute (it can happen in Display Task, see #825), the timer task does not have the opportunity to run fast enough to detect and debounce presses on the button. This commit sets the following priorities: - [0] : Display Task - [1] : Timer and System tasks - [2] : BLE Host - [3] : BLE LL This way, we ensure that button presses will always be detected, even if the rendering of the display takes a huge amount of time.
…This should work around this bug : #825 and prevent heap over-allocation.
…the lowest priority (0). Both display and system tasks are also set on priority 0. In cases where any other task takes too much time to execute (it can happen in Display Task, see #825), the timer task does not have the opportunity to run fast enough to detect and debounce presses on the button. This commit sets the following priorities: - [0] : Display Task - [1] : Timer and System tasks - [2] : BLE Host - [3] : BLE LL This way, we ensure that button presses will always be detected, even if the rendering of the display takes a huge amount of time.
…This should work around this bug : InfiniTimeOrg/InfiniTime#825 and prevent heap over-allocation.
…the lowest priority (0). Both display and system tasks are also set on priority 0. In cases where any other task takes too much time to execute (it can happen in Display Task, see InfiniTimeOrg/InfiniTime#825), the timer task does not have the opportunity to run fast enough to detect and debounce presses on the button. This commit sets the following priorities: - [0] : Display Task - [1] : Timer and System tasks - [2] : BLE Host - [3] : BLE LL This way, we ensure that button presses will always be detected, even if the rendering of the display takes a huge amount of time.
What Happened?
The Music app stops responding to screen and button inputs, or sometimes InfiniTime crashes
What should happen instead?
The Music app should still respond to button and screen input and InfiniTime should not crash
Reproduction Steps
Using Firefox on Android with Gadgetbridge:
The music app shows the video title and URL (scrolling since they are long) but no longer responds to button or screen presses. The watch must be restarted by holding the button. Or sometimes InfiniTime crashes altogether and reboots.
More Details
I'm on Android 12. The issue only happens with Firefox; watching the same videos in Chrome or the YouTube app does not impact the Music app. It seems these apps also don't send the video metadata to the watch (or at least the Music app doesn't display it).
I see the same issue on other sites with embedded videos, and not just YouTube-hosted videos.
This may be considered low priority since Chrome is the default browser and seems to be used by almost all Android users. I don't generally use the watch to control embedded video playback, but if I accidentally open Music while video is playing, I'm stuck having to reboot the watch.
Version
72900ca
Companion App
Gadgetbridge v0.62.0
The text was updated successfully, but these errors were encountered: