Skip to content

Conversation

@xXJSONDeruloXx
Copy link

Long time Onion Enjoyer, first time PR-er.

I do not have a MM flip yet to test, but these additions are all in reference to the implementation work done in Allium to accommodate the flip's hardware and implement features around the lid events.

Please let me know if this is at all helpful, and what needs to be changed to get this in a merge ready state. Anyone with MM Flip hardware any testing would be greatly appreciated.

@Sichroteph Sichroteph self-requested a review November 6, 2025 10:52
@Sichroteph
Copy link
Member

Sichroteph commented Nov 6, 2025

@xXJSONDeruloXx Thank you very much for this PR. I will test these additions and get back to you as soon as possible.

@Sichroteph
Copy link
Member

Sichroteph commented Nov 13, 2025

@xXJSONDeruloXx I’m curious how you created MainUI 285 clean and MainUI 285 expert ?
Sorry, I am testing this PR slowly as I struggle to find free time, but I am still making progress step by step.
At the moment, not much is working. Resolution changes seem to cause issues and, according to the keymon logs, the lid is not being detected.
I will tackle these points one by one.

@Sichroteph
Copy link
Member

@xXJSONDeruloXx Ok,
I think I have understood the source of the biggest glitches. It happens because the MainUI binary you are using is probably the one from the Miyoo Flip, using the screen’s original resolution.
On the Onion side, we use a 640x480 MainUI to maintain retro compatibility with all community themes.
The solution is to use the MainUI 354 Clean and MainUI 354 Expert binaries for the Miyoo Flip.

@xXJSONDeruloXx
Copy link
Author

@Sichroteph thanks for the review, updated this to point to same bin

@Dark98
Copy link

Dark98 commented Jan 1, 2026

I tested this and the hinge/lid isn'tbeing detected still, i have however started my own Onion Fork for the Mini Flip & got most stuff functional if you'd like me to make a PR with my changes instead?

@Sichroteph thanks for the review, updated this to point to same bin

@Sichroteph
Copy link
Member

Sichroteph commented Jan 7, 2026

Yes please, that would be great. We’ll make sure to credit both of you.
Thanks a lot for the awesome work 🙏

@ajb3932
Copy link

ajb3932 commented Jan 7, 2026

I'm happy to test today when I get back from the office if anyone would like me to 👍

@xXJSONDeruloXx
Copy link
Author

@Dark98 I can not find your fork, but if you like I would be happy to implement your working version of lid detection and co author the commits

@Dark98
Copy link

Dark98 commented Jan 7, 2026

@xXJSONDeruloXx @Sichroteph @ajb3932

I'll get them PR'ed later today :)

Yes please, that would be great. We’ll make sure to credit both of you.
Thanks a lot for the awesome work 🙏

@xXJSONDeruloXx
Copy link
Author

well, now I wanna race ya to find a working method lol

@xXJSONDeruloXx
Copy link
Author

ok have my flip mini now, was able to test this and with recent commit I am having lid close and open sleep wake, and tweaks options to change from sleep to shutdown does appear to be working too, so lid shut shuts down

@Dark98
Copy link

Dark98 commented Jan 7, 2026

I've had it working for a while so I technically won the race :P (tenlevels beat everyone 😂)

No point me making a PR if you've now got it working :)

Aside from a few visual glitches & chargingState, I think I have most stuff working on my fork so if you want help with anything like USB-C audio for example

well, now I wanna race ya to find a working method lol

@xXJSONDeruloXx
Copy link
Author

Demo with the 3 lid close settings in tweaks:

https://youtube.com/shorts/rROmtfiIfsg?si=E39PpKHJTRNzrDmE

@Dark98
Copy link

Dark98 commented Jan 7, 2026

Demo with the 3 lid close settings in tweaks:

https://youtube.com/shorts/rROmtfiIfsg?si=E39PpKHJTRNzrDmE

Is chargingState working properly for you?(i didnt test when i tested your build at first) I cant get it working on my fork 😅
The device shuts down immediately upon connecting a charger but charges still though chargingState doesnt display anything 😂

@xXJSONDeruloXx
Copy link
Author

@Dark98 can you link me to your fork?

@Dark98
Copy link

Dark98 commented Jan 7, 2026

@Dark98 can you link me to your fork?

It's currently private :P sorry😅

@xXJSONDeruloXx
Copy link
Author

@ajb3932 @Sichroteph ready to test

@xXJSONDeruloXx
Copy link
Author

xXJSONDeruloXx commented Jan 9, 2026

pushed a few housekeeping commits, plus I realized when lid close is set to shutdown and game is running, we were doing hard shutdown, now its same as half sec power button press, where it saves state and shuts down gracefully with deepSleep()

also did some A/B testing with the screen blanking concept vs the fallback for sleep, negligible heat and battery life, so instead of the logic overhead I reverted that to mirror behavior of brief power btn press

@Aemiii91 Aemiii91 changed the base branch from main to v4.5-dev January 18, 2026 00:30
@Aemiii91 Aemiii91 added this to the v4.5 milestone Jan 18, 2026
@xXJSONDeruloXx
Copy link
Author

per discussions in the discord, here is a release off this branch, will encourage testing and report back or point users to this PR to gather feedback

https://github.com/xXJSONDeruloXx/Onion/releases/tag/v4.5-dev-pr-1860

@fengfrw
Copy link
Contributor

fengfrw commented Jan 19, 2026

285headphone.c
The switching test between my USB-C headphones and the speaker was successful, but my usb-c headphones are together with Hall induction wheel inspection, so I don't know how to push the modification and post a reference. I hope it will be helpful.

@xXJSONDeruloXx
Copy link
Author

@fengfrw i prefer to keep the headphone change a separate PR

@Bapf
Copy link

Bapf commented Jan 19, 2026

I just tested your build on my mini flip. It works great. Thx for all your effort.

Two observations:
a) Netplay is not showing in GLO menu.
b) L/R and L2/R2 buttons are switched (at least in the onion ui).

int suspend_lid_state = read_lid_state(); // Store initial lid state

// Use shorter poll timeout for lid detection on flip devices
int poll_timeout = (DEVICE_ID == MIYOO285) ? 500 : timeout;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should respect timeout=-1 (no auto-sleep)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xXJSONDeruloXx what about this one?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does, if no auto sleep, then on lid close if in tweaks it's set to suspend it just stays suspended till you open lid or battery dies. If do nothing or shutdown, same concept

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copying from discord for posterity

better battery life but then when sleep is set to off, and tweaks setting set to sleep on lid close, upon lid open the screen would not come back on because no poll. That would be inconsistent with lid open behavior if sleep set to 5 min or whatever else, where on lid open screen comes back up, lid open is treated as power button tap.

What’s the preference here? I’d prefer consistent lid open behavior regardless of sleep timeout setting but lmk if you feel differently

@xXJSONDeruloXx
Copy link
Author

xXJSONDeruloXx commented Jan 24, 2026

Addressed all comments/change requests and tested on my device. also went ahead and added the tenlevels headphone detection slightly modified for deviceid rather than hal sensor detect. Also on sleep to shutdown if set I am having that be respected on lid close shutdown, I think that grants the most consistent behavior across devices. if sleep to shutdown is not set, then lid close sleeps indefinitely as before. LMK if any other changes needed

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.

7 participants