Jump to content
5410 posts in this topic

Recommended Posts

attachicon.gifResources.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.

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

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

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?

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

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.

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

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.

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.

  • Like 3

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

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

  • Like 1
×
×
  • Create New...