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
29 stars 1 forks source link

[Kernel/FB] ScreenPad display static on FB initialization #4

Open Qonfused opened 1 year ago

Qonfused commented 1 year ago

Follow up to https://github.com/shiecldk/ASUS-ZenBook-Pro-Duo-15-OLED-UX582-Hackintosh/issues/2 investigating scrambled screenpad plus display-out.

Current tasks:

Qonfused commented 1 year ago

Found a few item details from https://en.accessoires-asus.com/ regarding the Screenpad Plus:

Item Image
Asus Screen module blue touch screenpad FHD 12

SKU: MODULESCREENPADUX481BLUEFHD
P/N: 90NB0P61-R20010

EDP Cable reference: 1422-03ER0AS
back-screenpad-topcase
(For main display)

Asus Screen cable EDP for UX481FLY

SKU: EDPCBLUX481
P/N: 14005-03210100

EDP Cable reference: 1422-03EK0AS
long-edp-cable
Asus Touch controller card for UX481FLY

SKU: TOUCHCONTBDUX481
P/N: 90NB0P60-R10020
Model: 60NB0P60-TP1020
touch-controller

^ Both the screenpad plus assembly and actual primary display cable have an 'EDP cable reference' id, which appear only to deviate by the length of the cable. There however appears to not be any individual catalog item for the screenpad plus's EDP cable (probably only included in the whole top-case assembly linked above).

This also verifies the connector type from the datasheet @UsedDiscord provided, analyzed in https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/pull/1#issuecomment-1207468579 w/ the device schematic however pointing out a DP interface:

I noticed that the screenpad plus is designated as DP (also listed as DDI1) in the device's schematic w/ a different layout than eDP, though it matches what was shown in the datasheet you linked as the physical connector:

image image

On the left is the LCD connector and on the right looks to be for the touchscreen digitizer: image

Qonfused commented 1 year ago

I've also noted in https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/pull/2#issuecomment-1212688936 that an entry for the EDID data for the screenpad plus display exists in the linux-hw repository:

I also found the display under the linux hw EDID repo: https://raw.githubusercontent.com/linuxhw/EDID/master/DigitalDisplay.md MFG Model Name Res Inch Made ID
BOE BOE087F HF NV126B5M-N41 1920 x 515 12.6 2019 46E74341751E

edid-decode (hex):

00 ff ff ff ff ff ff 00 09 e5 7f 08 00 00 00 00
01 1d 01 04 a5 1f 08 78 02 d2 2d 93 51 57 8d 28
18 4e 52 00 00 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 94 1b 80 a0 70 03 32 20 30 20
55 00 35 53 10 00 00 1a 12 16 80 a0 70 03 32 20
30 20 55 00 35 53 10 00 00 1a 00 00 00 fe 00 42
4f 45 20 48 46 0a 20 20 20 20 20 20 00 00 00 fe
00 4e 56 31 32 36 42 35 4d 2d 4e 34 31 0a 00 ed

2 already confirms the validity of the EDID data present from the screenpad plus display. This can be further studied in Linux as to whether or not the display is connected to the iGPU through an eDP or a DP interface.

(e.g. https://linux-hardware.org/?probe=d680085d25):

EDID output ```text edid-decode "/sys/class/drm/card0-DP-1/edid": EDID (hex): 00ffffffffffff0009e57f0800000000 011d0104a51f087802d22d9351578d28 184e5200000001010101010101010101 010101010101941b80a0700332203020 550035531000001a121680a070033220 3020550035531000001a000000fe0042 4f452048460a202020202020000000fe 004e5631323642354d2d4e34310a00ed Extracted contents: header: 00 ff ff ff ff ff ff 00 serial number: ... version: 01 04 basic params: a5 1f 08 78 02 chroma info: d2 2d 93 51 57 8d 28 18 4e 52 established: 00 00 00 standard: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 descriptor 1: 94 1b 80 a0 70 03 32 20 30 20 55 00 35 53 10 00 00 1a descriptor 2: 12 16 80 a0 70 03 32 20 30 20 55 00 35 53 10 00 00 1a descriptor 3: 00 00 00 fe 00 42 4f 45 20 48 46 0a 20 20 20 20 20 20 descriptor 4: 00 00 00 fe 00 4e 56 31 32 36 42 35 4d 2d 4e 34 31 0a extensions: 00 checksum: ed EDID version: 1.4 Manufacturer: BOE Model 87f Serial Number ... Made in week 1 of 2019 Digital display 8 bits per primary color channel DisplayPort interface Maximum image size: 31 cm x 8 cm Gamma: 2.20 Supported color formats: RGB 4:4:4 First detailed timing includes the native pixel format and preferred refresh rate Display x,y Chromaticity: Red: 0.5771, 0.3173 Green: 0.3398, 0.5527 Blue: 0.1562, 0.0957 White: 0.3076, 0.3212 Established timings supported: Standard timings supported: Detailed mode: Clock 70.600 MHz, 309 mm x 83 mm 1920 1968 2000 2080 hborder 0 515 520 525 565 vborder 0 +hsync -vsync VertFreq: 60 Hz, HorFreq: 33942 Hz Detailed mode: Clock 56.500 MHz, 309 mm x 83 mm 1920 1968 2000 2080 hborder 0 515 520 525 565 vborder 0 +hsync -vsync VertFreq: 48 Hz, HorFreq: 27163 Hz ASCII string: BOE HF ASCII string: NV126B5M-N41 Checksum: 0xed (valid) EDID block does NOT conform to EDID 1.4! Missing name descriptor Missing monitor ranges ... ```
gpu-manager.log output ```text ... Vendor/Device Id: 8086:9b41 BusID "PCI:0@0:2:0" Is boot vga? yes Vendor/Device Id: 10de:1d52 BusID "PCI:2@0:0:0" can't open /sys/bus/pci/devices/0000:02:00.0/boot_vga Is boot vga? no ... Found "/dev/dri/card0", driven by "i915" output 0: card0-eDP-1 output 1: card0-DP-1 Number of connected outputs for /dev/dri/card0: 2 ...
xorg.log output ```text ... [ 9.435] (II) modeset(0): EDID for output DP-1 [ 9.435] (II) modeset(0): Manufacturer: BOE Model: 87f Serial#: ... [ 9.435] (II) modeset(0): Year: 2019 Week: 1 [ 9.435] (II) modeset(0): EDID Version: 1.4 [ 9.435] (II) modeset(0): Digital Display Input [ 9.435] (II) modeset(0): 8 bits per channel [ 9.435] (II) modeset(0): Digital interface is DisplayPort [ 9.435] (II) modeset(0): Max Image Size [cm]: horiz.: 31 vert.: 8 [ 9.435] (II) modeset(0): Gamma: 2.20 [ 9.435] (II) modeset(0): No DPMS capabilities specified [ 9.435] (II) modeset(0): Supported color encodings: RGB 4:4:4 [ 9.435] (II) modeset(0): First detailed timing is preferred mode [ 9.435] (II) modeset(0): Preferred mode is native pixel format and refresh rate [ 9.435] (II) modeset(0): redX: 0.577 redY: 0.317 greenX: 0.340 greenY: 0.553 [ 9.435] (II) modeset(0): blueX: 0.156 blueY: 0.096 whiteX: 0.308 whiteY: 0.321 [ 9.435] (II) modeset(0): Manufacturer's mask: 0 [ 9.435] (II) modeset(0): Supported detailed timing: [ 9.435] (II) modeset(0): clock: 70.6 MHz Image Size: 309 x 83 mm [ 9.435] (II) modeset(0): h_active: 1920 h_sync: 1968 h_sync_end 2000 h_blank_end 2080 h_border: 0 [ 9.435] (II) modeset(0): v_active: 515 v_sync: 520 v_sync_end 525 v_blanking: 565 v_border: 0 [ 9.435] (II) modeset(0): Supported detailed timing: [ 9.435] (II) modeset(0): clock: 56.5 MHz Image Size: 309 x 83 mm [ 9.435] (II) modeset(0): h_active: 1920 h_sync: 1968 h_sync_end 2000 h_blank_end 2080 h_border: 0 [ 9.435] (II) modeset(0): v_active: 515 v_sync: 520 v_sync_end 525 v_blanking: 565 v_border: 0 [ 9.435] (II) modeset(0): BOE HF [ 9.435] (II) modeset(0): NV126B5M-N41 [ 9.435] (II) modeset(0): EDID (in hex): [ 9.435] (II) modeset(0): 00ffffffffffff0009e57f0800000000 [ 9.435] (II) modeset(0): 011d0104a51f087802d22d9351578d28 [ 9.435] (II) modeset(0): 184e5200000001010101010101010101 [ 9.435] (II) modeset(0): 010101010101941b80a0700332203020 [ 9.435] (II) modeset(0): 550035531000001a121680a070033220 [ 9.435] (II) modeset(0): 3020550035531000001a000000fe0042 [ 9.436] (II) modeset(0): 4f452048460a202020202020000000fe [ 9.436] (II) modeset(0): 004e5631323642354d2d4e34310a00ed [ 9.436] (WW) modeset(0): Output DP-1: Strange aspect ratio (309/83), consider adding a quirk [ 9.436] (WW) modeset(0): Output DP-1: Strange aspect ratio (309/83), consider adding a quirk [ 9.436] (II) modeset(0): Printing probed modes for output DP-1 [ 9.436] (II) modeset(0): Modeline "1920x515"x60.1 70.60 1920 1968 2000 2080 515 520 525 565 +hsync -vsync (33.9 kHz eP) [ 9.436] (II) modeset(0): Modeline "1920x515"x48.1 56.50 1920 1968 2000 2080 515 520 525 565 +hsync -vsync (27.2 kHz e) [ 9.444] (II) modeset(0): EDID for output HDMI-1 [ 9.444] (II) modeset(0): Output eDP-1 connected [ 9.444] (II) modeset(0): Output DP-1 connected [ 9.444] (II) modeset(0): Output HDMI-1 disconnected ... ```
Qonfused commented 1 year ago

I do wonder, having tried patching the connector type as DisplayPort in #1 how I'd handle a passive eDP -> DP adapter with WEG patching.

As an example, a validation methodology paper from Intel covered the 'Hardware and Software Uniqueness' (pg. 12) of an eDP to DP cable. They state that since the standards are very similar, a passive adapter can be used without any level shifting (i.e. no active adapter is needed). From the pin layout of the adapter, it looks like you can just forgo eDP-specific capability to operate the display under a normal DisplayPort interface.

The DisplayPort interface shown in https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/issues/4#issuecomment-1215001389 also appears to have an identical layout for its control signals, though it terminates at a 30 pin DisplayPort connector vs a 20 pin eDP connector:

display-signals-schematic

Qonfused commented 1 year ago

It's the same case for the pro-duo as well, which has an eDP connector on the datasheet for the second display, but is connected via DP to the iGPU.

Maleficent-Magik commented 1 year ago

it seems to be complex... so if I summarize.

Screenpad screen: eDP -> Adapter -> DisplayPort? If so, then that means the adapter is not coded correctly for MacOS / WhatEverGreen... That's very strange... That would be an unlikely explanation, though.

Qonfused commented 1 year ago

No, if it's a passive adapter it should just function as a normal DisplayPort display just as it does for the pro-duo. What I mean there is that eDP-specific features like backlight control wouldn't be routed to the iGPU. To put it simply, eDP is like DisplayPort + Backlight, and if you route only the 'DisplayPort' part it should work as a regular DisplayPort monitor. You'd otherwise have a separate physical cable for backlight, but physically there exists only a eDP connector on the Display and a DP interface w/ the iGPU.

I think I just need to try more framebuffer profiles if both the second display and HDMI isn't working. There isn't a busID issue causing the second display and HDMI not to work (otherwise the second display would turn black instead).

VillenaDeveloper commented 1 year ago

I don't have much idea about the technical details, but at the level of the system specs is detected with a wrong resolution, in case you didn't notice> Screenpadplus resolution

Qonfused commented 1 year ago

That is interesting; I haven't noticed that at all in my testing. The 1280 x 720 resolution seems like it might be a fallback due to the odd display aspect ratio.

Could you try running the below command in terminal?

ioreg -l | grep -5 IODisplayEDID
Example output ```text $ ioreg -l | grep -5 IODisplayEDID | | | | { | | | | "IOClass" = "AppleBacklightDisplay" > | | | | "CFBundleIdentifier" = "com.apple.iokit.IOGraphicsFamily" | | | | "IOProviderClass" = "IODisplayConnect" | | | | "DisplayProductID" = 5333 | | | | "IODisplayEDID" = <00ffffffffffff000daed51400000000281a0104a51f117802ee95a3544c99260f505400000001010101010101010101010101010101b43b804a71383440503c680035ad10000018000000fe004e3134304843452d454e320a20000000fe00434d4e0a202020202020202020000000fe004e3134304843452d454e320a200010> | | | | "IODisplayPrefsKeyOld" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2/AppleIntelFramebuffer@0/display0/AppleBacklightDisplay-dae-14d5" | | | | "IODisplayPrefsKey" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2-dae-14d5-c148f7aca335bead" | | | | "IOProbeScore" = 3000 | | | | "IODisplayGUID" = 436849163854938112 | | | | "IODisplayParameters" = {"commit"={"reg"=0},"linear-brightness-probe"={"min"=0,"max"=65403,"value"=17497},"fade-time2"={"min"=0,"max"=10000,"value"=4000},"ggsc"={"min"=0,"max"=65536,"value"=65536},"vblm"={"min"=0,"max"=196608,"value"=65536},"dsyp"={"min"=0,"max"=2,"value"=2},"rgsc"={"min"=0,"max"=65536,"value"=65536},"fade-style"={"min"=0,"max"=10,"value"=0},"fade-time1"={"min"=0,"max"=10000,"value"=500},"bgsc"={"min"=0,"max"=65536,"value"=65536},"brightness-probe"={"min"=0,"max"=1024,"value"=768},"fade-time3"={"min"=0,"max"=10000,"value"=500},"bklt"={"min"=0,"max"=65535,"value"=17497},"linear-brightness"={"min"=0,"max"=65403,"value"=17497},"brightness"={"min"=0,"max"=1024,"value"=768},"brightness-fade"={"min"=0,"max"=1023,"value"=0},"usable-linear-brightness"={"min"=655,"max"=65403,"value"=17497},"ownr"=4294968567} -- | | | | { | | | | "IOClass" = "AppleDisplay" | | | | "CFBundleIdentifier" = "com.apple.iokit.IOGraphicsFamily" | | | | "IOProviderClass" = "IODisplayConnect" | | | | "DisplayProductID" = 2175 | | | | "IODisplayEDID" = <00ffffffffffff0009e57f0800000000011d0104a51f087802d22d9351578d28184e5200000001010101010101010101010101010101941b80a0700332203020550035531000001a121680a0700332203020550035531000001a000000fe00424f452048460a202020202020000000fe004e5631323642354d2d4e34310a00ed> | | | | "IODisplayPrefsKeyOld" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2/AppleIntelFramebuffer@1/display0/AppleDisplay-9e5-87f" | | | | "IODisplayPrefsKey" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2-9e5-87f-cbf4607b0ec1199d" | | | | "IOProbeScore" = 2000 | | | | "IOPowerManagement" = {"CapabilityFlags"=49152,"MaxPowerState"=3,"CurrentPowerState"=3} | | | | "IODisplayParameters" = {"bgsc"={"min"=0,"max"=65536,"value"=65536},"rgsc"={"min"=0,"max"=65536,"value"=65536},"vblm"={"min"=0,"max"=196608,"value"=65536},"ownr"=4294968568,"ggsc"={"min"=0,"max"=65536,"value"=65536}} ```

This is what it should look like in system report: Screen Shot 2022-08-18 at 9 22 22 AM

VillenaDeveloper commented 1 year ago

This is my output:

    | |   | | |     {
    | |   | | |       "IOClass" = "AppleBacklightDisplay"
    | |   | | |       "CFBundleIdentifier" = "com.apple.iokit.IOGraphicsFamily"
    | |   | | |       "IOProviderClass" = "IODisplayConnect"
    | |   | | |       "DisplayProductID" = 5333
    | |   | | |       "IODisplayEDID" = <00ffffffffffff000daed51400000000281a0104a51f117802ee95a3544c99260f505400000001010101010101010101010101010101b43b804a71383440503c680035ad10000018000000fe004e3134304843452d454e320a20000000fe00434d4e0a202020202020202020000000fe004e3134304843452d454e320a200010>
    | |   | | |       "IODisplayPrefsKeyOld" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2/AppleIntelFramebuffer@0/display0/AppleBacklightDisplay-dae-14d5"
    | |   | | |       "IODisplayPrefsKey" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2-dae-14d5-c148f7aca335bead"
    | |   | | |       "IOProbeScore" = 3000
    | |   | | |       "IODisplayGUID" = 436849163854938112
    | |   | | |       "IODisplayParameters" = {"commit"={"reg"=0},"linear-brightness-probe"={"min"=0,"max"=65403,"value"=65403},"fade-time2"={"min"=0,"max"=10000,"value"=4000},"ggsc"={"min"=0,"max"=65536,"value"=65536},"vblm"={"min"=0,"max"=196608,"value"=65536},"dsyp"={"min"=0,"max"=2,"value"=2},"rgsc"={"min"=0,"max"=65536,"value"=65536},"fade-style"={"min"=0,"max"=10,"value"=0},"fade-time1"={"min"=0,"max"=10000,"value"=500},"bgsc"={"min"=0,"max"=65536,"value"=65536},"brightness-probe"={"min"=0,"max"=1024,"value"=1024},"fade-time3"={"min"=0,"max"=10000,"value"=500},"bklt"={"min"=0,"max"=65535,"value"=52316},"linear-brightness"={"min"=0,"max"=65403,"value"=52316},"brightness"={"min"=0,"max"=1024,"value"=979},"brightness-fade"={"min"=0,"max"=1023,"value"=0},"usable-linear-brightness"={"min"=655,"max"=65403,"value"=52316},"ownr"=4294968515}
--
    | |   | | |     {
    | |   | | |       "IOClass" = "AppleDisplay"
    | |   | | |       "CFBundleIdentifier" = "com.apple.iokit.IOGraphicsFamily"
    | |   | | |       "IOProviderClass" = "IODisplayConnect"
    | |   | | |       "DisplayProductID" = 2175
    | |   | | |       "IODisplayEDID" = <00ffffffffffff0009e57f0800000000011d0104a51f087802d22d9351578d28184e5200000001010101010101010101010101010101941b80a0700332203020550035531000001a121680a0700332203020550035531000001a000000fe00424f452048460a202020202020000000fe004e5631323642354d2d4e34310a00ed>
    | |   | | |       "IODisplayPrefsKeyOld" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2/AppleIntelFramebuffer@1/display0/AppleDisplay-9e5-87f"
    | |   | | |       "IODisplayPrefsKey" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2-9e5-87f-cbf4607b0ec1199d"
    | |   | | |       "IOProbeScore" = 2000
    | |   | | |       "IOPowerManagement" = {"CapabilityFlags"=49152,"MaxPowerState"=3,"CurrentPowerState"=3}
    | |   | | |       "IODisplayParameters" = {"bgsc"={"min"=0,"max"=65536,"value"=65536},"rgsc"={"min"=0,"max"=65536,"value"=65536},"vblm"={"min"=0,"max"=196608,"value"=65536},"ownr"=4294968517,"ggsc"={"min"=0,"max"=65536,"value"=65536}}
Maleficent-Magik commented 1 year ago

Looks like many people are joining the problem! Glad to have people around :')

Maleficent-Magik commented 1 year ago

by the way, does your trackpad work? @Qonfused or you need to use a mouse?

Qonfused commented 1 year ago

Huh nothing looks wrong with the display's EDID data, and the entry otherwise looks identical to mine. I noticed a 0x3ea5 device id in your first screenshot, but I haven't seen this using that device id before. What does your DeviceProperties > Add > PciRoot(0x0)/Pci(0x2,0x0) section look like in your config.plist?

VillenaDeveloper commented 1 year ago

Using a mouse currently, and really glad about your efforts on making this hackintosh works. Thanks a lot!

Qonfused commented 1 year ago

by the way, does your trackpad work? @Qonfused or you need to use a mouse?

No but I think I only need to update the ACPI paths in the original Voodoo kexts to get the trackpad + touchscreen working. Touchscreen does occasionally work after wake but never the trackpad.

Maleficent-Magik commented 1 year ago

Okay I see, thanks you for your reply ^^

VillenaDeveloper commented 1 year ago

My device properties look like this

            <key>PciRoot(0x0)/Pci(0x2,0x0)</key>
            <dict>
                <key>AAPL,ig-platform-id</key>
                <data>CQClPg==</data>
                <key>AAPL01,override-no-connect</key>
                <data>AP///////wAJ5X8IAAAAAAEdAQSlHwh4AtItk1FXjSgYTlIAAAABAQEBAQEBAQEBAQEBAQEBlBuAoHADMiAwIFUANVMQAAAaEhaAoHADMiAwIFUANVMQAAAaAAAA/gBCT0UgSEYKICAgICAgAAAA/gBOVjEyNkI1TS1ONDEKAO0=</data>
                <key>device-id</key>
                <data>pT4AAA==</data>
                <key>enable-lspcon-support</key>
                <data>AQAAAA==</data>
                <key>enable-hdmi20</key>
                <data>AQAAAA==</data>
                <key>framebuffer-con1-enable</key>
                <data>AQAAAA==</data>
                <key>framebuffer-con1-alldata</key>
                <data>AQUJAAAEAACHAQAA</data>
                <key>framebuffer-con2-enable</key>
                <data>AQAAAA==</data>
                <key>framebuffer-con2-alldata</key>
                <data>AgQKAAAIAACHAQAA</data>
                <key>framebuffer-con2-has-lspcon</key>
                <data>AQAAAA==</data>
                <key>framebuffer-patch-enable</key>
                <data>AQAAAA==</data>
                <key>hda-gfx</key>
                <string>onboard-1</string>
            </dict>
VillenaDeveloper commented 1 year ago

And with that new frame buffer @Qonfused did you manage to use the second screen? or still the "analog noise" continuously there...?

Qonfused commented 1 year ago

It also seems the injected EDID data from AAPL01,override-no-connect matches:

// Injected EDID data
00FFFFFF FFFFFF00 09E57F08 00000000 011D0104 A51F0878 02D22D93 51578D28 184E5200 00000101 01010101 01010101 01010101 0101941B 80A07003 32203020 55003553 1000001A 121680A0 70033220 30205500 35531000 001A0000 00FE0042 4F452048 460A2020 20202020 000000FE 004E5631 32364235 4D2D4E34 310A00ED

// Expected EDID data
00ffffff ffffff00 09e57f08 00000000 011d0104 a51f0878 02d22d93 51578d28 184e5200 00000101 01010101 01010101 01010101 0101941b 80a07003 32203020 55003553 1000001a 121680a0 70033220 30205500 35531000 001a0000 00fe0042 4f452048 460a2020 20202020 000000fe 004e5631 32364235 4d2d4e34 310a00ed

It might help clearing NVRAM if you've tried booting before with a different framebuffer patch? You'd have to press space in the opencore boot menu and look for a 'Clear NVRAM' option. There is also the option to clear kext cache (sudo kextcache -i /) but idk if that would help.

Qonfused commented 1 year ago

And with that new frame buffer @Qonfused did you manage to use the second screen? or still the "analog noise" continuously there...?

It's still the same issue and strangely HDMI also doesn't work. I've been trying to get HDMI to work to reduce the issue to just the second display.

I'm thinking it's probably an issue with CSM + maybe the wrong framebuffer profile (the AAPL,ig-platform-id and maybe device-id keys). I'm looking into a workaround for that CSM issue in #3 but most likely that won't work.

Maleficent-Magik commented 1 year ago

When I downloaded the BIOS for the UX481FA (Y Specific!) and ran it through AMIBCP version 5.02.0031, a bios editor, I noticed that when I looked inside, I found several things

CSM1

I include 2 files:

and

and also the software of extract : https://www.mediafire.com/file/ckao23pe57ny7jm/AMIBCP_5.02.0031.rar/file

but nothing that can correspond to something active or inactive... So I think CSM is nothing in the story but more a framebuffer & WEG patch story possibly even a custom WEG patch

Maleficent-Magik commented 1 year ago

so, uh, I managed to get the screenpad touch back xD... so now when I touch the screenpad, it affects the main screen on top... it acts as a trackpad

Maleficent-Magik commented 1 year ago

Hello. Working on the trackpad, (btw, there is a problem with VoodooI2C... (broken button handling in VoodooI2CHID)I'm working on it a bit), I came across a GitHub that makes a command line request:

log show --predicate "processID == 0" --last boot --debug | grep "ERR"

So, I don't understand the processID = 0 corresponds to what, or to whom... but the command is very interesting because it allows to see the logs concerning "AppleIntelCFLGraphicsFramebuffer" ! and personally, I can see errors...

LOG > magik@LAPTOP-58F616EU ~ % log show --predicate "processID == 0" --last boot --debug | grep "ERR" >2022-08-22 21:13:07.518142+0200 0x3fa Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] [AGDC] AGDC not registered. Unmanaged display >2022-08-22 21:13:07.518177+0200 0x3fa Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] FB0 Not waiting for VBL as path state is not active >2022-08-22 21:13:07.524578+0200 0x3fa Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] [AGDC] AGDC not registered. Unmanaged display >2022-08-22 21:13:07.528067+0200 0x3fa Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] [AGDC] AGDC not registered. Unmanaged display >2022-08-22 21:13:07.653565+0200 0x3fa Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] FB1 Not waiting for VBL as path state is not active >2022-08-22 21:13:07.653568+0200 0x3fa Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] FB1 Not waiting for VBL as path state is not active >2022-08-22 21:13:07.653898+0200 0x3fa Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] [AGDC] AGDC not registered. Unmanaged display >2022-08-22 21:13:07.657069+0200 0x3fa Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] [AGDC] AGDC not registered. Unmanaged display >2022-08-22 21:13:07.762062+0200 0x3fa Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] [AGDC] AGDC not registered. Unmanaged display >2022-08-22 21:13:09.131375+0200 0x7d6 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] [doSetPowerState] Returning immediately as current power state is same as new >2022-08-22 21:13:09.131452+0200 0x7d6 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] [doSetPowerState] Returning immediately as current power state is same as new >2022-08-22 21:13:09.131494+0200 0x7d6 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] [doSetPowerState] Returning immediately as current power state is same as new >2022-08-22 21:13:10.369539+0200 0xa01 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] TxnHang1: FB0: IsTransactionComplete called following fakeVBL notification >2022-08-22 21:13:10.470105+0200 0xa09 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] TxnHang1: FB1: IsTransactionComplete called following fakeVBL notification >2022-08-22 21:13:10.482503+0200 0x3fa Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] FB0: Flip called without enabling VBL >2022-08-22 21:13:10.533811+0200 0xa7a Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] FB0: VBlank Timeout Timer called in 51ms - fTransactionState = 0x0, fLiveState = 0x0 fOnline: 1 >2022-08-22 21:13:10.533818+0200 0xa7a Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] Path state is 2 >2022-08-22 21:13:10.534149+0200 0x3fa Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] FB1: Flip called without enabling VBL >2022-08-22 21:13:10.586305+0200 0xa75 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] FB1: VBlank Timeout Timer called in 51ms - fTransactionState = 0x0, fLiveState = 0x0 fOnline: 1 >2022-08-22 21:13:10.586314+0200 0xa75 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] Path state is 2 >2022-08-22 21:13:14.238271+0200 0xa09 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] TxnHang1: FB1: IsTransactionComplete called following fakeVBL notification >2022-08-22 21:13:24.663096+0200 0x1583 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] kHDCP1_DPCD_AN write failed >2022-08-22 21:13:24.663100+0200 0x1583 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] WriteAnAksv failed >magik@LAPTOP-58F616EU ~ %

