Jump to content

USB 2.0 for Leopard 10.5.7


Slice
 Share

390 posts in this topic

Recommended Posts

I've installed IDeneb v1.3 10.5.5, but usb doesn't work properly. After disabling USB legacy support and usb 2 support in bios it works but only with some devices and very slowly. I've tried using the usb fix supplied with iDeneb and then I've tried the kexts in this post but none of them worked. :P Now I've reinstalled Windows because this is my only PC and I connect to the web trought a (usb) mobile phone which (on iDeneb) stay connected only for about 1 minute and then is disconnected, I thik this is because of the usb problem.

 

Please give me some suggestion to get usb working - I'd like to try again.

Link to comment
Share on other sites

thanks slice!

 

usbehci and pci family kexts fixed the issue with the speakers popping and crackling on my external usb X-Fi sound card in 10.5.6. Probably an interrupt issue as the card uses 10-15% cpu on interrupt requests in Windows just while idle. Card is still only recognized as USB1.1 even though it's a 2.0 device; any ideas on how to get it working at full speed?

Link to comment
Share on other sites

Hey, I think you're on to something here. I tried using your kext's on my Intel dp35dp and everything loaded up fine. I'm trying to get sleep working and with your usb drivers I've come closer then ever. Unfortunately my computer turns off instead of going into deep sleep. Any idea what may be wrong? I'm using the boot132/chameleon/efi method.

Link to comment
Share on other sites

Correction. If I sleep with s3 it shuts down. If I sleep with s1 it will now wake! _BUT_ after wake the mouse gets all jumpy and the computer wont shut down, however my usb keyboard still works fine. I feel my dream of a 100% machine is near.

Link to comment
Share on other sites

Slice,

 

I just wanted to report to you your kexts on my Gigabyte P965, ICH-8 chipset. The IOPCIFamily.kext you provided caused a kernel panic so I removed it. The IOUSBMassStorage kext caused all my internal hard drives to be recognized as external (orange icons). The IOUSBFamily plugins did no noticeble difference to my system. All my USB ports work anyways but speeds are around 5 MB/s so I figurred this would help. With your plugins the speed stayed the same.

 

Everything was installed properly so there was no operator error. I don't know if these are not supposed to work on ICH8 anyways and/ or if the 5 MB/s is a normal speed, but if not and you have any ideas on how to get a real 2.0 speed (which I thought bordered 25-30 MB/s) on these P965 ICH8 boards then that would be much appreciated.

What do you say?

I have the same Gigabyte 965p-s3 with ICH8 chipset. My USB kexts works fine! As well as IOPCIFamily. The last one give me no advantage for the computer.

About speed. I have 30Mb/s reading from USB stick and 5Mb/s writing. It's normal.

In these drivers I corrected only initialization.

Link to comment
Share on other sites

Slice, I've got some weird problem with my USB ports. Those problems begun when I fisrt plug my new Alu Apple keyboard. This USB keyboard didn't work properly (sometimes it worked, sometimes not, or even it worked under OSX for only a few minutes). Then I installed your USB Kext and it seemed better : keyboard were working all the time, but I can't plug too much devices otherwise some other USB device stop working (including most of the time this apple keyboard). Same problem if I plug a device after boot !

 

I think it's related to the mobo but not sure. What's weird is that all my USB ports were working like a charm before I plug the apple keyboard !

 

Any help would be greatly appreciated.

Link to comment
Share on other sites

Slice,

 

Can I please ask (beg!) you to take another look at the kexts with specific focus on the P45 (ICH10) chipset.

 

You state that you have not done anything about the ICH10 chipset as it was added by Apple.

 

However, with my Gigabyte EP45-UD3P (ICH10/P45) board USB doesn't work across sleep. With my previous P35 (ICH9) your kexts fixed these problems. Your patched kexts doesn't make a difference with the ICH10 board.

 

During boot the following is displayed:

 

AppleUSBOHCI[0xacf0000]::CheckSleepCapability - controller will be unloaded across sleep

 

