Jump to content

AppleHDA patching in Mountain Lion

AppleHDA ML .xml.zlib

  • Please log in to reply
237 replies to this topic

#21
DoiX

DoiX

    Homo discens

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,130 posts
  • Gender:Male
  • Location:Terra
  • Interests:Photography, design, beer.
Oh, yes i've seen it. Unfortunately i need the sources to apply it... damnit i'm stuck with broken/dubstepping sound.

#22
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 1,050 posts
  • Gender:Male
Thats what you get by installing pirated stuff ahead of the actual release :)

#23
DoiX

DoiX

    Homo discens

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,130 posts
  • Gender:Male
  • Location:Terra
  • Interests:Photography, design, beer.
My main OS was pretty much dead so i said why install lion only to reinstall ML next week.

#24
nyolc8

nyolc8

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 802 posts
  • Gender:Male
  • Location:Budapest, Hungary

@nyolc8
I can't tell yet. I have't installed GM yet and not planning to until the sources will be out, it will be a couple of weeks after the official release.

Okay, then I use Lion's AppleHDA for sound until there is no solution :)

#25
nyolc8

nyolc8

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 802 posts
  • Gender:Male
  • Location:Budapest, Hungary
Solved, needed two new binpatch, now works! :D

sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x53\x01\x00\x00|\x62\x06\xec\x10\x0f\x84\x1f\x01\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x2f\x01\x00\x00|\x62\x06\xec\x10\x0f\x84\xfb\x00\x00\x00|g' AppleHDA


#26
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 1,050 posts
  • Gender:Male
yes, I have calculated those here: http://applelife.ru/...e-9#post-299195
however this is only a good working solution for ALC662, 665, 889, 892. At least those were reported as working.
here are the confirmation that it worked: #1 #2 #3
These also should work:

sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x53\x01\x00\x00|\x62\x06\xec\x10\x0f\x84\x8f\x02\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x2f\x01\x00\x00|\x62\x06\xec\x10\x0f\x84\x53\x02\x00\x00|g' AppleHDA
Please report if they do, as these calculations don't match my codec so I'm unable to test myself. These are better, because they skip one additional jump that is used in the patch above.

#27
DoiX

DoiX

    Homo discens

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,130 posts
  • Gender:Male
  • Location:Terra
  • Interests:Photography, design, beer.
@TimeWalker, funny enough. Neither your patching nor the ones used by Vladlenas work, despite having the same audio chip.

#28
Riley Freeman

Riley Freeman

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 884 posts
  • Gender:Male
  • Location:The Streets
@TimeWalker: Is there any advantage to patching out the Wolfson codec? My HDA seems to be working just fine by patching out ALC262. There's only one string to binpatch and it doesn't need to be altered when the binary changes.

sudo perl -pi -e 's|\x62\x02\xec\x10|\x83\x08\xec\x10|g' /System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA

Just curious as patching out the Wolfson seems to be more involved and isn't constant between versions.

#29
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 1,050 posts
  • Gender:Male
DoiX,
every perl line has an id that need to be changed to your codec' s id. if you havent changed them it just won't work. so you just can't copy and pase the lines and hope for the best.
if the solution provided by Vladlenas has not worked for you, then you have an obvious problem with your:
1. layout it
2. pathmap id
3. platforms/layout zlib
4. pinconfig data


Riley Freeman,
take a look at this graph which describes the FunctionGroupFactory logic when enabling a functiongroup for a specific audio codec: http://puu.sh/JzZ0
the green lines are true, the red line - false. basically every codec goes through a series of checks to determine if it's a valid and can use one of the predefined groups/widget that actually enable audio. the wolfson is the first one to get checked. if we substitue it with the desired id and make it not go deep into the check sequence but instead forward it to the address we need (ie the desired substitute codec, which in your case is 262) we basically eliminate the fail factor.
well, the 262 is not that far in the check sequence actually and if your codec is close enough and is able to work than you're lucky :)

#30
DoiX

DoiX

    Homo discens

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,130 posts
  • Gender:Male
  • Location:Terra
  • Interests:Photography, design, beer.
@TimeWalker75a, obviously i wasn't born yesterday in the Osx86 scene :D. Every bite was changed accordingly to my audio chip. Layout id/pathmap/platforms/pinconfig have all been ported from previously patched AppleHDA (that works)...

Found the problem: The god damn DSDT compiler introduces unicode text in the region i modified the value. Must be something with ML because on Lion it works.

Edited by DoiX, 18 July 2012 - 03:51 PM.


#31
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 1,050 posts
  • Gender:Male
Ok, than this seems really strange to me.
Try this then:

sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x53\x01\x00\x00|\x65\x06\xec\x10\x0f\x84\x47\x01\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x2f\x01\x00\x00|\x65\x06\xec\x10\x0f\x84\x23\x01\x00\x00|g' AppleHDA

If this doesn't work, then try the good old method that Vladlenas was using:
sudo perl -pi -e 's|\x85\x08\xec\x10|\x65\x06\xec\x10|g' AppleHDA
sudo perl -pi -e 's|\x5f\x31\x30\x45\x43\x30\x38\x38\x35|\x5f\x31\x30\x45\x43\x30\x36\x36\x35|g' AppleHDA
If still no, than try to add
sudo perl -pi -e 's|\x84\x08\xec\x10|\x00\x00\x00\x00|g' AppleHDA
to the above patch.

if after all that it still doesn't work then welcome to my boat :(

UPD:
AFAIK dsdt is 32 bit. so ML might interpretate the unicode characters wrong. so it worked after all ? which of the patches exactly ? can you confirm the one I have previously asked to test works?

#32
DoiX

DoiX

    Homo discens

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,130 posts
  • Gender:Male
  • Location:Terra
  • Interests:Photography, design, beer.
Uh, i spoke to soon. i repatched the kext again (vladlenas method) to make sure i didn't miss something by mistake. Still not working. I'll test the other strings you suggest.

I'll report back in 15 minutes or so.

#33
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 1,050 posts
  • Gender:Male
ok, I'll stay put.
In case all of the above fails, try to substitute 262 .. but add the ASCII patch to it as well, like so:

sudo perl -pi -e 's|\x62\x02\xec\x10|\x65\x06\xec\x10|g' AppleHDA
sudo perl -pi -e 's|\x5f\x31\x30\x45\x43\x30\x32\x36\x32|\x5f\x31\x30\x45\x43\x30\x36\x36\x35|g' AppleHDA


#34
nyolc8

nyolc8

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 802 posts
  • Gender:Male
  • Location:Budapest, Hungary

yes, I have calculated those here: http://applelife.ru/...e-9#post-299195
however this is only a good working solution for ALC662, 665, 889, 892. At least those were reported as working.
here are the confirmation that it worked: #1 #2 #3
These also should work:


sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x53\x01\x00\x00|\x62\x06\xec\x10\x0f\x84\x8f\x02\x00\x00|g' AppleHDA
sudo perl -pi -e 's|\xff\x87\xec\x1a\x0f\x8f\x2f\x01\x00\x00|\x62\x06\xec\x10\x0f\x84\x53\x02\x00\x00|g' AppleHDA
Please report if they do, as these calculations don't match my codec so I'm unable to test myself. These are better, because they skip one additional jump that is used in the patch above.

Tried, these worked too :)

(edit: I'm getting sound assertion errors in console, but i'm getting those since 10.6.4 or something...)

#35
DoiX

DoiX

    Homo discens

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,130 posts
  • Gender:Male
  • Location:Terra
  • Interests:Photography, design, beer.
Alright, so:

First patch: Shows only HDMI output as a name, no specific info in System Profiler and devices section is empty, and cuts off AppleHDACodecGeneric in the IORegistry
The rest: Shows all the channels names, no specific info. Devices section empty. IOreg shows the AppleHDACodecGeneric with AppleHDA loaded beneath, but thats it.

In Other words, not working... so does your boat have a mini fridge? :D

#36
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 1,050 posts
  • Gender:Male
f . u encoding. ...

Tried, these worked too

(edit: I'm getting sound assertion errors in console, but i'm getting those since 10.6.4 or something...)


ok, cool. will make a note to myself then, as this is a more logical patch than the first one you've used.
yes, these are usually related to setpinconfig and powermanagement. i believe you can get rid of them, but i havent looked into it in detail...

In Other words, not working... so does your boat have a mini fridge?


ugghhh.. I guess you can try to patch out all of the ASCII, not just 2 occurrences with underscore (\x5f). I mean like this:
sudo perl -pi -e 's|\x31\x30\x45\x43\x30\x32\x36\x32|\x31\x30\x45\x43\x30\x36\x36\x35|g'  AppleHDA
basically try this
sudo perl -pi -e 's|\x62\x02\xec\x10|\x65\x06\xec\x10|g' AppleHDA
sudo perl -pi -e 's|\x31\x30\x45\x43\x30\x32\x36\x32|\x31\x30\x45\x43\x30\x36\x36\x35|g' AppleHDA
or this ...
sudo perl -pi -e 's|\x85\x08\xec\x10|\x65\x06\xec\x10|g' AppleHDA
sudo perl -pi -e 's|\x31\x30\x45\x43\x30\x38\x38\x35|\x31\x30\x45\x43\x30\x36\x36\x35|g' AppleHDA

If it fails, then I really have no clue what's wrong with your setup. I guess, make sure you use the right version of IOAudioFamily and also double-check that your layout id is set to one of the actual numbers used by Apple. In the event this is correct our boat shall sail on .. sadly, with no mini fridge at the moment ...

#37
DoiX

DoiX

    Homo discens

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,130 posts
  • Gender:Male
  • Location:Terra
  • Interests:Photography, design, beer.
@TimeWalker, could you ask vladlenas if he uses his AppleHDA.kext with the stock IOAudioFamily.kext or with the old patched one. Also if he did any extra DSDT modification?

#38
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 1,050 posts
  • Gender:Male
You can't use the old patched one, it is incompatible with the new zlib architecture in ML. You have to use ML vanilla one, that comes with the install.
In 10.7 he was using the stock one until i had patched the 10.7.4 recently, he is using it as of now for his 10.7 install and for 10.8 there's no solution since sources are not out yet.
He has no DSDT modifications for HDEF, he uses layout injection through Clover settings:

<key>PCI</key>
<dict>
<key>HDAInjection</key>
<string>12</string>
</dict>
I have been chatting with him a lot lately.

#39
DoiX

DoiX

    Homo discens

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,130 posts
  • Gender:Male
  • Location:Terra
  • Interests:Photography, design, beer.
Oh, thats better than switching distros to compile DSDT :D. I've tested your patches with both vanilla and your patched IOAudioFamily.kext. Using Lion's patched AppleHDA and your IOAudioFamily.kext everything works ok even on ML.

I've did a bit of debugging using darwindumper and comparing the results with Lion kexts. It seems to me that platforms.xml.zlib isn't getting loaded for some reason, i can't tell why.

#40
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 1,050 posts
  • Gender:Male
I haven't really looked into the changes to the xmls to be honest, those might be the problem you and me are not getting sound after all these patches. But for my desktop machine with ALC888 i just took both of the xmls, converted them to zlib and they work, so I just went ahead and assumed that nothing had changed dramatically .. so AL269 should also work.

Well, in case the principle of going around the obstacles (ie skipping most of the checks by patching wolfson out) still apply, I guess what I will be doing in the near future is taking all of the jumptables with the codec ids that are still in place in the binary, patching out the wolfson id with mine then jumping to a desired codec from jumptable. I will just need to calculate a new jump address for each codec that is found in the binary >_< this way i will be able to figure out why is AD1984 no longer working for ALC269/271 and what might be the aplicable codec as of 10.8 to patch it in the future.





Also tagged with one or more of these keywords: AppleHDA, ML, .xml.zlib


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy