Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is actually two questions in one.

  1. First, how do soundcards (the cheap ones) "detect" whether the headphones are plugged in? By measuring resistance or by some other technique?

  2. Second, can I somehow have different sound outputs sent to the speakers and the headphones? I'm guessing no, at least no on the cheap ones. What does one need to accomplish that?

(I've no idea about anything related to sound save of listening to mp3's, so this may be overly simple question to some.)

share|improve this question
+1, good question. cleaned it up a bit, hope my edits didn't change your meaning. also: why do people insist on putting spaces between the last word of a sentence and the question mark like this ? (??? is it some english-as-a-second-language thing?) – quack quixote Feb 20 '10 at 4:23
@~quack - Of course I don't mind, perish the thought. As to the question mark, maybe :), as you say is a second language thing. I don't know, I've always found it "normal", so ... – Rook Feb 20 '10 at 11:43
up vote 8 down vote accepted

The audio ports detect that something has been plugged in by monitoring for a change in resistance across the port. When nothing is plugged in the resistance is infinite, but when a coil is plugged in (speaker or mic) there is now a measurable resistance, and the computer pops up and asks you what it is you plugged in.

EDIT: I've been digging, and instead of trying to figure out what the audio adapter manufacturer's are doing, I decided to look at the jack manufacturer's to figure out if there are internal mechanical switches, as well as perhaps suggested uses.

Turning to Digi-key, I found that there are a few different mechanical ways the jacks provide for detection. The most common DOES seem to be a separate, internal switch circuit based on the position of the inner-most blade in the barrel; and they are only a couple cents more per unit than a non-switched jack. Here's a dual barrel surface mount by Tyco that I think looks similar to what can be on a motherboard.

Interestingly on many (most?) the detection switch is actually reversed. So the switch is closed until the plug is inserted, here's one by CUI.

This one by Schurter is crazy; it's a "stereo" jack that all three rings (including the ground) are switched. So it could tell you how deep the plug is pushed I guess ;) Only $6.50 each!

Using these switches DOES seem to be the more likely way they're doing it, and what I've been told in the past is probably incorrect, or at least not correct across-board.

I'm going to disect one Monday -- I gotta see if that switch is at least in the jacks Intel's been using. :)

If you are aiming to have the same sound on both headphones and speakers, then you may want to look into getting an audio jack y-adapter (splitter):

alt text

If you want different sounds on each a headphone and a speaker set then you're probably dependent on the abilities of the software mixer provided by your audio adapter's manufacturer, and/or the software you're using.

Depending on your situation, you may want to consider getting a secondary audio card as well, that way you can point different applications at each audio device.

share|improve this answer
I think the sockets actually have switches in that are operated when something is plugged into the socket. Its a standard part of most 3.5mm jack sockets. – pipTheGeek Feb 19 '10 at 17:59
cough Actually, it's more to the effect that the plug-in acts as a switch. When something is plugged into it, it completes the circuit (just like a light switch) and a) your headphones work, and b) the sound card knows it's plugged in by the fact that the circuit is complete. You don't have to muck around with measuring the resistance of the connection - that's complicated. Mostly, the fact that the computer knows at all is in software and drivers. – Ernie Dunbar Feb 19 '10 at 19:21
+A ... You've done your homework ... and there was little ol' me hoping for a (if) two sentence answer. Thanks mate ! Your nick serves you well :) – Rook Feb 20 '10 at 3:28
@erniedwork, elaborate on part b) "the sound card knows". What kind of circuit mechanism are you suggesting does this detection? – hyperslug Feb 20 '10 at 3:49
@hyperslug - i'm not sure, but i think he's talking about the fact that when plugged in, the signal path (the wires that make up channels L and R in a stereo signal) is a completed circuit -- soundcard -> jack -> headphones -> jack(GND) -> soundcard(GND) – quack quixote Feb 20 '10 at 5:44

As pipTheGeek stated, another option to the electrical resistance measurement is a mechanical switch.

Switch pushed down - something's plugged in.

You can test this by plugging a Y-adapter or size adapter into the jack. If the jack acts like there's something plugged into the port, you have a mechanical switch.

The adapter won't make any connections between the lines and ground so it shouldn't count as an output device to the resistance measurement.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .