[alsa-devel] [patch] Fix headphone automute on Asus G50Vt laptops
On an Asus G50Vt laptop, plugging in the headphone jack mutes the internal speakers and the headphone jack too. Unplugging the jack unmutes both. This is a regression introduced between linux 2.6.27 and 2.6.28, and is still present in current alsa git sources.
The root cause is that the g50v hooks in the hda-intel/patch_reaktek driver call an automute function for a different model (m51va).
This patch has been sitting in the ALSA bug tracker for more than a year. Any chance int can finally be applied?
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4468 https://bugtrack.alsa-project.org/alsa-bug/file_download.php?file_id=2913&am...
Even with this patch applied, there's still a secondary problem of the master 'mute' toggling both headphone and speaker outputs (I'm still poking around with hda_analyzer to figure out why) but even that's a vast improvement over no sound output at all when something's plugged in.
Thanks!
- Solomon
At Fri, 23 Apr 2010 16:08:14 -0400, Solomon Peachy wrote:
On an Asus G50Vt laptop, plugging in the headphone jack mutes the internal speakers and the headphone jack too. Unplugging the jack unmutes both. This is a regression introduced between linux 2.6.27 and 2.6.28, and is still present in current alsa git sources.
The root cause is that the g50v hooks in the hda-intel/patch_reaktek driver call an automute function for a different model (m51va).
This patch has been sitting in the ALSA bug tracker for more than a year. Any chance int can finally be applied?
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4468 https://bugtrack.alsa-project.org/alsa-bug/file_download.php?file_id=2913&am...
Even with this patch applied, there's still a secondary problem of the master 'mute' toggling both headphone and speaker outputs (I'm still poking around with hda_analyzer to figure out why) but even that's a vast improvement over no sound output at all when something's plugged in.
Thanks for the patch.
The problem is that you change the amp of pin 0x14 while the Speaker mixer element also changes it. That's why changing Master unmutes again.
What about the patch below instead? This fixes the init verbs and sets the headphone DAC properly so that the speaker can be muted independently via the widget 0x0c.
Also, please give alsa-info.sh output (run with --no-upload option) so that I can check with hda-emu.
thanks,
Takashi
--- diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 2078a1a..3b38ddc 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -17277,7 +17277,8 @@ static struct hda_verb alc663_g71v_init_verbs[] = { static struct hda_verb alc663_g50v_init_verbs[] = { {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, - {0x21, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Headphone */ + {0x21, AC_VERB_SET_CONNECT_SEL, 0x01}, /* 0x0d -> HP */ + {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* 0x0c -> SPK */
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT}, {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, @@ -18137,8 +18138,9 @@ static struct alc_config_preset alc662_presets[] = { [ALC663_ASUS_G50V] = { .mixers = { alc663_g50v_mixer }, .init_verbs = { alc662_init_verbs, alc663_g50v_init_verbs }, - .num_dacs = ARRAY_SIZE(alc662_dac_nids), + .num_dacs = 1, .dac_nids = alc662_dac_nids, + .hp_nid = 0x03, .dig_out_nid = ALC662_DIGOUT_NID, .num_channel_mode = ARRAY_SIZE(alc662_3ST_6ch_modes), .channel_mode = alc662_3ST_6ch_modes,
On Mon, Apr 26, 2010 at 02:47:30PM +0200, Takashi Iwai wrote:
What about the patch below instead? This fixes the init verbs and sets the headphone DAC properly so that the speaker can be muted independently via the widget 0x0c.
This patch is pretty similar to what I did with manual hda-verb twiddling, but also suffers from the same problem; namely no headphone volume control and the mute toggles aren't quite right.
So I tweaked your patch a little to add a volume slider for the headphone channel too -- the "virtual master" slider+toggle now works, yay. Modified patch is attached.
There's still the problem that the 'speaker' and the 'headphone' playback mixer switch affecting both outputs instead of just the one, and I'm not sure why -- If I toggle the 'OUT' pin on node 0x14 (speaker) and 0x21 (headphone) it only affects that particular output. Same for their mute controls.
Also, please give alsa-info.sh output (run with --no-upload option) so that I can check with hda-emu.
I've attached it. (and it's against the 1.0.23 codebase plus the attached patch)
Thanks!
- Solomon
At Mon, 26 Apr 2010 11:20:29 -0400, Solomon Peachy wrote:
On Mon, Apr 26, 2010 at 02:47:30PM +0200, Takashi Iwai wrote:
What about the patch below instead? This fixes the init verbs and sets the headphone DAC properly so that the speaker can be muted independently via the widget 0x0c.
This patch is pretty similar to what I did with manual hda-verb twiddling, but also suffers from the same problem; namely no headphone volume control and the mute toggles aren't quite right.
Yeah, the headphone volume was missing, indeed.
So I tweaked your patch a little to add a volume slider for the headphone channel too -- the "virtual master" slider+toggle now works, yay. Modified patch is attached.
There's still the problem that the 'speaker' and the 'headphone' playback mixer switch affecting both outputs instead of just the one, and I'm not sure why -- If I toggle the 'OUT' pin on node 0x14 (speaker) and 0x21 (headphone) it only affects that particular output. Same for their mute controls.
That's weird. So, changing the amp of only one of NIDs 0x02 or 0x03 influences really on both outputs...?
Also, please give alsa-info.sh output (run with --no-upload option) so that I can check with hda-emu.
I've attached it. (and it's against the 1.0.23 codebase plus the attached patch)
Thanks.
Another thing you can try is to just use model=auto. With the latest version, it should work relatively well.
Takashi
On Mon, Apr 26, 2010 at 05:33:15PM +0200, Takashi Iwai wrote:
There's still the problem that the 'speaker' and the 'headphone' playback mixer switch affecting both outputs instead of just the one, and I'm not sure why -- If I toggle the 'OUT' pin on node 0x14 (speaker) and 0x21 (headphone) it only affects that particular output. Same for their mute controls.
That's weird. So, changing the amp of only one of NIDs 0x02 or 0x03 influences really on both outputs...?
That's just it -- there's something going on here that I don't understand -- The mute swiches are defined as:
HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT),
If manually toggle these pins using hda-analyzer, only that specifc output is disabled/enabled. But if I use alsamixer to toggle these switches, both outputs are disabled/enabled. I don't know enough about the bowels of the ALSA codebase to even theorize why this could be happening (though I am using the v1.0.22 userspace stuff against a 1.0.23 kernel stack -- or maybe pulseaudio is mucking with something?)
Another thing you can try is to just use model=auto. With the latest version, it should work relatively well.
I've never specified a model=xxxx argument. Leaving model=xxxx off should be the same thing as model=auto, right? (and by latest do you mean git head?)
In any case, the 'take3' patch is such an improvement over the former state of affairs that in my opinion it should be applied -- we can always apply another patch once the mute wonkiness is figued out.
Thanks!
- Solmon
At Mon, 26 Apr 2010 12:21:52 -0400, Solomon Peachy wrote:
On Mon, Apr 26, 2010 at 05:33:15PM +0200, Takashi Iwai wrote:
There's still the problem that the 'speaker' and the 'headphone' playback mixer switch affecting both outputs instead of just the one, and I'm not sure why -- If I toggle the 'OUT' pin on node 0x14 (speaker) and 0x21 (headphone) it only affects that particular output. Same for their mute controls.
That's weird. So, changing the amp of only one of NIDs 0x02 or 0x03 influences really on both outputs...?
That's just it -- there's something going on here that I don't understand -- The mute swiches are defined as:
HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT),
If manually toggle these pins using hda-analyzer, only that specifc output is disabled/enabled. But if I use alsamixer to toggle these switches, both outputs are disabled/enabled. I don't know enough about the bowels of the ALSA codebase to even theorize why this could be happening (though I am using the v1.0.22 userspace stuff against a 1.0.23 kernel stack -- or maybe pulseaudio is mucking with something?)
Hm, this doesn't appear on emulator, so I can't say what could be wrong. Try a naked system without PA once, just to be sure.
Another thing you can try is to just use model=auto. With the latest version, it should work relatively well.
I've never specified a model=xxxx argument. Leaving model=xxxx off should be the same thing as model=auto, right? (and by latest do you mean git head?)
No, in your case, the specific model quirk is chosen. You need to pass model=auto explicitly.
In any case, the 'take3' patch is such an improvement over the former state of affairs that in my opinion it should be applied -- we can always apply another patch once the mute wonkiness is figued out.
Yes.
thanks,
Takashi
participants (2)
-
Solomon Peachy
-
Takashi Iwai