How to remap audio jack in BIOS?


look for CRB*** modules, pei smm and dxe variants. in 2014 ami bioses, HDA pins assigned in file CRBLib.c, so this is "verb" table.
in modern bioses it may moved to acpi tables



I searched CRB but find nothing.I will look into ACPI tables.Thanks for your advice.


try to hexfind all modules for ven/dev_id

for example i have realtek hda ven=10EC, dev=0887. hexfind for "EC 10 87 08" result two pei modules PlatformInit and PlatformInitPreMem
these modules very important and replacing from old bios probably will hang bios.

verb table embedded into these modules and look like this:



UINT32 CrbHdaVerbTbl1 = {
//
// Rear Audio Verb Table - 10EC0880/0000/03
//
// Pin Complex 1 (NID 1Eh)
0x01E71F01,
0x01E71E44,
0x01E71D21,
0x01E71C00,

// Pin Complex 2 (NID 1Fh)
0x01F71F01,
0x01F71EC4,
0x01F71D21,
0x01F71C10,

// Pin Complex 3 (NID 14h)
0x01471F01,
0x01471E01,
0x01471D40,
0x01471C20,

// Pin Complex 4 (NID 15h)
0x01571F01,
0x01571E01,
0x01571D40,
0x01571C21,

// Pin Complex 5 (NID 16h)
0x01671F01,
0x01671E01,
0x01671D90,
0x01671C22,

// Pin Complex 6 (NID 17h)
0x01771F01,
0x01771E01,
0x01771D30,
0x01771C23,

// Pin Complex 7 (NID 1Ah)
0x01A71F01,
0x01A71E81,
0x01A71D30,
0x01A71C30,

// Pin Complex 8 (NID 18h)
0x01871F01,
0x01871EA1,
0x01871D90,
0x01871C31,

// Pin Complex 11 (NID 1Ch)
0x01C71F99,
0x01C71E33,
0x01C71DF1,
0x01C71C70,

// Pin Complex 12 (NID 1Dh)
0x01D71F99,
0x01D71EF3,
0x01D71DF1,
0x01D71C80,

//
// front panel
//

// Pin Complex 9 (NID 1Bh)
0x01B71F02,
0x01B71E21,
0x01B71D40,
0x01B71C50,

// Pin Complex 10 (NID 19h)
0x01971F02,
0x01971EA1,
0x01971D90,
0x01971C60
};



#include <device/azalia_device.h>

const u32 cim_verb_data = {
/* coreboot specific header /
0x10ec0887, // Realtek 887
0x1458a002, // Subsystem ID
0x0000000e, // Number of entries

/
Pin Widget Verb Table */
AZALIA_PIN_CFG(0, 0x11, 0x411111f0),
AZALIA_PIN_CFG(0, 0x12, 0x411111f0),
AZALIA_PIN_CFG(0, 0x14, 0x01014410),
AZALIA_PIN_CFG(0, 0x15, 0x411111f0),
AZALIA_PIN_CFG(0, 0x16, 0x411111f0),
AZALIA_PIN_CFG(0, 0x17, 0x411111f0),
AZALIA_PIN_CFG(0, 0x18, 0x01a19c50),
AZALIA_PIN_CFG(0, 0x19, 0x02a19c60),
AZALIA_PIN_CFG(0, 0x1a, 0x0181345f),
AZALIA_PIN_CFG(0, 0x1b, 0x02214c20),
AZALIA_PIN_CFG(0, 0x1c, 0x411111f0),
AZALIA_PIN_CFG(0, 0x1d, 0x4004c601),
AZALIA_PIN_CFG(0, 0x1e, 0x411111f0),
AZALIA_PIN_CFG(0, 0x1f, 0x411111f0)
};

Thanks for testing BIOS and reporting back, I figured it might not boot. Any mod done to this BIOS may cause non-boot due to the Intel Boot Guard.
Maybe it’s only certain modules and that Realtek PEI one was a big hassle so I assumed it would probably fail. Then after several ways doing the insert I was finally able to make UEFITool output match for both your mod BIOS and the BIOS I mod so that gave me hope.

I found “CRB” at - AAC9B0AF-A46A-49D8-8016-9B9DAD2C7F5E > subGUID 39045756-FCA3-49BD-8DAE-C7BAE8389AFF (PE32) = DXEBoardConfigInit
Also at 39045756-FCA3-49BD-8DAE-C7BAE8389AFF > PE32 Module = TCG2DXE

lib.c I can only find references in CryptoPkgTest and RAIDModule (Maybe a TPM module too, but knew it wasn’t this) - nothing on easy search using CRBLib.c - will keep digging

I thought maybe I found at DevicePathDXE, still checking but I think not

Thanks for the latest update @Mov_AX_0xDEAD - so don’t copy/replace module, only edit sections from one to other, or do you think that still crash BIOS?
I do think this one is Realtek, found references to that yesterday. IS this work needed to be done in assembler, or can it be done in hex only? If assembler, I can’t do that so I wont be able to help further on this

@dsanke - can you get the hardware ID’s for the realtek controller from device manager - right click onto the Controller > “Properties” > “Details” > “Property” > “HardwareIDs”


Crash with wrong Platforminit is about 99.99%

Verb table in hex form, it has some unknow structure with repeating sequence, no asm needed.
Maybe replacing sequences from original bios may helps. Sequence in C files is short, but in bios modules long and have doubles
I see one way - replace some seq ->flash->check )


maybe this is answer, 4 bytes in sequences 01 x7 yy zz looks like in hex dump
in dump also i see incremental NIDs from 11 (01 17) to 1F(01 F7 )

Thank you Movax, I’ve noticed these hex pattern in modules long time ago but I don’t know what they are.
It works!
Now I get my audio work normally.

Thanks you sir,I’ve fixed that problem.


great news )

did you changed platforminit modules or else ?


I changed it too.Both 2 modules were changed.And I also corrected their subsystem id.

So audio is now working @dsanke ? That’s great if it is, very cool, thanks @Mov_AX_0xDEAD


I test it for whole day.
Realtek control panel show correct jacks and when I insert headphone , it report me that headphone inserted.
But there is no sound.I must edit Registry manually to get sound output.So weird.
Seems driver don’t change the value of proper Registry keys.
@Mov_AX_0xDEAD any ideas about this problem?
P7xxDM,DM3,TM official BIOS and my modified BIOS uploaded here :https://my.pcloud.com/publink/show?code=…5TOel48aQxHeUN7
P7xxDM 10EC0892
P7xxDM2,DM3,TM 10EC0899

Good it’s working, but bad on the issue still!
I noticed early on that RealtekPEI had lots more outputs (Audio outputs shown in text in there I mean) than the original realtekPEI module, maybe some part or all this still needs swapped in after above fix you found?


I have no ideas, i dont know how realtek control panel/driver works because i use native hda universal windows driver for realtek audio.
And it correct detect ejecting and inserting plug


The windows audio driver behaves the same as realtek driver.
Plug in headphone and speaker mutes , but no sound output to headphone.
Maybe other parts in BIOS need to be modified.


try to copy full table, in orig bios stored 0x0054h=84 entries starting from FFF51A8C (first copy ?) and FFF51BDC (second copy ?)


in ported bios 0x0064=100 entries starting from FFEB84E8 (first copy) and FFEB8678 (second)


Because size mismatch i think need:
1) change 0x0064 to 0x0054 at both places in port
2) copy 844=336 bytes at first copy location from orig to port
3) copy 84
4=336 bytes at second copy location from orig to port
4) repeat for PlatformInitPreMem (with other offsets)
if still no sound try exchange datas between first<->second location, because we dont know why there two copies and which is actual


try to copy full table, in orig bios stored 0x0054h=84 entries starting from FFF51A8C (first copy ?) and FFF51BDC (second copy ?)


in ported bios 0x0064=100 entries starting from FFEB84E8 (first copy) and FFEB8678 (second)


Because size mismatch i think need:
1) change 0x0064 to 0x0054 at both places in port
2) copy 844=336 bytes at first copy location from orig to port
3) copy 84
4=336 bytes at second copy location from orig to port
4) repeat for PlatformInitPreMem (with other offsets)
if still no sound try exchange datas between first<->second location, because we dont know why there two copies and which is actual


Done this and found only difference: inner mic disappear.
Headphone jack still don’t output sound.
2 sections are identical , only different is subsystem id.
Clevo use this to identity 15.6 or 17.3 device.

I change 54 to 40 and test again.The same.
There must be some other place in BIOS control audio.

And I am working on port P870TM to P870DM too.
The audio problem have 3 stage.
1.no modify to bios , just leave ec 10 99 08 and its verb table
subsystem id shows 10ec0892 in windows and got no sound at all.
2.change ec 10 99 08 to ec 10 92 08
speaker works and audio jack mismatch.
speaker play boom sound during boot.
3.replace part verb table
audio jack in driver become normal but no sound from headphone jack.
4.change 48 to 40(like 64 and 54 in p7xx bios),replace whole verb table
optical can work as headphone like tm series device.
but the verb table is totally dm data.

dm audio 4 jacks : line-in mic headphone optical
dm2,3 tm series 4 jacks: line-in mic line-out optical/headphone

It’s so weird.
dm device use dm verb table but still behaves like tm.
insert device to headphone jack and optical jack light red ,no sound from headphone jack but optical can output analog sound.

Hey @dsanke Are you the guy who discover the way to run Xeon E3 V5 on x1xx chipset?


Use Flash Image Tool set reserved to Enabled and try.

OK, i did that. Can you help us here, tell us more detail, blck oc etc… ?


HDA init becomes too messy. You also can look at PciPort dxe module, it has FIVE copies of data similar to verb tables but i dont see any references to dev_id.
For linux exist tools for override verb setting, but for windows i do not know of such tools. Even with access to rewrite verb in chip, you need to know what NID to change and to what value


I replaced PciPort module , nothing happen.
Is it possible related to ACPI table?