HD Audio Jack Detection Specifics and Spoofing - Page 1
Forum section: electronics / projects

author: JeWe37
author_rank: Newbie
timestamp: January 06, 2021, 12:48:04 pm
content: I have been trying to create a HD audio dongle that does not, as is normally the case, automatically detect the insertion of an audio cable when it is plugged in, but rather allows the user to control the detection via a physical button, which is notably also supposed to feature an LED indicator light so as to show when the jack is active.According to the HD audio specification, typically an isolated, normally open switch is used for this inside the jack.Now I am not sure what exactly would be necessary to emulate the behavior of such a switch. Since my button features an indicator LED it draws some current and would consequently mess with the Motherboard's detection circuitry, which relies on precise resistances. Therefore I would have to somehow switch separately, which could be achieved using a MOSFET. However this solution would not technically be isolated and I do not know if this could be troublesome. I am also not sure if a P- or N-channel MOSFET would be correct for this application, because the exact way that the jack detection network works is not specified.My current working hypothesis is that a P-channel MOSFET is the correct solution, but I would like to confirm this.

author: NiHaoMike
author_rank: Super Contributor
timestamp: January 06, 2021, 01:32:39 pm
content: A so called "analog switch" chip will do what you want.

author: magic
author_rank: Super Contributor
timestamp: January 06, 2021, 02:30:03 pm
content: Any chance PC817 would work?

author: JeWe37
author_rank: Newbie
timestamp: January 06, 2021, 02:47:47 pm
content: The issue with optocouplers is that they feature a non-negligible voltage drop that would interfer with the detection. An analog switch might work though, I will look into that.

author: Renate
author_rank: Super Contributor
timestamp: January 06, 2021, 09:54:12 pm
content: Why not do this simply?Use a DPDT toggle switch.One set of contacts replaces the jack switch.The other set of contacts feed whatever LEDs you want.Pin 7 could be a possible Vcc source for the LED(s).Try it, see if it screws up your detection.If it does just steal Vcc from somewhere else.Usually the red lead of the speaker is +5 V.Depending on how pin 7 works out you might even find that an SPDT will do the job.

author: JeWe37
author_rank: Newbie
timestamp: January 06, 2021, 11:28:00 pm
content: I had a particular type of switch in mind that is also supposed to be exposed to the user. As such this is not really an option.

author: Renate
author_rank: Super Contributor
timestamp: January 07, 2021, 05:06:27 pm
content: Quote from: JeWe37 on January 06, 2021, 11:28:00 pmWell, I don't read minds.Have you even tried if an SPST would work?Connect 7 to switch, switch to pin, pin to 1k resistor, 1k resistor to LED, LED to ground.This is a user connector, if it can't even tolerate a 1k to ground on a pin they shouldn't put it on the motherboard.Try it and tell us if it works.

author: amyk
author_rank: Super Contributor
timestamp: January 07, 2021, 10:13:45 pm
content: Jack detection uses an ADC that reads the values of the resistors, as shown in your diagram. You will not be able to draw "phantom power" from that, and if you introduce extra resistance in the loop, you will mess up the detection. See section 7.4.2 of the HD audio spec for more information. I suggest using a relay to connect those lines instead.

author: JeWe37
author_rank: Newbie
timestamp: January 07, 2021, 10:43:46 pm
content: According to some datasheets I have seen a low resistance analog switch as was recommended(less than 1Ohm) that can handle at least 5V should work just fine and still be within spec. The resistors used already introduce 1% inaccuracies, which is on the order of 10Ohms or more. A relay seems overkill for this application.

author: tooki
author_rank: Super Contributor
timestamp: January 08, 2021, 02:37:35 am
content: Quote from: JeWe37 on January 06, 2021, 12:48:04 pmWhat makes you think the mobo needs precise resistances?!? Most likely, the detect switch simply pulls an input line high or low, the exact opposite of measuring an exact resistance.

author: amyk
author_rank: Super Contributor
timestamp: January 08, 2021, 02:49:09 am
content: See section 7.4.2 of the HD audio spec for more information.