Update: Sunday Sep 24 The solution for the Wake Requests, stops Wake Requests, however I have experienced Restless Mac Syndrome. So far it appears inconsistent. Also updated is more research into AOP wakes.
At the request of a customer, I started to investigate this issue. Somehow I'd completely missed it on the Ventura/Sonoma test machine, but once I had a 16" MacBook Pro M2 Pro, it was unavoidable.
Out of 8 wakes during the night, two show up as "rtc/Maintenance". In the Power Management messages, I can see Wake Request messages and the times match.
22:16:39 wakeRequests Selected RTC wake request: {
UserVisible = 0;
appPID = 424;
eventtype = wake;
scheduledby = "com.apple.alarm.user-visible-com.apple.CalendarNotification.EKTravelEngine.periodicRefreshTimer";
time = "2023-09-19 17:08:39 +0000";
}
On my system appPID 424, is "UserEventAgent".
The UserEventAgent utility is a daemon that loads system-provided plugins to handle high-level system events which cannot be monitored directly by launchd(8). The UserEventAgent utility should not be invoked directly.
What does the "scheduledby" message mean? My guess is that this is the event/script/plugin it runs at that time, there is a "com.apple.alarm" plugin.
A newer version of Sleep Aid will pull out these details for you.
Executing a shell script (via Sleep Aid) to "sudo pkill -STOP UserEventAgent", then to use "pmset sched cancelall". Sleep Aid then executed a script on wake to "pkill -CONT UserEventAgent". I verified the log and there were no wakeRequest references during the sleep.
Lets focus on the remaining 6 or wakes that appear not be related to wakeRequests. I have data from 3 Macs, 2 on Ventura and one on Sonoma. They show different reasons but the pattern is always the same, the Mac wakes every 70 - 84 minutes or 4238 - 5073 seconds.
M2 Pro MacBook Pro shows "spu_queue_overflow_ep44", which ends up at something called "cma", related to Location Services. M1 Pro MacBook Pro shows "spu_queue_overflow_ep42", which appears to be a magnet sensor.
M1 MacBook Air shows "rtc/Maintenance", which indicates it's a scheduled wake (not event based). but... digging through the kernel logs on the M1, the kernel says it's caused by "AOP.udioPMD", by the time the wake reason is set, it shows it as "rtc/Maintenance". Always On Processor, again, my guess is this is a Power Management Unit.
Looking through the complete log, has given me clues and helped to rule out various things.
Maybe be interesting, but maybe nothing. Grabbing kIOPMSettingAutoWakeSecondsKey, kIOPMSettingAutoWakeCalendarKey, kIOPMSettingMaintenanceWakeCalendarKey & kIOPMSettingDebugWakeRelativeKey from IORootDomain on System sleep (not screen sleep), results in no values for any of these keys, in fact I now believe that these are not used at all on ARM Macs. Which means that there is another way the macOS can tell hardware when to wake.