Jump to content

AppleALC — dynamic AppleHDA patching


vit9696
5,371 posts in this topic

Recommended Posts

Hello,vit9696. Thanks for your work. I saw you add Conexant CX20751/2 in your project. Thanks very much. I download your project and build it . I had deleted the KextsToPatch for AppleHDA and the HDAinjector. I set layout-ID = 12 in my dsdt. Unfortunately, it didn't work. 

 

 

 

Please provide 100% working AppleHDA.kext or DummyHDA.kext for your codec and make info.plist with attached script.

Codec-Info.command.zip

  • Like 1
Link to comment
Share on other sites

Please provide 100% working AppleHDA.kext or DummyHDA.kext for your codec and make info.plist with attached script.

debug log

Apr  8 00:26:01 localhost kernel[0]: calling mpo_policy_init for AppleALC
Apr  8 00:26:01 localhost kernel[0]: Security policy loaded: AppleALC Kernel Module (AppleALC)

I had provided the normal work of the DummyHDA.kext  and codec on #191. And I use the script you provided info.plist to replace the project in the info.plist.I try  to build the AppleALC.kext. But it didn't work.

Link to comment
Share on other sites

I had provided the normal work of the DummyHDA.kext  and codec on #191. And I use the script you provided info.plist to replace the project in the info.plist.I try  to build the AppleALC.kext. But it didn't work.

 

What you provide in post #191 is TOTAL mess. Unpacked platforms, missing layout.xml.zlib... I need 100% working DummyHDA.kext (untouched by you) so i could take data from it and give you a test version of AppleALC.kext. If it's OK, i will add it for everyone...

Link to comment
Share on other sites

What you provide in post #191 is TOTAL mess. Unpacked platforms, missing layout.xml.zlib... I need 100% working DummyHDA.kext (untouched by you) so i could take data from it and give you a test version of AppleALC.kext. If it's OK, i will add it for everyone...

OK,I post the 100% working DummyHDA by Rehabman.Thanks very much.

AppleHDA_CX20751.kext.zip

codec.txt.zip

Link to comment
Share on other sites

Wiki says:

Count — number of required replacements

Is this to specify the number of matches that it can find in the FIND & REPLACE?

 

Yes

OK,I post the 100% working DummyHDA by Rehabman.Thanks very much.

 

Resources from this kext are already in AppleALC. Layout-id 12. Run script from my post #201 and give me info.plist

Link to comment
Share on other sites

Wiki says:

Count — number of required replacements

Is this to specify the number of matches that it can find in the FIND & REPLACE?

 

 

Yes

 

Let say i made the COUNT to 2 and binary has 3 Matches. Will it only replace 2 finds, leaving the other one untouched?

is it OK to make the COUNT a bigger value so that it replaces ALL it can find. That make sense?

Link to comment
Share on other sites

Important!!

1. Your AppleHDA.kext MUST be clean (vanilla)

2. HDEF section in your DSDT (or clover fix FixHDA_8000->True)

3. Layout-id specified in your DSDT (or clover Audio->Inject) 

4. Remove ALL patches for audio from your config.plist KextsToPatch

5. Remove DummyHDA.kext from S/L/E (if exists)

6. Remove VoodooHDA.kext and AppleHDADisabler.kext (if exists)

7. Intel HDMI Audio on HD4000/HD4600 - use clover key UseIntelHDMI->True 

  • Like 1
Link to comment
Share on other sites

Let say i made the COUNT to 2 and binary has 3 Matches. Will it only replace 2 finds, leaving the other one untouched?

is it OK to make the COUNT a bigger value so that it replaces ALL it can find. That make sense?

 

Read changelog!!! Starting from v1.0.3 you can use 0 to patch ALL entries... But it is NOT recommended...

 

 

  • Allowed kext patches with 0 count replacing all entries (use this with a reason)

Nice.! Thanks for your work. It is working.And you can tell me what you do. I want to know ! Thanks very much. 

 

I made a mistake in info.plist coz i do it myself without specific data.

 

upd. Updated sources for CX20751/2 on GitHub...

  • Like 1
Link to comment
Share on other sites

Read changelog!!! Starting from v1.0.3 you can use 0 to patch ALL entries... But it is NOT recommended...

 

I made a mistake in info.plist coz i do it myself without specific data.

 

upd. Updated sources for CX20751/2 on GitHub...

Uhm. .Thanks 

Link to comment
Share on other sites

Read changelog!!! Starting from v1.0.3 you can use 0 to patch ALL entries... But it is NOT recommended...

Ok that make sense. The COUNT depends on the OS build you are running. coz In Mountain Lion and up, 8B19D411 has 2 matches, while Lion has 4.

Got it. Thanks :)

  • Like 1
Link to comment
Share on other sites

Read changelog!!! Starting from v1.0.3 you can use 0 to patch ALL entries... But it is NOT recommended...

 

I made a mistake in info.plist coz i do it myself without specific data.

 

upd. Updated sources for CX20751/2 on GitHub...

I'm sorry.It case kerel panic after rebuild caches. 

 

 

 

 

How odd! It can work normally now!But AppleALC.kext lost HDMI on  my Intel HD Graphics 4600

Anonymous UUID:       D917E5E3-A074-DCBB-6B79-E754118AE358

Fri Apr  8 13:48:05 2016

*** Panic Report ***
panic(cpu 2 caller 0xffffff80051ce40a): Kernel trap at 0xffffff7f87a352d6, type 14=page fault, registers:
CR0: 0x0000000080000033, CR2: 0x0000000000000000, CR3: 0x0000000000564004, CR4: 0x00000000001627e0
RAX: 0x0000000000000000, RBX: 0x0000000000000000, RCX: 0x0000000000000000, RDX: 0x0000000000001c6c
RSP: 0xffffff8182833800, RBP: 0xffffff8182833830, RSI: 0x0000000000000000, RDI: 0x0000000000000000
R8:  0x0000000000ffffff, R9:  0x0000000000000000, R10: 0xffffff8141f9b000, R11: 0xffffff8141f9b200
R12: 0xffffff7f87a35434, R13: 0xffffff7f87a93d98, R14: 0xffffff7f87a3899a, R15: 0x0000000000000002
RFL: 0x0000000000010046, RIP: 0xffffff7f87a352d6, CS:  0x0000000000000008, SS:  0x0000000000000010
Fault CR2: 0x0000000000000000, Error code: 0x0000000000000000, Fault CPU: 0x2, PL: 0

Backtrace (CPU 2), Frame : Return Address
0xffffff8182833490 : 0xffffff80050dab12 
0xffffff8182833510 : 0xffffff80051ce40a 
0xffffff81828336f0 : 0xffffff80051ec273 
0xffffff8182833710 : 0xffffff7f87a352d6 
0xffffff8182833830 : 0xffffff7f87a2ad45 
0xffffff8182833850 : 0xffffff7f87a2bf8b 
0xffffff8182833860 : 0xffffff800571d6f7 
0xffffff8182833890 : 0xffffff800530e36f 
0xffffff8182833af0 : 0xffffff8005302c14 
0xffffff8182833f20 : 0xffffff8005302596 
0xffffff8182833f60 : 0xffffff8005627fa1 
0xffffff8182833fb0 : 0xffffff80051eca76 
      Kernel Extensions in backtrace:
         as.vit9696.AppleALC(1.0.8)[E3862BB5-C89E-3F4E-A50A-6B1AB42FDB8B]@0xffffff7f87a2a000->0xffffff7f87a93fff

BSD process name corresponding to current thread: mount_hfs
Boot args: dart=0 nv_disable=1 -v "Kernel=/System/Library/Kernels/kernel"  kext-dev-mode=1 rootless=0

Mac OS version:
15E65

Kernel version:
Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64
Kernel UUID: 4E7B4496-0B81-34E9-97AF-F316103B0839
Kernel slide:     0x0000000004e00000
Kernel text base: 0xffffff8005000000
__HIB  text base: 0xffffff8004f00000
System model name: MacBookPro11,1 (Mac-189A3D4F975D5FFC)

