bavariancake / XPS9570-macOS

macOS Mojave/Catalina on Dell XPS 9570.
263 stars 45 forks source link

Audio over HDMI #42

Open adityahota opened 4 years ago

adityahota commented 4 years ago

Hi @bavariancake, in your readme you mention that audio over HDMI does not work since it is dependent on a graphics fix. I have been attempting to get it working (with this EFI and lulettersoul's EFI) to no avail. lulettersoul's EFI has the SSDT-HDEF and SSDT-HDAU files, which appear to be the same ones as from 9560 EFIs.

However, I was also reading the guides for WhateverGreen and AppleALC, and they say that none of these patches are needed--only the layout ID needs to be specified in AppleALC, and then HDMI audio will work.

Despite this, I still am not able to get HDMI audio working. Do you know of where we could look at next steps to tackle this issue? This is the last major caveat with MacOS on the 9570 so getting it resolved would be amazing.

Thank you for all your hard work in getting macOS to work on our 9570s!

bavariancake commented 4 years ago

I haven't updated that section of the readme, since the graphics fix is already done of course, but I haven't spent much time testing HDMI audio. During some of the initial HDMI graphics testing I was using a 1080p TV, and on one single boot, I saw a Samsung TV show up as an audio device! I didn't test it at the time.

The SMBIOS section of config.plist will be interesting, because (I think) the main difference between this repo and @LuletterSoul are the features enabled by that section. His has sleep working (because USB doesn't KP on the way to/from sleep) and he has audio working with a layout-id that produces only distorted sound with this repo's config.plist. I think various drivers/hardware feature sets are used by the OS based on these SMBIOS definitions. I've been working on reducing the differences between LuletterSoul's repo and mine to get sleep and audio to work without adding any unnecessary changes.

So it's possible that these SMBIOS definitions say: "hey, there's no HDMI out on this device, don't bother with HDMI audio", just like they do for enabling HDMI video out (see agdpmod=vit9696 boot arg to fix this for video). In the same way, these definitions seem to make or break audio output with layout-id=30 for example. It's not clear to me what type of Mac these definitions in LuletterSoul's repo came from, or what they should be for e.g. HDMI audio. I'd try a set of values for a 2012 MacBook Pro (with HDMI out) for example.

If anyone else has a better understanding of the SMBIOS section, or any corrections to what I wrote above, please leave a comment 😊

The SSDT-HDEF and SSDT-HDAU ACPI patches are no longer needed, since AppleALC does the renames automatically, and HDAU is only for older architectures. I try to keep my repo small and eliminate anything that's not actually necessary to make it a little easier to debug issues.

I would also check out a debug build of WhateverGreen with the -igfxi2cdbg boot argument to log I2C transactions that are happening over HDMI, since for any HDMI audio to work, the display needs to advertise that it supports an audio channel. @0xFireWolf implemented LSPCON support in WhateverGreen, so he'd probably know more about this than anyone.

Let me know if you make any progress on this! Would be interesting to see if we can get this to work.

Oh, and I'm glad my repo has helped you!!

adityahota commented 4 years ago

Hey! Thank you so much for your response. It's interesting how the TV showed up as an audio source for one boot--do you mean it only worked once and hasn't shown up since? I was reading on a 9560 guide that HDIMI audio works but only at 1080p so I'm wondering if that has something to do with it.

I was looking at RehabMan's guide for HDMI audio on TonyMacx86 and it said to look in IO registry explorer and see if the connector type was 08000000 (meaning HDMI) and it looks like the WEG patch to make the output look like HDMI (instead of DP) is working. So it looks like all the conditions for WEG and AppleALC are satisfied. I removed all patches and followed the guide to make modifications (but still kept MacBookPro 15,1 -- 2018 Pro in the SMBIOS -- I haven't tested 2012 Pro yet) and it didn't work. When I get a chance I can try with a different SMBIOS. Better yet, I'll try with a fresh install and vanilla EFI to see if I can get this working.

Thanks again! Let me know if there is anything I can help you test!

yongjiajun commented 4 years ago

Hey @adityahota, any progress on this?

adityahota commented 4 years ago

Unfortunately not. I’ve tried several different guides to no avail. I’m not sure how it works on the 9560 but not the 9570. @bavariancake , were you able to gain any insight into this?

I tried RehabMan’s guide and different layout IDs but no luck.

bavariancake commented 4 years ago

I noticed that intermittently AppleALC won't configure the audio output correctly and no audio device will show up at all. On one single boot however, I noticed there were two audio devices - one of them being my monitor (via HDMI). I tried the monitor output, and it actually worked. Still have no idea how to get this to work all the time.

M69W commented 4 years ago

I noticed that intermittently AppleALC won't configure the audio output correctly and no audio device will show up at all. On one single boot however, I noticed there were two audio devices - one of them being my monitor (via HDMI). I tried the monitor output, and it actually worked. Still have no idea how to get this to work all the time.

https://github.com/xxxzc/xps15-9570-macos/issues/12

need device-idFakePCIID.kext and FakePCIID_Intel_HDMI_Audio.kext

rawrrencee commented 4 years ago

Can confirm adding <key>device-id</key><data>cKEAAA==</data> to the current "Devices">"Properties" key https://github.com/bavariancake/XPS9570-macOS/blob/5d9bb603c07ed6ce4d75464781a019a93b6f93ac/EFI/CLOVER/config.plist#L217 in config.plist, along with changing layout-id to "72" will allow HDMI audio to work reliably in Catalina. (NOTE: As mentioned above, the FakePCIID.kext and FakePCIID_Intel_HDMI_Audio.kext are required as well. Review the mentioned link https://github.com/xxxzc/xps15-9570-macos/issues/12#issuecomment-583803538 above to get the downloads from Rehabman https://bitbucket.org/RehabMan/os-x-fake-pci-id/downloads/)

image

duongleh commented 4 years ago

Can confirm adding <key>device-id</key><data>cKEAAA==</data> to the current "Devices">"Properties" key

https://github.com/bavariancake/XPS9570-macOS/blob/5d9bb603c07ed6ce4d75464781a019a93b6f93ac/EFI/CLOVER/config.plist#L217

in config.plist, along with changing layout-id to "72" will allow HDMI audio to work reliably in Catalina. image

Please open a pull request

rawrrencee commented 4 years ago

Can confirm adding <key>device-id</key><data>cKEAAA==</data> to the current "Devices">"Properties" key https://github.com/bavariancake/XPS9570-macOS/blob/5d9bb603c07ed6ce4d75464781a019a93b6f93ac/EFI/CLOVER/config.plist#L217

in config.plist, along with changing layout-id to "72" will allow HDMI audio to work reliably in Catalina. image

Please open a pull request

Please note that layout-id should not be changed to "72", it should remain as "30". Changing it to "72" will result in glitches over headphone. "30" will have good audio on both HDMI and headphones. Also, since I wasn't the one who wrote the code I'm not sure it's right for me to make a pull request :)

adityahota commented 4 years ago

@rawrrencee The issue with layout 30 is that on the i7 8750H model, kernel_task starts using like 30% CPU constantly after waking up from sleep. At least that was my experience back in August.

rawrrencee commented 4 years ago

@rawrrencee The issue with layout 30 is that on the i7 8750H model, kernel_task starts using like 30% CPU constantly after waking up from sleep. At least that was my experience back in August.

I set my macbook to never sleep though because I am usually shutting it down before I leave the area I'm in/its constantly plugged in. I also read somewhere that kernel_task % might be attributed to the polling rate of the touch screen, so it might decrease if you disable the touchscreen. But I cannot be sure

Alex74743 commented 4 years ago

Hi guys,

I'm new to the scene here and really loving the EFI.

I have the non-touch 1080p model. How do I ensure that the polling mode is set to non-touch?

In addition, do I need to update the kexts in clover whenever there's an update available for them, or should I wait until the kexts are updated on GitHub?

Thanks in advance

bavariancake commented 4 years ago

I have the non-touch 1080p model. How do I ensure that the polling mode is set to non-touch?

My guess is that model won't have a touchscreen controller built-in, so you probably don't have to do anything. You could always comment out the sections EFI/CLOVER/ACPI/patched/SSDT-I2C.dsl referring to TPL1, then recompile to create a new SSDT-I2C.aml file in the same folder (see documentation in this repo about iasl).

If you do find there's a difference by disabling the touchscreen stuff, let me know and I'll add it to the documentation.

In addition, do I need to update the kexts in clover whenever there's an update available for them, or should I wait until the kexts are updated on GitHub?

You could do it either way. I provide a set of kexts that I've tested together, but if you find that a new kext gives you something that you weren't getting before, you can always try new versions yourself. If a new version of a kext does give you something new / better stability / etc., a pull request is always appreciated.

bavariancake commented 4 years ago

@rawrrencee The issue with layout 30 is that on the i7 8750H model, kernel_task starts using like 30% CPU constantly after waking up from sleep. At least that was my experience back in August.

So it seems like there isn't one config that fixes all audio problems for HDMI/headphones/no kernel_task stuff. I don't have too much time to dig into this and figure this out properly (which probably requires changing something in AppleALC by creating a new config or whatever), but it would be great to get this working once and for all.

If someone wants to solve this problem, I will pay them $150 to do it. If someone helps by testing this thoroughly, I'll also pay that person $100. I may even award some smaller amounts for other people helping and testing and what not.

The goal would be to make all audio related items work:

Hopefully someone will be interested enough to take a look at this and fix it so we can all have good audio! 😬