i have a headset attached with a microphone. All this on a single cable and when i plugged this into the headset jack, i can hear sound perfectly. I have another port for mic. But i dont want to use it. I need to record sound from the mic on the headset through headset port. I dont think for buying a splitter for the headset/mic combo cable to work. When i checked the sound settings->Input(tab), there is an option "Record sound from" and it is selected to one and only in-built mic.
The headphone jack, or line out, has its voltage controlled by the computer. Software on the computer tells the sound card to produce certain sounds, and the sound card creates an oscillating voltage in the headphone jack.
The microphone jack does the opposite; it controls the computer through its voltage. An oscillating voltage is induced there by an external device, and that gets measured by the sound card and made readable by software.
They are incompatible; one cannot stand in for the other.
There is some compatibility between the actual devices that attach to each type of audio jack. A microphone and a speaker work in basically the same way, and provided that you use microphones and speakers with compatible impedance, you can sometimes plug a microphone in where a speaker should go and hear sound from the microphone; and you can sometimes plug a speaker in where a microphone should go and speak into the speaker as though it were a microphone.
This doesn't usually work very well. A computer-compatible microphone is lower voltage (amplitude) than a computer speaker. The primary practical application of this concept was in using old telephones, when they started to break down. If you have a landline phone today, you can still often yell into the speaker and make yourself (faintly) heard on the other end.
Since the microphone jack on your sound card only takes information in, and the line out jack on your sound card only puts information out, you're out of luck. This is a limitation in the sound card, and it cannot be overcome by an operating system (like Ubuntu).
On the other hand, if you tell us why you want to do this, it might be possible to figure out some other approach that would achieve your goals.