Jump to content
InsanelyMac Forum
vol264

DSDT USB Power Management

Recommended Posts

Hi,

 

I would like to ask if someone can help me fix the last problem I have with my hack.

 

Sleep is working with no problems but follwoing things do not work when wake up after sleep.

 

- The error "the disk was not ejected properly" appears when USB stick was connected

- Can wake up machine only with power button on the computer (no wake over Mac Alu Keyboard, Mouse)

- When I have connected an external device (let say USB controller for Traktor) and uplugg it when computer is in sleep mode, the computer wakes up.

 

I'm preety sure that somewhere in my DSDT my USB power management settings have to be adjusted.

 

Attached is also my dsdt.

 

Thanks,

post-515577-0-39834200-1362210243_thumb.png

dsdt.dsl.zip

Share this post


Link to post
Share on other sites
Advertisement

Hi,

 

- The error "the disk was not ejected properly" appears when USB stick was connected

Well, this is obvious, OS X thinks that the device is still connected when it wakes up, so if it can not be found, it will give the warning. Just remove the drive from finder, then let the device go to sleep.

 

Don't know about point 2.

 

- When I have connected an external device (let say USB controller for Traktor) and uplugg it when computer is in sleep mode, the computer wakes up.

Turn off Wake on USB or something similar in the bios.

Share this post


Link to post
Share on other sites

Is it possible to hack/trick something in DSDT to prevent all USB device suspending on sleep? There is an option in Windows (" disable usb selective suspend" or it's called something like this) power management settings, and I need that function/behavior in OSX too.

 

Anyone have an idea for this?

Share this post


Link to post
Share on other sites

Dsdt Fix For Usb Device Dead After Wake From Sleep Since 10.6.3 - Project OS X Forums

CODE

Device (UHC1)

{

Name (_ADR, 0x001D0000)

OperationRegion (BAR0, PCI_Config, 0xC4, One)

Field (BAR0, ByteAcc, NoLock, Preserve)

{

USBW, 2,

Offset (0x01)

}

------------------------------------------------------------------------------------- delete from here

Method (_S3D, 0, NotSerialized)

{

If (LOr (LEqual (OSFL (), One), LEqual (OSFL (), 0x02)))

{

Return (0x02)

}

Else

{

Return (0x03)

}

}

------------------------------------------------------------------------------------- to here

Method (_PSW, 1, NotSerialized)

{

If (Arg0)

{

Store (0x03, USBW)

}

Else

{

Store (Zero, USBW)

}

}

Method (_PRW, 0, NotSerialized)

{

Return (GPRW (0x03, 0x04))

}

}

"dirty" but it works.....

2.after wake from sleep the device is not working.

this happens for two reasons.

First is that the device is usb 1.1 and the solution is to unplug it and plug it again or see the jumper setting of the motherboard for "5V-DV" , "Wake" for that usb port or Bios setting for APM (PowerOn from usb keyboard-mouse)

Second is that for example in my case...go buy a new keyboard and throw away that "dump_cheap_usb1.1_keyboard_for_2euros" hahahaha

Now in the "case" we have a laptop and can't "buy" a new keyboard or touchpad the solution is to remove the "Wake from Sleep" (the device can wake the computer from sleep) section into DSDT , and we don't mind that cause this usbport connection is internal (no physical port) and the PowerButtom of the laptop is very close to the keyboard and mouse.

Press that , don't need to press a key or touch the trackpad to wake.

CODE

Device (UHC3)

{

Name (_ADR, 0x001D0000)

OperationRegion (BAR0, PCI_Config, 0xC4, One)

Field (BAR0, ByteAcc, NoLock, Preserve)

{

USBW, 2,

Offset (0x01)

}

Method (_S3D, 0, NotSerialized)

{

If (LOr (LEqual (OSFL (), One), LEqual (OSFL (), 0x02)))

{

Return (0x02)

}

Else

{

Return (0x03)

}

}

Method (_PSW, 1, NotSerialized)

{

If (Arg0)

{

Store (0x03, USBW)

}

Else

{

Store (Zero, USBW)

}

}

------------------------------------------------------------------------------------- delete from here

Method (_PRW, 0, NotSerialized)

{

Return (GPRW (0x03, 0x04))

}

}

------------------------------------------------------------------------------------- to here

 

.....

for the EHCI section (this is classical)

CODE

Device (EHC1)

{

Name (_ADR, 0x001D0007)

Method (_DSM, 4, NotSerialized)

{

Store (Package (0x04)

{

"AAPL,clock-id",

Buffer (One)

{

0x02

},

"device_type",

Buffer (0x05)

{

"EHCI"

}

}, Local0)

DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))

Return (Local0)

}

Method (_PRW, 0, NotSerialized)

{

Return (GPRW (0x0D, 0x04))

}

}

Share this post


Link to post
Share on other sites

Thanks, but my UHC1 looks like this:

Device (UHC1)
	 {
		 Name (_ADR, 0x001D0000)
		 Method (_S3D, 0, NotSerialized)
		 {
			 If (LEqual (OSFL, 0x02))
			 {
				 Return (0x02)
			 }
			 Return (0x03)
		 }
		 Name (_PRW, Package (0x02)
		 {
			 0x03,
			 0x03
		 })
	 }

If I delete the S3D section as suggested, my UHC1 (and other UHCX) will be almost empty :lol:

Or should I put those other thing in there and then remove the S3D section?

Share this post


Link to post
Share on other sites

I tried the above suggestions, I even tried another one which adds a _PSW method which should prevent the device from waking up the system.

Only this solution made something:

------------------------------------------------------------------------------------- delete from here
Method (_PRW, 0, NotSerialized)
{
Return (GPRW (0x03, 0x04))
}
}
-------------------------------------------------------------------------------------  to here

 

This made my machine stay in sleep mode nicely, but on wake the system hangs or something because the machine itself powering up, it's loading something (hdd led blinking), but display stays turned off for about ~30 sec, then it turns on, and the usb device disconnects. So it's still buggy.

Share this post


Link to post
Share on other sites

if its the G31m-es2l rev 1 try my dsdt in signature.

compare the memory line and change to yours if needed.

 

 

Edit:i just updated that post in my sig with a mediafire link with latest Dsdt/ smbios boot.com.

dsdt has hdef fix for Es2L rev1 audio

AppleHda for Lion 10.7.5 and Snow 10.6.8

Share this post


Link to post
Share on other sites

if its the G31m-es2l rev 1 try my dsdt in signature.

compare the memory line and change to yours if needed.

Your DSDT filesize is the third of mine lol. I think my dsdt is not really optimized... :D I added my ethernet, gfx0 to your dsdt, and now testing yours :)

 

edit: everything works, but the same sleep problem exists:

- bluetooth module plugged in - sleep wakes up immidiatelly (console says bluetooth module usb port "UHC3" was the reason)

- bluetooth module not plugged in - perfect sleeping, perfect waking with mouse.

Share this post


Link to post
Share on other sites

i think u are having the bluetooth isue of "ClassMustNotSeize"

or missing id in the proper kext plist.

seen somethign about that before..

 

what bluetooth device is it exact. .Pid Vid ?

Share this post


Link to post
Share on other sites

It's a BTech dongle

Product Id: 0x1 (yes, only a "1")

Vendor Id: 0xa12

 

Cambridge Silicon Radio Chip

Firmware version: 1593

Share this post


Link to post
Share on other sites

hmm i would check to see if theres any reports of sleep wake issue.

also try a different plug location.

optionally ive seen reports of working cheapos.. maybe buy a different one ?

Share this post


Link to post
Share on other sites

I checked the console many times, the wake happens because the bluetooth dongle gets disconnected on sleep. And osx thinks that I disconnected it so it wakes up.

 

I tried different plug location...

Oh and an important note: the same thing happens on Windows too!

But on windows there is an option called "USB Selective Suspend", which prevents some usb devices from sleep to fix these kind of problems. With that, the problem dissapears on windows. So I thought maybe there is a dsdt tweak or something to make the usb bluetooth device to not enter sleep mode on OSX.

Share this post


Link to post
Share on other sites

yeah u need to find the "ClassMustNotSeize" fix to add id in proper kext for chipset.. or find a different dongle

Share this post


Link to post
Share on other sites

Proper kext? What kext do you mean? Some legacy stuff? Btw the dongle works perfectly, just disconnects on sleep.

Share this post


Link to post
Share on other sites

I tried to inject ClassMustNotSeize (and other properties) in many different methods... but no change.

 

I even tried to modify the IOBluetoothFamily.kext to use broadcom driver, but then (obviously) it couldn't turn on the bluetooth radio, but the device was still recognized. (sleep worked then lol)

 

IORegistryExplorer image:

post-150972-0-03036400-1364301180_thumb.png

 

 

So there is no way to prevent a specific USB port from sleep?

Share this post


Link to post
Share on other sites

there is but its not easy 1.2.3 thing.

have to find which port it is on address with ioregexplorer then in there remove some code in dsdt for that usb

 

try turning off USB legacy in bios.

Share this post


Link to post
Share on other sites

if you want zero problems with bluetooth, buy a Belkin Mini this work O.O.B in Mac OS X, too wake from sleep Magic Mouse, AppleTrackpad, or any bluetooth hardware

Share this post


Link to post
Share on other sites

there is but its not easy 1.2.3 thing.

have to find which port it is on address with ioregexplorer then in there remove some code in dsdt for that usb

 

try turning off USB legacy in bios.

I already did that, its on the UHC3 port where the bluetooth dongle is. The UHC3 only have "_PRW" in the DSDT, tried to remove it, no change.

The last hope is that apply that "_PSW" thing (you can specify the wake capability or something with that) in the DSDT file you suggested for me.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.



×