There are many errors related to the AGDC

but also :

and some other errors... I don't really know what it could be... I'm sharing this in the hope of finding some clues.

Concerning #8, fixing trackpad, I would have to contact VoodooI2C or Qonfused to maybe get a kext? or an aml? I don't know...

(EDIT: The trackpad has 2 buttons, the left one opens the context menu, and the right one clicks at the cursor location... I have to reverse the 2 buttons so...)

Good continuation to all

Qonfused commented 1 year ago

I think that error is related to the HDMI port not reporting a connected display w/ gfxonln=1. The processID == 0 part apparently filters for kernel-only logs. You can also change it to log show --predicate "processID == 0" --last boot --debug | grep ": [IGFB]" to get more graphics related logs including info logs. That makes it much easier to debug the framebuffer using the HDMI port as well.

For the second display, ideally should be something like [Hot_Plug] HPD is high and [Hot_Plug] Setting DP power OK, assuming DP connection somewhere in those logs (I think) if it's detected as a DP display properly. Enabling debug mode for WEG and Lilu w/ boot args -wegdbg -liludbg (also using grep -i WhateverGreen in the command instead) should also help clarify how the second display is being patched, etc if there is an issue aside from macOS behavior. Another method is to put the WhateverGreen kext in ~/Library/Extensions (and also clear kext cache with sudo kextcache -i /).

