Author Topic: HD Audio Jack Detection Specifics and Spoofing  (Read 1160 times)

0 Members and 1 Guest are viewing this topic.

Offline JeWe37Topic starter

  • Newbie
  • Posts: 7
  • Country: de
HD Audio Jack Detection Specifics and Spoofing
« on: January 06, 2021, 12:48:04 pm »
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.
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9180
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: HD Audio Jack Detection Specifics and Spoofing
« Reply #1 on: January 06, 2021, 01:32:39 pm »
A so called "analog switch" chip will do what you want.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 
The following users thanked this post: JeWe37

Online magic

  • Super Contributor
  • ***
  • Posts: 7040
  • Country: pl
Re: HD Audio Jack Detection Specifics and Spoofing
« Reply #2 on: January 06, 2021, 02:30:03 pm »
Any chance PC817 would work?
 

Offline JeWe37Topic starter

  • Newbie
  • Posts: 7
  • Country: de
Re: HD Audio Jack Detection Specifics and Spoofing
« Reply #3 on: January 06, 2021, 02:47:47 pm »
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.
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: HD Audio Jack Detection Specifics and Spoofing
« Reply #4 on: January 06, 2021, 09:54:12 pm »
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.
 

Offline JeWe37Topic starter

  • Newbie
  • Posts: 7
  • Country: de
Re: HD Audio Jack Detection Specifics and Spoofing
« Reply #5 on: January 06, 2021, 11:28:00 pm »
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.
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: HD Audio Jack Detection Specifics and Spoofing
« Reply #6 on: January 07, 2021, 05:06:27 pm »
I had a particular type of switch in mind...
Well, 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.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8375
Re: HD Audio Jack Detection Specifics and Spoofing
« Reply #7 on: January 07, 2021, 10:13:45 pm »
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.
 

Offline JeWe37Topic starter

  • Newbie
  • Posts: 7
  • Country: de
Re: HD Audio Jack Detection Specifics and Spoofing
« Reply #8 on: January 07, 2021, 10:43:46 pm »
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.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 12383
  • Country: ch
Re: HD Audio Jack Detection Specifics and Spoofing
« Reply #9 on: January 08, 2021, 02:37:35 am »
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.
What 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.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8375
Re: HD Audio Jack Detection Specifics and Spoofing
« Reply #10 on: January 08, 2021, 02:49:09 am »
See section 7.4.2 of the HD audio spec for more information. ::)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf