Qonfused / ASUS-ZenBook-Duo-14-UX481-Hackintosh

OpenCore configuration for the ASUS ZenBook Duo 14" (UX481FA/FL)
https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh
BSD 3-Clause "New" or "Revised" License
31 stars 1 forks source link

Refactor UX481FA ACPI #19

Closed Qonfused closed 1 year ago

Qonfused commented 1 year ago

Current tasks:

Housekeeping:

Qonfused commented 1 year ago

Will defer users to use the USBToolbox method instead of relying on an ACPI patch for mapping USB personalities should this be similarly prone to change. Otherwise a note should be given somewhere to remove the respective SSDT sans any internal USB personalities w/ the appropriate instructions.

This may also require the following ACPI rename to avoid errors:

<dict>
  <key>Comment</key>
  <string>XHC: _UPC to XUPC</string>
  <key>Count</key>
  <integer>0</integer>
  <key>Enabled</key>
  <true/>
  <key>Find</key>
  <data>X1VQQw==</data>
  <key>Limit</key>
  <integer>0</integer>
  <key>Mask</key>
  <data></data>
  <key>OemTableId</key>
  <data>UHJvalNzZHQ=</data>
  <key>Replace</key>
  <data>WFVQQw==</data>
  <key>ReplaceMask</key>
  <data></data>
  <key>Skip</key>
  <integer>0</integer>
  <key>TableLength</key>
  <integer>6103</integer>
  <key>TableSignature</key>
  <data>U1NEVA==</data>
</dict>

USBX can be merged with the EC device as SSDT-EC/USBX for consistency with the Dortania OpenCore guide.

Qonfused commented 1 year ago

Removed all non-critical SSDTs (will need to test for UX581/UX582 in #7). Regressions will need to be cleared before implementing further fixes.

Qonfused commented 1 year ago

The trackpad is still reported operating in polling mode using the original ETPD (I2C) device, but disabling I2C interrupts through a _CRS rename should resolve this issue.

This will also now require the VoodooI2CPrecisionTouchpadHIDEventDriver Info.plist override from https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/issues/12#issuecomment-1330781823 to support multitouch gestures.

Qonfused commented 1 year ago

The GPI0 pin calculated from the CoffeeLake-LF table does not appear to work. I did notice that VoodooGPIOCannonLakeLP is attached for GPIO, matching INT34BB in the device's IONameMatched property. Referring to the VoodooI2C GPIO instructions for Cannon Point-LP, the APIC pin for the trackpad (0x6D) corresponds to the GPI0 IRQ label GPP_D13_IRQ and GPI0 pin number 81 (0x51) from GPP_D13.

Update: This may be the correct GPIO pin but is being investigated in #24.

Qonfused commented 1 year ago

Will test if GPIO pinning I2C touchscreen devices resolves intermittency issue (presumably caused from polling interrupt collision).

Qonfused commented 1 year ago

@UsedDiscord Does touchscreen on the screenpad plus work with the last commit (zip URL)? It should move the cursor on the primary display (known issue), but for me it is not working when GPIO pinned.

You may need to run these two commands to check if GPIO is working and what Voodoo drivers are attaching:

ioreg -rxn TPL1 -k i2cAddress -d1 | grep -i "gpio"
ioreg -rxn IOHIDInterface -k "VoodooI2CServices Supported" -t | grep -E 'IOACPIPlatformDevice|IOPCIDevice|VoodooI2CDeviceNub|VendorID|ProductID|HIDEventDriver  <class VoodooI2C|Interface  <class VoodooI2C' | cut -d "<" -f1
Maleficent-Magik commented 1 year ago

@UsedDiscord Does touchscreen on the screenpad plus work with the last commit (zip URL)? It should move the cursor on the primary display (known issue), but for me it is not working when GPIO pinned.

You may need to run these two commands to check if GPIO is working and what Voodoo drivers are attaching:

ioreg -rxn TPL1 -k i2cAddress -d1 | grep -i "gpio"
ioreg -rxn IOHIDInterface -k "VoodooI2CServices Supported" -t | grep -E 'IOACPIPlatformDevice|IOPCIDevice|VoodooI2CDeviceNub|VendorID|ProductID|HIDEventDriver  <class VoodooI2C|Interface  <class VoodooI2C' | cut -d "<" -f1

@Qonfused I haven't tested your latest Commit yet, I was busy with my law classes, I just did the EDID dump in a hurry before leaving... with an old commit (yeah I screwed up my own EFI so I downloaded yours directly..)

I will test your EFI tomorrow with the last Commit I'll be happy to give you an update tomorrow.

*I also need to clean the "SSDT GPU DISABLE" since I don't have a dGPU, I only have the Intel UHD iGPU

Qonfused commented 1 year ago

No worries there! Just want to verify it's an actual issue and not something specific to my install. The ZIP archive for that commit is available here. I'll go ahead and revert the screenpad GPIO pinning in another commit for now.

Maleficent-Magik commented 1 year ago

No worries there! Just want to verify it's an actual issue and not something specific to my install. The ZIP archive for that commit is available here. I'll go ahead and revert the screenpad GPIO pinning in another commit for now.

Thanks for your patience! I'm trying to work on the EDID problem myself :), so if you're interested, I'm working on it.

But yep, I'll test it tomorrow, it's always a joy to read you @Qonfused :) and to work on this macOS x)

Qonfused commented 1 year ago

It seems that the GPIO pin I had used didn't work (I followed the same method for both touch screens as I detailed for the trackpad in https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/pull/19#issuecomment-1369108835), but it does work using 0x55 instead. In the end, it was a much simpler fix than I anticipated.

You can use the first archive link which pulls from the latest commit instead.

Maleficent-Magik commented 1 year ago

