Jump to content

Power Button & WOL Wakes in Lion (10.7)


  • Please log in to reply
68 replies to this topic

#41
nissefar

nissefar

    InsanelyMac Protégé

  • Members
  • PipPip
  • 73 posts

It's my pleasure, glad this is useful to others! I rely heavily on WOL and this was my final outstanding issue with my Lion install. So today I am a happy bunny.


Actually, if you get Wake on Demand (bonjour proxy) working, you will benefit from leaving darkwake=1!

The only reason you would like to keep darkwake=0 is if you rely on old-skool WoL packets.

If you get Wake on Demand/bonjour proxy working, it means that if you try and access your network drives through finder from second system, the first system will wake with the monitor turned off, but you can still browse files, or activate remote desktop. The system will stay awake as long as the network services are active.

The problem is getting Wake on Demand to work though, if you got a Realtek 8111C or the like.

I managed to recompile a version of mDNSResponder where Wake on Demand is permanently activated, regardless of what the system believes your driver supports.

#42
ianmc81

ianmc81

    InsanelyMac Protégé

  • Members
  • Pip
  • 7 posts
  • Gender:Male
  • Location:Newcastle upon Tyne, UK
I do use Wake on Demand, and the darkwake=0 behaviour is still preferable to me as making SSH connections to my sleeping workstation didn't seem to be enough wake it up fully or "hold" it in low-power-wake. It seems not all network applications can do this even if they are Bonjour-advertised; I wasn't able to find any documentation on how this is done or why it works for some services and not others.

Lion's default behavior also broke wakeups using the iOS Remote.app for me, as sometimes the PC would go back to sleep before the app could fully connect to iTunes.

The problem is getting Wake on Demand to work though, if you got a Realtek 8111C or the like.

I managed to recompile a version of mDNSResponder where Wake on Demand is permanently activated, regardless of what the system believes your driver supports.


I used a similar method for some time, you will be pleased to hear there is a new version of the Realtek driver that has just been released that supports this natively:

http://lnx2mac.blogs...osx-driver.html

#43
nissefar

nissefar

    InsanelyMac Protégé

  • Members
  • PipPip
  • 73 posts
I swear I checked the lnx2mac site yesterday with no version 0.90 being there. What the hell! Nice though!

Anyway, sounds like I should experiment some with ssh and iOS remote before I settle for which darkwake state to use.

Ultimately it would be nice to get a motherboard where the wake reasons are recognized! Doesn't seem like it will ever get fixed for the current gigabyte boards.

I'm buying Asus or Intel next time.

#44
nissefar

nissefar

    InsanelyMac Protégé

  • Members
  • PipPip
  • 73 posts

I do use Wake on Demand, and the darkwake=0 behaviour is still preferable to me as making SSH connections to my sleeping workstation didn't seem to be enough wake it up fully or "hold" it in low-power-wake. It seems not all network applications can do this even if they are Bonjour-advertised; I wasn't able to find any documentation on how this is done or why it works for some services and not others.


I think the problem still is the fact that on some systems there is no wake reason for WoL.

Maybe it would be possible to recompile the "powerd" daemon with a hack that handles "wake reason:?" as if it were something else. Actually I think that would work quite nicely, the only problem is getting powerd to compile. It was a pain getting mDNSResponder to compile for me...

#45
ianmc81

ianmc81

    InsanelyMac Protégé

  • Members
  • Pip
  • 7 posts
  • Gender:Male
  • Location:Newcastle upon Tyne, UK

I think the problem still is the fact that on some systems there is no wake reason for WoL.


I think there are a number of issues at play and I think some users of genuine Macs are unhappy with the way that Wake on Demand behaves with non-Apple network services (there are a number of complaints over on Macrumours about things like SSH and LogMeIn). I would be intrigued to know if the kernel param improves matters for them (not sure if you can even pass them on real macs?).

Maybe it would be possible to recompile the "powerd" daemon with a hack that handles "wake reason:?" as if it were something else. Actually I think that would work quite nicely, the only problem is getting powerd to compile. It was a pain getting mDNSResponder to compile for me...


When I started looking into this I thought powerd was to blame, now I actually think this whole mechanism lives within the kernel, but I could be wrong about this - am not a kernel guru. If you look in IOPMrootDomain.cpp in the latest XNU sources I think you should be able to find the logic for this by seeing where "darkwake" pops up. Maybe with some digging you could re-map the wake reasons at this level (or make them more broad) if you were so inclined. There are a number of guides out there describing how to get the XNU sources to build.

Personally, I'd rather just switch the whole thing off as that seems cleaner to me. I am not bothered if my monitor turns on every time I access some network service or other... it did on Snow Leopard and I managed OK then :-)

#46
nissefar

nissefar

    InsanelyMac Protégé

  • Members
  • PipPip
  • 73 posts

I think there are a number of issues at play and I think some users of genuine Macs are unhappy with the way that Wake on Demand behaves with non-Apple network services (there are a number of complaints over on Macrumours about things like SSH and LogMeIn). I would be intrigued to know if the kernel param improves matters for them (not sure if you can even pass them on real macs?).

Could be true. Maybe it won't even stay awake when being accessed on real Macs. I might try and test if that is true.

When I started looking into this I thought powerd was to blame, now I actually think this whole mechanism lives within the kernel, but I could be wrong about this - am not a kernel guru. If you look in IOPMrootDomain.cpp in the latest XNU sources I think you should be able to find the logic for this by seeing where "darkwake" pops up. Maybe with some digging you could re-map the wake reasons at this level (or make them more broad) if you were so inclined. There are a number of guides out there describing how to get the XNU sources to build.

I'll look into the kernel sources and see what I can find. I've already managed to get XNU to build. I hardly have any C or hardware programming experience tho.

Personally, I'd rather just switch the whole thing off as that seems cleaner to me. I am not bothered if my monitor turns on every time I access some network service or other... it did on Snow Leopard and I managed OK then :-)

My selfbuilt Mac is in my bedroom, and the bonjour proxy wakes the Mac at some interval to keep the bonjour services updated. So I wouldn't mind if it was ultimately possible to get dark wake working perfectly. :)

#47
ianmc81

ianmc81

    InsanelyMac Protégé

  • Members
  • Pip
  • 7 posts
  • Gender:Male
  • Location:Newcastle upon Tyne, UK

My selfbuilt Mac is in my bedroom, and the bonjour proxy wakes the Mac at some interval to keep the bonjour services updated. So I wouldn't mind if it was ultimately possible to get dark wake working perfectly. :(


Are you sure it makes a difference in that case? The wakeup every two hours to re-register is actually done with an RTC Alarm on your PC, not a WOL from your router (incidentally - these are logged with a correct "Wake reason = RTC Maintenance Alarm").

I'm not sure if I've actually *seen* my PC do this or just *heard* the fans spinning up for a few seconds, but I was pretty sure that this had always been a "dark wake" (even in Snow Leopard) and it didn't switch the monitor on. It definitely isn't up more than a second or two, so it doesn't bring the system fully awake. Maybe I will have to sit next to my sleeping computer for two hours today and observe it, to be sure about this :-)

#48
zeddys

zeddys

    InsanelyMac Protégé

  • Members
  • Pip
  • 20 posts
This also fixed my bluetooth issue. Now the Magic Mouse reconnects automatically as it did in SL.

Thanks

#49
D-an-W

D-an-W

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 452 posts
Thanks for the info in this thread folks, it fixed my "double tap" wake feature and allows WOL to work with Lnx2Mac's new driver.

I am still getting the occasional short wake due to the RTC Alarm, I assume it is supposed to do this though?

It would be great if eventually low power wake could be made to work correctly, if anyone wants it testing on different hardware let me know!

#50
nissefar

nissefar

    InsanelyMac Protégé

  • Members
  • PipPip
  • 73 posts

I am still getting the occasional short wake due to the RTC Alarm, I assume it is supposed to do this though?

This is Wake on demand refreshing services.

#51
rayap

rayap

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 163 posts
  • Gender:Male

I am still getting the occasional short wake due to the RTC Alarm, I assume it is supposed to do this though?


A sleeping mac should (dark) wake up every couple of hours by RTC Alarm to refresh it's available services with a sleep proxy. Sleep proxies are available in Airport stuff or even in a mac. Use Bonjour Browser and watch.

#52
sbg

sbg

    InsanelyMac Protégé

  • Donators
  • 66 posts

Has anyone else tried booting with the following kernel parameter:

darkwake=0

This looks like it switches off Low Power Wake entirely, i.e. reverting to Snow Leopard's behaviour which doesn't care about "wake reason" and the like. I can now wake my Lion box fully with a Wake-on-Lan app and the front power button (which didn't work before).

I just came across this in IOPMrootDomain.cpp in the latest XNU sources. It seems to be working for me so far (along with patched AppleRTC.kext). Running a GA-P55M-UD2 with DSDT from tonymacx86.

Any suggestions on how to put this into .Boot.plist??
I tried
<key>darkwake</key>        <string>0</string>

but no success. Anybody?

#53
D-an-W

D-an-W

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 452 posts
<key>Kernel Flags</key>

	<string>darkwake=0</string>


#54
sbg

sbg

    InsanelyMac Protégé

  • Donators
  • 66 posts
That worked. Thanks :)

#55
ontheslab

ontheslab

    InsanelyMac Protégé

  • Members
  • Pip
  • 11 posts
  • Gender:Male
  • Location:Brisbane, Australia
Just to say thanks for the tip - got my WOL back up and running on 10.7.2!

Thanks.

#56
rimmi2002

rimmi2002

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 153 posts
Hi I started using darkwake=0 and started running into trouble. On occasion when waking from sleep...all my usb ports are dead...meaning don't come back even after unplugging and plugging. I have to restart the computer to get USB functionality.

To experiment I changed my darkwake from darkwake=0 to darkwake=1. Now things seem to be working better. Can anyone with more knowledge of the darkwake command please tell me what exactly it does and what is the difference between darkwake= 0 vs 1. Thanks.

#57
ApexDE

ApexDE

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 217 posts
I am using the CMOS reset patch from rayap (first post). All was fine until i wanted to use WOL. When WOL is enabled in EnergySaver Preferences i am getting sleep issues. The system won't wake up after sleep. Pushing the Powerbutton results in a cold start and resume-from-disk. It seems Sleep-to-RAM is broken when enabling WOL.

Anyone else experiencing this?

I assume the problem exists because of the CMOS Reset Patch?

#58
rayap

rayap

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 163 posts
  • Gender:Male
@ApexDE
Using Lnx2Mac's latest driver?

#59
ApexDE

ApexDE

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 217 posts
I am using the AppleRTL8169Ethernet.kext from SL. WOL works with it, but scheduled Wake is messed up, when activated. The Machine doesn't sleep to ram. If WOL is turned off, all is fine.

EDIT: i trashed the SnowLeopard AppleRTL8169.kext and installed the lnx2mac 0.9 kext. Sleep to RAM works now, when WOL is activated. I used the AppleRTL kext cause i had major sleep issues with the lnx2mac 0.67 kext in the past. It seems it's the other way around now :D

The only problem now is the known one: If darkewake is = 0 , the Machine will go back to sleep after waking up via WOL cause of "wake reason = ?"

I guess i'll have to use darkwake=1. Will the Machine wake up hourly if darkwake=1 is set? The Machine usesd to wake up hourly to update some bonjour service stuff.

#60
Noam AA

Noam AA

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 437 posts
  • Gender:Male
  • Location:IL
hey, i was able to solve the "wake reason = ?" in a friends PC after realizing that the boot loader that load the lion, wasn't the main boot loader (bios read from another hard-disk, and also the partition wasn't the active one)
do you have any other Chameleon other then the Lion one?





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy