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
Wake-up timer not working #957
Comments
You can try disabling the battery optimisation settings for Noice by navigating to Device Settings > Apps > Noice > Battery. The exact steps may vary for Lineage OS. |
I did as you suggested. Sadly, disabling battery optimizations did not solve my issue. The wake-up timer still doesn't wake the phone up to activate the alarm. |
Another interesting tidbit I found out is that the wake-up timer only activates if the Noice app is in the foreground on the phone. You don't even need to lock the screen. |
This issue comes around every now and then. Usually, turning off battery optimisation fixes the problem. The feature works as-is on most devices (and Android distributions) (including my own and the emulator). It essentially boils down to how a specific Android distribution handles background activity from an app, which is pretty much out of our control. Moreover, we use AlarmManager API from the Android Framework to set up alarms. Its whole point is to let an app schedule delayed callbacks. The platform guarantees that these callbacks will be delivered when the time comes, even if the app is not active. |
Well, I'm out of ideas then. I uninstalled the app from F-Droid, reinstalled it from Google play, and I still get the same issue. |
*should I close this issue |
No no. Let's keep this open. I want to know where it works and where it doesn't. There can be any reason why it isn't working as expected. To quote a StackOverflow answer:
I am reasonably confident that it isn't a bug in Noice because the same code works on other devices. So as long as the alarm indicator gets triggered in the notification bar on scheduling an alarm, there's nothing more we could do to mitigate this issue. |
"as long as the alarm indicator gets triggered in the notification bar" I am unsure what you mean by this. |
The indicator is exactly what I meant. It implies that Noice correctly schedules the alarm with the system. After this step, it's up to the system to fire it when the time comes. Would it be possible for you to monitor device logs at the time when the alarm is supposed to go off? I want to completely eliminate the possibility of a bug here. |
I would love to help but I'm unsure how to access such logs. Do I need to use adb to shell into my phone? Or where can I find such logs? |
Did you provide data collection consent? If so, then I am not seeing any crash logs in Firebase Console so we're good. Otherwise, to collect logs, you need to install adb on a computer. You also need to enable developer options on your device. Then connect your device to the computer, and schedule the alarm. A few seconds before the alarm goes off, you can run the following from a terminal/console on your computer.
A few seconds after the scheduled time, press To avoid all the hassle, you can just turn on data collection in Noice and reproduce this issue a few times. If it's indeed a crash, I'll automatically get the logs Firebase Crashlytics. |
logcat.txt |
Thank you for taking the time to collect and upload the logs. It appears that the alarm is fired precisely so it is a problem with Noice. It appears to be a silent error (i.e. doesn't cause a crash) and is indeed documented. I am not sure why it works flawlessly on my device and emulators. I will create a fix for it once I am done with v2 implementation, or if I find some time in the middle. |
Thank you for your time. If you need any more details about my device or setup, please feel free to just ask away |
This is also an issue on GrapheneOS (Android 13). Since this is my sole reason for using Noice the app is pretty useless to me. |
@sevmonster AFAIK, it only happens on devices running Android higher than 11. It is why I haven't had a lot of complaints regarding this. As of now, I am busy with the Chromecast implementation. I'll try to resolve it as soon as I finish that. I'd estimate it within two weeks, but it might be longer. Please subscribe to this issue to receive updates. |
Description
The wake-up timer seems to only work on my phone when the phone itself is unlocked and awake.
When I leave the phone locked and the screen black, the timer never goes off at the set hour. I'm not sure if the app gets optimized into the background to save battery life or what else could be going on but I simply can't use the app as an alarm clock.
To Reproduce
Steps to reproduce the behavior:
Others
The text was updated successfully, but these errors were encountered: