T2 MacBook suspend/resume + TouchBar (tiny-dfr) fix (kernel 7.x) #5862
Replies: 7 comments 8 replies
|
Thanks for this and I'll try it on my machine. This is the last missing piece for a perfectly functional 2019 MacBook Pro 16,1! |
|
Great write-up! I especially appreciate that you adapted the fix from an gentoo OpenRC/elogind setup to systemd — that's exactly what makes it useful for Omarchy users. One thing I wouldn't have thought of myself: you correctly identified that the USB path isn't fixed. On my machine it was I also have to admit that when the issue sat untouched for almost a year, I started thinking I might be the only person actually using suspend on an Intel T2 Mac under Linux. Glad to see that's not the case! best regards xing0r |
|
Update: The fix works for short suspends but fails after long suspends if hibernation is enabled. The issue is AllowHibernation=no
AllowSuspendThenHibernate=no
#HibernateDelaySec=10After this change, suspend-only works. Tested with a 26 minute suspend.
|
|
Thanks for this write up @fellow-11 I'm testing it on my machine later today and will report back on results. Installed yesterday on my Macbook 16 2019 and was looking for a solution to this |
|
This is awesome, will test on Macbook Pro 2019 13 inch asap and let you guys know. 🍻 |
|
Saw this discussion after being active in #4695. Have been working on a different approach in PR #5998 that avoids force removal (rmmod -f), hardcoded sleeps, and USB bConfigurationValue resets entirely — clean aaudio unbind + ordered module lifecycle. Already confirmed working on MacBookPro15,4 and MacBookAir8,1 with deep sleep (no s2idle workarounds needed). The 16,1 dGPU model is the one we haven't tested yet — would be great if someone here could try it. @fellow-11 — the appletbdrm probe failure you're seeing after long suspends might be addressed by our approach since we reload appletbdrm through clean module management rather than force removal. And the kernel revert @xing0r found (bfc66c4c) looks complementary regardless. |
|
whilst not perfect I have increased support in my fork of tiny-dfr it appears to have all the bits needed to resume/restore Ive also added a few more features e.g. hyprland window title, workspace number, weather, sliders for volume/brightness/backlight again its not perfect, but it appears to work pretty well, saying this the t2-mbp that ive been building this on is not my daily driver |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Overview
Working suspend/resume setup with automatic TouchBar restoration, tested on a MacBook Pro 16,1 (2019) with kernel
7.0.5-arch1-Watanare-T2-1-t2.Hardware
The Problem
T2 modules (
apple_bce,hid_appletb_kbd,hid_appletb_bl) must be unloaded before suspend and reloaded after resume, otherwise the system hangs or fails to resume properly.On kernels 6.12.31+,
appletbdrmfails to rebind to the TouchBar USB device after module reload. This was confirmed in t2linux/wiki#635 and reproduced on kernel 7.0.5. The root cause appears to be a USB communication timeout duringappletbdrm_probe(), which appears to mean the TouchBar device isn't ready when the driver tries to initialize it.The fix, discovered by @xing0r in that issue, is to force USB re-enumeration by resetting
bConfigurationValueto0then back to2, giving the device time to reset properly before tiny-dfr starts.Solution
0. Disable hibernation and configure suspend
In
/etc/systemd/logind.conf, set the sleep operation to suspend:In
/etc/systemd/sleep.conf, enable suspend and disable hibernation:Then reload:
1. Suspend service - unload T2 modules before sleep
/etc/systemd/system/suspend-fix-t2.service:2. Resume service - reload modules and restore TouchBar
/etc/systemd/system/resume-fix-t2.service:Enable both services:
3. Hyprland lid switch binding
In
~/.config/hypr/hyprland.conf:4. Disable TouchBar USB autosuspend (workaround for long suspends)
Create
/etc/udev/rules.d/99-touchbar-power.rules:Then reload udev:
Important: find your TouchBar USB path
The resume service hardcodes
7-6as the TouchBar USB path. This may be different on your machine. If it doesn't match, the TouchBar won't restore after resume. Find your path with:Look for product ID
8302, that's the TouchBar display device. Replace7-6in the resume service and manual fallback below with your actual path.Manual fallback
If the TouchBar doesn't restore after resume, run:
Unknowns
References
All reactions