Jump to content

GenericUSBXHCI USB 3.0 driver for OS X with source


928 posts in this topic

Recommended Posts

Hello Zenith!

I am having a severe issue with my highpoint 1144a card which uses amsedia 1042 chips. I have been using your driver for a long time, keeping it up to date, and in 10.8.x it worked wonderfully. Once I updated to 10.9 things are not working anymore. I started with 1.2.6 in 10.9 (which was working perfectly in 10.8) and have been updating each of the snapshots up until 1.2.7 which i am now running. So far none of the updates have worked for me either. I also tested DisableUAS in plist but that did not help.

 

Here is the odd issue i am having:

In 10.9 the drives mount and everything appears normal, you can browse the drives and the files and folders appear correctly. However if i try and copy anything to or from the drive i receive an error such as: "The Finder can’t complete the operation because some data in “xxxxx” can’t be read or written.

(Error code -36)". Further if i try to open any files they appear corrupted. image files just have a few lines of the actual image on black, etc. Yet other files do appear to be read OK if i open them from the drive. This is particularly true of smaller files and it may just be that the corrupt data is going unnoticed in certain files. In any case, i have many, many drives and devices to test with (different brands and formats) and they all have this behavior. If i take the drive and then connect it to the Apple driver based Z77 ports they read and write perfectly, and all files are correctly readable. So this is definitely an issue with 10.9 and the GUX driver (at least on my amsedia chipset/card).
 
I'm attaching my xhcdumps. This is with a single drive attached. I really appreciate the support.
Thanks,
g\
 
 

GUX1042genzai01.txt

Link to comment
Share on other sites

Still got my issue with no idle and usb2 defer flags and z77. With as much info as I can provide to describe my issue with 1.27 and 10.9 (only having this problem in 10.9, all versions work with 10.8.5).

 

Attached is IO reg export and error.

 

 

Borna.

 

forgot the dumps

 

 

 

 

 

xchcdump.rtf

Link to comment
Share on other sites

I uploaded 1.2.7.  No more complaints about Intel series 7 until trying this.

Yup. I explored the code and seen you disabled UAS for ASM1042. So, there is no issues on 10.8 anymore ;-)

 

I also upgraded to 10.9 and here is the strange thing with that ASM1042 (so, it's some kind of 10.8 -> 10.9 OS changes).

 

It uses 3 endpoints with my flash disk (not UAS one). It acts exactly as it was on 10.8 with streams enabled and UAS-compatible disk connected on HFS volume: disk mounted, you can read and write small amounts of data. You will get an error -36 on big writes. AJA system test will report weird enormous big values for write speed amounts. NTFS volume mounted RO (the same ufsd_NTFS error as it was on 10.8 with streams enabled).

 

The only diff in 10.8 (1.2.7d8) -> 10.9 (1.2.7) in xhcidump caps / running, is:

 

# Short Transfers with Success Code 26622 on 10.9

 

Can we enable some more debugging to find what's the problem in that chipset?

 

Nec upd720202 works perfectly on 10.9 in both UAS and BOT mode. Only strange thing is AJA test. It also give me wrong results but there is no errors on file writes and speeds are fine.

 

25.10.13 15:07:02,000 kernel[0]: USBMSC Identifier (non-unique): AA011223130957223472 0x781 0x5580 0x10, 3
25.10.13 15:07:03,000 kernel[0]: hfs: mounted MDP-10.9 on device disk1s2
25.10.13 15:07:31,946 AJA System Test[479]: Average read rate = 179.33
25.10.13 15:07:31,947 AJA System Test[479]: Average write rate = 118.44
25.10.13 15:07:45,032 AJA System Test[479]: Selected Unix API mode
25.10.13 15:07:56,939 AJA System Test[479]: Average read rate = 180.85
25.10.13 15:07:56,940 AJA System Test[479]: Average write rate = 118.08
25.10.13 15:08:21,858 AJA System Test[479]: Selected Mac API mode
25.10.13 15:08:31,189 AJA System Test[479]: Average read rate = 179.46
25.10.13 15:08:31,189 AJA System Test[479]: Average write rate = 120.12

 

 

p.s. Weird AJA test results on 10.9 somehow related to it's preferences about file IO API. Works well with "Unix" settings, weird with "Macintosh" settings on 10.9. On 10.8 "Macintosh" is default setting in AJA and it works correctly there (but not in case of streams enabled drive connected to ASM1042 with 1.2.6 driver)...

xhcidump-1042-10.9.txt

post-42158-0-99465700-1382694987_thumb.png

post-42158-0-80205500-1382699739_thumb.png

post-42158-0-96381000-1382699747_thumb.png

  • Like 1
Link to comment
Share on other sites

 You will get an error -36 on big writes. AJA system test will report weird enormous big values for write speed amounts.

OK sounds like we are having the same issue. Glad i am not alone in this boat.

g\

Link to comment
Share on other sites

b0rnav: Your xhcdump shows ExpansionDesk connected to ASM1042.  Remove '-gux_defer_usb2', disconnect Expansion Desk, shutdown, connect ExpansionDesk to one of the 4 Intel superspeed ports in the back, and power up again.

 

genzai, nikk: upload output of 'xhcdump endpoints 1' and 'ioreg -lxrn GenericUSBXHCI'.  (under 10.9 that is.)

Link to comment
Share on other sites

Ok, I opened ticket #16 for this.  Don't have an immediate solution, as I don't know what causes it.

At least it works on 10.8.5 with streams disabled. But, on 10.8.4 with 1.2.7,  <key>DisableUAS</key> <true/> do nothing. Still "Configured Endpoints 5" and errors with it (applied, according to ioreg).

 

I made full output of xhcidump (caps running slots endpoints 1 bandwidth) on 10.8.4 and 10.9 with the same driver and disk. All the same...

 

 

 

mbp17:Desktop mac$ diff xhcidump-asm1042.txt xhcidump-asm1042-10.9.txt 

3c3

< Darwin 12.4.0

---

> Darwin 13.0.0

24c24

< Darwin 12.4.0

---

> Darwin 13.0.0

32,33c32,33

< MFIndex 13631

< Last Time Sync xHC 333824 milliseconds <-> CPU 824283737607 nanoseconds

---

> MFIndex 13756

> Last Time Sync xHC 98304 milliseconds <-> CPU 98670000719 nanoseconds

38c38,39

< # Interrupts: Total 92278, Serviced 92278, Inactive 0, Offline 0

---

> # Interrupts: Total 732, Serviced 732, Inactive 0, Offline 0

> # Short Transfers with Success Code 7

 

 

More interesting diff in IOReg for driver:

 

 

 

diff ioreg.txt ioreg-10.9.txt

...

106c107

<   |   "this" = 0xffffff8030249000

---

>   |   "Errata" = 0x8000000000

107a109

>   |   "DisableUAS" = Yes

...

<             |   "IOMaximumByteCountRead" = 0x20000

<             |   "IOMaximumBlockCountRead" = 0x100

<             |   "IOPowerManagement" = {"TimeSinceDeviceIdle"=0x28ea5,"MaxPowerState"=0x4,"ActivityTickles"=0x82,"IdleTimerPeriod"=0x30d40,"DevicePowerState"=0x4,"TimeSinceLastTickle"=0x24a90,"DriverPowerState"=0x1,"CurrentPowerState"=0x4}

<             |   "IOMaximumByteCountWrite" = 0x20000

<             |   "IOMaximumBlockCountWrite" = 0x100

---

>             |   "IOMaximumByteCountRead" = 0x100000

>             |   "IOMaximumBlockCountRead" = 0x800

>             |   "IOPowerManagement" = {"TimeSinceDeviceIdle"=0x2cac3,"MaxPowerState"=0x4,"ActivityTickles"=0x0,"IdleTimerPeriod"=0x30d40,"DevicePowerState"=0x2,"TimeSinceLastTickle"=0x8e838,"DriverPowerState"=0x1,"CurrentPowerState"=0x2}

>             |   "IOMaximumByteCountWrite" = 0x100000

>             |   "IOMaximumBlockCountWrite" = 0x800

...

 

 

So, in 10.9 we have increased block size and count, maybe that's the reason?

 

Also, can't understand, why "DisableUAS" = Yes only set in 10.9 and what's that "this" = 0xffffff8030249000 on 10.8.4 ;-)

 

p.s. 10.8.5 fixed "this" )

xhcidump-ioreg-asm1042-10.8.4.txt

xhcidump-ioreg-asm1042-10.9.txt

  • Like 1
Link to comment
Share on other sites

nikk, genzai,  please download this, install it and try on OS 10.9 with ASM1042

 

First, on a BOT drive like Sandisk Extreme.  If you don't have a BOT drive, then set DisableUAS to true in Info.plist to force it.

1) test it to see if you still get the aborted transfers and corrupt files.

2) after some testing, do 'xhcdump running' and see if it still reports a non-zero value for "# Short Transfers with Success Code".

 

Second, on a UAS drive like Expansion Desk, ASM1051E, LaCie Rugged.

After connecting the drive, do 'ioreg -xrn IOUSBAttachedSCSI'.  If the output is nonempty, the drive is recognized as UAS.  If it's not, try setting DisableUAS to false in Info.plist to force it.

Then repeat test 1) and 2) above with UAS drive.

 

Let me know how it turns out.

 

Thanks.

Link to comment
Share on other sites

nikk, genzai,  please download this, install it and try on OS 10.9 with ASM1042

 

First, on a BOT drive like Sandisk Extreme.  If you don't have a BOT drive, then set DisableUAS to true in Info.plist to force it.

1) test it to see if you still get the aborted transfers and corrupt files.

2) after some testing, do 'xhcdump running' and see if it still reports a non-zero value for "# Short Transfers with Success Code".

 

Let me know how it turns out.

Hm, It's still buggy on 10.9. BOT disk SanDisk Extreme. Can't write much.

 

 

 

mbp17:GenericUSBXHCI_1.2.7 mac$ ./xhcdump running

Found a device of class GenericUSBXHCI: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/RP04@1C,3/IOPCI2PCIBridge/EXCD@0/GenericUSBXHCI

Darwin 13.0.0

Kext Version 1.2.8d1

Vendor 0x1b21, Device 0x1042, Revision 0

USBCmd RS Y HCRST N INTE Y HSEE N LHCRST N CSS N CRS N EWE Y EU3S N

USBSts HCH N HSE N EINT Y PCD N SSS N RSS N SRE N CNR N HCE N

DNCtrl 0xffff

CRCr CRR Y

Config 32

MFIndex 8021

Last Time Sync xHC 575488 milliseconds <-> CPU 575970565027 nanoseconds

Will Reset on Resume

Using MSI

Legacy Owner[bios,OS] NN, SMIEn[Event,HSE,OSOwn,PCI,BAR] NNNNN, Chg[OWOwn,PCI,BAR] NYN

# Configured Endpoints 3

# Interrupts: Total 4387, Serviced 4387, Inactive 0, Offline 0

# Short Transfers with Success Code 1988

 

 

 

I give up ) Switched to NEC. It works like a charm on 10.9 even in UAS mode )

post-42158-0-84826500-1382717190_thumb.png

post-42158-0-77068000-1382717200_thumb.png

Link to comment
Share on other sites

b0rnav: Your xhcdump shows ExpansionDesk connected to ASM1042.  Remove '-gux_defer_usb2', disconnect Expansion Desk, shutdown, connect ExpansionDesk to one of the 4 Intel superspeed ports in the back, and power up again.

 

genzai, nikk: upload output of 'xhcdump endpoints 1' and 'ioreg -lxrn GenericUSBXHCI'.  (under 10.9 that is.)

 

Can't say that I don't feel stupid. You are correct. I always assumed that the upper 2 ports were the Intel ports as they worked after installing your driver. I guess it was the ASM ports that were working before for some reason (EDIT: i see your post about changes from 10.8-10.9 that effect the ASM1042. Thats probably why they stopped working).

 

All works well now. Thank you!

Link to comment
Share on other sites

<             |   "IOMaximumByteCountRead" = 0x20000

<             |   "IOMaximumBlockCountRead" = 0x100

<             |   "IOPowerManagement" = {"TimeSinceDeviceIdle"=0x28ea5,"MaxPowerState"=0x4,"ActivityTickles"=0x82,"IdleTimerPeriod"=0x30d40,"DevicePowerState"=0x4,"TimeSinceLastTickle"=0x24a90,"DriverPowerState"=0x1,"CurrentPowerState"=0x4}

<             |   "IOMaximumByteCountWrite" = 0x20000

<             |   "IOMaximumBlockCountWrite" = 0x100

---

>             |   "IOMaximumByteCountRead" = 0x100000

>             |   "IOMaximumBlockCountRead" = 0x800

>             |   "IOPowerManagement" = {"TimeSinceDeviceIdle"=0x2cac3,"MaxPowerState"=0x4,"ActivityTickles"=0x0,"IdleTimerPeriod"=0x30d40,"DevicePowerState"=0x2,"TimeSinceLastTickle"=0x8e838,"DriverPowerState"=0x1,"CurrentPowerState"=0x2}

>             |   "IOMaximumByteCountWrite" = 0x100000

>             |   "IOMaximumBlockCountWrite" = 0x800

So, in 10.9 we have increased block size and count, maybe that's the reason?

That is for sure the reason why it broke between 10.8.x to 10.9 - the increase in max transaction size from 128K to 1MB.  What I'm trying to figure out is whether the breakdown is due to a defect in the ASM1042, or it's something in the way it's being operated.

Anyhow, nikk, if you don't want to continue investigating this since you have the Renesas card - ok.

But genzai - if you're still interested, please download this.  Test it on the Backup+ until there are some errors.  Then upload output from 'xhcdump running'.  I split the '# Short Packets with Success Code' to two parts.  I need to see how much is each part.  Thanks.

 

Looks like these number can be overridden.  For instance, in IOUSBAttachedSCSI.kext/Contents/Info.plist

<key>SCSI Device Characteristics</key>

                        <dict>

                                <key>IOMaximumBlockCountRead</key>

                                <integer>2048</integer>

                                <key>IOMaximumBlockCountWrite</key>

                                <integer>2048</integer>

                                <key>IOMaximumByteCountRead</key>

                                <integer>1048576</integer>

                                <key>IOMaximumByteCountWrite</key>

                                <integer>1048576</integer>

                        </dict>

Also some documentation from Apple.  Maybe I can set these on GenericUSBXHCI as a workaround...

Edited by Zenith432
Link to comment
Share on other sites

Well, these numbers can't be set on GenericUSBXHCI, but they can be set like this...

In IOUSBMassStorageClass.kext/Contents/Info.plist

 

...
       <key>IOUSBMassStorageClass6</key>
        <dict>
            ...
            <key>bInterfaceClass</key>
            <integer>8</integer>
            <key>bInterfaceSubClass</key>
            <integer>6</integer>
            <key>SCSI Device Characteristics</key>
                        <dict>
                                <key>IOMaximumBlockCountRead</key>
                                <integer>256</integer>
                                <key>IOMaximumBlockCountWrite</key>
                                <integer>256</integer>
                                <key>IOMaximumByteCountRead</key>
                                <integer>131072</integer>
                                <key>IOMaximumByteCountWrite</key>
                                <integer>131072</integer>
                        </dict>
        </dict>

and in IOUSBAttachedSCSI.kext/Contents/Info.plist just need to change the numbers

 

        <key>IOUSBAttachedSCSI1</key>
        <dict>
             ...
            <key>SCSI Device Characteristics</key>
            <dict>
                <key>IOMaximumBlockCountRead</key>
                <integer>256</integer>
                <key>IOMaximumBlockCountWrite</key>
                <integer>256</integer>
                <key>IOMaximumByteCountRead</key>
                <integer>131072</integer>
                <key>IOMaximumByteCountWrite</key>
                <integer>131072</integer>
            </dict>
        </dict>
  • Like 1
Link to comment
Share on other sites

Zenith432, here is output from last GenericUSBXHCI on ASM1042:

 

 

 

mbp17:GenericUSBXHCI_1.2.7 mac$ ./xhcdump running

Found a device of class GenericUSBXHCI: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/RP04@1C,3/IOPCI2PCIBridge/EXCD@0/GenericUSBXHCI

Darwin 13.0.0

Kext Version 1.2.8d1

Vendor 0x1b21, Device 0x1042, Revision 0

