Struggles with AppleALC Custom Layout for ALC887

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
I assume the Microphone still does not work?

There are two differences now:
  • Coefficient 0x02
    • 0x86a5 in Linux
    • 0x87a9 in macOS
  • Coefficient 0x17
    • 0x0340 in Linux
    • 0x034c in macOS
The previous difference has been resolved:
  • Coefficient 0x09 is 0x1800 in both Linux and macOS
  • So our assumption about the path map may have been correct
P.S. When copying-and-pasting text into a post on this site, we can press SHIFT-OPTION-CMD-V to avoid those extra line spaces.
 

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
I assume the Microphone still does not work?

There are two differences now:
  • Coefficient 0x02
    • 0x86a5 in Linux
    • 0x87a9 in macOS
  • Coefficient 0x17
    • 0x0340 in Linux
    • 0x034c in macOS
The previous difference has been resolved:
  • Coefficient 0x09 is 0x1800 in both Linux and macOS
  • So our assumption about the path map may have been correct
P.S. When copying-and-pasting text into a post on this site, we can press SHIFT-OPTION-CMD-V to avoid those extra line spaces.
Yes, it still doesn't work.

What's next? Fixing the remaining 2 coefficients?
 

CaseySJ

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

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
Let's try modifying the coefficients in a Terminal window. If the modifications work, I can incorporate them into the kext. To recap, these are two we'll be changing:
  • Coefficient 0x02
    • 0x86a5 in Linux
    • 0x87a9 in macOS
  • Coefficient 0x17
    • 0x0340 in Linux
    • 0x034c in macOS
Please try this from the directory containing alc-verb and coeff_dump.sh:
Bash:
# let's change coefficient 0x02
./alc-verb 0x20 0x5 0x02
./alc-verb 0x20 0x4 0x86a5

# now let's read back the new value, hopefully it got changed
./alc-verb 0x20 0x5 0x02
./alc-verb 0x20 0xC 0x0

Let's check microphone before proceeding.

Bash:
# now let's change coefficient 0x17
./alc-verb 0x20 0x5 0x17
./alc-verb 0x20 0x4 0x0340

# now let's read it back, hopefully it got changed
./alc-verb 0x20 0x5 0x17
./alc-verb 0x20 0xC 0x0

Did this make any difference to rear or front microphone?
 

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
I've added the new verbs to attached kext, but we should still run the Terminal commands first to determine which change, if any, makes a difference.

Coefficient 0x02 --> 0x86A5
Coefficient 0x17 --> 0x0340

The new verbs are:
02050002
020486A5
02050017
02040340

I think boot argument alcverbs=1 may be necessary.
 

Attachments

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

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
I've added the new verbs to attached kext, but we should still run the Terminal commands first to determine which change, if any, makes a difference.

Coefficient 0x02 --> 0x86A5
Coefficient 0x17 --> 0x0340

The new verbs are:
02050002
020486A5
02050017
02050340

I think boot argument alcverbs=1 may be necessary.
Unfortunately, neither the new kext or the commands change anything.

This is the new output.

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: 0x034c
 

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
At this point it's good to take a breather and see where we stand:
  • We've experimented with various PinConfigs (verbs)
  • We've experimented with various Path Maps
  • We've experimented with various Coefficients
  • Outputs (headphone and line-out) are working
  • Inputs (Mic and Line-in) are not working
Some questions:
  • You mentioned that microphone works with VoodooHDA. Is this compatible with Ventura? Or you are using it with a previous version of macOS?
  • VoodooHDA source code makes extensive use of DumpMsg( ... ) to generate detailed logs, but it reads the value of VoodooHDAVerboseLevel to determine what to log.
    • Do you know how to enable these logs?
    • Is this a boot argument?
    • It has to be an integer greater than 1 so VoodooHDAVerboseLevel=2 should work
    • I believe the logs will go to _IOLog
I'm still looking for my analog microphone to see whether the problem occurs also on my B550 Vision D. If it does, it allows me to run experiments locally.
 

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
At this point it's good to take a breather and see where we stand:
  • We've experimented with various PinConfigs (verbs)
  • We've experimented with various Path Maps
  • We've experimented with various Coefficients
  • Outputs (headphone and line-out) are working
  • Inputs (Mic and Line-in) are not working
Some questions:
  • You mentioned that microphone works with VoodooHDA. Is this compatible with Ventura? Or you are using it with a previous version of macOS?
  • VoodooHDA source code makes extensive use of DumpMsg( ... ) to generate detailed logs, but it reads the value of VoodooHDAVerboseLevelto determine what to log.
    • Do you know how to enable these logs?
    • Is this a boot argument?
    • It has to be an integer greater than 1 so VoodooHDAVerboseLevel=2 should work
    • I believe the logs will go to _IOLog
I'm still looking for my analog microphone to see whether the problem occurs also on my B550 Vision D. If it does, it allows me to run experiments locally.
VoodooHDA works on Big Sur and above only by installing it into /L/E, which requires disabling SIP, and it also has really bad sound output quality. The process can be seen here:

I have no idea how to get the logs from it, but would that actually help? I can also try to get disassembled files of the AppleHDA Kexts tomorrow.
 

CaseySJ

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


I have no idea how to get the logs from it, but would that actually help? I can also try to get disassembled files of the AppleHDA Kexts tomorrow.
I looked through the source code. The verbose logs generate very detailed configuration data. The source code does not apply patches for specific controllers so the idea of borrowing special coefficient settings is not an option.

Disassembled files are not necessary because the entire source code is available. I’ll try building the XCode project.
 

Shaneee

The AMD Guy
Staff member
Administrator
Joined
Mar 13, 2020
Messages
2,181
@CaseySJ Did I see you post a tutorial somewhere for AppleALC? I might see if I can get something with my S1220A codec. Somehow I've lost headphone detection too but who knows why lol
 

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
@CaseySJ Did I see you post a tutorial somewhere for AppleALC? I might see if I can get something with my S1220A codec. Somehow I've lost headphone detection too but who knows why lol
Certainly -- here's a link to that guide:

I've been updating it based on the struggles in this thread...
 
Last edited:

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
... I’ll try building the XCode project.
It was rather simple to build the Xcode project. That in itself, however, doesn't help us. I need to look for my analog microphone...

Screen Shot 2022-12-04 at 2.52.03 PM.png
 

CaseySJ

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

With VoodooHDA running, please run the attached binary in Terminal. It's part of the VoodoHDA source tree and seems to iterate through each Audio node and dump various data items.

Bash:
# cd to the directory containing this binary
# then invoke without any parameters

./getdump
 

Attachments

  • getdump.zip
    1.8 KB · Views: 2

CaseySJ

Guru
Guru
Donator
Joined
May 10, 2020
Messages
1,269
Fixed a mistake in the coefficient verb shown in yellow below.

Coefficient 0x02 --> 0x86A5
Coefficient 0x17 --> 0x0340

The new verbs are:

02050002
020486A5
02050017
02040340 <-- fixed this verb

This is why coefficient 0x17 did not change previously. No guarantees this will make things better, but it should be tested in order to properly conclude this particular experiment.
 

Attachments

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

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
Fixed a mistake in the coefficient verb shown in yellow below.

Coefficient 0x02 --> 0x86A5
Coefficient 0x17 --> 0x0340

The new verbs are:

02050002
020486A5
02050017
02040340 <-- fixed this verb

This is why coefficient 0x17 did not change previously. No guarantees this will make things better, but it should be tested in order to properly conclude this particular experiment.
Hello, sorry for the delay, unfortunately this version doesn't fix it either.

I also tested VoodooHDA and it doesn't seem to work on my codec, I assumed it would as it did on my friend's AMD Hackintosh.
 
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.