Jump to content

Verb Command Mayhem - Realtek ALC215


Fortitude
 Share

2 posts in this topic

Recommended Posts

I’ve been working for the past week on a method to enable native audio on my Alienware Area 51m R2 laptop running macOS Big Sur Version 11.5.2. Because my codec has limited support in the Hackintosh community, I had to learn how to create my own custom AppleALC audio patch. While I believe I figured out the correct pin configuration and path maps after a lot of trial and error, I’m running into issues with my outputs which require very specific verb commands in order to function properly.

 

(My inputs seem to work perfectly though which is the good news!)

 

Here's the information for my pin configuration and path maps for reference:

Pin Configuration

ConfigData:
01771c10 01771d01 01771e17 01771f90 02171c20 02171d10 02171e21 02171f03 02170c02 01271c30 01271d01 01271ea0 01271fb7 01b71c40 01b71d10 01b71e81 01b71f03 01b70c02

WakeConfigData:
02170c02 01b70c02
PathMaps

Inputs:				Outputs:

8 -> 35 -> 27			33 -> 2
Line Input			Headphones

8 -> 35 -> 18			23 -> 3
Mic Input			Speakers

Hackintool.thumb.png.fae3fdc6f3a89e313c9506728e1df5b2.png

 

1430570623_SpeakersHeadphones.thumb.png.188bc77b6fef47ded0dfaaebdd8d4004.png

 

The reason for the verb commands are as follows:

The system is aware when headphones are connected/disconnected and changes the one available output device accordingly (either “Internal Speakers” or “Headphones” become available). The problem is that my speakers don’t always produce sound once they’re connected (even though the volume can be altered). However, any pair of headphones once connected will always produce sound, but are a high gain mess.

 

After multiple hours of more trial and error, I figured out the required verb commands for the codec in order to remove headphone distortion and reenable the speakers after headphones are plugged/unplugged:

 

Remove Headphone Distortion:
(Needs to run once during startup.)

alc-verb 0x19 SET_PIN_WIDGET_CONTROL 0x20

I don’t understand why node 19 works specifically since I never used it in my path maps.
Enable Internal Speakers After Headphone Removal:
(Needs to run during startup, and when headphones are removed.)

alc-verb 0x21 SET_EAPD_BTLENABLE 0x1
alc-verb 0x21 SET_EAPD_BTLENABLE 0x2

When headphones are plugged in, my speakers are automatically turned off which seems to affect the value of the EAPD enable pin. I figured out a nonsequential way to fix my jack issues (see discussion below), but not my startup issues. This command needs to run at startup because when headphones aren’t plugged in, the enable bit on the EAPD seems to be somewhere between 0-1, and needs to be brute forced to a logical 1 before I can do anything else.
(I’m assuming that there could be a verb command to keep the EAPD enable pin on when headphones are plugged in, however, I don’t know if this exists.)

 

In order to run these commands, I figured that ALCPlugFix-Swift by black.dragon74 would be the best program to use.

Here's my current configuration:

 

ALCPlugFix.thumb.png.cdc8defae33b811c3cf6dae4c204f124.png

 

It allows me to remove the headphone distortion on startup, and I integrated a nonsequential method for interfacing with the EAPD in order to fix the jack issues. However, I require the sequential method at startup to fix speaker issues, and that’s where the problem that I’m having lies:

 

I have to run those two specific commands in that order on startup so that if headphones aren’t inserted, my internal speakers work properly. The current configuration with ALCPlugFix runs the two commands in any order it wants.

 

Does anyone know if ALCPlugFix/AppleALC supports sequential commands, or if a developer could add this functionality? If it doesn’t exist, I’m assuming that you could add sequentiality by running a for loop on some sort of an array, however, I’m not too familiar with how to extract data from a plist file, and don’t know if I’m up to the job of rewriting a daemon or kext. Finally, I believe that I can integrate the headphone distortion fix into my AppleALC patch, however, I’m not sure how to do this and could use some help.

 

I believe that with the InsanelyMac community on my side, we can make my codec work properly. I’ve attached the codec dumps for my system below, and will pm my full codec patch if necessary.

Thank you all for your support, and happy holidays everyone!

ALC215.txt UHD630.txt

Edited by Fortitude
Link to comment
Share on other sites

I’ve decided to try and modify the source code for ALCPlugFix-Swift in order to deal with this brutal codec and fix my startup issues:

This is a little beyond me as I’ve never worked with plist files, and have ZERO Swift programming experience (I have programming experience however in C/C++). Reading through the source code, it seems that this program passes a plist file to an ALCPlugFix object which contains an array of structs member called “hdaVerbs.”

 

After connecting to the provider, the program immediately processes specific verb commands contained in the struct array during the startup process. I modified the program to not only filter these commands, but also sort them before processing by using a new parameter that I added to the plist file:

 

I added a “Sequence” parameter into the plist file that sorts verb commands in a preferred order at startup.

 

1617511458_ModifiedProgram.thumb.png.57be768317733b93047874a1a1604a22.png

 

The problem is that this darn program still doesn’t seem to to sort the two sequential commands properly every time at startup, and I end up with no sound through my internal speakers. I also can’t seem to get debug output into the console in order to see if ANYTHING is being sorted!

 

1000968065_MoreData.thumb.png.52f37fb6d2e29e6690b5ab71a12160de.png

 

I’m desperate for assistance at this point because I know that I’m really close to fully solving my audio issues.

I didn't think that it would go as far as rewriting a daemon, but I'm sure that this modification will help someone else out in the future who's in a similar situation once working and possibly merged with the original repo. I’m not sure what I’m doing wrong with this program currently, and could really use some help.

Edited by Fortitude
  • Thanks 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...