Archive for the HD AUDIO Category

Note: Reload Verb Table for Azalia codec when system from S3 resume

Posted in BIOS, HD AUDIO on 2011 年 06 月 24 日 by Kun-Yi

如果只是按 ICH7的 Programmer’s Reference Manual 在 Page 125 頁所描述的S3 Resume BIOS Requirement仍然不足, 需要透過其GCTRL Register 將整個Codec 整個在 reset 一次才能正確的列舉在HDAudio Host Controller 上的各codec.

實際動作會變成

  1. Check Azalia Host controller enable/disable
  2. Enable Memeory space and Bus Master
  3. Save current base address
  4. Setup a temporary base address
  5. Store STATESTS
  6. clear CRST/GCTL bit, to reset
  7. clear STATESTS
  8. Set CRST/GCTL bit,
  9. clear CRST/GCTL bit, let ccodec link re-enumeration
  10. Set CRST/GCTL bit, exit reset.
  11. program Verb table to codec
  12. restore NOT(STATESTS)
  13. clear CRST/GCTL, let controller in reset state
  14. restore base address

Note: Microsoft Windows HDAudio Class Device & Pin Config Default

Posted in BIOS, 電腦和網際網路, HD AUDIO on 2010 年 03 月 22 日 by Kun-Yi

Open Regedit on Windows XP SP1 and later version.

Goto the path [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlClass{4D36E96C-E325-11CE-BFC1-08002BE10318}]

and to enumration “MatchingDeviceId”  value is  “^hdaudio” (RegExp)

like the below picture

WDMAudio

You can under {4D36E96C-E325-11CE-BFC1-08002BE10318}05 match the condition. So it is a HDAudio codec and in XP use “InitVerbs” to setting the Node/Pin config, But in Vista/Win 7 is use “PinConfigOverrideVerbs

Example

InitVerbs

You can to modify the PinConfig Value to change Audio device setting to verify something when developering Audio Driver/Testing WHQL.

Ref.

Microsoft HD Audio Pin Configuration Implementation Test Procedure Guidelines.

Microsoft HD Audio Tool

update the message from uaa@microsoft.com,  Microsoft HD Audio Tool for Win7 only now.

Hi Kun-Yi;
You can get a public version that works with Windows 7 at http://www.microsoft.com/whdc/device/audio/HDaudio_tool.mspx.  It’s tied to Windows 7 because we included driver features in Windows 7 that are necessary for the tool to work, and that let us post it publicly.  You must use the Windows HDAudio drivers when using the tool.

PS. 之前是解Windows Mobile Loge Test Kit Issues 現在換成解 Windows Hardward Quzlity Labs Testing. 不知道有沒有殺蟲執照可領?

Note: To decode HDAudio PinConfig Value

Posted in BIOS, 電腦和網際網路, HD AUDIO on 2010 年 03 月 22 日 by Kun-Yi

執行結果

PinComplex

這主要是學習 Azalia/HDAudio Verb Table 設定的小產出

畫面上面的值, 是從某個Pin Configuration 得來, 這個Pin Configuraiton 在Verb Table, 實際如下

0x30471C10
0x30471D00
0x30471E56
0x30471F58

這上面格式按 HDAudio spec. 可以得知 0x3 是 CAd(Codec Address), 0x04代表NID(Node ID, Refer Section 7.1.2 Node Addressing, HDAudio v1.0 spec.), 而 0x71C ~ 0x71F(Set Pin Configuration, Refer Section 7.3.3.31 Configuration Default in HDAudio v1.0 spec.)

而該pin configuration value 就是 0x58560010了,  透過該Configuration 的格式去解出該pin 實際的硬體電路狀態, 但這里並沒有將 32bit 格式全部解出, 只解出跟電路構成有關的部份!

Source code 如下

// ExtHDAudioPinComplex.cpp : Defines the entry point for the console application.
//

#include “stdafx.h"

void proceConnectivity(unsigned val)
{
unsigned connectivity = val >> 30;
const TCHAR* sa[] = {
_T(“The PinComplex is connected to a Jack"),
_T(“Not physical connection for Port"),
_T(“A fixed function device(Integrated speack/mic etc.)"),
_T(“Both a jack and an internal device are attached"),
};
_tprintf(_T(“Connectivity: %sn"), sa[connectivity]);
}

void procLocation(unsigned val)
{
unsigned gross = (val >> 28) & 0x3;
unsigned geometric = (val >> 24) & 0xF;
int pi = -1;

if (0 == gross)
{
if(7 == geometric) {
pi = 0;
} else if ( 8 == geometric) {
pi = 1;
}
} else if (1 == gross)
{
if (7 == geometric)    {
pi = 2;
} else if (8 == geometric)    {
pi = 3;
} else if (9 == geometric)    {
pi = 4;
}
} else if (3 == gross)
{
if (7 == geometric)    {
pi = 5;
} else if (8 == geometric)    {
pi = 6;
}
}

const TCHAR* sa0[] = {
_T(“Rear Panel"),
_T(“Drive Bay"),
_T(“Riser"),
_T(“HDMI"),
_T(“ATAPI"),
_T(“Mobile Lid-Inside"),
_T(“Mobile Lid-Outside"),
};

const TCHAR* sa1[] = {
_T(“External"),
_T(“Internal"),
_T(“Separate"),
_T(“Others"),

};

const TCHAR* sa2[] = {
_T(“N/A"),
_T(“Rear"),
_T(“Front"),
_T(“Left"),
_T(“Right"),
_T(“Top"),
_T(“Bottom"),
_T(“Special"),
_T(“Special"),
_T(“Special"),
_T(“Resvered"),
};

if (geometric > 9 ) geometric = 9;
if (-1 != pi)
{
_tprintf(_T(“Location: %sn"), sa0[pi]);
}
else
{
_tprintf(_T(“Location: %s, %sn"), sa1[gross], sa2[geometric]);
}
}

void procDevice(unsigned val)
{
val = (val>>20) & 0xF;
const TCHAR* strArray[] = {
_T(“Line Out"),
_T(“Speak"),
_T(“HP Out"),
_T(“CD"),
_T(“SPDIF Out"),
_T(“Digital Other Out"),
_T(“Modem Line Side"),
_T(“Modem Handset Side"),
_T(“Line In"),
_T(“AUX"),
_T(“Mic In"),
_T(“Telephony"),
_T(“SPDIF In"),
_T(“Digital Other In"),
_T(“Reserved"),
_T(“Other")
};

_tprintf(_T(“Device: %sn"), strArray[val]);
}

void printHelp(void)
{
_tprintf(_T(“Dump HDAudio PinComplexn"));
_tprintf(_T(“ttype ‘DHDPC hex’ n"));
}

int _tmain(int argc, _TCHAR* argv[])
{

unsigned dwPinWidget = 0x411111F0;
if (argc < 2)
{
printHelp();
return -1;
}
_stscanf_l(argv[1], _T(“%X"), 0, &dwPinWidget);

_tprintf(_T(“PinWidget : 0x%08Xn"), dwPinWidget);
proceConnectivity(dwPinWidget);
procLocation(dwPinWidget);
procDevice(dwPinWidget);
return 0;
}