Headphones with combo jack: Force internal mic for input and headphones for output

Linux doesn't have a "historical problem in configuring audio devices". The problem actually are the manufacturers of devices, mostly laptops, who just ship the laptop with pre-installed Windows drivers that can be configured acurately to deal with the laptop hardware, because the manufacturer of course knows exactly how the hardware is set up. On the other hand, the manufacturer doesn't want to share the details, doesn't document them and keeps them secret; after all, they have supplied the Windows driver. That's why often all non-standard features of laptops have to be found out through painful and time-consuming reverse engineering to be able to use them under Linux.

With regard to audio, basically all modern devices uses the Intel HDA architecture, which is self-describing and provides a graph representation of the codec (the analog audio chip). In principle, the BIOS is supposed to supply the "pin configuration", i.e. which pin of the codec chip is connected to internal speakers and mics, to line-in, line-out and headphone or headphone combo jacks.

However, especially in the last years, manufacturers didn't seem to find it necessary to correctly configure the BIOS (after all, they already supplied the Windows driver). So the cycle is: New laptop model comes out, somebody with the actual hardware and enough technical understanding figures out how the BIOS is lying and what the configuration should really look like, the kernel developers add a quirk (special treatment of that hardware) in the drivers to deal with that, with the newest driver the other people who use the same hardware don't notice and are happy. Until the next model comes out, and the cycle starts again. In the meantime, lots of unhappy users where it doesn't work leave their traces all over the internet asking in forums everywhere, often without getting the right answer.

So yes, drivers for the external mic are developed and available (in fact, they are the same drivers as for the rest of the codec). You can see all the quirks (non-standard behaviour) that have accumulated by inspecting the kernel source files in /sound/pci/hda/ and grep for "quirk".

Which means if you happen to have a laptop where the external headphone mic is not working, someone (maybe you?) has to dive into the technical details, make it work, and report it to the ALSA kernel developers.

You can look at what the codec chips report about their internal structure with

cat /proc/asound/card*/codec\#*

This gives the internal graph, you can follow it manually, or try programs like codecgraph to visualize it (doesn't always give good results). The "Pin complex" represent the pins. Look at the one you have, try to guess which might represent the external mic, even though it's mislabeled. Use hdajackretask to correctly label the pin if you've identified it (or guess until you do). There are ways to make this relabelling default on boot until the driver gets updated.

As for combining internal mic and headphones: ALSA has a mixer element called "Auto-Mute mode". This will cause ALSA to mute internal mic/speaker and unmute external mic/headphone (or vice versa) when the headphone jack is plugged or unplugged. Disable this in alsamixer or amixer, mute and unmute internal and external mic/speaker/headphone as desired.

You can also configure this in Pulseaudio: Start pavucontrol, select the right ports in the input and output tab.

If both internal and external "ports" are not available, or if you want to make it the default, that's also possible, though it's a bit of a pain to do: Look at the files in /usr/share/pulseaudio/alsa-mixer/, read the comments that explain how they work. You need a new "configuration" for your soundcard that combines two "paths", one for the internal mic, and one for the external headphone, using the correct ALSA mixer elements. This will probably take some time to make it work correctly, Pulseaudio is not very intuitive in this resepect.

No, there's no easy way to do what you want; you'll have to get your hands dirty.


After many trials and tests I found that this issue can be solved through hardware rather than software. Using a 'USB Headphone/Microphone Splitter', I was able to force internal mic for input and headphones for output.

Output need to be set to 'USB Audio Device'. enter image description here Input would be default built-in internal speakers. Just need to make sure that it is ON. enter image description here It works with skype too. Just need to set input and output to default and turn off the automatic adjustments of microphone. enter image description here