Contribute
Register

[Guide] Dell XPS 13 9360 on MacOS Sierra 10.12.x - LTS (Long-Term Support) Guide

Status
Not open for further replies.
For those still having problems with their builds, I've successfully hotpatched everything on this laptop, you are welcome to give it a try to see if it might solve your issues. Hotpatching bypasses any errors that would result from incorrectly dumping, patching and recompiling your DSDT.

Keep in mind that you need to be formatted on 4k sectors or else add in the NVMe patches yourself, but the further you stray from my build the more difficult it will be to give advice on why it's not working.

There are two patches present in Bozma88's build that are not present in mine:
[R] [sys] Skylake LPC -> Haven't found a need for this yet
MATH device (credit syscl) -> What does this do?

Webcam (including light) works perfectly without any 3rd-party kexts
USB-C/Thunderbolt: untested

Everything else: Bluetooth, Sleep, Backlight (including keys), works like a charm.

**Dont forget to paste in your SMBIOS**

First feedback:

AppleALC + Lilu - audio not working correctly. No headphone output. Amp stays powered for 10 seconds after sound stops, and you hear static noises in these 10 seconds. From headphones, in addition to not hearing any audio, you hear faint, high-pitched noises. These were the main reasons I switched to CloverHDA + CodecCommander + clover hot-patches.

VoodooPS2Controller - not smooth and cursor jumps, are you using the tweaked version or Rehabman's original one?

I am still testing, so expect other feedback in the next days.

Other feedback:

Bluetooth for me is still broken most times after wake from sleep, even with your Clover hot-patching config.
Sometime I see a duplicate BCM USB entry in System profiler after sleep, sometimes not, but bluetooth is still unavailable after sleep most of the times.
By trial and error, It just happened that I discovered a permanent fix for bluetooth, and it's a very odd one.
Bluetooth works perfectly before and after standby if I place BrcmPatchRAM2.kext and BrcmFirmwareRepo.kext in EFI.
Yes, I know it's not the correct place and this leads to firmware not uploading, but it works.
If I use BrcmNonPatchRAM2 of if I delete BrcmFirmwareRepo.kext from Clover EFI (which are the correct ways to prevent firmware uploading), bluetooth does not work at all. Tried many times, placing and removing the kexts, and it's always reproducible.

So, users like @rama1981 are encouraged to try this temp solution and see if it works.

I'll collect the usual reporting files tomorrow together with some log files, today I'm too busy.


Edit: it partially works: both-ways Airdrop works, but pairing with new devices does not. Sorry for this. Anyway, the problem seems to be in the uploader. I'll thoroughly look at the logs, sorry for the false hope.
 
Strange/unnecessary patches to DSDT.aml.
Try not to apply patches that aren't really needed.
Use "Rename _DSM to XDSM" instead of "Remove _DSM methods". And don't rename _T_x to T_x. Those two changes will make it much easier to compare patched vs. native.

It looks like there was an overzealous attempt to add things you might see in a Mac DSDT to your own...

Thanks for this - very insightful. Yes you're right - in the interests of squeezing every last ounce of performance I applied as much changes as possible to map local devices to the Apple Hardware. Not sure if this has made any difference though.

So I've rebuilt the DSDT patches from first principles and kept patches to a minimum, but the freezing still persists.

Any obvious issues arising from the differences in ioreg?
 
Other feedback:

Bluetooth for me is still broken most times after wake from sleep, even with your Clover hot-patching config.
Sometime I see a duplicate BCM USB entry in System profiler after sleep, sometimes not, but bluetooth is still unavailable after sleep most of the times.

Bluetooth still needs the procedure outlined in #707 in order to not crash during sleep, even with hotpatched Clover.

As for AppleALC + Lilu, yes I've mentioned before that this combo is only really beneficial if you have bluetooth headphones and don't use the audio jack, as in my case. If you need jack-sense, then you'll need to swap in cloverALC + related patches and CodecCommander.

VoodooPS2: I got used to Rehab's original, its drawbacks don't bother me. But this is very easy to swap out for personal preference and shouldn't affect system stability.
 
Thanks for this - very insightful. Yes you're right - in the interests of squeezing every last ounce of performance I applied as much changes as possible to map local devices to the Apple Hardware. Not sure if this has made any difference though.

It is a bad assumption that because Apple includes something in ACPI that hacks need it also...

So I've rebuilt the DSDT patches from first principles and kept patches to a minimum, but the freezing still persists.

Any obvious issues arising from the differences in ioreg?

No "Problem Reporting" files attached.
 
Bluetooth still needs the procedure outlined in #707 in order to not crash during sleep, even with hotpatched Clover.

As for AppleALC + Lilu, yes I've mentioned before that this combo is only really beneficial if you have bluetooth headphones and don't use the audio jack, as in my case. If you need jack-sense, then you'll need to swap in cloverALC + related patches and CodecCommander.

VoodooPS2: I got used to Rehab's original, its drawbacks don't bother me. But this is very easy to swap out for personal preference and shouldn't affect system stability.

I decided it was time to figure out my bluetooth issues.
I did a complete system cleanup. Turned out it is caused by a horrible and old Logitech driver that hooks the USB ports and releases them after 2 seconds after every wake.
No, it was not caused by anything else I thought before. I tried the sleepwatcher method, tried different firmware uploaders, tried everything.
There's a race condition between the firmware uploader and the Logitech driver.
Since I need my mouse more than my bluetooth, I temporarily disabled bluetooth in BIOS. I think the issue is similar to this: https://www.tonymacx86.com/threads/bluetooth-bcm20702a0-problem-usb.185785/#post1200910, caused by Android File Transfer.

Screen Shot 2017-05-24 at 18.31.10.png Screen Shot 2017-05-24 at 18.31.14.png

Before sleep (firmware load is veeery slow?):

Code:
2017-05-24 11:10:05.316616+0200  localhost kernel[0]: (kernel) BrcmPatchRAM: Loaded compressed embedded firmware for key "BCM20702A1_001.002.014.1443.1572_v5668".
2017-05-24 11:10:05.339233+0200  localhost kernel[0]: (kernel) BrcmPatchRAM: Decompressed firmware (29651 bytes --> 70012 bytes).
2017-05-24 11:10:05.347662+0200  localhost kernel[0]: (kernel) BrcmPatchRAM: Firmware is valid IntelHex firmware.
2017-05-24 11:10:05.355272+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: USB [346895ECEFC0 v274] "BCM20702A0" by "Broadcom Corp"
2017-05-24 11:10:05.755407+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: Firmware upgrade completed successfully.
2017-05-24 11:10:05.767789+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: Published new IOKit personality.
2017-05-24 11:10:05.776810+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: Processing time 8.75 seconds.
2017-05-24 11:10:05.787529+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: Version 2.2.7 starting on OS X Darwin 16.6.
2017-05-24 11:10:05.795401+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: USB [346895ECEFC0 v274] "BCM20702A0" by "Broadcom Corp"
2017-05-24 11:10:05.819193+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: Firmware upgrade not needed.

And that is what happens just after wake:

Code:
2017-05-24 11:11:13.433281+0200  localhost kernel[0]: (IOBluetoothHostControllerUSBTransport) <IOBluetoothHostControllerUSBTransport`IOBluetoothHostControllerUSBTransport::StartBulkPipeRead()> **** [IOBluetoothHostControllerUSBTransport][StartBulkPipeRead] -- mInt0BulkInPipe->clearStall (true) failed with error 0xE00002ED (kIOReturnNotResponding) -- 0xe000 ****
2017-05-24 11:11:13.433697+0200  localhost kernel[0]: (IOBluetoothHostControllerUSBTransport) <IOBluetoothHostControllerUSBTransport`IOBluetoothHostControllerUSBTransport::StartInterruptPipeRead()> **** [IOBluetoothHostControllerUSBTransport][StartInterruptPipeRead] -- mInt0InterruptPipe->clearStall (true) failed with error 0xE00002ED (kIOReturnNotResponding) -- 0xe000 ****
2017-05-24 11:11:13.434103+0200  localhost kernel[0]: (IOBluetoothHostControllerUSBTransport) <IOBluetoothHostControllerUSBTransport`IOBluetoothHostControllerUSBTransport::StartBulkPipeRead()> **** [IOBluetoothHostControllerUSBTransport][StartBulkPipeRead] -- mInt0BulkInPipe->clearStall (true) failed with error 0xE00002ED (kIOReturnNotResponding) -- 0xe000 ****
2017-05-24 11:11:13.434476+0200  localhost kernel[0]: (IOBluetoothHostControllerUSBTransport) <IOBluetoothHostControllerUSBTransport`IOBluetoothHostControllerUSBTransport::StartInterruptPipeRead()> **** [IOBluetoothHostControllerUSBTransport][StartInterruptPipeRead] -- mInt0InterruptPipe->clearStall (true) failed with error 0xE00002ED (kIOReturnNotResponding) -- 0xe000 ****
2017-05-24 11:11:13.434623+0200  localhost kernel[0]: (IOBluetoothHostControllerUSBTransport) <IOBluetoothHostControllerUSBTransport`IOBluetoothHostControllerUSBTransport::SetRemoteWakeUp(bool)> [IOBluetoothHostControllerUSBTransport][SetRemoteWakeUp] -- deviceRequest() failed: 0xE00002ED (kIOReturnNotResponding)

<.........>

2017-05-24 11:11:13.442731+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: Version 2.2.7 starting on OS X Darwin 16.6.
2017-05-24 11:11:13.442773+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: USB [346895ECEFC0 v274] "BCM20702A0" by "Broadcom Corp"
2017-05-24 11:11:13.582443+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: Not responding - Delaying next read.
2017-05-24 11:11:13.582930+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: Failed to write to bulk pipe ("0xe00002ed (UNDEFINED)" 0xe00002ed).
2017-05-24 11:11:13.585437+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: Not responding - Delaying next read.
2017-05-24 11:11:13.585530+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: Failed to write to bulk pipe ("0xe0005000 (UNDEFINED)" 0xe0005000).

Since USB ports are properly patched, and this of Bluetooth not loading after sleep was a recurring problem even on a old Ivy Bridge Hackintosh on which I used the same Logitech Mouse, I am finally happy(ish) to have found the root cause.
Now I have to see if I can tell the firmware uploader to wait e.g. 10 seconds after wake to try a new firmware upload... this may eventually make the patchRam uploader more stable even with Chrome USB hooking and AFT enabled, which are 99% of the time the reasons of Bluetooth not working properly after wake from sleep.
 

Attachments

  • post-boot-ok.ioreg.zip
    610.4 KB · Views: 86
  • post-wake-double-device.ioreg.zip
    634.2 KB · Views: 70
Last edited:
I decided it was time to figure out my bluetooth issues.
I did a complete system cleanup. Turned out it is caused by a horrible and old Logitech driver that hooks the USB ports and releases them after 2 seconds after every wake.
No, it was not caused by anything else I thought before. I tried the sleepwatcher method, tried different firmware uploaders, tried everything.
There's a race condition between the firmware uploader and the Logitech driver.
Since I need my mouse more than my bluetooth, I temporarily disabled bluetooth in BIOS. I think the issue is similar to this: https://www.tonymacx86.com/threads/bluetooth-bcm20702a0-problem-usb.185785/#post1200910, caused by Android File Transfer.

View attachment 257134 View attachment 257135

Before sleep (firmware load is veeery slow?):

Code:
2017-05-24 11:10:05.316616+0200  localhost kernel[0]: (kernel) BrcmPatchRAM: Loaded compressed embedded firmware for key "BCM20702A1_001.002.014.1443.1572_v5668".
2017-05-24 11:10:05.339233+0200  localhost kernel[0]: (kernel) BrcmPatchRAM: Decompressed firmware (29651 bytes --> 70012 bytes).
2017-05-24 11:10:05.347662+0200  localhost kernel[0]: (kernel) BrcmPatchRAM: Firmware is valid IntelHex firmware.
2017-05-24 11:10:05.355272+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: USB [346895ECEFC0 v274] "BCM20702A0" by "Broadcom Corp"
2017-05-24 11:10:05.755407+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: Firmware upgrade completed successfully.
2017-05-24 11:10:05.767789+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: Published new IOKit personality.
2017-05-24 11:10:05.776810+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: Processing time 8.75 seconds.
2017-05-24 11:10:05.787529+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: Version 2.2.7 starting on OS X Darwin 16.6.
2017-05-24 11:10:05.795401+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: USB [346895ECEFC0 v274] "BCM20702A0" by "Broadcom Corp"
2017-05-24 11:10:05.819193+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: Firmware upgrade not needed.

And that is what happens just after wake:

Code:
2017-05-24 11:11:13.433281+0200  localhost kernel[0]: (IOBluetoothHostControllerUSBTransport) <IOBluetoothHostControllerUSBTransport`IOBluetoothHostControllerUSBTransport::StartBulkPipeRead()> **** [IOBluetoothHostControllerUSBTransport][StartBulkPipeRead] -- mInt0BulkInPipe->clearStall (true) failed with error 0xE00002ED (kIOReturnNotResponding) -- 0xe000 ****
2017-05-24 11:11:13.433697+0200  localhost kernel[0]: (IOBluetoothHostControllerUSBTransport) <IOBluetoothHostControllerUSBTransport`IOBluetoothHostControllerUSBTransport::StartInterruptPipeRead()> **** [IOBluetoothHostControllerUSBTransport][StartInterruptPipeRead] -- mInt0InterruptPipe->clearStall (true) failed with error 0xE00002ED (kIOReturnNotResponding) -- 0xe000 ****
2017-05-24 11:11:13.434103+0200  localhost kernel[0]: (IOBluetoothHostControllerUSBTransport) <IOBluetoothHostControllerUSBTransport`IOBluetoothHostControllerUSBTransport::StartBulkPipeRead()> **** [IOBluetoothHostControllerUSBTransport][StartBulkPipeRead] -- mInt0BulkInPipe->clearStall (true) failed with error 0xE00002ED (kIOReturnNotResponding) -- 0xe000 ****
2017-05-24 11:11:13.434476+0200  localhost kernel[0]: (IOBluetoothHostControllerUSBTransport) <IOBluetoothHostControllerUSBTransport`IOBluetoothHostControllerUSBTransport::StartInterruptPipeRead()> **** [IOBluetoothHostControllerUSBTransport][StartInterruptPipeRead] -- mInt0InterruptPipe->clearStall (true) failed with error 0xE00002ED (kIOReturnNotResponding) -- 0xe000 ****
2017-05-24 11:11:13.434623+0200  localhost kernel[0]: (IOBluetoothHostControllerUSBTransport) <IOBluetoothHostControllerUSBTransport`IOBluetoothHostControllerUSBTransport::SetRemoteWakeUp(bool)> [IOBluetoothHostControllerUSBTransport][SetRemoteWakeUp] -- deviceRequest() failed: 0xE00002ED (kIOReturnNotResponding)

<.........>

2017-05-24 11:11:13.442731+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: Version 2.2.7 starting on OS X Darwin 16.6.
2017-05-24 11:11:13.442773+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: USB [346895ECEFC0 v274] "BCM20702A0" by "Broadcom Corp"
2017-05-24 11:11:13.582443+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: Not responding - Delaying next read.
2017-05-24 11:11:13.582930+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: Failed to write to bulk pipe ("0xe00002ed (UNDEFINED)" 0xe00002ed).
2017-05-24 11:11:13.585437+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: Not responding - Delaying next read.
2017-05-24 11:11:13.585530+0200  localhost kernel[0]: (kernel) BrcmPatchRAM2: [0a5c:216f]: Failed to write to bulk pipe ("0xe0005000 (UNDEFINED)" 0xe0005000).

Since USB ports are properly patched, and this of Bluetooth not loading after sleep was a recurring problem even on a old Ivy Bridge Hackintosh on which I used the same Logitech Mouse, I am finally happy(ish) to have found the root cause.
Now I have to see if I can tell the firmware uploader to wait e.g. 10 seconds after wake to try a new firmware upload... this may eventually make the patchRam uploader more stable even with Chrome USB hooking and AFT enabled, which are 99% of the time the reasons of Bluetooth not working properly after wake from sleep.

What evidence do you see in ioreg that the Logitech drivers are hooking USB?
With more details, I will add it the FAQ.

Waiting 10sec to upload firmware will likely cause the native BT drivers to fail...
 
I did a complete system cleanup. Turned out it is caused by a horrible and old Logitech driver that hooks the USB ports and releases them after 2 seconds after every wake.

Can you confirm that your Bluetooth does not crash after wake (from 5min+ of unplugged sleep) if the Logitech drivers are not present?

Because I had the same problem (excluding the duplicating BCM20702A0 device, and also strange that your webcam is not present there - have you disabled it?), without ever having any 3rd party peripheral drivers installed.
 
Because I had the same problem (excluding the duplicating BCM20702A0 device, and also strange that your webcam is not present there - have you disabled it?), without ever having any 3rd party peripheral drivers installed.

Do you use Chrome?
Did you install Android File Transfer?
 
Status
Not open for further replies.
Back
Top