[alsa-devel] [PATCH 0/2] Two fixes for ca0132
I came across the following codec: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1038651/+attachment/326...
...and the codec wouldn't load due to mixer errors. I don't know more about the codec than the codec proc shows, and looking at that file it seems a bit broken, but maybe Ian would be able to make it work, with the help of some secret verbs? At least now the codec would load correctly, so that the output side could be used.
David Henningsson (2): ALSA: hda - Fix "Line" and "Mic" names for CA0132 ALSA: hda - don't create dysfunctional mixer controls for ca0132
sound/pci/hda/patch_ca0132.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
The names "Line-In" and "Mic-In" are nonstandard. Standard names make them controllable by e g PulseAudio.
Signed-off-by: David Henningsson david.henningsson@canonical.com --- sound/pci/hda/patch_ca0132.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index d0d3540..2685590 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c @@ -988,12 +988,12 @@ static void ca0132_config(struct hda_codec *codec)
/* Mic-in */ spec->input_pins[0] = 0x12; - spec->input_labels[0] = "Mic-In"; + spec->input_labels[0] = "Mic"; spec->adcs[0] = 0x07;
/* Line-In */ spec->input_pins[1] = 0x11; - spec->input_labels[1] = "Line-In"; + spec->input_labels[1] = "Line"; spec->adcs[1] = 0x08; spec->num_inputs = 2; }
It's possible that these amps are settable somehow, e g through secret codec verbs, but for now, don't create the controls (as they won't be working anyway, and cause errors in amixer).
Cc: stable@kernel.org BugLink: https://bugs.launchpad.net/bugs/1038651 Signed-off-by: David Henningsson david.henningsson@canonical.com --- sound/pci/hda/patch_ca0132.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index 2685590..bf061a3 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c @@ -275,6 +275,10 @@ static int _add_switch(struct hda_codec *codec, hda_nid_t nid, const char *pfx, int type = dir ? HDA_INPUT : HDA_OUTPUT; struct snd_kcontrol_new knew = HDA_CODEC_MUTE_MONO(namestr, nid, chan, 0, type); + if ((query_amp_caps(codec, nid, type) & AC_AMPCAP_MUTE) == 0) { + snd_printdd("Skipping '%s %s Switch' (no mute on node 0x%x)\n", pfx, dirstr[dir], nid); + return 0; + } sprintf(namestr, "%s %s Switch", pfx, dirstr[dir]); return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec)); } @@ -286,6 +290,10 @@ static int _add_volume(struct hda_codec *codec, hda_nid_t nid, const char *pfx, int type = dir ? HDA_INPUT : HDA_OUTPUT; struct snd_kcontrol_new knew = HDA_CODEC_VOLUME_MONO(namestr, nid, chan, 0, type); + if ((query_amp_caps(codec, nid, type) & AC_AMPCAP_NUM_STEPS) == 0) { + snd_printdd("Skipping '%s %s Volume' (no amp on node 0x%x)\n", pfx, dirstr[dir], nid); + return 0; + } sprintf(namestr, "%s %s Volume", pfx, dirstr[dir]); return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec)); }
At Mon, 20 Aug 2012 11:16:58 +0200, David Henningsson wrote:
I came across the following codec: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1038651/+attachment/326...
...and the codec wouldn't load due to mixer errors. I don't know more about the codec than the codec proc shows, and looking at that file it seems a bit broken, but maybe Ian would be able to make it work, with the help of some secret verbs? At least now the codec would load correctly, so that the output side could be used.
Both fixes already have existed in my local queue for weeks and provided to some people who reported CA0132 problems (including Ian). Basically they are for fixing the missing SPDIF controls. But they were pending because of the upcoming DSP loading stuff, which seem to be pretty delayed.
So I'm going to apply the fixes for 3.6 kernel.
thanks,
Takashi
David Henningsson (2): ALSA: hda - Fix "Line" and "Mic" names for CA0132 ALSA: hda - don't create dysfunctional mixer controls for ca0132
sound/pci/hda/patch_ca0132.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
-- 1.7.9.5
At Mon, 20 Aug 2012 11:22:45 +0200, Takashi Iwai wrote:
At Mon, 20 Aug 2012 11:16:58 +0200, David Henningsson wrote:
I came across the following codec: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1038651/+attachment/326...
...and the codec wouldn't load due to mixer errors. I don't know more about the codec than the codec proc shows, and looking at that file it seems a bit broken, but maybe Ian would be able to make it work, with the help of some secret verbs? At least now the codec would load correctly, so that the output side could be used.
Both fixes already have existed in my local queue for weeks and provided to some people who reported CA0132 problems (including Ian). Basically they are for fixing the missing SPDIF controls. But they were pending because of the upcoming DSP loading stuff, which seem to be pretty delayed.
So I'm going to apply the fixes for 3.6 kernel.
FWIW, the patches are in topic/ca0132-fix branch of sound git tree (which should appear shortly later).
Takashi
On 08/20/2012 11:22 AM, Takashi Iwai wrote:
At Mon, 20 Aug 2012 11:16:58 +0200, David Henningsson wrote:
I came across the following codec: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1038651/+attachment/326...
...and the codec wouldn't load due to mixer errors. I don't know more about the codec than the codec proc shows, and looking at that file it seems a bit broken, but maybe Ian would be able to make it work, with the help of some secret verbs? At least now the codec would load correctly, so that the output side could be used.
Both fixes already have existed in my local queue for weeks and provided to some people who reported CA0132 problems (including Ian). Basically they are for fixing the missing SPDIF controls.
In my case, it was about input (mic and mic boost).
But they were pending because of the upcoming DSP loading stuff, which seem to be pretty delayed.
So I'm going to apply the fixes for 3.6 kernel.
At least the latter one (don't create dysfunctional...) should go to stable, too.
thanks,
Takashi
David Henningsson (2): ALSA: hda - Fix "Line" and "Mic" names for CA0132 ALSA: hda - don't create dysfunctional mixer controls for ca0132
sound/pci/hda/patch_ca0132.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
-- 1.7.9.5
At Mon, 20 Aug 2012 11:27:08 +0200, David Henningsson wrote:
On 08/20/2012 11:22 AM, Takashi Iwai wrote:
At Mon, 20 Aug 2012 11:16:58 +0200, David Henningsson wrote:
I came across the following codec: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1038651/+attachment/326...
...and the codec wouldn't load due to mixer errors. I don't know more about the codec than the codec proc shows, and looking at that file it seems a bit broken, but maybe Ian would be able to make it work, with the help of some secret verbs? At least now the codec would load correctly, so that the output side could be used.
Both fixes already have existed in my local queue for weeks and provided to some people who reported CA0132 problems (including Ian). Basically they are for fixing the missing SPDIF controls.
In my case, it was about input (mic and mic boost).
But they were pending because of the upcoming DSP loading stuff, which seem to be pretty delayed.
So I'm going to apply the fixes for 3.6 kernel.
At least the latter one (don't create dysfunctional...) should go to stable, too.
Right. I applied that one now.
thanks,
Takashi
participants (2)
-
David Henningsson
-
Takashi Iwai