Re: [alsa-devel] HD-audio regression after commit 34588709af61be1550b4e2bcee5c85d0ac4f34d4
At Thu, 17 Jan 2013 21:40:43 +0100, Manolo Díaz wrote:
El jue, 17 ene 2013 a las 21:16 horas Takashi Iwai escribió:
At Thu, 17 Jan 2013 19:12:24 +0100, Manolo Díaz wrote:
El jue, 17 ene 2013 a las 16:32 horas Takashi Iwai escribió:
At Thu, 17 Jan 2013 09:59:20 -0500, Miro Hodak wrote:
On Thu, Jan 17, 2013 at 7:49 AM, Raymond Yau superquad.vortex2@gmail.comwrote:
> > OK, now as far as Auto-Mute goes, should it do what expected when enabled - i.e. muting the speakers when headphones are connected to the front panel? I have tried that, does not seem to work. >
Do your computer chassis have a hda front audio panel with Jack detection ?
The front headphone Jack should return true when headphone Jack is plugged
control.35 { iface CARD name 'Front Headphone Jack'
value false comment { access read type BOOLEAN count 1 } }
All ADI codecs support impedance measurement
Try the modified hda-jack-sense-test which need hda-analyzer
http://thread.gmane.org/gmane.linux.alsa.devel/90911/focus=91115
Hmmm, ran into some python issues. Even hda-analyzer itself is not working: ... File "/dev/shm/hda-analyzer/hda_proc.py", line 143, in wrongfile raise ValueError, "wrong proc file format (%s)" % msg ValueError: wrong proc file format (integer decode 'State of AFG node 0x01:' ('Node '))
Ah, it's a new proc file entry that has been added recently. hda-analyzer needs to be fixed.
In anyway, only for checking the presence unsolicited events, you can do without extra program. Suppose you built your kernel with the tracing support. See "Tracepoints" option in Documentation/sound/alsa/HD-Audio.txt.
# echo 1 > /sys/kernel/debug/tracing/events/hda/hda_unsol_event/enable
(plug and unplug your headphone jacks)
# cat /sys/kernel/debug/tracing/trace
If you see some hda_unsol_event lines there, it implies that the jack detection basically works in hardware level.
Takashi
I Suppose that when auto-mute is enabled an HP independent is disabled, inserting the HP jack should disable sound from front speakers. If so then auto-mute doesn't work. Jack insertion/extraction events are well detected for front speakers and HP.
#~ cat /sys/kernel/debug/tracing/trace # tracer: nop # # entries-in-buffer/entries-written: 4/4 #P:2 # # _-----=> irqs-off # / _----=> need-resched # | / _---=> hardirq/softirq # || / _--=> preempt-depth # ||| / delay # TASK-PID CPU# |||| TIMESTAMP FUNCTION # | | | |||| | | <idle>-0 [001] d.h. 137.881919: hda_unsol_event: [0] res=8000000, res_ex=10 <idle>-0 [001] d.h. 162.511102: hda_unsol_event: [0] res=8000000, res_ex=10 <idle>-0 [001] d.h. 246.529813: hda_unsol_event: [0] res=4000000, res_ex=10 <idle>-0 [001] d.h. 272.381719: hda_unsol_event: [0] res=4000000, res_ex=10
branch tested: test/hda-gen-parser
Please test with either master or test/hda-migrate branch. test/hda-gen-parser branch doesn't contain the patch for AD codecs.
In anyway, please attach alsa-info.sh outputs before and after plugging the headphone with the latest sound-unstable tree (and a proper branch).
thanks,
Takashi
branch tested: master
commit d89012bef4ad6d33c1050dd2924f010f5072ff52 Merge: ad92fbe 36c9db7 Author: Takashi Iwai tiwai@suse.de Date: Thu Jan 17 17:47:19 2013 +0100
Just the same: auto-mute doesn't work.
alsa-info output show no differences (attached).
Thanks. It turned out that simply missing unsol_event handlers in the codec driver code. The patch below should fix the issue. It's already merged in test/hda-migrate and master branches.
Takashi
--- From: Takashi Iwai tiwai@suse.de Subject: [PATCH] ALSA: hda - Fix missing unsol event handler in some codec drivers
This resulted in non-working auto-mute behavior, of course...
Signed-off-by: Takashi Iwai tiwai@suse.de --- sound/pci/hda/patch_analog.c | 1 + sound/pci/hda/patch_ca0110.c | 1 + sound/pci/hda/patch_cmedia.c | 1 + 3 files changed, 3 insertions(+)
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 02fe0d1..6feaec4 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c @@ -595,6 +595,7 @@ static const struct hda_codec_ops ad198x_auto_patch_ops = { .build_pcms = snd_hda_gen_build_pcms, .init = snd_hda_gen_init, .free = ad198x_free, + .unsol_event = snd_hda_jack_unsol_event, #ifdef CONFIG_PM .check_power_status = snd_hda_gen_check_power_status, .suspend = ad198x_suspend, diff --git a/sound/pci/hda/patch_ca0110.c b/sound/pci/hda/patch_ca0110.c index 8d09325..db7635c 100644 --- a/sound/pci/hda/patch_ca0110.c +++ b/sound/pci/hda/patch_ca0110.c @@ -36,6 +36,7 @@ static const struct hda_codec_ops ca0110_patch_ops = { .build_pcms = snd_hda_gen_build_pcms, .init = snd_hda_gen_init, .free = snd_hda_gen_free, + .unsol_event = snd_hda_jack_unsol_event, };
static int ca0110_parse_auto_config(struct hda_codec *codec) diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c index 04dd3b6..087cabb 100644 --- a/sound/pci/hda/patch_cmedia.c +++ b/sound/pci/hda/patch_cmedia.c @@ -576,6 +576,7 @@ static const struct hda_codec_ops cmi_auto_patch_ops = { .build_pcms = snd_hda_gen_build_pcms, .init = snd_hda_gen_init, .free = snd_hda_gen_free, + .unsol_event = snd_hda_jack_unsol_event, };
static int cmi_parse_auto_config(struct hda_codec *codec)
On Fri, Jan 18, 2013 at 2:04 AM, Takashi Iwai tiwai@suse.de wrote:
Thanks. It turned out that simply missing unsol_event handlers in the codec driver code. The patch below should fix the issue. It's already merged in test/hda-migrate and master branches.
Takashi
From: Takashi Iwai tiwai@suse.de Subject: [PATCH] ALSA: hda - Fix missing unsol event handler in some codec drivers
This resulted in non-working auto-mute behavior, of course...
Tested and it works for me!
Thanks for great work.
El vie, 18 ene 2013 a las 2:31 horas Miro Hodak escribió:
On Fri, Jan 18, 2013 at 2:04 AM, Takashi Iwai tiwai@suse.de wrote:
Thanks. It turned out that simply missing unsol_event handlers in the codec driver code. The patch below should fix the issue. It's already merged in test/hda-migrate and master branches.
Takashi
From: Takashi Iwai tiwai@suse.de Subject: [PATCH] ALSA: hda - Fix missing unsol event handler in some codec drivers
This resulted in non-working auto-mute behavior, of course...
Tested and it works for me!
Thanks for great work.
I can confirm Miro's results: auto-mute now does work. But, as Raymond says, Mic doesn't.
branch: master
commit 11ccc0c507c07cb3ac1e827a1eca0a2b8b708461 Merge: d89012b 8a6c21a Author: Takashi Iwai tiwai@suse.de Date: Fri Jan 18 07:58:34 2013 +0100
Regards,
On Fri, Jan 18, 2013 at 3:08 AM, Manolo Díaz diaz.manolo@gmail.com wrote:
I can confirm Miro's results: auto-mute now does work. But, as Raymond says, Mic doesn't.
branch: master
commit 11ccc0c507c07cb3ac1e827a1eca0a2b8b708461 Merge: d89012b 8a6c21a Author: Takashi Iwai tiwai@suse.de Date: Fri Jan 18 07:58:34 2013 +0100
Regards,
Manolo Díaz
It appears that the Mic is now labeled as a "Digital" capture device. Increasing its volume (I had to at zero), I have a functional microphone.
At Fri, 18 Jan 2013 03:14:19 -0500, Miro Hodak wrote:
On Fri, Jan 18, 2013 at 3:08 AM, Manolo Díaz diaz.manolo@gmail.com wrote:
I can confirm Miro's results: auto-mute now does work. But, as Raymond says, Mic doesn't.
branch: master
commit 11ccc0c507c07cb3ac1e827a1eca0a2b8b708461 Merge: d89012b 8a6c21a Author: Takashi Iwai tiwai@suse.de Date: Fri Jan 18 07:58:34 2013 +0100
Regards,
Manolo Díaz
It appears that the Mic is now labeled as a "Digital" capture device. Increasing its volume (I had to at zero), I have a functional microphone.
It's just a workaround :) The "Digital" capture thing is an implementation in alsa-lib, and it's a digital gain.
Looking at the problem more deeply, I found a couple of underlying problems, and now fixed in sound-unstable git tree.
The master branch is 77ecb70ef5b022a1ee80169583753d85d7a9c396, and test/hda-migrate is 6f7c83afc6cc3f66d13e4ad0a0f5693d9175e1ab.
It might take a bit time until the tree is published on kernel.org server. If you still don't see the commit above, just wait for a while and pull again.
(BTW, now I really migrate both test/hda-gen-parser and test/hda-migrate branches, so from now on, both branches point to the same code.)
thanks,
Takashi
El vie, 18 ene 2013 a las 11:17 horas Takashi Iwai escribió:
At Fri, 18 Jan 2013 03:14:19 -0500, Miro Hodak wrote:
On Fri, Jan 18, 2013 at 3:08 AM, Manolo Díaz diaz.manolo@gmail.com wrote:
I can confirm Miro's results: auto-mute now does work. But, as Raymond says, Mic doesn't.
branch: master
commit 11ccc0c507c07cb3ac1e827a1eca0a2b8b708461 Merge: d89012b 8a6c21a Author: Takashi Iwai tiwai@suse.de Date: Fri Jan 18 07:58:34 2013 +0100
Regards,
Manolo Díaz
It appears that the Mic is now labeled as a "Digital" capture device. Increasing its volume (I had to at zero), I have a functional microphone.
It's just a workaround :) The "Digital" capture thing is an implementation in alsa-lib, and it's a digital gain.
Looking at the problem more deeply, I found a couple of underlying problems, and now fixed in sound-unstable git tree.
The master branch is 77ecb70ef5b022a1ee80169583753d85d7a9c396, and test/hda-migrate is 6f7c83afc6cc3f66d13e4ad0a0f5693d9175e1ab.
It might take a bit time until the tree is published on kernel.org server. If you still don't see the commit above, just wait for a while and pull again.
(BTW, now I really migrate both test/hda-gen-parser and test/hda-migrate branches, so from now on, both branches point to the same code.)
thanks,
Takashi
Sorry, forgot to cc.
It's already in the repository. Now none of the input sources work for me: front-mic, rear-mic nor input line. Alsa-info output is attached.
commit 77ecb70ef5b022a1ee80169583753d85d7a9c396
Regards,
At Fri, 18 Jan 2013 13:37:53 +0100, Manolo Díaz wrote:
El vie, 18 ene 2013 a las 11:17 horas Takashi Iwai escribió:
At Fri, 18 Jan 2013 03:14:19 -0500, Miro Hodak wrote:
On Fri, Jan 18, 2013 at 3:08 AM, Manolo Díaz diaz.manolo@gmail.com wrote:
I can confirm Miro's results: auto-mute now does work. But, as Raymond says, Mic doesn't.
branch: master
commit 11ccc0c507c07cb3ac1e827a1eca0a2b8b708461 Merge: d89012b 8a6c21a Author: Takashi Iwai tiwai@suse.de Date: Fri Jan 18 07:58:34 2013 +0100
Regards,
Manolo Díaz
It appears that the Mic is now labeled as a "Digital" capture device. Increasing its volume (I had to at zero), I have a functional microphone.
It's just a workaround :) The "Digital" capture thing is an implementation in alsa-lib, and it's a digital gain.
Looking at the problem more deeply, I found a couple of underlying problems, and now fixed in sound-unstable git tree.
The master branch is 77ecb70ef5b022a1ee80169583753d85d7a9c396, and test/hda-migrate is 6f7c83afc6cc3f66d13e4ad0a0f5693d9175e1ab.
It might take a bit time until the tree is published on kernel.org server. If you still don't see the commit above, just wait for a while and pull again.
(BTW, now I really migrate both test/hda-gen-parser and test/hda-migrate branches, so from now on, both branches point to the same code.)
thanks,
Takashi
Sorry, forgot to cc.
It's already in the repository. Now none of the input sources work for me: front-mic, rear-mic nor input line. Alsa-info output is attached.
commit 77ecb70ef5b022a1ee80169583753d85d7a9c396
Hmm, through a quick glance, all look OK.
Could you verify whether the command below really doesn't work for all inputs?
% arecord -fdat -Dplughw:0 -vv foo.wav
Takashi
It's already in the repository. Now none of the input sources work for me: front-mic, rear-mic nor input line. Alsa-info output is attached.
commit 77ecb70ef5b022a1ee80169583753d85d7a9c396
Hmm, through a quick glance, all look OK.
It is strange that three input source are line but audio selector are not the same
Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',1 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',2 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line'
Node 0x0c [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 11 0x38 0x39 0x3a* 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 0x1f Node 0x0d [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 Node 0x0e [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20
At Fri, 18 Jan 2013 22:49:37 +0800, Raymond Yau wrote:
It's already in the repository. Now none of the input sources work for me: front-mic, rear-mic nor input line. Alsa-info output is attached.
commit 77ecb70ef5b022a1ee80169583753d85d7a9c396
Hmm, through a quick glance, all look OK.
It is strange that three input source are line but audio selector are not the same
Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',1 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',2 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line'
Node 0x0c [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 11 0x38 0x39 0x3a* 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 0x1f Node 0x0d [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 Node 0x0e [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20
Good catch. It's a recent regression. I fixed now with the patch below.
test/hda-gen-parser and master branches are updated now with this and other fixes.
thanks,
Takashi
--- From: Takashi Iwai tiwai@suse.de Subject: [PATCH] ALSA: hda - Fix the wrong adc_idx for capture source
The patch "ALSA: hda - fix wrong adc_idx in generic parser" fixed the adc_idx for the capture volume and capture switch controls. But also modified the adc_idx retrieval for the capture source controls wrongly. As multiple capture source controls are created in a single shot with counts > 1, the id.index doesn't contain the real value. The real index has to be taken via snd_ctl_get_ioffidx() as in the original code.
This patch reverts the fixes partially to recover from the regression.
Signed-off-by: Takashi Iwai tiwai@suse.de --- sound/pci/hda/hda_generic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index e4e71fa..29f37c9 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -2675,7 +2675,8 @@ static int mux_enum_get(struct snd_kcontrol *kcontrol, { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct hda_gen_spec *spec = codec->spec; - unsigned int adc_idx = kcontrol->id.index; + /* the ctls are created at once with multiple counts */ + unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
ucontrol->value.enumerated.item[0] = spec->cur_mux[adc_idx]; return 0; @@ -2685,7 +2686,7 @@ static int mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); - unsigned int adc_idx = kcontrol->id.index; + unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); return mux_select(codec, adc_idx, ucontrol->value.enumerated.item[0]); }
El vie, 18 ene 2013 a las 16:30 horas Takashi Iwai escribió:
At Fri, 18 Jan 2013 22:49:37 +0800, Raymond Yau wrote:
It's already in the repository. Now none of the input sources work for me: front-mic, rear-mic nor input line. Alsa-info output is attached.
commit 77ecb70ef5b022a1ee80169583753d85d7a9c396
Hmm, through a quick glance, all look OK.
It is strange that three input source are line but audio selector are not the same
Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',1 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',2 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line'
Node 0x0c [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 11 0x38 0x39 0x3a* 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 0x1f Node 0x0d [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 Node 0x0e [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20
Good catch. It's a recent regression. I fixed now with the patch below.
test/hda-gen-parser and master branches are updated now with this and other fixes.
thanks,
Takashi
From: Takashi Iwai tiwai@suse.de Subject: [PATCH] ALSA: hda - Fix the wrong adc_idx for capture source
The patch "ALSA: hda - fix wrong adc_idx in generic parser" fixed the adc_idx for the capture volume and capture switch controls. But also modified the adc_idx retrieval for the capture source controls wrongly. As multiple capture source controls are created in a single shot with counts > 1, the id.index doesn't contain the real value. The real index has to be taken via snd_ctl_get_ioffidx() as in the original code.
This patch reverts the fixes partially to recover from the regression.
Signed-off-by: Takashi Iwai tiwai@suse.de
sound/pci/hda/hda_generic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index e4e71fa..29f37c9 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -2675,7 +2675,8 @@ static int mux_enum_get(struct snd_kcontrol *kcontrol, { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct hda_gen_spec *spec = codec->spec;
- unsigned int adc_idx = kcontrol->id.index;
/* the ctls are created at once with multiple counts */
unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
ucontrol->value.enumerated.item[0] = spec->cur_mux[adc_idx]; return 0;
@@ -2685,7 +2686,7 @@ static int mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
- unsigned int adc_idx = kcontrol->id.index;
- unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); return mux_select(codec, adc_idx, ucontrol->value.enumerated.item[0]);
}
The problem persists after commit d821c1ef2c8ada02f1feada071a37ced69b300fe, master branch
arecord -fdat -Dplughw:0 -vv foo.wav Recording WAVE 'foo.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo Plug PCM: Hardware PCM card 0 'HDA ATI SB' device 0 subdevice 0 Its setup is: stream : CAPTURE access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 48000 exact rate : 48000 (48000/1) msbits : 16 buffer_size : 24064 period_size : 6016 period_time : 125333 tstamp_mode : NONE period_step : 1 avail_min : 6016 period_event : 0 start_threshold : 1 stop_threshold : 24064 silence_threshold: 0 silence_size : 0 boundary : 6773413839565225984 appl_ptr : 0 hw_ptr : 0 ##### + | 10%^C
Playing the foo.wav file I can only hear noise.
Regards,
At Fri, 18 Jan 2013 17:48:23 +0100, Manolo Díaz wrote:
El vie, 18 ene 2013 a las 16:30 horas Takashi Iwai escribió:
At Fri, 18 Jan 2013 22:49:37 +0800, Raymond Yau wrote:
It's already in the repository. Now none of the input sources work for me: front-mic, rear-mic nor input line. Alsa-info output is attached.
commit 77ecb70ef5b022a1ee80169583753d85d7a9c396
Hmm, through a quick glance, all look OK.
It is strange that three input source are line but audio selector are not the same
Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',1 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',2 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line'
Node 0x0c [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 11 0x38 0x39 0x3a* 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 0x1f Node 0x0d [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 Node 0x0e [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20
Good catch. It's a recent regression. I fixed now with the patch below.
test/hda-gen-parser and master branches are updated now with this and other fixes.
thanks,
Takashi
From: Takashi Iwai tiwai@suse.de Subject: [PATCH] ALSA: hda - Fix the wrong adc_idx for capture source
The patch "ALSA: hda - fix wrong adc_idx in generic parser" fixed the adc_idx for the capture volume and capture switch controls. But also modified the adc_idx retrieval for the capture source controls wrongly. As multiple capture source controls are created in a single shot with counts > 1, the id.index doesn't contain the real value. The real index has to be taken via snd_ctl_get_ioffidx() as in the original code.
This patch reverts the fixes partially to recover from the regression.
Signed-off-by: Takashi Iwai tiwai@suse.de
sound/pci/hda/hda_generic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index e4e71fa..29f37c9 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -2675,7 +2675,8 @@ static int mux_enum_get(struct snd_kcontrol *kcontrol, { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct hda_gen_spec *spec = codec->spec;
- unsigned int adc_idx = kcontrol->id.index;
/* the ctls are created at once with multiple counts */
unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
ucontrol->value.enumerated.item[0] = spec->cur_mux[adc_idx]; return 0;
@@ -2685,7 +2686,7 @@ static int mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
- unsigned int adc_idx = kcontrol->id.index;
- unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); return mux_select(codec, adc_idx, ucontrol->value.enumerated.item[0]);
}
The problem persists after commit d821c1ef2c8ada02f1feada071a37ced69b300fe, master branch
arecord -fdat -Dplughw:0 -vv foo.wav Recording WAVE 'foo.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo Plug PCM: Hardware PCM card 0 'HDA ATI SB' device 0 subdevice 0 Its setup is: stream : CAPTURE access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 48000 exact rate : 48000 (48000/1) msbits : 16 buffer_size : 24064 period_size : 6016 period_time : 125333 tstamp_mode : NONE period_step : 1 avail_min : 6016 period_event : 0 start_threshold : 1 stop_threshold : 24064 silence_threshold: 0 silence_size : 0 boundary : 6773413839565225984 appl_ptr : 0 hw_ptr : 0 ##### + | 10%^C
Playing the foo.wav file I can only hear noise.
You chose "Rear Mic" only in the third capture source. There are three "Input Source" controls, and the first one corresponds to the primary recording stream.
Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',1 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Front Mic' Simple mixer control 'Input Source',2 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Rear Mic'
BTW, you should turn down the "Digital" capture volume to the half (0dB). It's an artificial gain in software, so at best keep it in 0dB.
% amixer -c0 set "Digital" 0dB
Takashi
El vie, 18 ene 2013 a las 17:58 horas Takashi Iwai escribió:
At Fri, 18 Jan 2013 17:48:23 +0100, Manolo Díaz wrote:
El vie, 18 ene 2013 a las 16:30 horas Takashi Iwai escribió:
At Fri, 18 Jan 2013 22:49:37 +0800, Raymond Yau wrote:
It's already in the repository. Now none of the input sources work for me: front-mic, rear-mic nor input line. Alsa-info output is attached.
commit 77ecb70ef5b022a1ee80169583753d85d7a9c396
Hmm, through a quick glance, all look OK.
It is strange that three input source are line but audio selector are not the same
Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',1 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',2 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line'
Node 0x0c [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 11 0x38 0x39 0x3a* 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 0x1f Node 0x0d [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 Node 0x0e [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20
Good catch. It's a recent regression. I fixed now with the patch below.
test/hda-gen-parser and master branches are updated now with this and other fixes.
thanks,
Takashi
From: Takashi Iwai tiwai@suse.de Subject: [PATCH] ALSA: hda - Fix the wrong adc_idx for capture source
The patch "ALSA: hda - fix wrong adc_idx in generic parser" fixed the adc_idx for the capture volume and capture switch controls. But also modified the adc_idx retrieval for the capture source controls wrongly. As multiple capture source controls are created in a single shot with counts > 1, the id.index doesn't contain the real value. The real index has to be taken via snd_ctl_get_ioffidx() as in the original code.
This patch reverts the fixes partially to recover from the regression.
Signed-off-by: Takashi Iwai tiwai@suse.de
sound/pci/hda/hda_generic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index e4e71fa..29f37c9 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -2675,7 +2675,8 @@ static int mux_enum_get(struct snd_kcontrol *kcontrol, { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct hda_gen_spec *spec = codec->spec;
- unsigned int adc_idx = kcontrol->id.index;
/* the ctls are created at once with multiple counts */
unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
ucontrol->value.enumerated.item[0] = spec->cur_mux[adc_idx]; return 0;
@@ -2685,7 +2686,7 @@ static int mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
- unsigned int adc_idx = kcontrol->id.index;
- unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); return mux_select(codec, adc_idx, ucontrol->value.enumerated.item[0]);
}
The problem persists after commit d821c1ef2c8ada02f1feada071a37ced69b300fe, master branch
arecord -fdat -Dplughw:0 -vv foo.wav Recording WAVE 'foo.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo Plug PCM: Hardware PCM card 0 'HDA ATI SB' device 0 subdevice 0 Its setup is: stream : CAPTURE access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 48000 exact rate : 48000 (48000/1) msbits : 16 buffer_size : 24064 period_size : 6016 period_time : 125333 tstamp_mode : NONE period_step : 1 avail_min : 6016 period_event : 0 start_threshold : 1 stop_threshold : 24064 silence_threshold: 0 silence_size : 0 boundary : 6773413839565225984 appl_ptr : 0 hw_ptr : 0 ##### + | 10%^C
Playing the foo.wav file I can only hear noise.
You chose "Rear Mic" only in the third capture source. There are three "Input Source" controls, and the first one corresponds to the primary recording stream.
Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',1 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Front Mic' Simple mixer control 'Input Source',2 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Rear Mic'
BTW, you should turn down the "Digital" capture volume to the half (0dB). It's an artificial gain in software, so at best keep it in 0dB.
% amixer -c0 set "Digital" 0dB
Takashi
It stops with error:
arecord -fdat -Dplughw:0 -vv foo.wav Recording WAVE 'foo.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo Plug PCM: Hardware PCM card 0 'HDA ATI SB' device 0 subdevice 0 Its setup is: stream : CAPTURE access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 48000 exact rate : 48000 (48000/1) msbits : 16 buffer_size : 24064 period_size : 6016 period_time : 125333 tstamp_mode : NONE period_step : 1 avail_min : 6016 period_event : 0 start_threshold : 1 stop_threshold : 24064 silence_threshold: 0 silence_size : 0 boundary : 6773413839565225984 appl_ptr : 0 hw_ptr : 0 arecord: pcm_read:1801: read error: Input/output error
amixer Simple mixer control 'Master',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum Playback channels: Mono Limits: Playback 0 - 39 Mono: Playback 29 [74%] [-15.00dB] [on] Simple mixer control 'Headphone',0 Capabilities: pvolume pswitch penum Playback channels: Front Left - Front Right Limits: Playback 0 - 39 Mono: Front Left: Playback 39 [100%] [0.00dB] [on] Front Right: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'PCM',0 Capabilities: pvolume penum Playback channels: Front Left - Front Right Limits: Playback 0 - 255 Mono: Front Left: Playback 255 [100%] [0.00dB] Front Right: Playback 255 [100%] [0.00dB] Simple mixer control 'Front',0 Capabilities: pvolume pswitch penum Playback channels: Front Left - Front Right Limits: Playback 0 - 39 Mono: Front Left: Playback 39 [100%] [0.00dB] [on] Front Right: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'Front Mic Boost',0 Capabilities: volume penum Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 3 Front Left: 3 [100%] [30.00dB] Front Right: 3 [100%] [30.00dB] Simple mixer control 'Surround',0 Capabilities: pvolume pswitch penum Playback channels: Front Left - Front Right Limits: Playback 0 - 39 Mono: Front Left: Playback 39 [100%] [0.00dB] [on] Front Right: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'Center',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum Playback channels: Mono Limits: Playback 0 - 39 Mono: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'LFE',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum Playback channels: Mono Limits: Playback 0 - 39 Mono: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'Side',0 Capabilities: pvolume pswitch penum Playback channels: Front Left - Front Right Limits: Playback 0 - 39 Mono: Front Left: Playback 39 [100%] [0.00dB] [on] Front Right: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'Line Boost',0 Capabilities: volume penum Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 3 Front Left: 3 [100%] [30.00dB] Front Right: 3 [100%] [30.00dB] Simple mixer control 'IEC958',0 Capabilities: pswitch pswitch-joined penum Playback channels: Mono Mono: Playback [off] Simple mixer control 'IEC958 Default PCM',0 Capabilities: pswitch pswitch-joined penum Playback channels: Mono Mono: Playback [off] Simple mixer control 'Capture',0 Capabilities: cvolume cswitch penum Capture channels: Front Left - Front Right Limits: Capture 0 - 54 Front Left: Capture 54 [100%] [22.50dB] [on] Front Right: Capture 54 [100%] [22.50dB] [on] Simple mixer control 'Capture',1 Capabilities: cvolume cswitch penum Capture channels: Front Left - Front Right Limits: Capture 0 - 54 Front Left: Capture 54 [100%] [22.50dB] [on] Front Right: Capture 54 [100%] [22.50dB] [on] Simple mixer control 'Capture',2 Capabilities: cvolume cswitch penum Capture channels: Front Left - Front Right Limits: Capture 0 - 54 Front Left: Capture 54 [100%] [22.50dB] [on] Front Right: Capture 54 [100%] [22.50dB] [on] Simple mixer control 'Auto-Mute Mode',0 Capabilities: enum Items: 'Disabled' 'Enabled' Item0: 'Disabled' Simple mixer control 'Digital',0 Capabilities: cvolume penum Capture channels: Front Left - Front Right Limits: Capture 0 - 120 Front Left: Capture 60 [50%] [0.00dB] Front Right: Capture 60 [50%] [0.00dB] Simple mixer control 'Independent HP',0 Capabilities: enum Items: 'Disabled' 'Enabled' Item0: 'Disabled' Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Rear Mic' Simple mixer control 'Input Source',1 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',2 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Front Mic' Simple mixer control 'Rear Mic Boost',0 Capabilities: volume penum Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 3 Front Left: 3 [100%] [30.00dB] Front Right: 3 [100%] [30.00dB]
Regards,
El vie, 18 ene 2013 a las 18:51 horas Manolo Díaz escribió:
El vie, 18 ene 2013 a las 17:58 horas Takashi Iwai escribió:
At Fri, 18 Jan 2013 17:48:23 +0100, Manolo Díaz wrote:
El vie, 18 ene 2013 a las 16:30 horas Takashi Iwai escribió:
At Fri, 18 Jan 2013 22:49:37 +0800, Raymond Yau wrote:
> It's already in the repository. Now none of the input sources work for > me: front-mic, rear-mic nor input line. Alsa-info output is attached. > > commit 77ecb70ef5b022a1ee80169583753d85d7a9c396
Hmm, through a quick glance, all look OK.
It is strange that three input source are line but audio selector are not the same
Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',1 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',2 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line'
Node 0x0c [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 11 0x38 0x39 0x3a* 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 0x1f Node 0x0d [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 Node 0x0e [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20
Good catch. It's a recent regression. I fixed now with the patch below.
test/hda-gen-parser and master branches are updated now with this and other fixes.
thanks,
Takashi
From: Takashi Iwai tiwai@suse.de Subject: [PATCH] ALSA: hda - Fix the wrong adc_idx for capture source
The patch "ALSA: hda - fix wrong adc_idx in generic parser" fixed the adc_idx for the capture volume and capture switch controls. But also modified the adc_idx retrieval for the capture source controls wrongly. As multiple capture source controls are created in a single shot with counts > 1, the id.index doesn't contain the real value. The real index has to be taken via snd_ctl_get_ioffidx() as in the original code.
This patch reverts the fixes partially to recover from the regression.
Signed-off-by: Takashi Iwai tiwai@suse.de
sound/pci/hda/hda_generic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index e4e71fa..29f37c9 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -2675,7 +2675,8 @@ static int mux_enum_get(struct snd_kcontrol *kcontrol, { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct hda_gen_spec *spec = codec->spec;
- unsigned int adc_idx = kcontrol->id.index;
/* the ctls are created at once with multiple counts */
unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
ucontrol->value.enumerated.item[0] = spec->cur_mux[adc_idx]; return 0;
@@ -2685,7 +2686,7 @@ static int mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
- unsigned int adc_idx = kcontrol->id.index;
- unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); return mux_select(codec, adc_idx, ucontrol->value.enumerated.item[0]);
}
The problem persists after commit d821c1ef2c8ada02f1feada071a37ced69b300fe, master branch
arecord -fdat -Dplughw:0 -vv foo.wav Recording WAVE 'foo.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo Plug PCM: Hardware PCM card 0 'HDA ATI SB' device 0 subdevice 0 Its setup is: stream : CAPTURE access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 48000 exact rate : 48000 (48000/1) msbits : 16 buffer_size : 24064 period_size : 6016 period_time : 125333 tstamp_mode : NONE period_step : 1 avail_min : 6016 period_event : 0 start_threshold : 1 stop_threshold : 24064 silence_threshold: 0 silence_size : 0 boundary : 6773413839565225984 appl_ptr : 0 hw_ptr : 0 ##### + | 10%^C
Playing the foo.wav file I can only hear noise.
You chose "Rear Mic" only in the third capture source. There are three "Input Source" controls, and the first one corresponds to the primary recording stream.
Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',1 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Front Mic' Simple mixer control 'Input Source',2 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Rear Mic'
BTW, you should turn down the "Digital" capture volume to the half (0dB). It's an artificial gain in software, so at best keep it in 0dB.
% amixer -c0 set "Digital" 0dB
Takashi
It stops with error:
arecord -fdat -Dplughw:0 -vv foo.wav Recording WAVE 'foo.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo Plug PCM: Hardware PCM card 0 'HDA ATI SB' device 0 subdevice 0 Its setup is: stream : CAPTURE access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 48000 exact rate : 48000 (48000/1) msbits : 16 buffer_size : 24064 period_size : 6016 period_time : 125333 tstamp_mode : NONE period_step : 1 avail_min : 6016 period_event : 0 start_threshold : 1 stop_threshold : 24064 silence_threshold: 0 silence_size : 0 boundary : 6773413839565225984 appl_ptr : 0 hw_ptr : 0 arecord: pcm_read:1801: read error: Input/output error
amixer Simple mixer control 'Master',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum Playback channels: Mono Limits: Playback 0 - 39 Mono: Playback 29 [74%] [-15.00dB] [on] Simple mixer control 'Headphone',0 Capabilities: pvolume pswitch penum Playback channels: Front Left - Front Right Limits: Playback 0 - 39 Mono: Front Left: Playback 39 [100%] [0.00dB] [on] Front Right: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'PCM',0 Capabilities: pvolume penum Playback channels: Front Left - Front Right Limits: Playback 0 - 255 Mono: Front Left: Playback 255 [100%] [0.00dB] Front Right: Playback 255 [100%] [0.00dB] Simple mixer control 'Front',0 Capabilities: pvolume pswitch penum Playback channels: Front Left - Front Right Limits: Playback 0 - 39 Mono: Front Left: Playback 39 [100%] [0.00dB] [on] Front Right: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'Front Mic Boost',0 Capabilities: volume penum Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 3 Front Left: 3 [100%] [30.00dB] Front Right: 3 [100%] [30.00dB] Simple mixer control 'Surround',0 Capabilities: pvolume pswitch penum Playback channels: Front Left - Front Right Limits: Playback 0 - 39 Mono: Front Left: Playback 39 [100%] [0.00dB] [on] Front Right: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'Center',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum Playback channels: Mono Limits: Playback 0 - 39 Mono: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'LFE',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum Playback channels: Mono Limits: Playback 0 - 39 Mono: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'Side',0 Capabilities: pvolume pswitch penum Playback channels: Front Left - Front Right Limits: Playback 0 - 39 Mono: Front Left: Playback 39 [100%] [0.00dB] [on] Front Right: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'Line Boost',0 Capabilities: volume penum Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 3 Front Left: 3 [100%] [30.00dB] Front Right: 3 [100%] [30.00dB] Simple mixer control 'IEC958',0 Capabilities: pswitch pswitch-joined penum Playback channels: Mono Mono: Playback [off] Simple mixer control 'IEC958 Default PCM',0 Capabilities: pswitch pswitch-joined penum Playback channels: Mono Mono: Playback [off] Simple mixer control 'Capture',0 Capabilities: cvolume cswitch penum Capture channels: Front Left - Front Right Limits: Capture 0 - 54 Front Left: Capture 54 [100%] [22.50dB] [on] Front Right: Capture 54 [100%] [22.50dB] [on] Simple mixer control 'Capture',1 Capabilities: cvolume cswitch penum Capture channels: Front Left - Front Right Limits: Capture 0 - 54 Front Left: Capture 54 [100%] [22.50dB] [on] Front Right: Capture 54 [100%] [22.50dB] [on] Simple mixer control 'Capture',2 Capabilities: cvolume cswitch penum Capture channels: Front Left - Front Right Limits: Capture 0 - 54 Front Left: Capture 54 [100%] [22.50dB] [on] Front Right: Capture 54 [100%] [22.50dB] [on] Simple mixer control 'Auto-Mute Mode',0 Capabilities: enum Items: 'Disabled' 'Enabled' Item0: 'Disabled' Simple mixer control 'Digital',0 Capabilities: cvolume penum Capture channels: Front Left - Front Right Limits: Capture 0 - 120 Front Left: Capture 60 [50%] [0.00dB] Front Right: Capture 60 [50%] [0.00dB] Simple mixer control 'Independent HP',0 Capabilities: enum Items: 'Disabled' 'Enabled' Item0: 'Disabled' Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Rear Mic' Simple mixer control 'Input Source',1 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',2 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Front Mic' Simple mixer control 'Rear Mic Boost',0 Capabilities: volume penum Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 3 Front Left: 3 [100%] [30.00dB] Front Right: 3 [100%] [30.00dB]
Regards,
Sorry, forget my previous mail, I don't know what I did wrong, but the three input sources works.
Regards,
At Fri, 18 Jan 2013 19:20:47 +0100, Manolo Díaz wrote:
El vie, 18 ene 2013 a las 18:51 horas Manolo Díaz escribió:
El vie, 18 ene 2013 a las 17:58 horas Takashi Iwai escribió:
At Fri, 18 Jan 2013 17:48:23 +0100, Manolo Díaz wrote:
El vie, 18 ene 2013 a las 16:30 horas Takashi Iwai escribió:
At Fri, 18 Jan 2013 22:49:37 +0800, Raymond Yau wrote:
> > It's already in the repository. Now none of the input sources work for > > me: front-mic, rear-mic nor input line. Alsa-info output is attached. > > > > commit 77ecb70ef5b022a1ee80169583753d85d7a9c396 > > Hmm, through a quick glance, all look OK. >
It is strange that three input source are line but audio selector are not the same
Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',1 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',2 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line'
Node 0x0c [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 11 0x38 0x39 0x3a* 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 0x1f Node 0x0d [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 Node 0x0e [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20
Good catch. It's a recent regression. I fixed now with the patch below.
test/hda-gen-parser and master branches are updated now with this and other fixes.
thanks,
Takashi
From: Takashi Iwai tiwai@suse.de Subject: [PATCH] ALSA: hda - Fix the wrong adc_idx for capture source
The patch "ALSA: hda - fix wrong adc_idx in generic parser" fixed the adc_idx for the capture volume and capture switch controls. But also modified the adc_idx retrieval for the capture source controls wrongly. As multiple capture source controls are created in a single shot with counts > 1, the id.index doesn't contain the real value. The real index has to be taken via snd_ctl_get_ioffidx() as in the original code.
This patch reverts the fixes partially to recover from the regression.
Signed-off-by: Takashi Iwai tiwai@suse.de
sound/pci/hda/hda_generic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index e4e71fa..29f37c9 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -2675,7 +2675,8 @@ static int mux_enum_get(struct snd_kcontrol *kcontrol, { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct hda_gen_spec *spec = codec->spec;
- unsigned int adc_idx = kcontrol->id.index;
/* the ctls are created at once with multiple counts */
unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
ucontrol->value.enumerated.item[0] = spec->cur_mux[adc_idx]; return 0;
@@ -2685,7 +2686,7 @@ static int mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
- unsigned int adc_idx = kcontrol->id.index;
- unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); return mux_select(codec, adc_idx, ucontrol->value.enumerated.item[0]);
}
The problem persists after commit d821c1ef2c8ada02f1feada071a37ced69b300fe, master branch
arecord -fdat -Dplughw:0 -vv foo.wav Recording WAVE 'foo.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo Plug PCM: Hardware PCM card 0 'HDA ATI SB' device 0 subdevice 0 Its setup is: stream : CAPTURE access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 48000 exact rate : 48000 (48000/1) msbits : 16 buffer_size : 24064 period_size : 6016 period_time : 125333 tstamp_mode : NONE period_step : 1 avail_min : 6016 period_event : 0 start_threshold : 1 stop_threshold : 24064 silence_threshold: 0 silence_size : 0 boundary : 6773413839565225984 appl_ptr : 0 hw_ptr : 0 ##### + | 10%^C
Playing the foo.wav file I can only hear noise.
You chose "Rear Mic" only in the third capture source. There are three "Input Source" controls, and the first one corresponds to the primary recording stream.
Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',1 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Front Mic' Simple mixer control 'Input Source',2 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Rear Mic'
BTW, you should turn down the "Digital" capture volume to the half (0dB). It's an artificial gain in software, so at best keep it in 0dB.
% amixer -c0 set "Digital" 0dB
Takashi
It stops with error:
arecord -fdat -Dplughw:0 -vv foo.wav Recording WAVE 'foo.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo Plug PCM: Hardware PCM card 0 'HDA ATI SB' device 0 subdevice 0 Its setup is: stream : CAPTURE access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 48000 exact rate : 48000 (48000/1) msbits : 16 buffer_size : 24064 period_size : 6016 period_time : 125333 tstamp_mode : NONE period_step : 1 avail_min : 6016 period_event : 0 start_threshold : 1 stop_threshold : 24064 silence_threshold: 0 silence_size : 0 boundary : 6773413839565225984 appl_ptr : 0 hw_ptr : 0 arecord: pcm_read:1801: read error: Input/output error
amixer Simple mixer control 'Master',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum Playback channels: Mono Limits: Playback 0 - 39 Mono: Playback 29 [74%] [-15.00dB] [on] Simple mixer control 'Headphone',0 Capabilities: pvolume pswitch penum Playback channels: Front Left - Front Right Limits: Playback 0 - 39 Mono: Front Left: Playback 39 [100%] [0.00dB] [on] Front Right: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'PCM',0 Capabilities: pvolume penum Playback channels: Front Left - Front Right Limits: Playback 0 - 255 Mono: Front Left: Playback 255 [100%] [0.00dB] Front Right: Playback 255 [100%] [0.00dB] Simple mixer control 'Front',0 Capabilities: pvolume pswitch penum Playback channels: Front Left - Front Right Limits: Playback 0 - 39 Mono: Front Left: Playback 39 [100%] [0.00dB] [on] Front Right: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'Front Mic Boost',0 Capabilities: volume penum Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 3 Front Left: 3 [100%] [30.00dB] Front Right: 3 [100%] [30.00dB] Simple mixer control 'Surround',0 Capabilities: pvolume pswitch penum Playback channels: Front Left - Front Right Limits: Playback 0 - 39 Mono: Front Left: Playback 39 [100%] [0.00dB] [on] Front Right: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'Center',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum Playback channels: Mono Limits: Playback 0 - 39 Mono: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'LFE',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum Playback channels: Mono Limits: Playback 0 - 39 Mono: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'Side',0 Capabilities: pvolume pswitch penum Playback channels: Front Left - Front Right Limits: Playback 0 - 39 Mono: Front Left: Playback 39 [100%] [0.00dB] [on] Front Right: Playback 39 [100%] [0.00dB] [on] Simple mixer control 'Line Boost',0 Capabilities: volume penum Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 3 Front Left: 3 [100%] [30.00dB] Front Right: 3 [100%] [30.00dB] Simple mixer control 'IEC958',0 Capabilities: pswitch pswitch-joined penum Playback channels: Mono Mono: Playback [off] Simple mixer control 'IEC958 Default PCM',0 Capabilities: pswitch pswitch-joined penum Playback channels: Mono Mono: Playback [off] Simple mixer control 'Capture',0 Capabilities: cvolume cswitch penum Capture channels: Front Left - Front Right Limits: Capture 0 - 54 Front Left: Capture 54 [100%] [22.50dB] [on] Front Right: Capture 54 [100%] [22.50dB] [on] Simple mixer control 'Capture',1 Capabilities: cvolume cswitch penum Capture channels: Front Left - Front Right Limits: Capture 0 - 54 Front Left: Capture 54 [100%] [22.50dB] [on] Front Right: Capture 54 [100%] [22.50dB] [on] Simple mixer control 'Capture',2 Capabilities: cvolume cswitch penum Capture channels: Front Left - Front Right Limits: Capture 0 - 54 Front Left: Capture 54 [100%] [22.50dB] [on] Front Right: Capture 54 [100%] [22.50dB] [on] Simple mixer control 'Auto-Mute Mode',0 Capabilities: enum Items: 'Disabled' 'Enabled' Item0: 'Disabled' Simple mixer control 'Digital',0 Capabilities: cvolume penum Capture channels: Front Left - Front Right Limits: Capture 0 - 120 Front Left: Capture 60 [50%] [0.00dB] Front Right: Capture 60 [50%] [0.00dB] Simple mixer control 'Independent HP',0 Capabilities: enum Items: 'Disabled' 'Enabled' Item0: 'Disabled' Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Rear Mic' Simple mixer control 'Input Source',1 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',2 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Front Mic' Simple mixer control 'Rear Mic Boost',0 Capabilities: volume penum Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 3 Front Left: 3 [100%] [30.00dB] Front Right: 3 [100%] [30.00dB]
Regards,
Sorry, forget my previous mail, I don't know what I did wrong, but the three input sources works.
OK, thanks for quick tests!
Takashi
It's already in the repository. Now none of the input sources work
for
me: front-mic, rear-mic nor input line. Alsa-info output is
attached.
commit 77ecb70ef5b022a1ee80169583753d85d7a9c396
Hmm, through a quick glance, all look OK.
It is strange that three input source are line but audio selector are
not
the same
Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',1 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',2 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line'
Node 0x0c [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 11 0x38 0x39 0x3a* 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 0x1f Node 0x0d [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 Node 0x0e [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20
Good catch. It's a recent regression. I fixed now with the patch below.
test/hda-gen-parser and master branches are updated now with this and other fixes.
thanks,
Takashi
From: Takashi Iwai tiwai@suse.de Subject: [PATCH] ALSA: hda - Fix the wrong adc_idx for capture source
The patch "ALSA: hda - fix wrong adc_idx in generic parser" fixed the adc_idx for the capture volume and capture switch controls. But also modified the adc_idx retrieval for the capture source controls wrongly. As multiple capture source controls are created in a single shot with counts > 1, the id.index doesn't contain the real value. The real index has to be taken via snd_ctl_get_ioffidx() as in the original code.
This patch reverts the fixes partially to recover from the regression.
Refer to commit
http://git.kernel.org/?p=linux/kernel/git/tiwai/sound-unstable.git;a=commit;...
Do you mean user have to specify hint
1) mixer_nid to analog the aa-path for creating those Mic/line playback volume/switch ?
2) add_stereo_mix_input for the missing input source "mix"
At Sat, 19 Jan 2013 10:39:39 +0800, Raymond Yau wrote:
[1 <text/plain; UTF-8 (7bit)>]
It's already in the repository. Now none of the input sources work
for
me: front-mic, rear-mic nor input line. Alsa-info output is
attached.
commit 77ecb70ef5b022a1ee80169583753d85d7a9c396
Hmm, through a quick glance, all look OK.
It is strange that three input source are line but audio selector are
not
the same
Simple mixer control 'Input Source',0 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',1 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line' Simple mixer control 'Input Source',2 Capabilities: cenum Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' Item0: 'Line'
Node 0x0c [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 11 0x38 0x39 0x3a* 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 0x1f Node 0x0d [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=1, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20 Node 0x0e [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=2, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x27, nsteps=0x36, stepsize=0x05, mute=1 Amp-Out vals: [0x36 0x36] Connection: 10 0x38 0x39* 0x3a 0x3b 0x3c 0x18 0x24 0x25 0x3d 0x20
Good catch. It's a recent regression. I fixed now with the patch below.
test/hda-gen-parser and master branches are updated now with this and other fixes.
thanks,
Takashi
From: Takashi Iwai tiwai@suse.de Subject: [PATCH] ALSA: hda - Fix the wrong adc_idx for capture source
The patch "ALSA: hda - fix wrong adc_idx in generic parser" fixed the adc_idx for the capture volume and capture switch controls. But also modified the adc_idx retrieval for the capture source controls wrongly. As multiple capture source controls are created in a single shot with counts > 1, the id.index doesn't contain the real value. The real index has to be taken via snd_ctl_get_ioffidx() as in the original code.
This patch reverts the fixes partially to recover from the regression.
Refer to commit
http://git.kernel.org/?p=linux/kernel/git/tiwai/sound-unstable.git;a=commit;...
Do you mean user have to specify hint
- mixer_nid to analog the aa-path for creating those Mic/line playback
volume/switch ?
mixer_nid should be set in each caller, i.e. patch_ad1988(). It's just missing there. Of course, you can set it explicitly via a hint string by yourself later.
- add_stereo_mix_input for the missing input source "mix"
This also depends on the codec and preference. I guess it'd make sense to enable it as default for AD1988x.
Takashi
Refer to commit
http://git.kernel.org/?p=linux/kernel/git/tiwai/sound-unstable.git;a=commit;...
Do you mean user have to specify hint
- mixer_nid to analog the aa-path for creating those Mic/line playback
volume/switch ?
mixer_nid should be set in each caller, i.e. patch_ad1988(). It's just missing there. Of course, you can set it explicitly via a hint string by yourself later.
Can the auto parser find this mixer instead of hard code ?
- add_stereo_mix_input for the missing input source "mix"
This also depends on the codec and preference. I guess it'd make sense to enable it as default for AD1988x.
Do the user really need Line boost volume control ?
Node 0x3a [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Line Boost Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-Out vals: [0x03 0x03] Connection: 1 0x15
Is it feasbile at this stage to implement the centre and lfe swap switch when orange jack and retasked rear mic jack support L/R swap ?
Node 0x24 [Pin Complex] wcaps 0x40098d: Stereo Amp-Out R/L Control: name="Center Playback Switch", index=0, device=0 ControlAmp: chs=1, dir=Out, idx=0, ofs=0 Control: name="LFE Playback Switch", index=0, device=0 ControlAmp: chs=2, dir=Out, idx=0, ofs=0 Control: name="Line Out CLFE Jack", index=0, device=0 Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00] Pincap 0x00000037: IN OUT Detect Trigger ImpSense Pin Default 0x01016011: [Jack] Line Out at Ext Rear Conn = 1/8, Color = Orange DefAssociation = 0x1, Sequence = 0x1 Pin-ctls: 0x40: OUT Unsolicited: tag=04, enabled=1 Connection: 1 0x27
Node 0x17 [Pin Complex] wcaps 0x40098d: Stereo Amp-Out R/L Control: name="Rear Mic Jack", index=0, device=0 Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80] Pincap 0x00003737: IN OUT Detect Trigger ImpSense Vref caps: HIZ 50 GRD 80 100 Pin Default 0x01a19020: [Jack] Mic at Ext Rear Conn = 1/8, Color = Pink DefAssociation = 0x2, Sequence = 0x0 Pin-ctls: 0x24: IN VREF_80 Unsolicited: tag=07, enabled=1 Connection: 1 0x26
At Sat, 19 Jan 2013 20:37:00 +0800, Raymond Yau wrote:
Refer to commit
http://git.kernel.org/?p=linux/kernel/git/tiwai/sound-unstable.git;a=commit;...
Do you mean user have to specify hint
- mixer_nid to analog the aa-path for creating those Mic/line playback
volume/switch ?
mixer_nid should be set in each caller, i.e. patch_ad1988(). It's just missing there. Of course, you can set it explicitly via a hint string by yourself later.
Can the auto parser find this mixer instead of hard code ?
Possible but not trivial.
- add_stereo_mix_input for the missing input source "mix"
This also depends on the codec and preference. I guess it'd make sense to enable it as default for AD1988x.
Do the user really need Line boost volume control ?
Node 0x3a [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Line Boost Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-Out vals: [0x03 0x03] Connection: 1 0x15
Well, it's a matter of taste. This has been requested some times, but I'm open about the default behavior.
Is it feasbile at this stage to implement the centre and lfe swap switch when orange jack and retasked rear mic jack support L/R swap ?
Node 0x24 [Pin Complex] wcaps 0x40098d: Stereo Amp-Out R/L Control: name="Center Playback Switch", index=0, device=0 ControlAmp: chs=1, dir=Out, idx=0, ofs=0 Control: name="LFE Playback Switch", index=0, device=0 ControlAmp: chs=2, dir=Out, idx=0, ofs=0 Control: name="Line Out CLFE Jack", index=0, device=0 Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00] Pincap 0x00000037: IN OUT Detect Trigger ImpSense Pin Default 0x01016011: [Jack] Line Out at Ext Rear Conn = 1/8, Color = Orange DefAssociation = 0x1, Sequence = 0x1 Pin-ctls: 0x40: OUT Unsolicited: tag=04, enabled=1 Connection: 1 0x27
Node 0x17 [Pin Complex] wcaps 0x40098d: Stereo Amp-Out R/L Control: name="Rear Mic Jack", index=0, device=0 Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80] Pincap 0x00003737: IN OUT Detect Trigger ImpSense Vref caps: HIZ 50 GRD 80 100 Pin Default 0x01a19020: [Jack] Mic at Ext Rear Conn = 1/8, Color = Pink DefAssociation = 0x2, Sequence = 0x0 Pin-ctls: 0x24: IN VREF_80 Unsolicited: tag=07, enabled=1 Connection: 1 0x26
Such a feature is basically codec specific. This should be implemented in the AD codec driver side.
Takashi
participants (4)
-
Manolo Díaz
-
Miro Hodak
-
Raymond Yau
-
Takashi Iwai