Popular Post vit9696 Posted March 7, 2016 Popular Post Share Posted March 7, 2016 Hello,This is going to be a support/discussion topic of AppleALC on InsanelyMac. AppleALC is a kernel extension allowing you to enable native apple HD audio without any filesystem modifications. It dynamically injects the necessary modifications to AppleHDA (and other kexts) including the layouts, and makes your audio work starting from the OS installation. It should be noted that AppleALC starting with version 1.1.0 requires Lilu.kext to be put in the same folder as AppleALC.kext. See this topic for more details. For quite some time we are trying to obtain the necessary information about AppleALC codec compatibility. If you use something, please, consider checking the compatibility table (do not worry, it is in English), and report (here) on your codec. We are also looking for all the possible revisions of the codec, if we do not have the revisions listed for your codec please report as well. Thanks for understanding. The report is meant to contain: 1. Laptop model/Motherboard model2. Codec name3. Layout used with the info what works for you (ideally if you try them all)4. OS X versions you tried5. Autogenerated Info.plist made with the help of this utility. All the details including the source code are available on github:https://github.com/vit9696/AppleALCSome short wiki articles explaining the usage are included. As for now the project is relatively immature without practically any codec support. But it should be pretty easy to add more of them, I am hoping for the support of the "community" If you have any issues, better report them on github for structural reasons. 64 1 Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/ Share on other sites More sharing options...
smolderas Posted March 7, 2016 Share Posted March 7, 2016 Is this needed to be in /S/L/E, or can it be in /L/E or better in /EFI/CLOVER/.../kexts...? 1 Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2221657 Share on other sites More sharing options...
vit9696 Posted March 7, 2016 Author Share Posted March 7, 2016 As you wish. The point was no system modifications, so I would rather use /EFI/CLOVER out of the three. 1 Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2221660 Share on other sites More sharing options...
smolderas Posted March 8, 2016 Share Posted March 8, 2016 As you wish. The point was no system modifications, so I would rather use /EFI/CLOVER out of the three. Nice. I will definitely give it a try... Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2221697 Share on other sites More sharing options...
Rodion2010 Posted March 8, 2016 Share Posted March 8, 2016 Resources.zip Resources for HDA Codec #0: Analog Devices AD1988B HDA Codec ID: 0x11d4198bVendor: 0x11d4Device: 0x198b but it doesn't work what's wrong? Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2221730 Share on other sites More sharing options...
FredWst Posted March 8, 2016 Share Posted March 8, 2016 Hi, I compile for alc 892. I get this error at boot : AppleALC: mach @ no slide is present. AppleALC: alc @ failed to setup kext hooking. no error if i load it with kextload. Fred Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2221755 Share on other sites More sharing options...
vit9696 Posted March 8, 2016 Author Share Posted March 8, 2016 Resources.zip Resources for HDA Codec #0: Analog Devices AD1988B HDA Codec ID: 0x11d4198b Vendor: 0x11d4 Device: 0x198b but it doesn't work what's wrong? Hi, I assume you are the same guy from life, therefore I will reply there. Hi, I compile for alc 892. I get this error at boot : AppleALC: mach @ no slide is present. AppleALC: alc @ failed to setup kext hooking. no error if i load it with kextload. Fred Hi, Please enable alc_dbg in boot arguments, and pass me the whole log grepped by AppleALC. Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2221767 Share on other sites More sharing options...
FredWst Posted March 10, 2016 Share Posted March 10, 2016 Hi, With last commit, ALC 892 working fine. ALC892.zip Always see some errors about AppleHDA in log, think it's cause to audio HD4600. Can we patch AppleHDAController ? look likes yes ... Fred Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222389 Share on other sites More sharing options...
vit9696 Posted March 10, 2016 Author Share Posted March 10, 2016 Yes we can. You need to follow the instructions to do this… In brief: add a new kext to Kexts.plist, add a patch to a corresponding codec plist. Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222410 Share on other sites More sharing options...
FredWst Posted March 10, 2016 Share Posted March 10, 2016 i've try to patch hd4600. But does not works. I don't forget to add AppleHDAController to kext.plist ALC892-with patch hdmi hd4600.zip debug.log.zip Patch is not like other, Toleda do that. # HD4600/0c0c HDMI El Capitan sudo xxd -ps /System/Library/Extensions/AppleHDA.kext/Contents/Plugins/AppleHDAController.kext/Contents/MacOS/AppleHDAController | tr -d > /tmp/AppleHDAController.txt sudo perl -pi -e 's|3d0c0a0000|3d0c0c0000|g' /tmp/AppleHDAController.txt sudo xxd -r -p /tmp/AppleHDAController.txt /System/Library/Extensions/AppleHDA.kext/Contents/Plugins/AppleHDAController.kext/Contents/MacOS/AppleHDAController sudo rm -R /tmp/AppleHDAController.txt One more thing, debug boot-args parsing does not work for me. To get debug i need to : debugEnabled = true; //PE_parse_boot_argn(booatargDebug, buf, sizeof(buf)); Fred PS Bootloader Ozmosis, GA-H97N-WIFI Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222543 Share on other sites More sharing options...
vit9696 Posted March 11, 2016 Author Share Posted March 11, 2016 Indeed AppleHDAController patching is currently broken, thanks for the log which made it clear. Although, it might be a little problematic. Given that we detect the codecs by AppleHDAController results. Do you have any good ideas on how to detect them before AppleHDAController loads other than direct probing? Perhaps, 3d0c0a0000 → 3d0c0c0000 patching can be used regardless of the codec? Does this patch conflict with anything? Do AppleHDAController patches need anything special other than that for other platforms? From what I can from the disassembly tell this patch simply changes the some id from 0xA0C to 0xC0C. if ( v15 != 0xC0C /* this thing */ && v15 != 0xD0C && v15 != 0x160C ) { LODWORD(v16) = (*(int (__fastcall **)(AppleHDAController *, _QWORD, _BYTE *))(*(_QWORD *)v4 + 696LL))( v4, AppleHDAController::DPAudioDeviceExclusionString, byte_11FE8); or bool __fastcall AppleHDAController::shouldSetGraphicsClockDivider(AppleHDAController *this){ int id; // eax@2 bool result; // al@5 result = 0; if ( *((_DWORD *)this + 948) == 0x8086 ) // Intel { id = *((_DWORD *)this + 949); if ( id == 0xA0C || id == 0xD0C || id == 0x160C ) result = 1; } return result; } Making it not to exclude 0xC0C from the supported list. May it be a good idea to replace the jmps instead of the id itself? Or that is going to conflict with some completely unsupported devices? As for boot-args, the debug argument changed to -alcdbg. Are you sure you use the new one? Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222674 Share on other sites More sharing options...
Hiko Posted March 11, 2016 Share Posted March 11, 2016 Will Creative CA0132 work via your work? Thanks! Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222690 Share on other sites More sharing options...
vit9696 Posted March 11, 2016 Author Share Posted March 11, 2016 Hiko, it's in your hands Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222704 Share on other sites More sharing options...
FredWst Posted March 11, 2016 Share Posted March 11, 2016 Indeed AppleHDAController patching is currently broken, thanks for the log which made it clear. Although, it might be a little problematic. Given that we detect the codecs by AppleHDAController results. Do you have any good ideas on how to detect them before AppleHDAController loads other than direct probing? Perhaps, 3d0c0a0000 → 3d0c0c0000 patching can be used regardless of the codec? Does this patch conflict with anything? Do AppleHDAController patches need anything special other than that for other platforms? From what I can from the disassembly tell this patch simply changes the some id from 0xA0C to 0xC0C. if ( v15 != 0xC0C /* this thing */ && v15 != 0xD0C && v15 != 0x160C ) { LODWORD(v16) = (*(int (__fastcall **)(AppleHDAController *, _QWORD, _BYTE *))(*(_QWORD *)v4 + 696LL))( v4, AppleHDAController::DPAudioDeviceExclusionString, byte_11FE8); or bool __fastcall AppleHDAController::shouldSetGraphicsClockDivider(AppleHDAController *this){ int id; // eax@2 bool result; // al@5 result = 0; if ( *((_DWORD *)this + 948) == 0x8086 ) // Intel { id = *((_DWORD *)this + 949); if ( id == 0xA0C || id == 0xD0C || id == 0x160C ) result = 1; } return result; } Making it not to exclude 0xC0C from the supported list. May it be a good idea to replace the jmps instead of the id itself? Or that is going to conflict with some completely unsupported devices? As for boot-args, the debug argument changed to -alcdbg. Are you sure you use the new one? Hi, Debug trace is ok now with new option -alcdbg. (Update wiki, if not done) I try to patch with dsdt but does not work. i'm not able to help on this kind of issue, i've no skill on that. But what i find strange is the way taken by Toleda to patch this kext. May be he can explain why it can't be done like other ? Fred Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222825 Share on other sites More sharing options...
vit9696 Posted March 11, 2016 Author Share Posted March 11, 2016 I had a talk with a few people, and I think I got the point of this kind of patching. Such patches are not codec patches but codec controller patches. Therefore they are not dependent on codec detection. I am writing an update in the periods I have free time, hopefully it will be ready soon. In a new version one will be able to apply codec controller patches and therefore use AppleALC for Intel HD4600 HDMI audio, x99 analog audio, and possibly more. Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222837 Share on other sites More sharing options...
FredWst Posted March 11, 2016 Share Posted March 11, 2016 I had a talk with a few people, and I think I got the point of this kind of patching. Such patches are not codec patches but codec controller patches. Therefore they are not dependent on codec detection. I am writing an update in the periods I have free time, hopefully it will be ready soon. In a new version one will be able to apply codec controller patches and therefore use AppleALC for Intel HD4600 HDMI audio, x99 analog audio, and possibly more. Very nice, as i see you able to patch on the fly, should be interesting to patch other kind of kext. i think about usb limit. So i know it's not the goal of you project... Fred Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222863 Share on other sites More sharing options...
TheRacerMaster Posted March 11, 2016 Share Posted March 11, 2016 Will test ASAP, nice work. This is a great idea, now audio can work regardless of SIP settings/etc and with a clean install. Edit: Working fine with ALC898 here. Removed /L/E/AppleHDA898.kext (generated with Pike's script) and deleted Clover kext patch entries, then rebuilt kext caches - audio is still working well. Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222864 Share on other sites More sharing options...
Rocky12 Posted March 12, 2016 Share Posted March 12, 2016 Any hope for ALC262 10EC0262 283902562 Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222882 Share on other sites More sharing options...
pmcnano Posted March 12, 2016 Share Posted March 12, 2016 @vit9696 Doesn't seem to work when using Nvidia Web Drivers. Using OSX Native drivers does load sound devices though. Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222894 Share on other sites More sharing options...
vit9696 Posted March 12, 2016 Author Share Posted March 12, 2016 I added controller patching code to trunk with x99/hd4600 examples. HDMI audio should be addible now. Any other (even non-audio) kext patching can be done as well, the platform allows it, just edit the plists. Rockey12, pretty much no one here will write anything for you, and me in particular. There is a decent instruction, follow it and make the codec supported if it is not already. Why do people think I am the one going to set their audio up after creating a platform and even writing the docs on how to use it. pmcnano, I use nvidia web drivers here, and the system boots at least. No idea what fails for you, be more descriptive if you want to get a decent reply. 3 Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222898 Share on other sites More sharing options...
FredWst Posted March 12, 2016 Share Posted March 12, 2016 I added controller patching code to trunk with x99/hd4600 examples. HDMI audio should be addible now. Any other (even non-audio) kext patching can be done as well, the platform allows it, just edit the plists. Rockey12, pretty much no one here will write anything for you, and me in particular. There is a decent instruction, follow it and make the codec supported if it is not already. Why do people think I am the one going to set their audio up after creating a platform and even writing the docs on how to use it. pmcnano, I use nvidia web drivers here, and the system boots at least. No idea what fails for you, be more descriptive if you want to get a decent reply. Hello, AppleALC does not work for me. debug.log.zip Fred Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222919 Share on other sites More sharing options...
WinstonAce Posted March 12, 2016 Share Posted March 12, 2016 Working great here with ALC1150 (Z97) and ozmosis Thanks! Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222956 Share on other sites More sharing options...
cecekpawon Posted March 12, 2016 Share Posted March 12, 2016 AppleALC does not work for me. Fred Same alc892 & log here. Got it working with latest Andrey1970s compiled kext from applelife. Looks like applealc always failed to patch the target binary (only working with clover patch) when i compile it myself. And now receiving error when compiling with latest commit from repo. Could anyone share your "working" full project source here please 1 Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222978 Share on other sites More sharing options...
vit9696 Posted March 12, 2016 Author Share Posted March 12, 2016 Please update to the latest github revision. Most of the issues were fixed, and it will surely compile. Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222983 Share on other sites More sharing options...
cecekpawon Posted March 12, 2016 Share Posted March 12, 2016 (edited) Same error -- remove attachment Edited March 13, 2016 by cecekpawon Link to comment https://www.insanelymac.com/forum/topic/311293-applealc-%E2%80%94-dynamic-applehda-patching/#findComment-2222985 Share on other sites More sharing options...
Recommended Posts