Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDMI with audio #28

Open
lvs1974 opened this issue Mar 6, 2020 · 24 comments
Open

HDMI with audio #28

lvs1974 opened this issue Mar 6, 2020 · 24 comments

Comments

@lvs1974
Copy link

lvs1974 commented Mar 6, 2020

Here we can start a discussion about available HDMI fixes.
AppleALC does not provide any fixes for 8086:A348. Before there was fix replacing 709D0000 to 48A30000, but since 10.14 started to support A348 natively, fix was turned off. Anyway, even with this fix HDMI Audio does not work.
We have a few possible solutions which I would like to discuss here later.

But first of all there is a question: in Readme.md for this project stated:
"HDMI work (With audio if boot with pluged HDMI)".

The source guide how to get HDMI Audio working:
[Guide] Enable Intel IGPU HDMI/DP Audio (Sandy/Ivy/Haswell/Broadwell/Skylake/Kaby Lake/Kaby Lake-R)

@tctien342: is it true? When and how did it work? Could you give a bit more details, please?

@tctien342
Copy link
Owner

@lvs1974 , on stock config without any fixed for HDMI audio, follow step:

  • Boot to macos
  • Plug HDMI to external monitor
  • Close laptop lid an using only external monitor (screen in laptop complete disabled)
  • Reboot while using external monitor -> after boot up the hdmi will usable and stable ( internal screen compete disabled in this stage even open lid)

@lvs1974
Copy link
Author

lvs1974 commented Mar 6, 2020

@tctien342, thank you for the information! It would be hard to guess!

So, now we have another fix, but it requires sleep/wake trick.
The fix is quite simple: in AppleHDAController we need replace all occurrences of 709D0000 with 48A30000. FakePCIID is not needed.

We have many possibilities to do this:

  • We can patch com.apple.driver.AppleHDAController in OpenCore for all occurences
  • We can selectively patch only required occurences in _ZN18AppleHDAController20framebufferEventGateEPvP13IOFramebufferiS0 and in __ZN18AppleHDAController26controllerSpecificFeaturesEv (using keyword Base for specifying method name)
  • We can do these fixes in acidanthera AppleALC, but there is a problem: this fix does not provide "clean" result, since sleep/wake trick is needed. And we don't know how this fix will work on different hardware.
  • We can do these fixes in your own AppleALC which is used in this project

But the simplest solution is using OpenCore to patch AppleHDAController.

  • We will never get any conflicts via merging AppleALC from acidanthera to your branch (Controllers.plist)
  • Rebuild is not required
  • Your repository represents a whole EFI folder as a "solution", so anyway these patches will be in place

@tctien342
Copy link
Owner

@lvs1974 did you try to patch AppleHDAController using OpenCore yet?

@lvs1974
Copy link
Author

lvs1974 commented Mar 6, 2020

@lvs1974 did you try to patch AppleHDAController using OpenCore yet?

Yes, sure. It works.

@lvs1974
Copy link
Author

lvs1974 commented Mar 7, 2020

@tctien342, I saw you mentioned in experimental branch update a special build AppleALC supporting alc-device-id and alc-vendor-id for spoof HDMI audio.
But you can use a standard AppleALC and OpenCore patch:
com.apple.driver.AppleHDAController
Find: 709D0000
Replace: 48A30000
It is much better and simpler.

@tctien342
Copy link
Owner

@lvs1974 okay, thank you :)) ,just testing build's script, will add this to build, but above patch can be use in clover too ?

@lvs1974
Copy link
Author

lvs1974 commented Mar 7, 2020

@tctien342, yes, sure! In Clover also!

@tctien342
Copy link
Owner

@lvs1974 okay, thanks u

@lvs1974
Copy link
Author

lvs1974 commented Mar 8, 2020

@tctien342: I was wrong. I tested it many times, and unfortunately binary patches in OpenCore (and I suppose in clover) do not work.
Probably this issue is related to AppleALC, it patches AppleHDAController anyway...
So, the only stable way - add our patch into Conrollers.plist and re-build AppleALC.
Sorry for the inconvenience!
Below you will find attached examples:
Only1_Controllers.plist - only one patch for our controller, I think this file can replace Controllers.plist in AppleALC and it should be enough.
Controllers.plist - full list of patches.
One more possible solution: in Controllers.plist find existing entry for device 41800, an in first patch for key "FInd" replace value 0x70a10000 with 0x709D0000 and clear MaxKernel. Then remove the second patch.

Only1_Controllers.plist.zip

Controllers.plist.zip

@tctien342
Copy link
Owner

