toleda / audio_CloverALC

macOS Realtek ALC onboard audio with Clover
679 stars 109 forks source link

ALC1220 support #95

Open NewsGuyTor opened 7 years ago

NewsGuyTor commented 7 years ago

Most of the new Z270 (Kaby Lake) motherboards feature an improved version of the Realtek ALC audio codec, the ALC1220.

I would love to see audio_CloverALC/audio_RealtekALC support it. 👍

I've got my Hackintosh up and running, the only thing missing is the sound support, so I can be of assistance if you need me to dump files/run commands in order to help you add support for it. :)

toleda commented 7 years ago

Working on it. No ETA at this time.

NewsGuyTor commented 7 years ago

Do you need a codec dump?

robingoh commented 7 years ago

Hi Toleda, Do you have any advice on how to work on audio codecs for hackintosh? Thank you!

toleda commented 7 years ago

@NewsGuyTor: have a 1220 codec dump

@robingoh: Best advice, however, the site disappeared years ago: THe KiNG: [HOW TO] Patch AppleHDA - Knowledge Base - Project OS X Forums. Search on the title for copies.

ghost commented 7 years ago

Hi Toleda, I thought this might help. Its the ALC 1220 patch for the linux ALSA sound driver. Looks like they are using the same patch as for ALC882: alsa.patch.zip

toleda commented 7 years ago

Won't work, device_id of ALC1220 is not 0x10ec1220

kristofferR commented 7 years ago

This works fine, maybe you can use it to implement support into CloverALC: http://www.insanelymac.com/forum/files/file/693-applehda-for-realtek-alc1220-10123

toleda commented 7 years ago

Not interested in another's work.
Try: https://github.com/toleda/audio_alc_test/blob/master/audio_cloverALC-1220-120.command.zip

kanwei commented 7 years ago

This did not work for me with an Asus board with the 1168 codec. The devices are shown correctly, but no sound coming from the speakers.

toleda commented 7 years ago

What is connected to what? Selected audio device? What app is playing? macOS version? README/F. Problem Reporting/Files?

kanwei commented 7 years ago

Specs: Sierra 10.12.3 ASUS Z270I-STRIX (S1220A codec) Audio correctly injected via SSDT-HDEF-HDAS-1.aml

What works: http://www.insanelymac.com/forum/topic/321300-native-alc1220-audio-for-200-series-motherboards/ Adding these 3 patches + installing kext to /S/L/E creates fully working audio.

What doesn't work I undid all the steps for the above, ran the command you just posted, and it ran successfully. After restart, all the devices are shown in Sound pref panel, but no audio coming from Internal Speakers when playing music or youtube. Spotify says "Can't play file"

Attached relevant files in zip. Note that Ioreg info is with "What works" applied.

Z270i.zip

toleda commented 7 years ago

You linked to a thief, my work. You have the 0x1168 (Strix/S1220), not 0x1220 (Maximus/S1220A) "What works" is useless; no problem to fix. Attach "doesn't work" files.

kanwei commented 7 years ago

Hey toleda,

I have no idea what the politics behind all this is... it was just a solution I found and it worked for me.

Anyway, here are two more IOReg files. One is clean with no audio kext patches and no .kext files, the other is after running your 1.0f script. Yes, I am aware that it's for deviceid 0x1168 but the S1220(A) nomenclature was confusing.

Thanks for the help. Z270i_2.zip

toleda commented 7 years ago

All audio devices show. Add 200 series controller patch. If still not working, attach script output, config.plist, Clover boot log and IOReg; all from the same boot.

kanwei commented 7 years ago

Thanks for the suggestion! It started working when adding this :)

<dict>
    <key>Comment</key>
    <string>200 Series Audio Controller patch</string>
    <key>Find</key>
    <data>
    cKE=
    </data>
    <key>Name</key>
    <string>AppleHDAController</string>
    <key>Replace</key>
    <data>
    8KI=
    </data>
</dict>
ghost commented 7 years ago

@toleda, Perhaps if you took the time to read the above linked post you would hesitate before calling me a thief. I credit you for the work in the very first sentence of that post and make no claim to be the author. All I did was tweak it a little. I'm sorry if this has caused offence but it would make more sense to make the accusation directly to the person concerned (me) rather than posting it in response to another persons enquiry.

toleda commented 7 years ago

@dgsga This was very surprising as I value and respect your contributions. As you previously posted to this thread with insight to a solution, a post on this thread with your solution was expected. A link to file sources is often appropriate credit. 1150 deja vu.

ghost commented 7 years ago

Hi Toleda, Thanks for the reply, I certainly value all the work you've done for the community and my ethos is very much about helping each other to solve problems. I'll certainly link to file sources in future.

NewsGuyTor commented 7 years ago

Awesome toleda, works perfectly! Sorry to pester you more, but could you also update audio_CloverHDMI with these patches?

toleda commented 7 years ago

@NewsGuyTor audio_CloverHDMI does not touch the ALC1220 Post HDMI audio issues to https://github.com/toleda/audio_CloverHDMI Attach an IOReg

NewsGuyTor commented 7 years ago

Ah, sorry, I meant supporting the 200-series motherboards in the script.

toleda commented 7 years ago

Script updated for 200 Series audio support. Recognize the patch is temporary.

kanwei commented 7 years ago

Hey @toleda,

Had to RMA my ASUS board due to coil whine and got an "MSI Z270I GAMING PRO CARBON AC" board instead with deviceid of 0x10ec1220. I saw your updated thread on insanelymac and tried to run it, but got this error:

File: audio_cloverALC-120.command_v1.0f
Release Mode
Password:
EFI partition is mounted
System Integrity Protection status: disabled.

OK to patch
/Users/kanwei/Downloads/audio_cloverALC-120_v1.0f 2.command: line 671: syntax error near unexpected token `fi'
/Users/kanwei/Downloads/audio_cloverALC-120_v1.0f 2.command: line 671: `fi'

[Process completed]

After removing the offending lines, the script ran, I restarted, and there are no devices found. I've attached script output, ioreg, and config.plist.

Happy to be a guiney pig again

MSI_Z1220.zip

toleda commented 7 years ago

@kanwei Thanks. Typo fixed in script 1220/realtekALC.kext updated Run script again, reply with new files.

kanwei commented 7 years ago

Still no devices, files attached

Hacksierra_MSI_2.zip

NewsGuyTor commented 7 years ago

I tried applying the latest audio_cloverALC-120_v1.0f.command, but it asked me to download ALC1220S beta files, even though I am using the non-S Gigabyte version.

`Confirm ALC1220S Beta files (y/n): y

Download ALC1220S files ...`

That just gave me a kernel panic at boot, until I restored the previous AppleHDA.kext

toleda commented 7 years ago

Apologies. The files for device_id: 0x1220 are labeled 1220S If available, attach KP screenshot, script output and patched AppleHDA.kext.

toleda commented 7 years ago

@NewsGuyTor Working https://github.com/toleda/audio_alc_test/blob/master/audio_cloverALC-1220-120.command.zip

erikwestlund commented 7 years ago

Gigabyte Z270N-Wifi

Install patch. Downloads 1200S files, everything shows up in system prefs. No sound.

I installed the 200 series patch and get kernel panic on boot.

Here's the KP error.

http://imgur.com/a/oxOK8

Here's patched AppleHDA

AppleHDA.kext.zip

And, the installer output:

Last login: Sun Apr  2 11:44:34 on ttys000
Eriks-Workstation:~ erik$ /Users/erik/Desktop/ALC1220/audio_cloverALC-120_v1.0f1.command ; exit;

Agreement
The audio_cloverALC script is for personal use only. Do not distribute
the patch, any or all of the files or the resulting patched AppleHDA.kext
for any reason without permission. The audio_cloverALC script is
provided as is and without any kind of warranty.

File: audio_cloverALC-120.command_v1.0f1
Release Mode
Password:
EFI partition is mounted
System Integrity Protection status: disabled.

OK to patch
Confirm Realtek ALC1220 (y/n): y
Clover Audio ID Injection (y/n): y
Use Audio ID: 1 (y/n): y
Confirm 200 Series audio (y/n): y
Confirm ALC1220S Beta files (y/n): y

Download ALC1220S files ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9916  100  9916    0     0   1559      0  0:00:06  0:00:06 --:--:--  2051
Edit config.plist/Devices/Audio/Inject/1
Edit config.plist/SystemParameters/InjectKexts/YES
Download kext patches
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1838  100  1838    0     0    873      0  0:00:02  0:00:02 --:--:--   873
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4223  100  4223    0     0    256      0  0:00:16  0:00:16 --:--:--  1029
Install /Volumes/EFI/EFI/CLOVER/kexts/10.12/realtekALC.kext
Install System/Library/Extensions/AppleHDA.kext/ALC1220S zml files
Fix permissions ...
Kernel cache...
rebuilding //System/Library/PrelinkedKernels/prelinkedkernel
kext-dev-mode allowing invalid signature -67013 0xFFFFFFFFFFFEFA3B for kext AppleMobileDevice.kext
kext-dev-mode allowing invalid signature -67054 0xFFFFFFFFFFFEFA12 for kext AppleHDA.kext
KernelCache ID: EBE299A8D75D5AFAD757BC77B327D31D
kextcache updated critical boot files, requesting launchd reboot

Install finished, restart required.
To save a Copy of this Terminal session: Terminal/Shell/Export Text As ...
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]
kanwei commented 7 years ago

@erikwestlund I also had a kernel panic when upgrading to 10.12.4 with the 200 series patch, and had to use AppleALC to make it work again.

toleda commented 7 years ago

The patch is for 10.12.3 only. The script does not install the patch. Remove.

toleda commented 7 years ago

@erikwestlund Attach IOReg, config.plist and Clover boot log. How are you verifying sound, details?

xelanaiznac commented 7 years ago

hi toleda. I used your beta script found here (the f1 version). i have 10.12.4 audio is not working and quicktime or youtube videos are not playing. I'm attaching here files you requested. I have z270 Asus ALC1220S z270 asus.zip

thanks for your help

toleda commented 7 years ago

Why are the Nvidia HDMI audio edits the same as Intel HDMI audio (onboard-1)? Edit Nvidia HDMI audio to onboard-2. Reply with new files.

xelanaiznac commented 7 years ago

hi. because your script make it automatically. ssdt from script+output.zip

I run again the script to give you the output, same situation. audio not working and cdmi audio not recognized. ps toleda I attached here a ssdt made by darthsian. I think it could be interesting for you because it enabled intel quick sync adding the string "model" to your ssdt. maybe you can implement it. SSDT-HDMI-HD530-Airplay.aml.zip

toleda commented 7 years ago

SSDT-HDMI-NVIDIA-PEG0.aml shows GFX0 and onboard-2. IOReg shows PEGP and onboard-1. Something is interfering with the ssdt, remove the something (Clover?). Attach boot log.

Regarding Quick Synch, first report of a problem with the ssdt. My testing shows model injection is not required. I will look again.

xelanaiznac commented 7 years ago

hi toleda, thank you for your support. here you are new files. I really can't understand what is interfering with ssdt. ps regarding quick sync, without model injection it's not working. tried with both imac14,2 and imac14,1 and imac17,1. tried even with only igpu enabled without discrete graphic card. the only way to enable it that I found, for now, is with the modified ssdt (+ model). new files.zip

toleda commented 7 years ago

HDMI-Nvidia ssdt is working. Try a different port on the graphics card, reply with IORegs.

"tried even with only igpu enabled without discrete graphic card." no ssdt is required for Airplay in that scenario What macOS version did the Airplay ssdt stop working?

xelanaiznac commented 7 years ago

tried with the second cdmi port of my Nvidia card, still no hdmi audio. ioreg attached. if you want I can check the display ports if I can find a DisplayPort to hdmi cable

regarding quick sync, here attached result using your original ssdt and using "model" modified ssdt. I haven't checked if quick sync was working in earlier version of Mac OS with this hardware build. ps. airplay mirroring seems to be enabled (but not checked if it is really working) with both of the ssdt. I can see airplay logo in the top bar on the right and even on system preferences /monitor. I'm not sure but I read somewhere that with the original 530 ssdt airplay is enabled but it is really laggy

ioreg second hdmi.zip quick sync images.zip

toleda commented 7 years ago

Nvidia 10xx Web driver: DP/HDMI audio working on DP Ports, HDMI audio is not working on HDMI ports. Consider https://www.monoprice.com/product?p_id=4826

AyrPlay images are are not meaningful. Working AirPlay: screen shot 2017-04-14 at 9 25 38 pm

xelanaiznac commented 7 years ago

I think that is not the solution: now I'm using a display port-hdmi cable but I can't have hdmi audio that I have just bought. I'm attaching here ioreg using display port cable ioreg display port to hdmi cable.zip

regarding quick sync...as I told you with both the ssdt-530 (yours an the patched one with "model") airplay is working (as your photo of your last post) but only with the modified ssdt-530 quick sync is working and with your original ssdt-530 I have glitches in safari menu bar etc as I show you with foto I attached in my previous post. hope it helps

toleda commented 7 years ago

IOReg: Error 404 DP2HDMI cable must be certified for audio for HDMI audio to work (y/n)? The images and files attached previously do not show AirPlay working or not working.

xelanaiznac commented 7 years ago

DP2HDMI cable must be certified for audio for HDMI audio to work (y/n)? yes, it is certified and it works using applealc.kext with audio id set to 7. I forgot to add picture about airplay, but as I told you, it works both using your original ssdt-530 or with the "patched" ssdt (model added). again, with your ssdt without adding model, quick sync doesn't work. with the patched ssdt, it works thank you for your help, happy Easter Day

nahtnam commented 7 years ago

ALC 1220 is working great for my G270x-UD3 board, however I have one issue. If I set my volume over 3 or 4 bars, the audio will cut in and out. I know the speaker has enough power because if I plug it into my macbook, it can go way higher and louder.

I can provide any information/files you need to help debug this.