Struggles with AppleALC Custom Layout for ALC887

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
@ExtremeXT,

There are still a handful of options left:
  • Currently the rear Mic and rear Line In are configured as auto-sense pairs, which is technically not correct
  • So we can go back to pairing the rear Mic and front Mic together
  • Or we can split the front Mic and rear Mic (i.e. remove auto-switching) so they appear as separate inputs
    • This can produce 3 inputs:
      • Mic 1
      • Mic 2
      • Line In
  • We can also temporarily remove the front Mic and focus on bringing up the rear Mic
    • This will produce:
      • Mic 1
      • Line In
  • We can also remove front Mic and Line In
    • This will produce:
      • Mic 1
If you're up for testing these variants, I can produce all three variants and upload them by your morning time.

Variant AMic 1, Mic 2, Line In as 3 independent outputs
Variant BMic 1 and Line In only
Variant CMic 1 only
 
Last edited:

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
This is Variant A

It will look weird. That's okay. We just want to see:
  • Which Inputs are available in Sound --> Input
  • Do any of the inputs work?
  • Do both outputs still work?
 

Attachments

  • AppleALC.kext.zip
    1.3 MB · Views: 2

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
This is Variant B

We just want to see:
  • Which Inputs are available in Sound --> Input
  • Do any of the inputs work?
  • Do both outputs still work?
 

Attachments

  • AppleALC.kext.zip
    1.3 MB · Views: 2

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
This is Variant C

We just want to see:
  • Which Inputs are available in Sound --> Input
  • Do any of the inputs work?
  • Do both outputs still work?
 

Attachments

  • AppleALC.kext.zip
    1.3 MB · Views: 1

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
Variant A:
  • Internal Microphone, Line In, Line In
  • No
  • Yes
Variant B: Same as Variant A.

Variant C: Same as Variant B and C.

Is it possible to focus on the front mic port instead of the back one? It's easier for me to plug it in there.
 
Last edited:

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
There are very few options remaining.

We can try changing the Mic address from 0x50010018 to 0x50010019 in layout15.xml (in Resources/ALC887 sub folder) just under MuteGPIO. The address is specified in decimal, so it would be: 1342242841

XML:
<key>Mic</key>
   <dict>
   <key>MuteGPIO</key>
   <integer>1342242841>
   <key>SignalProcessing</key>
   …
   </dict>

Another option would be to use the SignalProcessing section from a different layout XML.

The microphone should work on other boards that use the same chip/codec so it’s puzzling why this particular board is not cooperating.
 

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
There are very few options remaining.

We can try changing the Mic address from 0x50010018 to 0x50010019 in layout15.xml (in Resources/ALC887 sub folder) just under MuteGPIO. The address is specified in decimal, so it would be: 1342242841

XML:
<key>Mic</key>
   <dict>
   <key>MuteGPIO</key>
   <integer>1342242841>
   <key>SignalProcessing</key>
   …
   </dict>

Another option would be to use the SignalProcessing section from a different layout XML.

The microphone should work on other boards that use the same chip/codec so it’s puzzling why this particular board is not cooperating.
My guess is that AppleHDA doesn't support AMD microphones, it's been known for a while that you need VoodooHDA or an USB DAC. Maybe we could look into patching AppleHDA and integrating that into AppleHDA?
 

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
Have you tried Layout 77?

It looks quite reasonable…

We just need to set alcid=77
 
Last edited:

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
My guess is that AppleHDA doesn't support AMD microphones, it's been known for a while that you need VoodooHDA or an USB DAC. Maybe we could look into patching AppleHDA and integrating that into AppleHDA?
Let me test Mic input on my Gigabyte B550 Vision D shortly. It uses ALC1220.
 

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
Please ignore previous post about layout 77. That’s for 897 not 887.
 

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
We may need to look at PROC_COEF and COEF_INDEX values, then construct additional verbs for the Microphone input if something significant is discovered. Normally it's not necessary to inject additional verbs, but this has helped solve the following problems in the recent past (i.e. within the last year):
  1. Sound output not working after booting from Windows to Mac if Realtek drivers are installed in Windows
  2. Microphone input not working on some codecs
I can create the additional verbs, but let's first run the following data-collection steps:
  1. Create a Linux Live USB
    • We can download Ubuntu, for example, and use Balena Etcher to transfer the ISO image to an empty USB flash drive
    • Then we boot from the flash drive and choose the option to run Linux without installing it
  2. Boot Linux Live
  3. Important: In Linux, verify that sound output and input are working
  4. If so, then run the two commands shown below and post the output directly to this site from Linux (Firefox is included with Ubuntu)
Screen Shot 2022-12-04 at 3.53.38 AM.png

Then we'll boot into macOS and use alc-verb and dump_coeff.sh (which I can post here) to query the system for specific coefficients on our Microphone and Line-In nodes to see if they are different from Linux. If they're different, we can try injecting alc-verbs to make them equivalent to Linux.

The procedure is located here:
 

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
Attached ZIP contains two files for macOS:
  • dump_coeff.sh
  • alc-verb
The script dump_coeff.sh is what we'll use. It calls alc-verb internally. To use this in macOS, however, we need the output from Linux.
 

Attachments

  • ALC-Dumps.zip
    7.4 KB · Views: 2

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
We may need to look at PROC_COEF and COEF_INDEX values, then construct additional verbs for the Microphone input if something significant is discovered. Normally it's not necessary to inject additional verbs, but this has helped solve the following problems in the recent past (i.e. within the last year):
  1. Sound output not working after booting from Windows to Mac if Realtek drivers are installed in Windows
  2. Microphone input not working on some codecs
I can create the additional verbs, but let's first run the following data-collection steps:
  1. Create a Linux Live USB
    • We can download Ubuntu, for example, and use Balena Etcher to transfer the ISO image to an empty USB flash drive
    • Then we boot from the flash drive and choose the option to run Linux without installing it
  2. Boot Linux Live
  3. Important: In Linux, verify that sound output and input are working
  4. If so, then run the two commands shown below and post the output directly to this site from Linux (Firefox is included with Ubuntu)
View attachment 8919

Then we'll boot into macOS and use alc-verb and dump_coeff.sh (which I can post here) to query the system for specific coefficients on our Microphone and Line-In nodes to see if they are different from Linux. If they're different, we can try injecting alc-verbs to make them equivalent to Linux.

The procedure is located here:
Here is my codec dump from an older Linux Mint ISO I had laying around on my Ventoy USB drive, I hope it's okay. The microphone works perfectly in this environment. macOS coefficient dump coming soon.
 

Attachments

  • linux_codec_dump.txt
    15.8 KB · Views: 5

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
@CaseySJ Here is the output from the script on macOS, I hope I did it right.
extremext@ExtremeXTs-Mac-Pro ALC-Dumps % ./dump_coeff.sh 1 0x20 24


Node 0x20


Processing caps: ncoeff=24


Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc
Coeff 0xe00002bc: 0xe00002bc

EDIT: All of them are the same 🤔
 

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
So I forgot to add the alc-verb property, here is the new list.

extremext@ExtremeXTs-Mac-Pro ALC-Dumps % ./dump_coeff.sh 0 0x20 24


Node 0x20


Processing caps: ncoeff=24


Coeff 0x00: 0x6033


Coeff 0x01: 0xa9a8


Coeff 0x02: 0x86a5


Coeff 0x03: 0x0000


Coeff 0x04: 0x0001


Coeff 0x05: 0x0000


Coeff 0x06: 0x0000


Coeff 0x07: 0x0808


Coeff 0x08: 0x0030


Coeff 0x09: 0x1900


Coeff 0x0a: 0x0000


Coeff 0x0b: 0x0c00


Coeff 0x0c: 0x3f02


Coeff 0x0d: 0x0000


Coeff 0x0e: 0x0000


Coeff 0x0f: 0xddcc


Coeff 0x10: 0xddcc


Coeff 0x11: 0xddcc


Coeff 0x12: 0x0300


Coeff 0x13: 0x0053


Coeff 0x14: 0x3fff


Coeff 0x15: 0x0080


Coeff 0x16: 0x062b


Coeff 0x17: 0x0340
 

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
Coefficient 0x09 is different:
  • Linux = 0x1800
  • Mac = 0x1900
This might pertain to the path map, as follows:
  • Currently we have Audio Input 0x08 connected to Microphone node 0x18
  • Currently we have Audio Input 0x09 connected to Microphone node 0x19 <-- hence Coeff 0x09 on Mac is 0x1900 (I believe)
This is a guess. But we can harmlessly try this:
  • Remap Audio Input 0x09 to Microphone node 0x18
  • Remap Audio Input 0x08 to Microphone node 0x19
Line-In can be left as-is:
  • Audio Input 0x08 to Line-In node 0x1A
I can make this change to the ConfigData and compile a new version.
 
Last edited:

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
However, we can also add an ALC Verb for node 0x20 that makes the change to 0x1800. I can do that as well.
 

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
Attached is AppleALC that includes these 2 changes to path map:
  • Remap Audio Input 0x09 to Microphone node 0x18
  • Remap Audio Input 0x08 to Microphone node 0x19
After booting with this, let's generate the coeff dump in macOS once again.
 

Attachments

  • AppleALC.kext.zip
    1.3 MB · Views: 1

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
Attached is AppleALC that includes these 2 changes to path map:
  • Remap Audio Input 0x09 to Microphone node 0x18
  • Remap Audio Input 0x08 to Microphone node 0x19
After booting with this, let's generate the coeff dump in macOS once again.
Here are the coeffs.
Coeff 0x00: 0x6033


Coeff 0x01: 0xa9a8


Coeff 0x02: 0x87a9


Coeff 0x03: 0x0000


Coeff 0x04: 0x0001


Coeff 0x05: 0x0000


Coeff 0x06: 0x0000


Coeff 0x07: 0x0808


Coeff 0x08: 0x0030


Coeff 0x09: 0x1800


Coeff 0x0a: 0x0000


Coeff 0x0b: 0x0c00


Coeff 0x0c: 0x3f02


Coeff 0x0d: 0x0000


Coeff 0x0e: 0x0000


Coeff 0x0f: 0xddcc


Coeff 0x10: 0xddcc


Coeff 0x11: 0xddcc


Coeff 0x12: 0x0300


Coeff 0x13: 0x0053


Coeff 0x14: 0x3fff


Coeff 0x15: 0x0080


Coeff 0x16: 0x062b


Coeff 0x17: 0x034c
 
Back
Top Bottom
  AdBlock Detected
Sure, ad-blocking software does a great job at blocking ads, but it also blocks some useful and important features of our website. For the best possible site experience please take a moment to disable your AdBlocker.