[alsa-devel] [PATCH 1/1] ALSA: hda - Analog Devices AD1984A add HP Touchsmart model
Hello,
I would like to submit this patch,
it will fix the bug I've submited : https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4614
Thanks, Miguel de Barros
At Sun, 27 Sep 2009 22:34:58 +0200, Miguel de Barros wrote:
Hello,
I would like to submit this patch,
it will fix the bug I've submited : https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4614
Thanks, Miguel de Barros [2 0001-ALSA-hda-Analog-Devices-AD1984A-add-HP-Touchsmart.patch <text/x-patch; UTF-8 (7bit)>]
From 8a106650b4f18c956ae40bf863fb3423b66d605f Mon Sep 17 00:00:00 2001
From: Miguel de Barros miguel.de.barros@bluewin.ch Date: Sun, 27 Sep 2009 22:11:21 +0200 Subject: [PATCH 1/1] ALSA: hda - Analog Devices AD1984A add HP Touchsmart model modified: Documentation/HD-Audio-Models.txt modified: pci/hda/patch_analog.c
Signed-off-by: Miguel de Barros miguel.de.barros@bluewin.ch
Thanks for the patch.
Could you add a bit more description what you change and/or fix with this patch? The reference to bug tracking can be also in the changelog text. OTOH, the list of modified files is superfluous since we can track them via git more easily.
+static struct hda_input_mux ad1984a_touchsmart_capture_source = {
- .num_items = 3,
- .items = {
{ "Mix", 0x3 }, /* Mixer */
{ "Mic", 0x4 }, /* port-E */
{ "Internal Mic", 0x5 }, /* Digital Mic */
- },
+};
+/* switch to external mic if plugged */ +static void ad1984a_touchsmart_automic(struct hda_codec *codec) +{
- if (snd_hda_codec_read(codec, 0x1c, 0,
AC_VERB_GET_PIN_SENSE, 0) & 0x80000000) {
snd_hda_codec_write(codec, 0x0c, 0,
AC_VERB_SET_CONNECT_SEL, 0x4);
- } else {
snd_hda_codec_write(codec, 0x0c, 0,
AC_VERB_SET_CONNECT_SEL, 0x5);
- }
+}
The auto-mic feature is actually conflicting with the capture_source setup. That is, even if you choose "Internal Mic" manually as the capture source, it's changed (even without notification) to the mic jack when plugged in.
So, either use only the auto-mic and get rid of the manual "capture source" (I prefer), or disable auto-mic. We can remove "Mix" item in the first case just for simplicity.
Could you fix and repot?
thanks,
Takashi
Thanks for your feedback,
here is a new version of the patch taking into account your comments. I fully agree the mix source is not really useful.
I've put in the commit comment some info on what is included in the patch. Tell me if more information is needed...
Miguel
Le lundi 28 septembre 2009 à 10:47 +0200, Takashi Iwai a écrit :
At Sun, 27 Sep 2009 22:34:58 +0200, Miguel de Barros wrote:
Hello,
I would like to submit this patch,
it will fix the bug I've submited : https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4614
Thanks, Miguel de Barros [2 0001-ALSA-hda-Analog-Devices-AD1984A-add-HP-Touchsmart.patch <text/x-patch; UTF-8 (7bit)>]
From 8a106650b4f18c956ae40bf863fb3423b66d605f Mon Sep 17 00:00:00 2001
From: Miguel de Barros miguel.de.barros@bluewin.ch Date: Sun, 27 Sep 2009 22:11:21 +0200 Subject: [PATCH 1/1] ALSA: hda - Analog Devices AD1984A add HP Touchsmart model modified: Documentation/HD-Audio-Models.txt modified: pci/hda/patch_analog.c
Signed-off-by: Miguel de Barros miguel.de.barros@bluewin.ch
Thanks for the patch.
Could you add a bit more description what you change and/or fix with this patch? The reference to bug tracking can be also in the changelog text. OTOH, the list of modified files is superfluous since we can track them via git more easily.
+static struct hda_input_mux ad1984a_touchsmart_capture_source = {
- .num_items = 3,
- .items = {
{ "Mix", 0x3 }, /* Mixer */
{ "Mic", 0x4 }, /* port-E */
{ "Internal Mic", 0x5 }, /* Digital Mic */
- },
+};
+/* switch to external mic if plugged */ +static void ad1984a_touchsmart_automic(struct hda_codec *codec) +{
- if (snd_hda_codec_read(codec, 0x1c, 0,
AC_VERB_GET_PIN_SENSE, 0) & 0x80000000) {
snd_hda_codec_write(codec, 0x0c, 0,
AC_VERB_SET_CONNECT_SEL, 0x4);
- } else {
snd_hda_codec_write(codec, 0x0c, 0,
AC_VERB_SET_CONNECT_SEL, 0x5);
- }
+}
The auto-mic feature is actually conflicting with the capture_source setup. That is, even if you choose "Internal Mic" manually as the capture source, it's changed (even without notification) to the mic jack when plugged in.
So, either use only the auto-mic and get rid of the manual "capture source" (I prefer), or disable auto-mic. We can remove "Mix" item in the first case just for simplicity.
Could you fix and repot?
thanks,
Takashi
At Mon, 28 Sep 2009 21:13:26 +0200, Miguel de Barros wrote:
Thanks for your feedback,
here is a new version of the patch taking into account your comments. I fully agree the mix source is not really useful.
I've put in the commit comment some info on what is included in the patch. Tell me if more information is needed...
Miguel
Looks good to me. I applied the patch now. Thanks!
Takashi
participants (2)
-
Miguel de Barros
-
Takashi Iwai