Adding audio connectors on your PC front can be problematic when you don't know what is going on;
especially when you are building your own stuff and use random spareparts (as I am normally doing).
A frontpanel with headset-output and microphone-input is constructed and connected correctly like this:
When no headset or microphone connected to the frontpanel, the audio connectors on the PC-backpanel are used.
When headset or microphone plugged in on the front, the inputs on the back are automatically switched off.
This page explains all the things that can be hard to find, so you don't have to use several hours digging through dubious forums.
- There are two standards; AC97 and HDaudio
- They both use the same motherboard connector
- AC97 uses normal frontpanel audio connectors, but HDaudio uses audio connectors with special switches.
- AC97 has different versions, depending on how the motherboard can switch between audio routing when a jack is inserted.
- Some AC97 versions don't support automatic audio switching.
- HDaudio has a standardized audio switching that always works.
Here below are two documents that have helped me a lot to understand it:
Realtek ALC1220 Audio Codec datasheet: link to Audio Codec datasheet
(most often the audio chip on your motherboard is made by Realtek)
page 75-77 show the HDaudio connections, with frontpanel schematics.
Intel's HD audio specification: link to specification
chapter 7.4.2 shows how the "pluggable jack detection" is done.
Difference between AC97 and HDaudio.
The following front-panel schematics show how the jacks are connected to the cable and connector that goes to the motherboard:
The motherboard detects that it is a HDaudio frontpanel when pin 4 (presence#) is connected to ground on the frontpanel.
Pin 8 of the connector doesn't have hole, to prevent from accidently turning the connector 180degrees or even plugging into a wrong motherboard connector.
As can be seen from the right half of the schematic, the AC97 jacks are standard audio connectors, that each have two built-in switches that open when an audio jack is inserted. The headphone jack breaks the audio path when the jack is connected, so the audio output is only routed to the frontpanel and the jacks on the back of your pc (that go to your speaker system) get disconnected.
NB most often in new motherboards the FP_return pins are not connected, so automatic switching is NOT performed when you plug your headset in the frontpanel jack connector of an AC97 panel.
The microphone jack uses its switches to short to input to ground when no microphone is connected to the frontpanel, so the input doesn't collect hum and noise (a microphone input is very sensitive).
The HDaudio jacks have an isolated switch, that makes it possible for the motherboard to detect with pin 7 (sense_send) which jacks are plugged in.
For this purpose, on the motherboard there are different values resistor connected from the sense1 and sense2 pins to gnd.
E.g. on my HP Z800 motherboard there is a 20k for the microphone frontpanel input (resistor from sense1_return to gnd) and a 40k for the headphone output (from sense2_return to gnd).
So when the motherboard measures resistance via sense-send, it will measure OPEN when no jacks are plugged in, 40k when a headphone is plugged in, 20K when a microphone is plugged in, and 40K in parallel with 20K = (40k*20k)/(40k+20k) = 13.3kOhms when both are plugged in.
According to the HDaudio standard, even up to 8 audio ports can be detected, by using resistors of 5k, 10k, 20k or 40kOhms on the two sense pins.
NB the ability to detect plugging/unplugging of so many audio ports is very useful when the motherboard has its own audio chip and you also have e.g. a PCIE audio card with several audio connectors plus a frontpanel with headset and microphone jacks.
And here below is what the connector for the AAFP (analog audio front panel) on the Asus motherboard of my PC called Apollo looks like:
This connector is default used for HDaudio, but you can enable HDaudio/AC97-detection in the bios and use the same connector for AC97.
This motherboard doesn't have the AC97 "return" connections, and automatic audio switching is only done when using HDaudio.
How to make your own audio frontpanel with automatic audio-switching.
Of course you will want to make a HDaudio compatible frontpanel, as all new motherboards support this, and the automatic plug-detection and switching is good.
It is hard to find mini-jack connectors with a built-in isolated "normally-open" switch, but you can find them in scrapped PCs that are not too old.
Sometimes you can find a nice scrapped panel-module that is easy to build in to your PC cabinet and that even has some USB ports as well.
But often it is just an AC97 version, like this one.
You can check if it is HD audio by measuring the resistance between "Presence#" and Ground. If it is open then there is a big chance it is AC97.
To be sure that it is a HDaudio panel, measure the resistance between "sense-send" and "sense2_retur", while plugging in a headphone or just a loose jack connector. The resistance must be OPEN without the headset, and SHORTED when the headset is plugged in.
Here is what I ended up with making for my PC.
It is a sawed-off circuit board from a scrapped PC front panel, mounted on a bottompiece of a scrapped floppydrive.
Corresponding holes were made in the PC front.