Hi,
I think I have found a bug in patch_realtek.c. I have a 272X codec in my laptop and have discovered that it is only reported through the ALSA driver API when my headphone minijack is disconnected and not when it is connected. This is happening because alc_report_jack(...) is only called when the minijack connector is disconnected and not when it is connected. In order to make jack sensing work properly i modified patch_realtek.c and added alc_report_jack(codec, spec->autocfg.hp_pins[i]); at line 1132 (see code below).
The code shown below is from: http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=blob;f=sound...
1118 static void alc_automute_speaker(struct hda_codec *codec, int pinctl) 1119 { 1120 struct alc_spec *spec = codec->spec; 1121 unsigned int mute; 1122 hda_nid_t nid; 1123 int i; 1124 1125 spec->jack_present = 0; 1126 for (i = 0; i < ARRAY_SIZE(spec->autocfg.hp_pins); i++) { 1127 nid = spec->autocfg.hp_pins[i]; 1128 if (!nid) 1129 break; 1130 if (snd_hda_jack_detect(codec, nid)) { 1131 spec->jack_present = 1; //ADDED BY KT: alc_report_jack(codec, spec->autocfg.hp_pins[i]);
1132 break; 1133 } 1134 alc_report_jack(codec, spec->autocfg.hp_pins[i]); 1135 } 1136 1137 mute = spec->jack_present ? HDA_AMP_MUTE : 0; 1138 /* Toggle internal speakers muting */ 1139 for (i = 0; i < ARRAY_SIZE(spec->autocfg.speaker_pins); i++) { 1140 nid = spec->autocfg.speaker_pins[i]; 1141 if (!nid) 1142 break; 1143 if (pinctl) { 1144 snd_hda_codec_write(codec, nid, 0, 1145 AC_VERB_SET_PIN_WIDGET_CONTROL, 1146 spec->jack_present ? 0 : PIN_OUT); 1147 } else { 1148 snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0, 1149 HDA_AMP_MUTE, mute); 1150 } 1151 } 1152 } Best regards, Kim Therkelsen