Jump to content

AppleALC — dynamic AppleHDA patching


vit9696
5,371 posts in this topic

Recommended Posts

Changes ONLY in platforms9.xml.zlib file? Rest of files untouched in attached archive? Sorry. Don't have time to compare resources...

Miner changed 4 files

 

layout9.xml.zlib

Info.plist

Platforms9.xml.zlib

PinConfigs.kext

 

Sound is better.Compare when you have time.

Thank you.

Link to comment
Share on other sites

I am looking at the AppleALC code and was wondering if it would be better to save xml files to the repository instead of the zlib products. That way, you can look at the files without deflating them, do diffs, etc.

To set that up, I used the following commands:

cd ~/Downloads/AppleALC-master/Resources
./Tools/zlib_unpack.command
rm $(find . -type f -name *.zlib)

Then I created a file "makefile" in the AppleALC-master folder (I haven't made many unix makefiles so maybe this could be improved):

#
# Makefile for kern_resources.cpp
#

PROJECTDIR := ${PROJECT_DIR}
TARGETDIR := ${TARGET_BUILD_DIR}

SOURCEXML := $(shell find $(PROJECTDIR)/Resources -type f -name *.xml)
SOURCEPLIST := $(shell find $(PROJECTDIR)/Resources -type f -name *.plist)
OUTXML := $(patsubst $(PROJECTDIR)/%,$(TARGETDIR)/%,$(SOURCEXML:.xml=.xml.zlib))
OUTPLIST := $(patsubst $(PROJECTDIR)/%,$(TARGETDIR)/%,$(SOURCEPLIST))

ZLIB := perl $(PROJECTDIR)/Tools/zlib.pl deflate

$(PROJECTDIR)/AppleALC/kern_resources.cpp: $(OUTXML) $(OUTPLIST) $(PROJECTDIR)/ResourceConverter/main.mm $(TARGETDIR)/ResourceList.txt
	@echo "Recreating $@"
	@rm -f "$@"
	@"$(TARGETDIR)/ResourceConverter" "$(TARGETDIR)/Resources" "$@" || (echo "Failed to build kern_resources.cpp"; rm -f "$@")

$(TARGETDIR)/Resources/%.xml.zlib: $(PROJECTDIR)/Resources/%.xml
	@echo "Compressing $< to $@"
	@mkdir -p "$(@D)"
	@$(ZLIB) "$<" > "$@"

$(TARGETDIR)/Resources/%.plist: $(PROJECTDIR)/Resources/%.plist
	@echo "Copying $< to $@"
	@mkdir -p "$(@D)"
	@cp "$<" "$@"

$(TARGETDIR)/ResourceList.txt: .PHONY
	@echo "Checking reource list..."
	@pushd $(PROJECTDIR) > /dev/null; find ./Resources -type f \( -name *.xml -or -name *.plist \) | sed -E '/\.xml$$/s//.xml.zlib/' > "$@".tmp1; popd > /dev/null
	@cmp -s "$@".tmp1 "$@" && ( echo "Resource list is unchanged."; rm -f "$@".tmp1; : ) || ( echo "Resource list changed."; mv -f "$@".tmp1 "$@"; pushd $(TARGETDIR) > /dev/null; find ./Resources -type f \( -name *.xml.zlib -or -name *.plist \) > "$@".tmp2; rm -f $$(fgrep -v -f "$@" "$@".tmp2) "$@".tmp2 ; popd > /dev/null )

.PHONY:

Then for the Xcode project, select AppleALC project, ResourceConverter target, Build Phases, change the shell command to "make". You can remove generate.sh since the makefile takes its place.

The make command will use the makefile to build the kern_resources.cpp file only if the plists or zlib files changed or if any of those files were removed or added. It will deflate any xml files that were changed since the last time it was deflated or if it wasn't deflated yet. The first time you build the project takes awhile to deflate all the xml files. After that it takes no time at all. This also makes editing the xml files faster, since you don't need to manually deflate them.

 

  • Like 1
Link to comment
Share on other sites

Thanks joevt but I wonder whether we really need to edit xml files often enough to need this. I put the tool to the repo basically not to forget about it, and needed it like once. After all AppleALC does not really intend to help people build their resources, it only accepts the ones users provide out of convenience.

Another issue I can imagine with this is having to alter ignore files and polluting the build directory.

 

All in all this is a smart idea but I am unsure of its necessity.

  • Like 3
Link to comment
Share on other sites

Thanks joevt but I wonder whether we really need to edit xml files often enough to need this. I put the tool to the repo basically not to forget about it, and needed it like once. After all AppleALC does not really intend to help people build their resources, it only accepts the ones users provide out of convenience.

Another issue I can imagine with this is having to alter ignore files and polluting the build directory.

 

All in all this is a smart idea but I am unsure of its necessity.

I don't know if it's needed. It's like AppleALC itself. We could manually patch AppleHDA, or use AppleALC. We could manually compress our xml files, or we could let Xcode do it automatically.

 

Are there ignored files? The makefile uses the find command which can be used to include or exclude files based on just about any criteria. If there's an ignore list then that can be incorporated. I suppose it would even be possible to add an option to include only resources for your own codec. That way, you don't need to physically remove the files to make the kext smaller (though I don't know why that's a concern).

 

About polluting the build directory, You could change TARGETDIR to be anywhere, even the project directory where the files are now. As it is, it has the feature of not polluting the source directory. It keeps it cleaner. The build directory is already polluted with the ResourceConverter product so I put these other intermediate build products there too.

 

I think if a person needs to download and build the source, then they probably have an unsupported codec, and they'll want to edit an xml file. Or at least view it. The other reason that a person would need to build it is because there is no binary download of the kext, but I'll ignore that for now. Since everyone needs to build it (people who want to make changes, or people that just want the kext) then the build process should make as much sense as possible.

 

This makes the source code more transparent. At first glance, a person may not even realize that the zlib files have information that may need to be edited (not knowing what AppleHDA is all about) since being binary files usually means they aren't to be edited. It doesn't make sense to have a source folder with a info.plist file that can be edited and a zlib file that can't be edited. "Source" is the root word in "source code" - it means the source of the zlib file should be in the folder instead of the zlib file.

Link to comment
Share on other sites

Well, actually our experience shows that most of the people who download the sources use them to get a trunk version. Very few actually test things in AppleALC itself, it is a lot easier to go with AppleHDA patching than constantly launch Xcode. Moreover, having zlibs in the repo allows users to grab them for their AppleHDA tests without any packing/unpacking, which is also nice.

 

I don't know, I can foresee your feature being added in the future in some form but maybe not now at least.

Link to comment
Share on other sites

Moreover, having zlibs in the repo allows users to grab them for their AppleHDA tests without any packing/unpacking, which is also nice.

Do you mean that a user would just grab a new zlib, and place it in their AppleHDA.kext instead of using AppleALC? In that case, I suppose there's no reason why you couldn't include both the xml and zlib file in the repository if you think that convenience is important although it would be redundant.
Link to comment
Share on other sites

Do you mean that a user would just grab a new zlib, and place it in their AppleHDA.kext instead of using AppleALC? In that case, I suppose there's no reason why you couldn't include both the xml and zlib file in the repository if you think that convenience is important although it would be redundant.

No, I mean that the user can grab the zlobs from the repo and install them to AppleHDA when AppleALC/kext injection is incompatible with the current OS update for example. And redundancy is something I'd like to avoid. More I think of it, less I understand what's the issue with running a single command to pack/unpack all the zlibs if one needs it so badly, to be honest. We had a talk with Vandroiy yesterday, and he came to the same conclusion.
Link to comment
Share on other sites

Is "John" the one made layout/platform 28 for Lenovo Z580 here ? I would like to ask him a few question related to his patching, as there is another user who uses Lenovo B580 ( same motherboard ) and couldn't have full audio experience using his file. I notice that Revision 100202 is presented in the ALC269 info.plist and the user with Lenovo B580 has the same revision

Link to comment
Share on other sites

No, I mean that the user can grab the zlobs from the repo and install them to AppleHDA when AppleALC/kext injection is incompatible with the current OS update for example. And redundancy is something I'd like to avoid. More I think of it, less I understand what's the issue with running a single command to pack/unpack all the zlibs if one needs it so badly, to be honest. We had a talk with Vandroiy yesterday, and he came to the same conclusion.

Nothing wrong with doing extra work if you like doing that. I just thought it would be cool to remove an unnecessary manual step from the build process.
Link to comment
Share on other sites

This is a great kext, it works more reliably than a patched AppleHDA, and it also survives the updates and random resets to Vanilla AppleHDA that I have been experiencing while using my 1st hack in signature (the one i really use all the time, rest are more for fun  =D although I am building a Hack with Realtek ALC 888 Desktop so I am not sure if this beautiful little kext will support that codec?)

 

Thanks for all your great work guys :D

 

With all above said, I have a little problem to report.

 

ASUS X550LD

Intel Core i7 @ 2.00GHz

Intel HD4400 Graphics 

Realtek ALC 233 (in codec dump it is ALC3236 but I have seen you have knowledge of that)

 

I have tried many layout ids with different patched AppleHDA, but the best one is definitely 3 and it is the one I have been using all the time

 

Microphone does not catch a single sound, I am unsure why, but I have the same problem with all the Apple HDAs I have ever tried and also with the ones I made myself, and in Linux it happens the same, no sound on the internal microphone, so I gave up on it.

 

It is the only thing keeping me from putting Clover in No Selection mode, and erase Windows once for all, but I work a lot with video conference, and it would be awesome to use the integrated microphone in Mac OS X

 

I have been trying and experimenting on this Hack since OS X 10.9.5 until Mac OS Sierra, and the same happens with all versions, using this kext

I currently stayed in Mavericks.

 

post-1517295-0-22907800-1470696155_thumb.png

 

Thanks in advance

 

Info.plist.zip

 

 

Link to comment
Share on other sites

This is a great kext, it works more reliably than a patched AppleHDA, and it also survives the updates and random resets to Vanilla AppleHDA that I have been experiencing while using my 1st hack in signature (the one i really use all the time, rest are more for fun  =D although I am building a Hack with Realtek ALC 888 Desktop so I am not sure if this beautiful little kext will support that codec?)

 

Thanks for all your great work guys :D

 

With all above said, I have a little problem to report.

 

ASUS X550LD

Intel Core i7 @ 2.00GHz

Intel HD4400 Graphics 

Realtek ALC 233 (in codec dump it is ALC3236 but I have seen you have knowledge of that)

 

I have tried many layout ids with different patched AppleHDA, but the best one is definitely 3 and it is the one I have been using all the time

 

Microphone does not catch a single sound, I am unsure why, but I have the same problem with all the Apple HDAs I have ever tried and also with the ones I made myself, and in Linux it happens the same, no sound on the internal microphone, so I gave up on it.

 

It is the only thing keeping me from putting Clover in No Selection mode, and erase Windows once for all, but I work a lot with video conference, and it would be awesome to use the integrated microphone in Mac OS X

 

I have been trying and experimenting on this Hack since OS X 10.9.5 until Mac OS Sierra, and the same happens with all versions, using this kext

I currently stayed in Mavericks.

 

attachicon.gifScreen Shot 2016-08-08 at 23.43.10.png

 

Thanks in advance

 

attachicon.gifInfo.plist.zip

your plist contains bin patch for 1984b , you should use 1984 wich already presented in ALC233 resource 

  • Like 1
Link to comment
Share on other sites

Hello all friends! I already patch applehda with applealc, but still nosound after sleep. I hear this problemcan fix with codeccommander, but how to use it? just install kext codeccommander or must modify something else? I try install codeccommander in SLE, but still no sound after sleep? I thing i miss something

Link to comment
Share on other sites

I installed el capitan following this guide http://www.tonymacx86.com/threads/[url=&quot;http://www.insanelymac.com/forum/topic/279450-why-insanelymac-does-not-support-tonymacx86/&quot;]#####[/url]-install-os-x-el-capitan-on-any-supported-intel-based-pc.172672/All is ok, except audio. Maybe I miss something. I installed applealc, following those steps:

1. mount efi with clover configurator.
2. put Applealc.kext in  efi>clover>kext>10.11
3. audio ID  - 11 or 12
4. restart
No audio.
I not using custom dsdt and don't know, where to ''add'' FixHDA_8000. This option is under DSDT menu in PlistEditPro.

Specs: g1 sniper z87 (ca0132chip), i7 4771, gtx 780, 16gb geil potenza. For audio now I using voodoohda (have sound, but without volume control).

Link to comment
Share on other sites

I installed el capitan following this guide http://www.tonymacx86.com/threads/[url=&quot;http://www.insanelymac.com/forum/topic/279450-why-insanelymac-does-not-support-tonymacx86/&quot;]#####[/url]-install-os-x-el-capitan-on-any-supported-intel-based-pc.172672/All is ok, except audio. Maybe I miss something. I installed applealc, following those steps:

 

1. mount efi with clover configurator.

2. put Applealc.kext in  efi>clover>kext>10.11

3. audio ID  - 11 or 12

4. restart

No audio.

I not using custom dsdt and don't know, where to ''add'' FixHDA_8000. This option is under DSDT menu in PlistEditPro.

 

Specs: g1 sniper z87 (ca0132chip), i7 4771, gtx 780, 16gb geil potenza. For audio now I using voodoohda (have sound, but without volume control).

You can try this kext, remove applehdadisabler, voodoohda.kext, applealc.kext, and install it @/S/L/E

If you don't use a DSDT search with ioregistryexplorer for the HDEF device, if it's there you don't need the FixHDA patch, else add this to your config.plist 

<key>ACPI</key>
	<dict>
		<key>DSDT</key>
		<dict>
			<key>Debug</key>
			<false/>
			<key>DropOEM_DSM</key>
			<false/>
			<key>Fixes</key>
			<dict>
				<key>FixHDA_8000</key>
				<true/>

If it doesn't work your DSDT is patched to another layout-id, and must be changed to 0.

Link to comment
Share on other sites

Hi Wern Apfel. If this kext is the same like those from your thread  I can confirm that those kexts work, atleast which I tested - AppleHDA.kext_2CH.zip and AppleHDA.kext_2CH_s_quali.zip . Sound control work too, but have 1 problem with them - if increase volume to max via el capitan volume control, audio is...distorted. But if decrease volume (20-30%) from volume control in el capitan, all is flawless. I use two stereo speakers and mic for skype. 

I forgot to mention that I change layout id from 1 to 0 when tested your kexts. And not have dsdt. I use this tutorial  to install El Capitan without using my custom dsdt. All work flawless, even my 144hz monitor work perfect. Using only atheros kext for internet and fake smc, ofc clover bootloader too.

Link to comment
Share on other sites

×
×
  • Create New...