Contribute
Register

[Guide] HP Elite X2 1012 G1 / G2, Clover UEFI, VirtualSMC, Hot Patch

Status
Not open for further replies.
I've been working on a way to get pressure sensitivity working again in Sierra. I have something that's working on my machine (a G1). I am, however, running Sierra (I haven't gotten around upgrading). I am curious if my solution works for newer MacOS versions and G2, so I'm including the modified Kext and relevant files for those who want to test it out.

Some technical info:
I exfiltrate the data from kernel-space to user-space via the IORegistry. A launchAgent process (I'm calling it an IOManager, similar to Wacom's IOManager process) needs to be installed in order to tap into the events and patch the relevant mouse events with the exfiltrated data. Note: I don't know if G2 supports tilt or pen rotation so those properties aren't hooked up in the IOManager currently. Also note: I compiled the Kexts with the 10.12 SDK, I'm unsure if that will be ok for later MacOS versions.


Here's a gif of it in action (excuse the slight lag and delay, screenrecording while using sketchbook did not play nicely); performance is actually smooth when you're not screenrecording.
View attachment 474716

Hi mate,

Can confirm working in Catalina on my G3. Thanks so much this is great, you deserve a lot of credit. Crashes Photoshop unfortunately but still great.

Edit - C4D sculpting is amazing wow, davinci resolve feels more sensitive too this is superb... thanks this is huge

This makes the pen work so much better generally too, it's like going from digital to analog, can rotate the viewport in c4d now.. that's a gamechanger... cheers for this
 
Last edited:
Hi mate,

Can confirm working in Catalina on my G3. Thanks so much this is great, you deserve a lot of credit. Crashes Photoshop unfortunately but still great.

Edit - C4D sculpting is amazing wow, davinci resolve feels more sensitive too this is superb... thanks this is huge

This makes the pen work so much better generally too, it's like going from digital to analog, can rotate the viewport in c4d now.. that's a gamechanger... cheers for this

I've updated my post with the latest build.
I also tested photoshop on my machine and it works though I'm running an older build of photoshop (from 2017) (I am waiting for photoshop to finish updating to see if it's an issue with the latest version). See if the update works for you.

Edit - I've tested this on the latest version of Photoshop on Sierra and that works. When I have time, I'll update to Catalina and give that a test
 
Last edited:
I've updated my post with the latest build.
I also tested photoshop on my machine and it works though I'm running an older build of photoshop (from 2017) (I am waiting for photoshop to finish updating to see if it's an issue with the latest version). See if the update works for you.

Edit - I've tested this on the latest version of Photoshop on Sierra and that works. When I have time, I'll update to Catalina and give that a test

So just tested your new build... Still crashing in Photoshop 2020 I'm afraid,,, Maybe I will try 2017 and I will let you know

EDIT - So Catalina only has compatibility as far back as 2019 and that.... works!

Great almost got a fully functioning G3 now, your work is much appreciated, pressure sensitivity is super cool thanks a lot.
 
Last edited:
Also do you know a way to remap the stylus buttons? Can't seem to find an option in Bettertouch which would be perfect so it can be mapped to applications.

Actually better touch recognises it as a normal mouse trigger but needs a modifier key too which ain't great
 
Last edited:
Also do you know a way to remap the stylus buttons? Can't seem to find an option in Bettertouch which would be perfect so it can be mapped to applications.

Actually better touch recognises it as a normal mouse trigger but needs a modifier key too which ain't great


MacOS is dispatching the stylus events as mouse events. According to both their docs and Wacom's docs, there are two ways you can get a stylus to work, either you dispatch special stylus only events or you dispatch mouse events with additional stylus-only properties. I tried reassigning the mouse events into stylus events, but that doesn't work, so I had to go with the latter method. One of the stylus buttons acts as a middle-click, which should be an eraser. I've been unsuccessful to get applications to recognize it as an eraser, so maybe it's related to issues with remapping it?

I haven't tried using bettertouch, maybe that'll help me debug the middleclick issue.
 
Middle click is recognised correctly in C4D to open all views and adjust brush size, in AE it works to pan and Davinci it works to grab a still. So that is exactly as expected, are you sure it's not a software issue?

Edit - Just checked bettertouch recognises it as middle mouse button too you have it right. System preference does not recognise it as a mouse though I will look at other software for mouse remapping.

Yeah all good can be remapped in Bettertouch to anything so great. Also eraser is E in Photoshop and S in Sketchbook
 
Last edited:
hp 1012 g1 bios 44, catalina 10.15.5. Clover.
Working:
sound, touchscreen, touchpad, keyboard, sleep (button, not cover), battery.
Not working:
WiFi, bluetooth, sleep with cover, fingerprint, nfc.

please, before using - change smbios.
 

Attachments

  • EFI.zip
    24.3 MB · Views: 240
Hi,
My Hp Elite x2 1013 G3 was DOA but it's ok now.

Anyway I have attached the EFI for you.

Unfortunatelly, I'm unable to boot OpenCore using the copy of your EFI folder. On an older dev I get the following (Hp is way to fast to read the mesg):

OCS: failed to parse string field of type 0

Maybe a kind of config file corruption? Could you please check if the contents of EFI.zip you posted is ok?
 
The HP Elite X2 1012 G2 — Still the best tablet macOS experience IMO (The next gen Elite X2 1013 G3 has soldered Wifi! Boo! Dell has a couple good options but their screens are low res and the build quality isn't quite as nice). Anyway, hot patching makes things easy to replicate so here’s the abbreviated guide…

Hardware Considerations
As always, the WiFi needs to be replaced. The Dell DW1560 is really the only choice that makes sense. The DW1830 physically won’t fit and while the DW1820a *can* be made to work, it’s not worth the effort or the potential compatibility problems down the road (it takes a kext from a previous version of OS X to get it going). It’s also best to replace the NVMe drive with a plain old SATA SSD. The battery life hit you take by using the NVMe drive isn’t worth any speed benefit you may get. Let’s face it, if you need that sort of speed, then you probably need more CPU than is available in this package.

BIOS setup
Update to the latest (as of this writing, 1.25 rev A for the G2 / 1.32 for the G1). Be sure to disable secure boot so you can install, disable fastboot and up the DVMT to 64MB. Other than that, the settings don’t matter a ton. I disable all the cameras / fingerprint sensor / sd card reader, etc, since they aren’t functional in macOS and they will consume some battery power otherwise.

USB Prep
Download the latest Mojave (10.14.4 as of now) and use the createinstall media method to create your installer. When installing clover to your USB, make sure to use v4920 or greater and select UEFI. Then simply replace the Clover folder with the one attached to this post. In the config.plist, adjust the ig-platform-id and Apple model to suit your specific device, G1 or G2 (I suggest MacBook9,1 / 00001e19 for the G1 and MacBookPro14,1 / 00001659 for the G2). It’s also probably a good idea to sort out the serial number and MLB at this time as well. Clover Configurator makes it simple to find a good serial number, once you have it use it in the MLB section as well and add 5 random hex characters / numbers to the end. Regardless, to minimize the chance of any issues with your Apple ID / iMessage, it is best not to connect to any networks until you’ve sorted out any post install issues. Also, add back the dart=0 boot flag if you kept Virtualization enabled in the BIOS. And lastly, if you have the G1, use the separately attached SSDT-UIAC instead of the one in the Clover zip.

Installation
If you swapped out your SSD, then after the install USB boots up, simply format / partition the SSD however you like. Bear in mind that if you plan to dual / triple boot, only use OS X partition types for now or otherwise you will end up with a hybrid disk and you won’t be able to install any other OS’s later on. If you plan to keep the stock drive, chances are the boot partition is too small. Starting fresh is probably best, but macOS’s Disk Utility doesn’t cope well with erasing it. However, you can use the Terminal and ‘dd’ to overwrite it. This will wreck the stock Windows installation so back up whatever you had on there and reinstall after you install macOS if you intend to dual boot.

Post Install
Not much to do here, install Clover to the internal drive (selecting UEFI again) and copy over the included Clover folder. Seems the best technique is to install all the kexts to /Library/Extensions/ and leave everything *but* VoodooI2C/VoodooI2CHID/AlpsT4USB in /CLOVER/kexts/Other/; then set 'Inject Kexts' to 'Detect' in the config.plist. Rebuild the kextcache and reboot. You'll get the benefit of booting with the kernel cache, but will still be able to boot via kext injection if something goes wrong with the cache as well as update without issue.

Oddities
There are some boot flags in the config that help with Bluetooth wake from sleep. USB-C hot plug works like a champ, but shows up as an express card icon in the menu bar. I just acquired a TB3 to displayport device and can confirm that with the current config, you can insert a TB3 device and it will work. However, you will get a kernel panic on unplug. This is expected behavior as a real mac has the TB3 controller powered at all times and the OS KPs when it is powered down unexpectedly. To avoid this simply shutdown your tablet before unplugging the TB3 device. And of course, still no pressure with the stylus. We still collect the data, but Apple removed the bits that passed it to the OS back in Sierra and every attempt I've made to get it back have failed. Gotta go back to 10.11 if you need the pressure to work and since we are hot patching, the Clover folder will very likely work.

Future Items
I may look into hibernation at some point. I also have a couple different WWAN cards on the way and will update with any findings.

*** Edit 5/1/19 -- Recompiled the Bluetooth kext to include the fix outlined here -- https://www.tonymacx86.com/threads/guide-how-to-fix-bcm94352z-dw1560-bt-lost-after-sleep.276501/
On my machine, this also eliminates the boot glitch completely for some reason.

*** Edit 5/3/19 -- After more testing it seems that the wake from sleep issue happens regardless of which combo you use FakeSMC/ACPIBatteryManager or VirtualSMC/SMCBattery. It also appears to be USB related, possibly because the charge port is USB 3.1 / TB3.

*** Edit 5/7/19 -- The issue with charge state seems to have been due to incompatible BIOS settings that lingered after the BIOS upgrade (very likely hidden settings). If you have any of those issues, then reset your BIOS to factory defaults and set it up from scratch.

*** Edit 5/18/19 -- I ported the Linux driver for our vendor defined Alps touchpad to allow native multitouch using VoodooI2C's MT2 engine. The AlpsT4USB.kext must be placed in /Library/Extensions along with the latest VoodooI2C / VoodooI2CHID (as of now v2.1.6). It will not work injected from Clover. It's added to the zip in this post but source and release here - https://github.com/blankmac/AlpsT4USB/releases It should also work for the Elite X2 1012 G1 but it's only been tested on the G2.

*** Edit 5/23/19 -- Changed the audio layout from 3 to 21 to fix the headphone jack on the G2.

*** Edit 6/14/19 -- Update AlpsT4USB.kext to latest.
Hi. Thank you for your guidance and the attachments files given. I had successfully done fresh install Mojave to my newly refurbished HP Elite G1 by made some changes in the config.plist regarding to display card to be suit to G1. I had format SSD. Everything ok and i can boot from internal storage which has single macOS. After i made windows installation in additional partition, I cant't boot to macos from clover internal ssd. It always quit/reset half-way after macos was selected. But if i'm using usb drive to boot clover and select the installed mac it will run perfect as usual.

Could you please assist me and thanks in advance.

Regards
 
Hi,
My Hp Elite x2 1013 G3 was DOA but it's ok now.



Unfortunatelly, I'm unable to boot OpenCore using the copy of your EFI folder. On an older dev I get the following (Hp is way to fast to read the mesg):

OCS: failed to parse string field of type 0

Maybe a kind of config file corruption? Could you please check if the contents of EFI.zip you posted is ok?

Hi sorry not been keeping up with this thread...

So can you not boot Opencore at all?

I had to swap out the SSD as the one that came with my G3 would crash during install of OS X. Also I installed OS X in Clover and swapped to Opencore post install.

Anyway I have reuploaded the EFI, this is the one I am using that works so should be good.

Also check your Bios settings are correct and update too.
 

Attachments

  • EFI.zip
    26.1 MB · Views: 170
Last edited:
Status
Not open for further replies.
Back
Top