danperks commented 1 year ago

Not yet up to speed enough on how any of this works, as I've only recently started looking into Hackintosh's as a whole, but if you want anything testing or anything like that, I currently have my UX581 (specifically UX581LV-H2023T) running the Kexts and setup from ShieldCK and am looking for a fix for the bottom screen being garbled too. Will be watching closely and rooting for you! :D

Maleficent-Magik commented 1 year ago

Hey ! happy to see a new person joining the buggy screen adventure (😂), it's completely strange... About me, I went back to law studies (Criminal Law) so I don't really have time to test to see if things really work... so for now, the beta adventure stops for me here ^^' but I'd be happy to help just by giving sources, but I can't test anymore for now

Tristan296 commented 1 year ago

Hey Everyone! I'm studying at University just like you @UsedDiscord, except I'm studying Information Technology. I've got the exact same laptop with the same issue. I have tried fixing the secondary screen by using the Hackintool patcher, however nothing really seems to fix it. IMO we probably have to find how windows can connect to the secondary screen and somehow create a similar patch for macos but I'm not too sure as I'm really just a beginner to all this Hackintosh stuff XD.

Qonfused commented 1 year ago

Hello! I've been a bit busy lately but have been (very slowly) chipping away at this.

@danperks: Not yet up to speed enough on how any of this works, as I've only recently started looking into Hackintosh's as a whole, but if you want anything testing or anything like that, I currently have my UX581 (specifically UX581LV-H2023T) running the Kexts and setup from ShieldCK and am looking for a fix for the bottom screen being garbled too. Will be watching closely and rooting for you! :D

That's interesting. You should have the correct SMBIOS and framebuffer patches using shiecldk's config. Something to test is if HDMI works in macOS and (on windows) if HDMI is routed to the 2060; I think you can check in NVIDIA control panel for the last bit (example). You might also want to check if any thunderbolt ports can connect external displays in Windows but not in macOS.

@Tristan296: IMO we probably have to find how windows can connect to the secondary screen and somehow create a similar patch for macos but I'm not too sure as I'm really just a beginner to all this Hackintosh stuff XD.

As far as I know, it should work plug and play with the correct patching; it should be a normal DisplayPort panel as far as macOS is concerned. Also, some display data could be dumped from Linux (in this post).


As a TLDR of the issue, the display reports the correct power data, display resolution, EDID data, etc. The scrambled display suggested it could potentially be using the wrong clock data, but in my case it appears to use the correct 60 Hz timings (there's also 48 Hz timings for the display, which is why this is relevant). In @VillenaDeveloper's case, they didn't have the correct display resolution reported but had correct EDID data. Aside from the screen static (and not being able to set/see any resolution options in display settings), it would appear to be completely fine; the issue is relatively invisible to other parts of macOS.

Additionally, the HDMI port doesn't detect any displays (either connected before boot or through hotplug). My suspicion is that both the second display and the HDMI connector aren't correctly patched with the WhateverGreen kext (which handles framebuffer patching). There may exist a similar conflict w/ HDMI and/or thunderbolt for @danperks's case. I've detailed various framebuffer patches in #1 that I've tried before, though none fixed the secondary screen's issue and I don't recall any fixing HDMI.

Also, there also doesn't appear to be anything that should make this display incompatible with macOS; whatever is conflicting with the secondary display I reckon must be conflicting with HDMI also, which is addressable with WhateverGreen. I still need to update opencore, kexts, etc in the #update-opencore-config branch, though once I do it should be fully compatible with Monterey and Ventura.

danperks commented 1 year ago

I can test what's handling the HDMI in Windows later today, but I can confirm the thunderbolt port can connect to external displays in both Windows and MacOS as this is how I mainly use it at the moment. USB-C goes into my monitor, which also acts as a dock, passing through 4 USB-As that are plugged straight into the monitor, and that works on both OSs.

I'm also 90% sure the HDMI does work on MacOS, which appears to be different to what you are seeing. Again, can confirm later today.

FYI Still running the config straight from ShieldCK's repo on Monterey with no issues. Didn't even change my ID for Facetime and that all still worked 🤦‍♂️

wern-apfel commented 1 year ago

Do these issues only occur with the UX481 with the nVidia card ? I own the UX481 with Intel GPU, except for the Screenpad almost everything works, not fully tested yet, but apparently most of the patches from my UX434 also work on this laptop.

It is a bit confusing: "What's not working for now

Brightness auto adjustment with ambient sensor Trackpad GPIO mode (haven't looked into this) HDMI port (only if routed to MX 250, which isn't supported by macOS)"

Everything else is working ?? Does this Laptop really have an ambient sensor?

Qonfused commented 1 year ago

Do these issues only occur with the UX481 with the nVidia card ? I own the UX481 with Intel GPU, except for the Screenpad almost everything works, not fully tested yet, but apparently most of the patches from my UX434 also work on this laptop.

Could you double check that you have acceleration? (Check that the dock is transparent and not a solid opaque color) What are you using for your framebuffer patches and boot args?

You can find framebuffer patches under: DeviceProperties > Add > PciRoot(0x0)/Pci(0x2,0x0) and boot args under: NVRAM > Add > 7C436110-AB2A-4BBB-A880-FE41995C9F82 > boot-args


It is a bit confusing: "What's not working for now

Brightness auto adjustment with ambient sensor Trackpad GPIO mode (haven't looked into this) HDMI port (only if routed to MX 250, which isn't supported by macOS)"

Everything else is working ?? Does this Laptop really have an ambient sensor?

I'm not sure there is an ambient light sensor, though I can double check the schematic later (I'm busy at the moment).

It seems that the screenpad plus issue isn't dGPU related (it still affects you without a MX250), and I imagine this means that HDMI also affects you as well. It's probably worth checking if an HDMI display can be detected in macOS by your machine, though I wouldn't expect any success.

wern-apfel commented 1 year ago

I don't use GFX related boot-args, device-properties, see screenshot. I couldn't see any brightness change when using Windows, so I guess there is no ambient sensor. HDMI works. The Trackpad also works in GPIO mode, but only left click for both buttons.

A lot of informations here, I need to do some reading, I just saw "What's not working for now" and thought everything else is working. dev_prop

Qonfused commented 1 year ago

The main functional difference I can see is the different busid for con2 and that you've disabled con1 (the screenpad plus). The platform-id is different (default for the device-id); this is a functional change so I will have to test using this platform-id to try and reproduce this. I don't think the GfxYTile attribute is doing anything here though I also don't see anything about it in the Whatevergreen documentation.

danperks commented 1 year ago

The main functional difference I can see is the different busid for con2 and that you've disabled con1 (the screenpad plus).

Hackintosh noob and off topic but would disabling con1 stop the Screenpad from flickering and showing the garbled data? Currently very distracting when I'm using it 😂

As before, happy to test anything you smart people come up with.

Qonfused commented 1 year ago

I thought it would but it doesn't appear to; I don't think I've tried the same approach w/ changing the index of the connector at all like what wern-apfel is using, so maybe fiddling with that can yield different results?

I did find https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/pull/1#issuecomment-1207287705 which stopped the static (the backlight is still on but it's just black).

Edit: fixed comment link

danperks commented 1 year ago

Fantastic, will definitely be getting that in the go tomorrow, thanks!

wern-apfel commented 1 year ago

As already mentioned, I used the EFI from my UX434 where the Screenpad (can be turned on and off) + HDMI works. So far I have only made a few adjustments, apparently only the Screepad does not work (shows me a white noise, you probably have the same behaviour) As @danperks suspects, I disabled the 2nd port to stop the Screenpad flickering. The backlight is also switched off (can also be changed) Disabling the Screenpad does not enable HDMI, in my experience (Dell Laptops) the HDMI port is tied to the Nvidia card when present. Since you disabled the Nvidia card, HDMI will probably not work (only a guess). This platform-id worked on the UX434 and seems to be suitable for the UX481 as well. GfxYTile was used on my previous machine, and can be removed. I prefer to use the device-properties i'ts easier to know where it belongs.

I think quoting is better, but I need to see how it works.

Qonfused commented 1 year ago

The screenpad plus and HDMI are connected to the iGPU (confirmed through the device schematic in https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/pull/1#issuecomment-1207468579). It's not uncommon for them to be hardwired to the dGPU on laptops though. I had originally thought HDMI being broken was a symptom of the scrambing static behavior of the screenpad, since the screenpad appears to have valid EDID and clock data (otherwise it should just be a black screen).

I'll probably move away from using boot-args for things like the RPS patch since I agree with making the framebuffer patches less scattered.

danperks commented 1 year ago

Still don't understand about 30% of the words you lot are saying, but FYI my HDMI works fine, even with the bottom screen flickering.

How did you disable the bottom screen and the backlight? @wern-apfel

wern-apfel commented 1 year ago

I've only owned the machine for two days, so I can't say that much about it yet. @Qonfused HDMI works regardless of whether the Screenpad is disabled or not. @danperks I disabled the port, and the backlight via ACPI code SSDT. If you want you can try the EFI from my repository (I hope it works), just make sure you modify the Serial MLB... if you use apple services.

wern-apfel commented 1 year ago

Have you tried it with the whole EFI? It would be cool if you try it to see what does not work but worked with yours.

You probably only need the DDGPU SSDT to disable the Nvidia card, and the Monterey Airport kext, I only used BigSur at the beginning and then upgraded to Ventura

Qonfused commented 1 year ago

I tried the framebuffer patch with my whole config though I had no dice there. I can also try your config just to see if I can reproduce as-is (probably should have started there anyways).

I noticed a lot of inconsistencies from the base plist with my current config that I couldn't explain; I'll need to go through the same process in #10 for the previous version of opencore to properly base changes between the two opencore versions. It's easier to compare the updated config with yours since they should match more closely in plist schema and kext version.

Qonfused commented 1 year ago

I think I've already mentioned this somewhere, but it's possible that if this is a CSM issue that the only way to resolve this is through this method of patching the sync width to 100. There doesn't appear to be any means of changing CSM in the BIOS (unless I can figure out where it is w/ grubmod.efi).

Qonfused commented 1 year ago

Current issues:

Resolution is however reported correctly in System Information, and it is attached to con1 in IORegistryExplorer as an external display.

wern-apfel commented 1 year ago

I changed the sync width to 100 but it doesn't change anything. Nothing found about CSM in the extracted BIOS setup. It seems that about this Mac calculates the display size only for known sizes. about

Qonfused commented 1 year ago

@wern-apfel Were you able to change the resolution of the second display?

Qonfused commented 1 year ago

This might also be applicable then: https://www.tonymacx86.com/threads/adding-using-hidpi-custom-resolutions.133254/

Seems it's no longer possible to modify permissions for /System/Library/.... This is the resulting folder+plist w/o the HiDPI fix (irrelevant in our case): DisplayVendorID-9e5.zip

wern-apfel commented 1 year ago

There are only two resolutions: 1920x515 and 1280x720. When the manufacturer ID is faked to an Apple display ID, there are many resolutions, but non of them work. When the default resolution is 4:3, the Screenpad doesn't flicker, but the screen is black. I think the Screenpad is disabled by the ACPI code, I'm working on it right now, it's a little different than the UX434. At the moment I can only control the brightness. iMac_display

Qonfused commented 1 year ago

There are only two resolutions: 1920x515 and 1280x720. When the manufacturer ID is faked to an Apple display ID, there are many resolutions, but non of them work. When the default resolution is 4:3, the Screenpad doesn't flicker, but the screen is black.

I've noticed similar behavior as well; it seems to be sent the wrong resolution data whenever the framebuffer is attached. Did you modify the name of the display or did it detect the name as 'BOE HF' by default?

I think the Screenpad is disabled by the ACPI code, I'm working on it right now, it's a little different than the UX434.

Are you referring to one of the SSDTs in the EFI or the firmware? These are the only direct mentions of the screenpad in firmware (Resources/Firmware/DSDT.dsl):

58    | External (_SB_.PCI0.GFX0.DD1F, DeviceObj)
...   |
21543 | Method (BRTN, 1, Serialized)
21544 |    {
21545 |        If (((DIDX & 0x0F00) == 0x0400))
21546 |        {
21547 |            Notify (\_SB.PCI0.GFX0.DD1F, Arg0)
21548 |        }
21549 |    }

I'm not sure what key/button (BRTN) this is triggered for, though this seems to be related to backlight control of the display? DIDX contains the ID of the panel (functioning as eDP).

At the moment I can only control the brightness. This is for the screenpad plus ('BOE HF' in your case), correct?

wern-apfel commented 1 year ago

I refer to the DSDT, WMI device: WMB method. The Screenpad is controlled there, as well as the FN keys. FN key lock works, turn Screenpad on and off (for now brightness at 0 means off) brightness in 5 levels. On the UX434, the Screenpad can be turned off completely, meaning the port is disabled, which is what I'm looking for.

wern-apfel commented 1 year ago

Did you modify the name of the display or did it detect the name as 'BOE HF' by default?

The EDID is wrong for both displays, the name is a data string instead of product name, that's what I changed and also the reason why it says unknown monitor.

Seems it's no longer possible to modify permissions for /System/Library/.... This is the resulting folder+plist w/o the HiDPI fix (irrelevant in our case): DisplayVendorID-9e5.zip

This still works, make the folder /Library/Displays/Contents/Resources/Overrides/DisplayVendorID-...