I think that the OHCI part is wrong (bug in Apple's IOUSBFamily.kext?), since no OHCI controllers are present on the ICH10 chipset.

 

Please see this thread. Others are having the same problems. You could help many people if you could take another look :thumbsup_anim:

 

Update:

 

I got the IOUSBFamily source from Apple.

 

In AppleUSBEHCI_PwrMgmt.cpp the string:

 

AppleUSBOHCI[0xacf0000]::CheckSleepCapability - controller will be unloaded across sleep

 

is found, even though the kext is EHCI-related.

 

Also, this .cpp states that all controllers not returning a certain phrase (AAPL, clock-id) are to be treated as external PCI-card controllers and that these are not sleep capable. This must be why the above string is displayed during boot and why the EHCI controllers is "unloaded across sleep".

 

In System Profiler, all my High Speed USB (=EHCI) controllers are showed as being located on an Expansion Slot. UHCI controllers are "Built-In". There are no OHCI controllers present, confirming that the boot message mentioned earlier is inaccurate.

 

Is it possible to patch the AppleUSBEHCI.kext to remedy the "bugs" outlined above?

 

Would be highly appreciated! Thanks!

Link to comment
Share on other sites

2 Hafnium

I made correction to test

	//Slice - changes from 03.03.09
if (1) // !_device->getProperty("AAPL,clock-id") && !((getPlatform()->getChipSetType() == kChipSetTypeGossamer) && getPlatform()->getMachineType() == kGossamerTypeYosemite) )
{
	if (1) //_device->getProperty("built-in"))
	{

AppleUSBEHCI.kext.zip

Link to comment
Share on other sites

2 Hafnium

I made correction to test

	//Slice - changes from 03.03.09
 if (1) // !_device->getProperty("AAPL,clock-id") && !((getPlatform()->getChipSetType() == kChipSetTypeGossamer) && getPlatform()->getMachineType() == kGossamerTypeYosemite) )
 {
	 if (1) //_device->getProperty("built-in"))
	 {

AppleUSBEHCI.kext.zip

 

Sadly, that made no difference on my system.

 

Did you only make the changes quoted above? I really think we should try that I suggested in my PM to you...

 

Thanks so far...!

Link to comment
Share on other sites

I don't quite understand this. Should I just unzip these to my desktop:

 

AppleUSBEHCI328.kext.zip ( 50.13K )

 

AppleUSBOHCI328.kext.zip ( 36.61K )

 

AppleUSBUHCI328.kext.zip ( 46.8K )

 

IOUSBMassStorageClass205.kext.zip ( 32.45K )

 

 

 

and then run these:

 

Enter terminal

sudo -s

mkdir ~/Desktop/Off

cp -r -v ~/Desktop/*USB*.kext /S*/L*/E*/IOUSB*/C*/P*/

chown -R root:wheel /S*/L*/E*/IOUSB*/C*/P*/

rm -v /S*/L*/E*.mke*

diskutil repairpermissions /

reboot

Link to comment
Share on other sites

Hi, checking in from another thread:

 

USB sleep then wake "Device Removal" problem

 

This is the edit I made to the stock AppleUSBEHCI.kext:

 

        if (!_hasPCIPwrMgmt)
       {
//            USBError(1, "AppleUSBOHCI[%p]::CheckSleepCapability - controller will be unloaded across sleep",this);
//            _controllerCanSleep = false;
//            setProperty("Card Type","PCI");

           // My power management fix
           _controllerCanSleep = true;
           setProperty("Card Type","Built-in");
	}

 

This works on my system, a GA-EP45-Extreme.

 

I've attached the compiled AppleUSBEHCI.kext to test, which has only the change above from the current vanilla 10.5.6 driver.

AppleUSBEHCI.kext.zip

Link to comment
Share on other sites

Hi, checking in from another thread:

 

USB sleep then wake "Device Removal" problem

 

This is the edit I made to the stock AppleUSBEHCI.kext:

 

        if (!_hasPCIPwrMgmt)
       {
//            USBError(1, "AppleUSBOHCI[%p]::CheckSleepCapability - controller will be unloaded across sleep",this);
//            _controllerCanSleep = false;
//            setProperty("Card Type","PCI");

           // My power management fix
           _controllerCanSleep = true;
           setProperty("Card Type","Built-in");
	}

 

This works on my system, a GA-EP45-Extreme.

 

I've attached the compiled AppleUSBEHCI.kext to test, which has only the change above from the current vanilla 10.5.6 driver.

 

Great. This partially works on my system (GA-EP45-UD3P). No error message during boot and no device removal across sleep.

Still no wake from USB for me, though.

 

How does it work on your system?

 

I've asked Slice what changes he has made, as those changes made my previous system (P35 based) work as expected (even wake from USB keyboard).

 

How do you succeed in compiling these kexts? I've downloaded Xcode as well as the source. However, when I try to build I get all sorts of errors and warnings. (I'm not used to programming, not at all, so I'm hoping it is not too difficult to get the right environment set up).

 

Thanks so far!

 

I don't quite understand this. Should I just unzip these to my desktop:

 

AppleUSBEHCI328.kext.zip ( 50.13K )

 

AppleUSBOHCI328.kext.zip ( 36.61K )

 

AppleUSBUHCI328.kext.zip ( 46.8K )

 

IOUSBMassStorageClass205.kext.zip ( 32.45K )

 

 

 

and then run these:

 

Enter terminal

sudo -s

mkdir ~/Desktop/Off

cp -r -v ~/Desktop/*USB*.kext /S*/L*/E*/IOUSB*/C*/P*/

chown -R root:wheel /S*/L*/E*/IOUSB*/C*/P*/

rm -v /S*/L*/E*.mke*

diskutil repairpermissions /

reboot

 

Copy original (in your S/L/E folder) IOUSBFamily.kext to eg. desktop.

Show the package contents, navigate to Plugins.

Replace vanilla kexts in Plugins with patched ones (the ones you download from this thread.

Use Kexthelper, OSXTools or Uinstaller to correctly install the patched IOUSBFamily.kext (on your desktop) to your S/L/E folder.

Link to comment
Share on other sites

Wake and sleep, now perfect, except for one problem. USB read/write speeds are 30% slower on the resumed drive until an eject/re-insertion cycle. I've looked at the log files and they seem normal.

 

Getting the environment set up is a little tricky, you have to install the iokit headers and even then there's a number of deprecated functions that need to be recast.

Link to comment
Share on other sites

2 Hafnium

Take my compileable sources (many corrections) here.

They don't include last corrections. They are

1. From my last post

2. message about OHCI -> EHCI. It is simple mistake.

 

The method replacing false -> true is not correct. As you see

			if (_device->hasPCIPowerManagement(kPCIPMCPMESupportFromD3Cold) && (_device->enablePCIPowerManagement(kPCIPMCSPowerStateD3) == kIOReturnSuccess))

The driver is trying to initialize PCI bus PowerManagement with state D3. As I see the procedure failed.

It works on my Dell (ICH8M) but doesn't work on my Gigabyte (ICH8).

You say that it works on ICH9R but doesn't work on ICH10?

We can't simply set _hasPCIPwrMgmt = true; if we didn't initialize PCI bus.

May be some changes in BIOS needed?

Link to comment
Share on other sites

2 Hafnium

Take my compileable sources (many corrections) here.

They don't include last corrections. They are

1. From my last post

2. message about OHCI -> EHCI. It is simple mistake.

 

The method replacing false -> true is not correct. As you see

			if (_device->hasPCIPowerManagement(kPCIPMCPMESupportFromD3Cold) && (_device->enablePCIPowerManagement(kPCIPMCSPowerStateD3) == kIOReturnSuccess))

The driver is trying to initialize PCI bus PowerManagement with state D3. As I see the procedure failed.

It works on my Dell (ICH8M) but doesn't work on my Gigabyte (ICH8).

You say that it works on ICH9R but doesn't work on ICH10?

We can't simply set _hasPCIPwrMgmt = true; if we didn't initialize PCI bus.

May be some changes in BIOS needed?

 

Thanks alot for the sources. I'll experiment with them a bit.

 

You are probably right that some settings/changes in the BIOS are somehow the cause, but I've been trough them many times doublechecking with other people's settings for my particular board (GA-EP45-UD3P; eg. Weaksauce12's Leopard Soup guide).

 

But with PCB355's changes it actually worked so that USB flash drives were not lost across sleep. That must mean that the controller did not unload during sleep.

 

About the D3 state stuff I'm approaching my limits; I don't quite know how to read the code you quote from the .cpp. But I'll look into it in more detail. Maybe USB flash drives are not D3 relevant - USB keyboards and mice should be, right?

 

Could it be that USB devices that need a tiny, little bit of power during sleep (i.e. the D3 state), eg. USB keyboards, are not getting it?

 

To recap: With the changes made by PCB355 I find that USB devices are not removed across sleep. But I still can't wake from USB keyboard or mouse.

 

Any ideas? I'll investigate further myself and try to experiment with your sources (thanks again).

Link to comment
Share on other sites

May be it is better to make the follow

If not D3 then standart PM?

 

Sorry, I'm a bit confused. What do you mean by standard PM? D3, as I remember, means Device Power State 3 = OFF.

 

Next, do you (or anyone else reading this) know how the AAPL,clock-id is generated/found?

 

// Now, look at PCI cards. Note that the onboard controller's provider is an IOPCIDevice so we cannot use that

// to distinguish between USB PCI cards and the on board controller. Instead, we use the existence of the

// "AAPL,clock-id" property in the provider. If it does not exist, then we are a EHCI controller on a USB PCI card.

 

What is the provider that has the AAPP,clock-id property. Can it be added by DSDT manipulation? Maybe it's an issue with some other kexts?

Link to comment
Share on other sites

Sorry, I'm a bit confused. What do you mean by standard PM? D3, as I remember, means Device Power State 3 = OFF.

 

Next, do you (or anyone else reading this) know how the AAPL,clock-id is generated/found?

 

// Now, look at PCI cards. Note that the onboard controller's provider is an IOPCIDevice so we cannot use that

// to distinguish between USB PCI cards and the on board controller. Instead, we use the existence of the

// "AAPL,clock-id" property in the provider. If it does not exist, then we are a EHCI controller on a USB PCI card.

 

What is the provider that has the AAPP,clock-id property. Can it be added by DSDT manipulation? Maybe it's an issue with some other kexts?

I mean that we have check for built-in

		if (_device->getProperty("built-in"))
	{
		// rdar://5769508 - if we are on a built in PCI device, then assume the system supports D3cold
		if (_device->hasPCIPowerManagement(kPCIPMCPMESupportFromD3Cold) && (_device->enablePCIPowerManagement(kPCIPMCSPowerStateD3) == kIOReturnSuccess))
		{
			_hasPCIPwrMgmt = true;
			setProperty("Card Type","Built-in");
		}
	}
	else
	{
		// rdar://5856545 - on older machines without the built-in property, we need to use the "default" case in the IOPCIDevice code
		if (_device->hasPCIPowerManagement() && (_device->enablePCIPowerManagement() == kIOReturnSuccess))
		{
			_hasPCIPwrMgmt = true;
			setProperty("Card Type","Built-in");
		}

May be it is better to make

			if (_device->hasPCIPowerManagement(kPCIPMCPMESupportFromD3Cold) && (_device->enablePCIPowerManagement(kPCIPMCSPowerStateD3) == kIOReturnSuccess))
		{
			_hasPCIPwrMgmt = true;
			setProperty("Card Type","Built-in");
		}
	else
		if (_device->hasPCIPowerManagement() && (_device->enablePCIPowerManagement() == kIOReturnSuccess))
		{
			_hasPCIPwrMgmt = true;
			setProperty("Card Type","Built-in");
		}
	else
	{
		USBError(1, "AppleUSBEHCI[%p]::CheckSleepCapability - controller will be unloaded across sleep",this);
		_controllerCanSleep = false;
		setProperty("Card Type","PCI");
	}

Or something like this.

 

I do not think that we need "AAPL,clock-id property".

Link to comment
Share on other sites

Copy original (in your S/L/E folder) IOUSBFamily.kext to eg. desktop.

Show the package contents, navigate to Plugins.

Replace vanilla kexts in Plugins with patched ones (the ones you download from this thread.

Use Kexthelper, OSXTools or Uinstaller to correctly install the patched IOUSBFamily.kext (on your desktop) to your S/L/E folder.

Thank you so much!
Link to comment
Share on other sites

I tried the above code change, to both the vanilla kext and Slice's latest kext, and I can confirm that on my MB (GA-EP45-Extreme) the two power management calls come back false, so the error condition that sets the Card Type to "PCI" is enabled. If this error condition code is replaced with my previously discussed patch, then the EHCI controller is set to "Built-in" and it suspends/resumes across sleep. As mentioned before, this works perfectly for me except that the USB drive is 30%-40% slower after resume until an ejection/reinsertion. I'm wondering if other people with ICH10 MBs can test for this USB slowdown after resume. A good quick test for this is the AJA System Test, available as a free download. It's possible that it is hardware or BIOS related, so no amount of driver patching will fix this. I'll probably build up a Windows installation on this machine and check for a similar USB slowdown after resume to confirm this.

Link to comment
Share on other sites

Hi Slice,

 

I'm able to get my notebook to sleep when I set "hibernatemode" to 1 or 5. I'm able to achieve this without your USB 2.0 driver but now I want to try to get my notebook to sleep with "hibernatemode" set to 3 or 7. I have installed your USB 2.0 driver & USB device working as it should be. But sleep still failed where it will wake immediately. I found out that USB7 caused it to wake. Here I attached one file contain message from "dmesg" & one file contain ioreg that show what device was attached to USB7.

 

Please let me know if you need anything else. Thank you. :)

 

kizwan

dmesg_sleep.txt

ioreg_usb7.txt

Link to comment
Share on other sites

I tried the above code change, to both the vanilla kext and Slice's latest kext, and I can confirm that on my MB (GA-EP45-Extreme) the two power management calls come back false, so the error condition that sets the Card Type to "PCI" is enabled. If this error condition code is replaced with my previously discussed patch, then the EHCI controller is set to "Built-in" and it suspends/resumes across sleep. As mentioned before, this works perfectly for me except that the USB drive is 30%-40% slower after resume until an ejection/reinsertion. I'm wondering if other people with ICH10 MBs can test for this USB slowdown after resume. A good quick test for this is the AJA System Test, available as a free download. It's possible that it is hardware or BIOS related, so no amount of driver patching will fix this. I'll probably build up a Windows installation on this machine and check for a similar USB slowdown after resume to confirm this.

 

I see the same. With PCB355's patches, the EHCI controller works as expected. (Still no wake from USB keyboard/mouse for me, though).

 

I was able to test the write/read speeds quickly this morning - no differences in speed was found. I averaged around 13-14 mb/s write and 35-40 mb/s read both before and after sleep on a newly booted system using a SanDisk 8 Gb Contour USB flash drive.

 

Right now, as I see it, PCB355's patches are as far as we can get patching the IOUSBFamily.kext to remedy the shortcommings I personally have had. I can't get wake from USB working - if anyone has any ideas they will be most appreciated.

Link to comment
Share on other sites

Hi Slice,

 

I'm able to get my notebook to sleep when I set "hibernatemode" to 1 or 5. I'm able to achieve this without your USB 2.0 driver but now I want to try to get my notebook to sleep with "hibernatemode" set to 3 or 7. I have installed your USB 2.0 driver & USB device working as it should be. But sleep still failed where it will wake immediately. I found out that USB7 caused it to wake. Here I attached one file contain message from "dmesg" & one file contain ioreg that show what device was attached to USB7.

 

Please let me know if you need anything else. Thank you. :D

 

kizwan

I see that USB7 is your Web Camera. Is it working?

Link to comment
Share on other sites

I see that USB7 is your Web Camera. Is it working?

 

It is a built-in webcam, manufactured by SuYin. It is working with Yahoo Messenger.

 

I was going to try codes posted by pcb355 but I'm having trouble to compile the source code (even the original one). Do I need to repair the variables declaration? I think I have correct environment unless I'm trying to compile using wrong gcc version.

 

The last question is optional. Let me know if you have any idea how to deal with the USB7 issue.

 

Thank you. :D

 

kizwan

Link to comment
Share on other sites

 Share

×
×
  • Create New...