@lvs1974 i think combojack fix now work with stock applealc, how about stock apple alc + Fakepciid ?

@lvs1974
Copy link
Author

lvs1974 commented Mar 9, 2020

@tctien342, I would prefer do not use FakePCIID.
If you use build script anyway, you can clone AppleALC from acidanthera, replace strings in Controllers.plist (for the second patch you can set MinKernel to 50) and build it with xcodebuild.

For FakePCIID:

  • 2 new kexts in bootloader config
  • additional trick is needed: either add property device-id or change Info.plist in FakePCIID_Intel_HDMI_Audio.kext

It is bad to use such "hacky" way if AppleALC can do it for us.

@tctien342
Copy link
Owner

@lvs1974 seem like HDMI audio not work anymore in 10.15.6 and 11, can u check this?

@lvs1974
Copy link
Author

lvs1974 commented Sep 10, 2020

@tctien342: I did not check yet, will do it later.

But: I don't use patch for AppleHDAController in OpenCore any more, since it is unstable.
Instead I patch Resources/Controllers.plist in AppleALC, and patch a bit different.
And it works steady in all macOS.

mypatch_extended.patch.zip

Screenshot 2020-09-10 at 08 49 14

Off-topic:

  • Why did you change a model from MacBookPro15,3 to MacBookPro15,2?
  • Do you still use 10.15.4 or 10.15.6?

I have to switch to Mojave 10.14.6: it is more stable, and GPU frequency does not stuck (without Apple GuC).
In 10.15.6 or 11.0 GPU frequency stuck sometimes and I have to reboot.

@tctien342
Copy link
Owner

tctien342 commented Sep 10, 2020

  • I tried to see if 15,2 have better battery management than 15,3.
    • Found that disabled thunderbolt will make total idle power around 8W, same as windows
  • Currently, I use SMBIOS 16,1 in MacOS 11 beta 6
  • And yep, GPU suck in 10.15 and 11 :)), after deep sleep, freq will suck at 350hz

@lvs1974
Copy link
Author

lvs1974 commented Sep 10, 2020

@tctien342: so, it really gives a better battery management in 15,2?
Or disabling of thunderbolt completely is quite enough?

@tctien342
Copy link
Owner

@tctien342: so, it really gives a better battery management in 15,2?
Or disabling of thunderbolt completely is quite enough?

Disabled thunderbolt is enough

@lvs1974
Copy link
Author

lvs1974 commented Sep 10, 2020

@tctien342: could you specify here what exactly has to be switched off for thunderbolt, please?
There are so many settings for thunderbolt...
And will USB-type C 10 Gb port work after disabling?

@tctien342
Copy link
Owner

tctien342 commented Sep 10, 2020

Sys config => thunder auto sw => disabled auto sw and select bios assist

@lvs1974
Copy link
Author

lvs1974 commented Sep 10, 2020

In Mojave battery management is a bit better OOB.
And everything is ok with GPU.
I am also worried about battery drain during sleep: 7-8% per 12 hours...

@lvs1974
Copy link
Author

lvs1974 commented Sep 10, 2020

@tctien342: interesting observation:
Catalina 10.15.6 with disabled thunderbolt is equal to Mojave 10.14.6 with fully enabled thunderbolt in terms of battery management.
So, in Catalina I could feel a difference after disabling thunderbolt, in Mojave - there is no difference.

It seems Mojave - is the last stable and power conservative OS.

@tctien342
Copy link
Owner

@lvs1974 , yep catalina is suck :))), event in Big Sur still have this bug. Maybe they have some big change with thunderbolt driver

@lvs1974
Copy link
Author

lvs1974 commented Sep 11, 2020

@tctien342: HDMI audio works if AAPL,ig-platform-id is <00009b3e>.
With value <0900A53E> it does not work.

@lvs1974
Copy link
Author

lvs1974 commented Sep 25, 2020

@tctien342: did you manage to get HDMI audio working with AAPL,ig-platform-id = 00009b3e? On README.md you wrote it is dead since 10.15.6 event 11.
What does it mean?

@tctien342
Copy link
Owner

tctien342 commented Sep 26, 2020

@tctien342: did you manage to get HDMI audio working with AAPL,ig-platform-id = 00009b3e? On README.md you wrote it is dead since 10.15.6 event 11.
What does it mean?

It working now, no need to change AAPL, only AppleALC with your patch is enough, 00009b3e make my laptop usually dark screen after sleep

I think HDMI dead from 10.15.6 due to opencore cant patch the fix then it dead :))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants