Alarm not ringing or ringing later than specified
Describe the bug The alarm seems to ring ~10 minutes late or doesn't ring at all sometimes
To Reproduce Steps to reproduce the behavior:
- Set an alarm more than 30 minutes away
- Wait
Expected behavior Ring at specified time
Smartphone Information
- Device: OnePlus 9RT
- OS: Android 13
- App version: 4.1 (clean install)
Additional context I had enabled foreground, background usage, turned off optimization, enabled auto launch. Still the alarm ringing is a hit or miss. In contast, I gave Simple Clock only foreground usage and it still seems to ring at specified times
Screenshots
Example 1: At 8:30 AM an alarm was set for 9:35 AM. It rang at 9:39 only after unlocking the phone and opening Chrono
Example 2: A notification for upcoming alarm at 11:15 AM (set at 10:30 AM) was receieved. But the alarm failed to ring. Opening the app also didn't make the alarm ring as well.
https://github.com/vicolo-dev/chrono/assets/69535896/43aac825-14e0-4826-ae0e-75e262609b9e
Battery settings for Chrono: (Simple Clock only had the Foreground activity enabled)
Have you tried everything listed here: https://dontkillmyapp.com/oneplus
And here: https://oneplus.gadgethacks.com/how-to/disable-setting-if-notifications-are-delayed-your-oneplus-0192639/
Especially the Advanced Optimization thing.
I don't own a OnePlus device but can you also make sure that 'Show on Lock Screen' or something similar and 'Show Fullscreen Notifications' or something similar is enabled for the app?
Have you tried everything listed here: https://dontkillmyapp.com/oneplus
Pretty much
Especially the Advanced Optimization thing.
That is not a thing in current OxygenOS. The only settings related to battery is the one shown in the screenshot and also Special App Access > Battery Optimization.
I don't own a OnePlus device but can you also make sure that 'Show on Lock Screen' or something similar and 'Show Fullscreen Notifications' or something similar is enabled for the app?
Yeah it is. Besides, the alarm does show up on lock screen if it's set not too far long (~20 minutes?). Like I've mentioned I didn't face the same thing with Simple Clock. Maybe they're doing something extra to get the alarm go off?
Other battery settings:
Display over other apps: (Chrono doesn't show up here and Simple Clock was disabled as well
Special App Access > Battery Optimization:
App Ops and Uses permissions of Simple Clock are given below. The only thing stood out to me was the "Start Foreground" option. And Chrono seems to have quite a bit more Uses permissions.
App Ops:
Uses Permissions:
Thanks, I'll take a look what SimpleClock does differently. Also, when did this issue first started for you? After 0.4.0/0.4.1 update or before that?
Also, when did this issue first started for you? After 0.4.0/0.4.1 update or before that?
I had some reliability issues as well, so that is why I was going back and forth between Chrono and Simple Clock.
Also, I have resolved the issue with the alarm by disabling the "Battery Optimization" option inside App Manager. Not sure what setting it enables/disables, but it does use root permissions. For now, the issue seems to have been resolved for me. Feel free to close it! Also, there seems to be an issue with the timer as well. I'll try to do some more testing and create a new issue.
The App Manager option:
https://github.com/vicolo-dev/chrono/assets/69535896/92d6aefc-d709-43de-a3ac-c56d8b7cb4f5
I have this same behavior on a Moto G7 running LineageOS, I'm afraid. It only started happening after upgrading from LineageOS 20 (Android 13) to LineageOS 21 (Android 14). Battery optimization is off, and notifications are on.
What specifically happens is that the alarm does not go off at all, but the upcoming alarm notification is shown. The alarm does not go off after opening the app.
I don't know if this will help - Android 14 seems to have broken a lot of things that use background processing for me, from alarms to offline music players.
I don't know if this will help - Android 14 seems to have broken a lot of things that use background processing for me, from alarms to offline music players.
Don't have a real Android 14 device at the moment but I've tested it on a stock android 14 emulator, and it works well there. So probably a real device specific optimization.
I had this happen on my Pixel 7 pro. Did not happen before 0.4.0. I disabled battery optimization in app manager, will see if that helps. Though I had it disabled anyway.
The alarm didn't go off 3 nights in a row. It works after not touching the phone for about half an hour. Tinkering with app manager did not help. Trying to figure out if the issue is connected with turning on rising volume.
I mentioned it in another issue, but will also mention it here. I am currently looking at adding a foreground service (optional in the settings), which will show a peristent notification and hopefully prevent the app from being killed. It will help in fixing alarm reliability issues.
Also, if possible, can you guys run the benchmark in DontKillMyApp from the app store and report the results?
It would also be helpful if you guys can suggest opensource apps that work correctly in the background on your devices, and whether they do it through a persistent notification (foreground service).
I think the apps I have that are not having problems with being killed on Android 14 all have foreground services (and thus persistent notifications). I'm talking about music apps here, though, not clock apps. The only other clock app I have tried is LineageOS stock, which rings, but only silently.
Don't kill my app returns 100%.
K9 Mail runs well on my phone. I think it also uses a foreground service.
I deleted the old alarm that was failing and created a new one without rising volume and alarm worked this morning. Might be luck. Not sure.
On my device, DontKillMyApp returns 100%.
I also created an alarm without rising volume after I saw the previous comment this morning, and it worked correctly (my phone had been asleep for about an hour). The same thing fixes the silent alarms on the stock LineageOS/AOSP clock, so I'm guessing this is an exception that is being handled differently by the two clocks.
I deleted the old alarm that was failing and created a new one without rising volume and alarm worked this morning. Might be luck. Not sure.
If you turn on rising volume, and create an instant alarm (which rings after 5 second, button can be turned on through settings -> developers options -> show instant alarm button), does the alarm still not work?
Turn on rising volume where? Do I set it in default settings or do I create an alarm first?
I turned it on in the default settings and it works with instant alarm. It just fails after not touching it for a longer time. As already mentioned, after about one hour it still works but after a whole night it doesn't. But there is a notification showing that the alarm rang. It is like the app fails to increase the volume.
It would also be helpful if you guys can suggest opensource apps that work correctly
- Simple Clock
- Fairemail (uses persistent notification)
- tasks.org (Reminders)
Note: As of now the alarm and timers (except timer notification) has been working flawlessly after the App Manager setting
Instant alarm with rising volume works for me. Overnight with rising volume does not.
And I'm afraid I spoke too soon. Even with rising volume turned off, my alarms have failed to go off for the last two days. So I think these are separate problems that are interacting with each other.
After like two weeks it failed again for me
This is a complete shot in the dark, but if you open the Android system settings and go to Apps → Special app access (might be located somewhere else on non-stock Android ROMs) there's a permission called Alarms and reminders, with the following description:
Maybe Chrono needs to request this permission? It currently doesn't.
also having this issue on lineage android 14, on a oneplus 6, battery optimization disabled
go to Apps → Special app access (might be located somewhere else on non-stock Android ROMs)
Not available on OxygenOS 13
This is a complete shot in the dark, but if you open the Android system settings and go to Apps → Special app access (might be located somewhere else on non-stock Android ROMs) there's a permission called Alarms and reminders, with the following description:
Maybe Chrono needs to request this permission? It currently doesn't.
I think this refers to the SCHEDULE_EXACT_ALARM permission, which is only required for apps that aren't alarm clock apps. For alarm clock apps, this permission isn't needed and we instead use USE_EXACT_ALARM which is granted automatically by the system. Anyhow, if setting an alarm 1 minute into the future rings correctly, this likely isn't the issue in your case.
Just a bit of update, all my current research does lead to this being a battery optimization issue specific to some roms, which would need either a foreground service, or something else that I'm not aware of, to work correctly. I've planned out how the foreground service will be implemented. Currently finishing up the 0.5.0 version which brings widgets and localization and language support. After that, all my focus will be on implementing foreground service and fixing this issue.
There's an open source clock/alarm app that works at here Apache 2.0 licensed. Might want to look at what they're doing?
Yes, I'm having these issues. Tried everything that "don't kill my app" recommends. And the test returns 100%. Alarms almost never work. Neither do timers. On a moto stylus 4G 2021 running android 11.
So I'm using "Clock" now.
Getting this same problem on my Pixel 6,running GrapheneOS on Android 14. Chrono App version is 0.4.2
Timers won't go off after the screen times out. I can see the notification icon on the lock screen, but it won't ring with the fullscreen alert until I unlock my phone.
This is a continuation of the #286
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
I don't know why, alarms often don't go off, usually when they're close by.
Describe the solution you'd like On several other alarm applications, it is possible to define an application as "alarm and reminder" in "special access" (see photo below).
It says:
"Alarms and reminders
Allow this application to set alarms and schedule actions at certain times. It will then run in the background, which can battery.
If authorisation is disabled, existing alarms and events alarms and events programmed by the the app will not work."
Off-topic: do you know how to reduce the size of photos on github for this type of issues ?
I have also encountered this issue on my Pixel 8 with GrapheneOS. Already two times this week, the alarm did not go off at all
Hi everyone. I have added option to enable foreground notification in v0.5.2-beta1. You can turn it one by going to Settings > General > Reliability > Show Foreground Notification. Please try it and let me know if it helps in any ways.
Also let me know if you experience increased battery consumption by turning on foreground notification (compared to having it off). A little bit increase is expected, but too much increase will be an issue so I will try dialing down the frequency in that case.
I have also added another alarm permission. The docs said it is not needed on newer android versions so I had disabled it on new Android versions previously, but I have re-enabled it now, because why not. It might also help.
Not sure if this will fix issue on devices where alarm does not ring after screens time out. Let me know if thats the case.