Nice that, good work :) I'll keep a feedback tomorrow to do a test on my side :)

Maleficent-Magik commented 1 year ago

so, good morning @Qonfused , I took your last commit https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/commit/07eafd3745779650f1e3cd2c15c688a0a4e20320.

Several points I note:

1) The touchpad of the screenpad worked some time before a standby (without doing it on purpose of the PC...) and it didn't work after... smh... same for the main touch screen...

2) I have done your orders, here are the pictures:

image

Command : ioreg -rxn TPL1 -k i2cAddress -d1 | grep -i "gpio" Result :

magik@LAPTOP-58F616EU ~ % ioreg -rxn TPL1 -k i2cAddress -d1 | grep -i "gpio"
      "gpioIRQ" = 0x8
      "Interrupt Mode" = "GPIO"
      "gpioPin" = 0x56

image

Command : ioreg -rxn IOHIDInterface -k "VoodooI2CServices Supported" -t | grep -E 'IOACPIPlatformDevice|IOPCIDevice|VoodooI2CDeviceNub|VendorID|ProductID|HIDEventDriver <class VoodooI2C|Interface <class VoodooI2C' | cut -d "<" -f1 Result :

magik@LAPTOP-58F616EU ~ % ioreg -rxn IOHIDInterface -k "VoodooI2CServices Supported" -t | grep -E 'IOACPIPlatformDevice|IOPCIDevice|VoodooI2CDeviceNub|VendorID|ProductID|HIDEventDriver  <class VoodooI2C|Interface  <class VoodooI2C' | cut -d "<" -f1
      +-o PCI0@0  
          +-o I2C0@15  
                  +-o TPL1  
                        |   "VendorID" = 0x4f3
                        |   "ProductID" = 0x2b6a
                        +-o VoodooI2CTouchscreenHIDEventDriver  
                          +-o VoodooI2CMultitouchInterface  
      +-o PCI0@0  
          +-o I2C1@15,1  
                  +-o ETPD  
                        |   "VendorID" = 0x4f3
                        |   "ProductID" = 0x310e
                        +-o VoodooI2CPrecisionTouchpadHIDEventDriver  
                          +-o VoodooI2CMultitouchInterface  
      +-o PCI0@0  
          +-o I2C3@15,3  
                  +-o TPL0  
                        |   "VendorID" = 0x4f3
                        |   "ProductID" = 0x2c58
                        +-o VoodooI2CTouchscreenHIDEventDriver  
                          +-o VoodooI2CMultitouchInterface  
magik@LAPTOP-58F616EU ~ % 

3) my trackpad jumps a lot less than before anyway!

4) the Disable Screenpad function (or darken it, second last button... the one on the left of the Power button) works, the main screen becomes black for a few seconds but nothing more :)

5) the function to switch the Screenpad with the main screen does not switch the 2 screens but allows to put + or - brightness on the Screenpad

6) FN+F11 : "Clear" all windows, and if you click on them, they come back

7) F7 (Only F7) allows to decrease or increase the keyboard brightness

8) F6 (Only F6) allows you to disable or enable the trackpad

9) F4 and F5 (only F4 and F5) allows to increase or decrease the brightness of the main screen

10) F1,F2,F3 (Only F1,F2,F3) allows to decrease the sound, to cut it or to increase it, unfortunately, I lose the audio a few seconds after the starting...

11) I didn't test FN Lock btw

Wishing you a pleasant day :)

Qonfused commented 1 year ago

It seems that VoodooI2C may still be polling a device somewhere, though the trackpad + both touchscreen are GPIO pinned. There is also a HID device for stylus input, which I may also need to address to resolve that. Related issue is found in https://github.com/VoodooI2C/VoodooI2C/issues/435.

The FN lock key is only cosmetic at the moment - it just toggles the keyboard light for it.

Qonfused commented 1 year ago

I may split this PR to deal with the screenpad issue separately.

Maleficent-Magik commented 1 year ago

after, I put back like that just by removing an ACPI the Disable GPU which is useless to me and which causes me errors in addition in the logs... ((I don't have Nvidia in my pc)

I didn't read the logs of the Kernel, nor of VoodooI2C... I just did a quick test, I have some exams in a few days... It's not easy to finish my courses and to do the test on a trackpad that doesn't work haha...

Qonfused commented 1 year ago

after, I put back like that just by removing an ACPI the Disable GPU which is useless to me and which causes me errors in addition in the logs... ((I don't have Nvidia in my pc)

This issue was overlooked. I'll add a null check to skip applying the DGPU SSDT on the UX481FA model.

Qonfused commented 1 year ago

Added a proper disable method with S3 fallback with the proper null checks, so it should always work for the UX418FL or early return for the UX481FA. You can check for any ACPI errors by running log show --last boot | grep AppleACPIPlatform.

Maleficent-Magik commented 1 year ago

Thank, I'll see when I work at night :) but it will save a few MICRO seconds in the MacOS boot since it doesn't have to check this... In that's great

(Micro seconds : in its pure state, it is really 0,00001 and still...)

Qonfused commented 1 year ago

Unclear what these ADB codes are (from SSDT-KBD):

"Custom PS2 Map", 
Package (0x06)
{
    Package (0x00){},
    "46=80",   // 0x006b, Scroll Lock
    "e045=80", // 0x0071, Pause
    "e037=64", // 0x0000, Print Screen
    "e052=67", // 0x0000, Insert
    "e05d=57"  // 0x0a00, App (context menu key)
},
Qonfused commented 1 year ago

Will revisit pending commits from @wern-apfel/Zenbook-UX481FA in a separate PR.

Remaining issues will have to be solved in separate PRs:

Qonfused commented 1 year ago

Still need to test on different macOS versions (Catalina, Big Sur, Monterey <12.3) before merge.