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

qt5-qpa-hwcomposer-plugin & timed: Add support for ambient mode. #43

Merged
merged 3 commits into from Aug 13, 2020

Conversation

MagneFire
Copy link
Member

@MagneFire MagneFire commented Aug 2, 2020

The PR adds support for an Always on display functionality. Because qt5-qpa-hwcomposer-plugin & timed don't have a repo in the AsteroidOS organization. It may be easier to look in the separate commits for review:
MagneFire/qt5-qpa-hwcomposer-plugin@1c568ba
MagneFire/timed@28c579d

Other PRs that are also needed are:

And for devices I have tuned the ambient mode brightness setting for sturgeon and smelt:

Here is also an overview of what the watchfaces look like in ambient mode:
Screenshot_20200801_202406
Screenshot_20200801_202350
Screenshot_20200801_202331
Screenshot_20200801_202311
Screenshot_20200801_202253
Screenshot_20200801_202236
Screenshot_20200801_202217
Screenshot_20200801_202158
Screenshot_20200801_202139
Screenshot_20200801_202121
Screenshot_20200801_202102

Of course this finally fixes AsteroidOS/asteroid#58

Add ability to keep the screen on while in deep sleep mode.
This is achieved by setting the power mode to HWC_POWER_MODE_DOZE_SUSPEND.

https://android.googlesource.com/platform/hardware/libhardware/+/refs/heads/master/include/hardware/hwcomposer_defs.h#299 implies that the power mode needs to be changed to update the screen, but according to several tests (on sturgeon and smelt) this seems to be not necessary. Swapping the buffer while the screen is off still appears to update the screen.
It seems like there is no easy way to get a callback from when an event occurs.
The only way is using voland. Which, on AsteroidOS, is used by the alarmclock app.
So scheduling an event for use with ambient mode would actually show the alarmclock dialog (and update the screen).
This is due to alarmclock using a D-Bus (systemd) service that triggers on any voland signal. I don't think there is a way to filter these events with systemd.
Another thing that may be used is the `next_bootup_event` event. But this is not a reliable source, because alarmclock events also cause this signal, can cause multiple triggers at irregular intervals.

Somehow we need to update the screen without triggering the alarmclock alarm dialog.
The most straightforward way to do this is by adding a special `wakeup` type event, that doesn't trigger the voland event, but instead a new event.
@FlorentRevest
Copy link
Member

I also can't think of anything better for timed :) that will do!

@FlorentRevest FlorentRevest merged commit 92f2daa into AsteroidOS:master Aug 13, 2020
@Doomsdayrs
Copy link

Took years, But hozzah!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Always on display
3 participants