Mic input captures internal audio also

I have two problems with microphone input.

  1. Captures internal audio like music from player, voices from youtube etc along with external or internal mic input.

  2. Inverted mic setup when external mic connected, external mic input is actually given to internal microphone (unplugged) and internal is switched over to microphone option