ananjaser1211 / Opencore-HP-Pavilion-Gaming-15-cx0056wm

Opencore Hackintosh Monterey/Ventura - HP Pavilion Gaming 15-cx0056wm
16 stars 7 forks source link

HDMI through USB-C port #5

Open freakyappleman opened 2 years ago

freakyappleman commented 2 years ago

I have an HP Gaming 15-cx0007nl laptop and currently using your EFI's to boot. Regarding the HDMI out issue it won't work through the physical hdmi out port but it will work with an usb-c to hdmi converter, so this explains that at least in my case (but I guess in all 15-cx0 platforms) the usb-c is linked to the igpu. Only issue know is trying to get sound working out of the hdmi. I don't know if I am posting this in the right place (first time ever on github) but I can't thank you enough for sharing this.

freakyappleman commented 2 years ago

I have rebooted the system and hdmi output sound works. When having the lid closed and booting up the system it will work fine for a few seconds but then it will result in a glitchy green screen. To solved this I have to open the lid, wait for the image to go back on the external monitor, close the lid back again and works perfectly.

ananjaser1211 commented 2 years ago

Hello mate, glad to know that the USB-C port is linked to the iGPU, had my doubts but i have yet to purchase a type c > hdmi dongle.

it might be possible that we need common iGPU patches for hdmi audio out, such as

                <key>hda-gfx</key>
                <string>onboard-1</string>

Which is said to enable Audio output through the igpu video out, it can be added after this property

@SkyrilHD extra Ideas are welcomed

ill try and get my hands on an adapter to test out TypeC, it is a great alternative, Thanks for sharing your findings

freakyappleman commented 2 years ago

No problem I am looking forward to build this project properly, every time I encounter issues I am going to share for sure. Anyways I have noticed that there is a time limit to the usb, looks like after a while of usage ONLY when the monitor connected something gets messed up and makes them not working, except for video out through the usb c to hdmi adapter (sound should be coming out as well). This may be due because of usbc drivers messing up or my keyboard (don't have a chance to try a different keyboard, currently using a Logitech G215) which sometimes gets locked for some reason and need to be unplugged and replugged to make it work again, but won't work in this case tho :(. Anyways it's important to notice that usb kexts may not be able to handle errors. For your information I am using a CFG locked BIOS, the only options I have changed are boot entry order and of course disabled secure boot and quick boot, if that helps.

SkyrilHD commented 2 years ago

Since I don't have any hacks with a Type C port, I cannot really comment about that.

But I have a few ideas regarding my experience with my Broadwell hack with a physical HDMI port. Some of Dell Broadwell Latitudes have broken HDMI Audio, while some (like mine) have working HDMI Audio without any modifications. The solution for that is to patch the framebuffer connector. These two commits should enable HDMI Audio (at least on physical HDMI port): 1 and 2

To determine which connector needs to be patched, one can do so using IORegistryExplorer. image Basically, this screenshot is from my laptop and one can see that on "connector" 0, there is an internal display. When you connect an HDMI cable, another display entry should be shown. Except AppleBacklightDisplay, there should be just "AppleDisplay". Typically, it is either AppleIntelFramebuffer@1 or AppleIntelFramebuffer@2. If it is 2, then change the connector patch to 2 as well.

Lastly, I want to note that the framebuffer-con1-type should be tested with <00 04 00 00> first, as it is the connector for DisplayPort (which Type C ports are internally). If it still does not work, setting to <00 08 00 00> (like the commit, I linked) might fix it, as it is used for HDMI.

The ˙hda-gfx˙ property is not needed, as AppleALC injects it automatically.

freakyappleman commented 2 years ago

Hello @SkyrilHD , thak you for your suggestions to solve the problem, I have tried editing the config.plist (it's the same that can be found under this topic since IORegistryExplorer doesn't allow me to edit the string (it will let me select but when I try to change the values it goes back to original ones. I have no experience with this program btw). I am currently using a usb-c to hdmi adapter, tried multiple ones (Trust and Aukey(looks the exact same except this one is a different brand) if this is of any help). As you can see from the picture below AppleDisplay appears under AppleIntelFramebuffer@1 with IODisplayConnectFlags <00 00 00 00>. Schermata 2022-02-03 alle 19 40 34

Instead after looking inside AppleIntelFramebuffer@1 the connector-type field is shown as being set to DisplayPort <00 04 00 00> Schermata 2022-02-03 alle 19 40 18 I have tried editing the config.plist to insert the strings, keys and data tags manually but it doesn't seem to make a difference in my case since I couldn't find a string tag containing the iGPU field as shown in your shared link.

Anyways I have tried solving the problem by using an external usb soundcard (Behringer UFO 202 to be more specific) but seems to be causing problems with the display, going out of sync when changing volume levels (may be a grounding problem, not software related since I had kind of the same issues with windows when multi displaying).

Sorry for having been so long about this but I wanted to be really specific, thank you both in advance @SkyrilHD & @ananjaser1211 for your tough collaboration :-) .

SkyrilHD commented 2 years ago

IORegistryExplorer only shows services about the system. You cannot modify anything, hence the editing does not work. That's why we use DeviceProperties patches to inject/modify a property into the OS.

When I use an external display, my IODisplayConnectFlags is also set at <00 00 00 00>. Seems like this is normal. image Since I don't use any patches for the connector, my connector-type is also set to <00 04 00 00>. If you add framebuffer-con1-enable and set the exact framebuffer-con1-type as mentioned in the commit, check if the connector-type changes as well (should be <00 08 00 00>).

BTW, did you try with another display if the issue persists?

freakyappleman commented 2 years ago

I finally got to test another display and this time I still get a green screen on boot, I have to do the open and close lid procedure to "patch" the issue. This time around used a different keyboard and mouse which seems to have solved the freezing USB issue as well, I am very convinced it was my Logitech g215 keyboard to make it crash. I have still not figured out how to modify arguments with DeviceProperties ( I have never patched anything on macOS, just used @SkyrilHD EFI to boot and run the system). Therefore my question is, would it be possible for @SkyrilHD to patch this issue for me so that I can test it out and give feedback please? I don't want to be asking a lot but if 75hz refresh rate could be possible, could it please be enabled as well. Thank you very much again for all your help : ) .

darkexone commented 1 year ago

Hi there, I have similar HP model 15-cx0026nl with i7-8750h (Coffee Lake H) and UHD 630 running Ventura on OC 0.8.5 (note that my README doesn't look as good as yours yet).

I recently discovered that USB-C is also a video output (you can check at HP page that this port is data only X D) and it works with my AORUS FI32U connected via USB-C <-> USB-C cable at max resolution 1440p@144Hz. The interesting part for you is that audio output via DP is working.

Feel free to ask for IORegistryExplorer screenshots but tell me what to look for :smiley:

System report > Audio (in Polish):

DisplayPort:

  Domyślne urządzenie wyjściowe:        Tak
  Domyślne systemowe urządzenie wyjściowe:  Tak
  Producent:                    Apple Inc.
  Kanały wyjściowe:             2
  Bieżąca częstotliwość próbkowania:        48000
  Transport:                    DisplayPort
  Źródło wyjścia:               AORUS FI32U

image image image

MazenYasser commented 1 month ago

So it works with a C to C cable? But does this disable the internal display? Or can you run both displays at the same time?

freakyappleman commented 1 month ago

Both displays are enabled as far as I remember. I don't have it anymore, so I can't test it, sorry...