USBCmd RS Y HCRST N INTE Y HSEE N LHCRST N CSS N CRS N EWE Y EU3S N

USBSts HCH N HSE N EINT Y PCD N SSS N RSS N SRE N CNR N HCE N

DNCtrl 0xffff

CRCr CRR Y

Config 32

MFIndex 6298

Last Time Sync xHC 233472 milliseconds <-> CPU 257982716801 nanoseconds

Will Reset on Resume

Using MSI

Legacy Owner[bios,OS] NN, SMIEn[Event,HSE,OSOwn,PCI,BAR] NNNNN, Chg[OWOwn,PCI,BAR] NYN

# Configured Endpoints 3

# Interrupts: Total 16643, Serviced 16643, Inactive 0, Offline 0

# Short Transfers with Success Code (ED) 971

Port   1 PortSC CCS N PED N OCA N PR N

           PLS RxDetect PP Y Speed Unknown PIC Off LWS N

           CSC N PEC N WRC N OCC N PRC N PLC N CEC N CAS N

           WCE N WDE N WOE N DR N WPR N

         PortPmsc U1 0 U2 0 FLA N PortLi LEC 0

Port   2 PortSC CCS Y PED Y OCA N PR N

           PLS U0 PP Y Speed Super PIC Off LWS N

           CSC N PEC N WRC N OCC N PRC N PLC N CEC N CAS N

           WCE N WDE N WOE N DR N WPR N

         PortPmsc U1 0 U2 0 FLA N PortLi LEC 0

Port   3 PortSC CCS N PED N OCA N PR N

           PLS RxDetect PP Y Speed Unknown PIC Off LWS N

           CSC N PEC N WRC N OCC N PRC N PLC N CEC N CAS N

           WCE N WDE N WOE N DR N WPR N

         PortPmsc L1S Invalid RWE N HIRD 50 us L1Slot 0 HLE N TestMode Disabled

Port   4 PortSC CCS N PED N OCA N PR N

           PLS RxDetect PP Y Speed Unknown PIC Off LWS N

           CSC N PEC N WRC N OCC N PRC N PLC N CEC N CAS N

           WCE N WDE N WOE N DR N WPR N

         PortPmsc L1S Invalid RWE N HIRD 50 us L1Slot 0 HLE N TestMode Disabled

Interrupter 0 iman IP N imod I 40000 ns C 0 ns erstsz 1 erdp DESI 0 EHB N

 

 

 

I think best option for ASM1042 users just stick on 10.8.5+ ;-)

  • Like 1
Link to comment
Share on other sites

But genzai - if you're still interested, please download this.  Test it on the Backup+ until there are some errors.  Then upload output from 'xhcdump running'.  I split the '# Short Packets with Success Code' to two parts.  I need to see how much is each part.  Thanks.

I am still very interested. I will get this data to you ASAP. just wrapping up some urgent work. Maybe in a couple hours.

Thanks,

g\

Link to comment
Share on other sites

Ok,it's the ED transfers reporting short.  I think I know what's causing this.  It's a transaction byte-counter that ASM1042 is supposed to reset to zero when a transaction passes 128K, but it's not doing that.  If that's the problem, there's an easy-enough workaround for it.  But I need to be sure, and for that - I need to dump some detailed prints of the counter in syslog.  Can I upload a build for doing this dump?  Or anyone with ASM1042 that wants to resolve this?

Zenith432, here is output from last GenericUSBXHCI on ASM1042:

Link to comment
Share on other sites

But I need to be sure, and for that - I need to dump some detailed prints of the counter in syslog.  Can I upload a build for doing this dump?  Or anyone with ASM1042 that wants to resolve this?

Just give us a link )

Link to comment
Share on other sites

Ok, it's here.

Open Console.app, in system.log.

Use the drive.

Look for string GenericUSBXHCI

It prints a line for each of those short-transfer-with-success-code.  So there could be a lot.  Just paste a bunch of them.

Just give us a link )

Link to comment
Share on other sites

Ok, it's here.

Open Console.app, in system.log.

Use the drive.

Look for string GenericUSBXHCI

It prints a line for each of those short-transfer-with-success-code.  So there could be a lot.  Just paste a bunch of them.

 

Here are my console logs. 

Many many thanks,

g\

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...