System uptime in nanoseconds: 2513315959
last loaded kext at 1620858380: com.no-one.BrcmPatchRAM2	2.2.1 (addr 0xffffff7f87aa0000, size 36864)
loaded kexts:
com.no-one.BrcmPatchRAM2	2.2.1
com.no-one.BrcmFirmwareStore	2.2.1
org.emlydinesh.driver.ApplePS2SmartTouchPad	4.5
org.emlydinesh.driver.ApplePS2Keyboard	4.5
com.insanelymac.RealtekRTL8111	2.2.1
org.hwsensors.driver.LPCSensors	1707
org.rehabman.driver.FakePCIID	1.2.4
org.hwsensors.driver.ACPISensors	1707
org.emlydinesh.driver.AsusNBFnKeys	2.5.5
com.rehabman.driver.IntelBacklight	1.0.5
org.emlydinesh.driver.ApplePS2Controller	4.5
org.hwsensors.driver.CPUSensors	1707
org.netkas.driver.FakeSMC	1707
as.vit9696.AppleALC	1.0.8
org.rehabman.driver.AppleSmartBatteryManager	1.52
com.apple.driver.AppleFileSystemDriver	3.0.1
com.apple.AppleFSCompression.AppleFSCompressionTypeDataless	1.0.0d1
com.apple.AppleFSCompression.AppleFSCompressionTypeZlib	1.0.0
com.apple.BootCache	38
com.apple.iokit.IOAHCIBlockStorage	2.8.5
com.apple.driver.AirPort.Brcm4360	1040.1.1a6
com.apple.driver.AppleAHCIPort	3.1.8
com.apple.driver.AppleRTC	2.0
com.apple.driver.AppleACPIButtons	4.0
com.apple.driver.AppleHPET	1.8
com.apple.driver.AppleSMBIOS	2.1
com.apple.driver.AppleACPIEC	4.0
com.apple.driver.AppleAPIC	1.7
com.apple.nke.applicationfirewall	163
com.apple.security.quarantine	3
com.apple.security.TMSafetyNet	8
com.apple.driver.usb.IOUSBHostHIDDevice	1.0.1
com.apple.driver.usb.cdc	5.0.0
com.apple.driver.usb.networking	5.0.0
com.apple.driver.usb.AppleUSBHostCompositeDevice	1.0.1
com.apple.driver.AppleXsanScheme	3
com.apple.driver.AppleEFINVRAM	2.0
com.apple.iokit.IO80211Family	1110.26
com.apple.driver.mDNSOffloadUserClient	1.0.1b8
com.apple.iokit.IONetworkingFamily	3.2
com.apple.driver.corecapture	1.0.4
com.apple.iokit.IOUSBFamily	900.4.1
com.apple.driver.usb.AppleUSBXHCIPCI	1.0.1
com.apple.driver.usb.AppleUSBXHCI	1.0.1
com.apple.iokit.IOUSBHostFamily	1.0.1
com.apple.driver.AppleUSBHostMergeProperties	1.0.1
com.apple.iokit.IOAHCIFamily	2.8.1
com.apple.driver.AppleEFIRuntime	2.0
com.apple.iokit.IOHIDFamily	2.0.0
com.apple.iokit.IOGraphicsFamily	2.4.1
com.apple.iokit.IOSMBusFamily	1.1
com.apple.security.sandbox	300.0
com.apple.kext.AppleMatch	1.0.0d1
com.apple.driver.AppleKeyStore	2
com.apple.driver.AppleMobileFileIntegrity	1.0.5
com.apple.driver.AppleCredentialManager	1.0
com.apple.driver.DiskImages	417.2
com.apple.iokit.IOStorageFamily	2.1
com.apple.iokit.IOReportFamily	31
com.apple.driver.AppleFDEKeyStore	28.30
com.apple.driver.AppleACPIPlatform	4.0
com.apple.iokit.IOPCIFamily	2.9
com.apple.iokit.IOACPIFamily	1.4
com.apple.kec.Libm	1
com.apple.kec.pthread	1
com.apple.kec.corecrypto	1.0
Model: MacBookPro11,1, BootROM MBP111.0138.B03, 2 processors, Intel Core i5, 2.79 GHz, 12 GB, SMC 2.16f58
Graphics: Intel HD Graphics 4600, Intel HD Graphics 4600, Built-In
Memory Module: BANK0/DIMM0, 4 GB, DDR3, 1600 MHz, Samsung, M471B5173DB0-YK0
Memory Module: BANK1/DIMM1, 8 GB, DDR3, 1600 MHz, Samsung, M471B1G73QH0-YK0
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8659), Broadcom BCM43xx 1.0 (7.21.95.175.1a6)
Bluetooth: Version 4.4.4f4 17685, 3 services, 27 devices, 1 incoming serial ports
Network Service: Ethernet, Ethernet, en0
Serial ATA Device: WDC WD10JPVX-80JC3T0, 1 TB
Serial ATA Device: PLEXTOR PX-256M6S, 256.06 GB
USB Device: USB 3.0 Bus
USB Device: USB Camera
USB Device: BCM20702A0
USB Device: USB OPTICAL MOUSE
USB Device: USB KEYBOARD
Thunderbolt Bus: 

post-1557617-0-89886800-1460094924_thumb.jpg

  • Like 1
Link to comment
Share on other sites

I compared codec resources from Toleda and Mirone with ALSA/VoodooHDA dumps and Codec Datasheets.

AMP (PublishVolume, PublishMute, MulteInputAMP, VolumeInputAMP) never match the Vendor's AMPCaps 

Is it a kind of some secret knowledge or just a mistyping?

for example, Node 2 of ALC1150 cannot Mute

           nid: 2

           Name: audio output
     Widget cap: 0x0000041d
                 PWR STEREO
    Association: 0 (0x00000001)
            OSS: pcm (pcm)
     Stream cap: 0x00000001
                 PCM
        PCM cap: 0x000e0560
                 16 20 24 bits, 44 48 96 192 KHz
     Output amp: 0x00025757
                 mute=0 step=87 size=2 offset=87
     Output val: [0x3F 0x3F]
 
</array>
<key>MuteInputAmp</key> ////???? WHY?
<true/>
<key>PublishMute</key> ///???? WHY???
<true/>
<key>PublishVolume</key> /// yes, it controls Volume step=87 size=2*0.25=0.5 dB each step
<true/>
<key>VolumeInputAmp</key>
<false/>
</dict>
<key>NodeID</key>
<integer>2</integer>
 
in the same way nid12
nid: 12
           Name: audio mixer
     Widget cap: 0x0020010b
                 STEREO
    Association: 0 (0x00000001)
            OSS:  (igain)
      Input amp: 0x80000000
                 mute=1 step=0 size=0 offset=0
      Input val: [0x00 0x00] [0x80 0x80] 
    connections: 2 enabled 2
CAN mute but cannot control Volume ...but it works in practice...why these values differ?
  • Like 1
Link to comment
Share on other sites

 

@Rodion2010,
Neither my kext or the toleda
It does work the Mute for you?
post your specs.

 

All works OK, just interesting, is there any reason for this difference?

As far as I understand the platform.xml structure, 4 values for AMP (PublishVolume, etc) are AMPCAPS from Intel HDA Specs and they need to be exactly the same as these values in ALSA and VoodooHDA.Am i wrong?

BTW, I modified the XML to match dump exactly.  It also works. I am not sure about what solution is more correct, have You any ideas about this?

here is my xml for 1150, stereo out only, no 5.1,  and it slightly differs from yours in AMPs config at nodes 2 and 12  

maybe it is important for further development, maybe not

Works good, installed the patched applehda and hdaenabler with kext utility.

Which comes with the applehda patcher.

Still cannot got hdmi sound working with the igpu :/

AppleALC does not require any patched kexts, AppleHDA.kext must be original one from OS X installESD.dmg!!!

Platforms.xml.zip

  • Like 1
Link to comment
Share on other sites

CommonPeripheralDSP is a description of EQs and other DSPs used for Apple's iPhone Mics and HeadPhones

No use for this in Hackintosh, so it can be deleted from each platforms resource

 

PS I tried to remove it completely, it does not work 

there must be 2 empty values ))

<key>CommonPeripheralDSP</key>
	<array>
		<dict>
			<key>DeviceID</key>
			<integer>0</integer>
			<key>DeviceType</key>
			<string>Headphone</string>
		</dict>
		<dict>
			<key>DeviceID</key>
			<integer>0</integer>
			<key>DeviceType</key>
			<string>Microphone</string>
		</dict>
	</array>

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...