[alsa-devel] [ALSA][hda-codec] fix-connexant-headphone-mute
Hi,
The sound works ok with the built-in speakers on my Fujitsu laptop(amilo pro v3205). But if I plug in headphones in the audio out jack there is no sound in the headphones. With kernel 2.6.20 it worked ok. With 2.6.21 it doesn't. This BUG is reported in ALSA bugtracking system with ID 0003039.
Patch that fixes this bug:
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 46e93c6..5edd330 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -636,7 +636,7 @@ static void cxt5045_hp_automute(struct hda_codec *codec)
bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0; snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 0x80, bits); - snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0x80, bits); + snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0, bits); }
/* unsolicited event for HP jack sensing */ @@ -988,10 +988,10 @@ static void cxt5047_hp_automute(struct hda_codec *codec)
bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0; snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0x80, bits); - snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0x80, bits); + snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0, bits); /* Mute/Unmute PCM 2 for good measure - some systems need this */ snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0, 0x80, bits); - snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 0x80, bits); + snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 0, bits); }
/* toggle input of built-in and mic jack appropriately */
On Sun, 2007-04-29 at 04:43 +0300, Andrei Popa wrote:
Hi,
The sound works ok with the built-in speakers on my Fujitsu laptop(amilo pro v3205). But if I plug in headphones in the audio out jack there is no sound in the headphones. With kernel 2.6.20 it worked ok. With 2.6.21 it doesn't. This BUG is reported in ALSA bugtracking system with ID 0003039.
Patch that fixes this bug:
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 46e93c6..5edd330 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -636,7 +636,7 @@ static void cxt5045_hp_automute(struct hda_codec *codec)
bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0; snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 0x80,
bits);
snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0x80,
bits);
snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0,
bits); }
/* unsolicited event for HP jack sensing */ @@ -988,10 +988,10 @@ static void cxt5047_hp_automute(struct hda_codec *codec)
bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0; snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0x80,
bits);
snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0x80,
bits);
snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0,
bits); /* Mute/Unmute PCM 2 for good measure - some systems need this */ snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0, 0x80, bits);
snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 0x80,
bits);
snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 0,
bits); }
/* toggle input of built-in and mic jack appropriately */
first patch was broken. it only worked for the right channel. this fixes this:
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 46e93c6..0822df7 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -635,8 +635,8 @@ static void cxt5045_hp_automute(struct hda_codec *codec) AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0; - snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 0x80, bits); - snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0x80, bits); + snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 0, bits); + snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0, bits); }
/* unsolicited event for HP jack sensing */ @@ -987,11 +987,11 @@ static void cxt5047_hp_automute(struct hda_codec *codec) AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0; - snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0x80, bits); - snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0x80, bits); + snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0, bits); + snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0, bits); /* Mute/Unmute PCM 2 for good measure - some systems need this */ - snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0, 0x80, bits); - snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 0x80, bits); + snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0, 0, bits); + snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 0, bits); }
/* toggle input of built-in and mic jack appropriately */
At Sun, 29 Apr 2007 05:19:50 +0300, Andrei Popa wrote:
On Sun, 2007-04-29 at 04:43 +0300, Andrei Popa wrote:
Hi,
The sound works ok with the built-in speakers on my Fujitsu laptop(amilo pro v3205). But if I plug in headphones in the audio out jack there is no sound in the headphones. With kernel 2.6.20 it worked ok. With 2.6.21 it doesn't. This BUG is reported in ALSA bugtracking system with ID 0003039.
Patch that fixes this bug:
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 46e93c6..5edd330 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -636,7 +636,7 @@ static void cxt5045_hp_automute(struct hda_codec *codec)
bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0; snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 0x80,
bits);
snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0x80,
bits);
snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0,
bits); }
/* unsolicited event for HP jack sensing */ @@ -988,10 +988,10 @@ static void cxt5047_hp_automute(struct hda_codec *codec)
bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0; snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0x80,
bits);
snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0x80,
bits);
snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0,
bits); /* Mute/Unmute PCM 2 for good measure - some systems need this */ snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0, 0x80, bits);
snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 0x80,
bits);
snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 0,
bits); }
/* toggle input of built-in and mic jack appropriately */
first patch was broken. it only worked for the right channel. this fixes this:
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 46e93c6..0822df7 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -635,8 +635,8 @@ static void cxt5045_hp_automute(struct hda_codec *codec) AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0;
snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 0x80,
bits);
snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0x80,
bits);
snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 0,
bits);
snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0,
bits); }
/* unsolicited event for HP jack sensing */ @@ -987,11 +987,11 @@ static void cxt5047_hp_automute(struct hda_codec *codec) AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0;
snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0x80,
bits);
snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0x80,
bits);
snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0,
bits);
snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0,
bits); /* Mute/Unmute PCM 2 for good measure - some systems need this */
snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0, 0x80,
bits);
snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 0x80,
bits);
snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0, 0,
bits);
snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 0,
bits); }
/* toggle input of built-in and mic jack appropriately */
But this means to _unmute_ the speaker (0x1d) when you plug HP. So, something else should be wrong. Is hp_present detected properly per plugging or unplugging?
thanks,
Takashi
participants (2)
-
Andrei Popa
-
Takashi Iwai