alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: "Manolo Díaz" <diaz.manolo@gmail.com>
To: "Manolo Díaz" <diaz.manolo@gmail.com>
Cc: Takashi Iwai <tiwai@suse.de>,
	Raymond Yau <superquad.vortex2@gmail.com>,
	basinilya@gmail.com, alsa-devel@alsa-project.org,
	Miro Hodak <mhodak127@gmail.com>
Subject: Re: HD-audio regression after commit 34588709af61be1550b4e2bcee5c85d0ac4f34d4
Date: Fri, 18 Jan 2013 19:20:47 +0100	[thread overview]
Message-ID: <20130118192047.403f52d0@gmail.com> (raw)
In-Reply-To: <20130118185115.442a3d97@gmail.com>

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,
-- 
Manolo Díaz
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2013-01-18 18:20 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-13 18:05 HD-audio regression after commit 34588709af61be1550b4e2bcee5c85d0ac4f34d4 Miro Hodak
2013-01-14  3:42 ` Raymond Yau
2013-01-14 11:03   ` Takashi Iwai
2013-01-14 13:46     ` Raymond Yau
2013-01-14 14:18       ` Takashi Iwai
2013-01-15  7:59         ` Takashi Iwai
2013-01-16  2:04           ` Raymond Yau
2013-01-16  6:47             ` Takashi Iwai
2013-01-16  7:19               ` Raymond Yau
2013-01-16  7:24                 ` Takashi Iwai
2013-01-14 11:37   ` Clemens Ladisch
2013-01-14 12:31   ` Manolo Díaz
2013-01-14 12:48     ` Takashi Iwai
2013-01-14 12:59       ` Manolo Díaz
2013-01-14 13:03         ` Takashi Iwai
2013-01-14 13:10           ` Manolo Díaz
2013-01-14 16:23           ` Manolo Díaz
2013-01-15  0:42             ` Raymond Yau
2013-01-15  8:53               ` Manolo Díaz
2013-01-16  1:52                 ` Raymond Yau
2013-01-16  8:49                   ` Manolo Díaz
2013-01-16  8:54                     ` Takashi Iwai
2013-01-16 12:37                       ` Raymond Yau
2013-01-16 12:39                       ` Manolo Díaz
2013-01-16 12:54                         ` Takashi Iwai
2013-01-16 13:04                           ` Manolo Díaz
2013-01-16 13:16                             ` Takashi Iwai
2013-01-16 13:55                               ` Manolo Díaz
2013-01-16 14:20                                 ` Takashi Iwai
2013-01-17  3:51                                   ` Raymond Yau
2013-01-17  6:30                                     ` Takashi Iwai
2013-01-17  6:40                                       ` Raymond Yau
2013-01-17  6:49                                         ` Takashi Iwai
2013-01-17  8:10                                           ` Miro Hodak
2013-01-17  9:04                                             ` Takashi Iwai
2013-01-17  9:24                                               ` Miro Hodak
2013-01-17  9:29                                                 ` Takashi Iwai
2013-01-17  9:42                                                   ` Miro Hodak
2013-01-17  9:55                                                     ` Takashi Iwai
2013-01-17 10:17                                                       ` Miro Hodak
2013-01-17 10:21                                                         ` Takashi Iwai
2013-01-17 10:32                                                           ` Miro Hodak
2013-01-17 11:09                                                             ` Takashi Iwai
2013-01-17 12:49                                                             ` Raymond Yau
2013-01-17 14:59                                                               ` Miro Hodak
2013-01-17 15:29                                                                 ` Raymond Yau
2013-01-17 15:33                                                                   ` hda_analyzer (was: Re: HD-audio regression after commit 34588709af61be1550b4e2bcee5c85d0ac4f34d4) David Henningsson
2013-01-17 15:32                                                                 ` HD-audio regression after commit 34588709af61be1550b4e2bcee5c85d0ac4f34d4 Takashi Iwai
2013-01-17 18:12                                                                   ` Manolo Díaz
2013-01-17 19:51                                                                     ` Miro Hodak
2013-01-17 21:12                                                                       ` ALSA versions versus kernel versions Daniel Griscom
2013-01-17 20:16                                                                     ` HD-audio regression after commit 34588709af61be1550b4e2bcee5c85d0ac4f34d4 Takashi Iwai
     [not found]                                                                       ` <20130117214043.5a1574ee@gmail.com>
2013-01-18  4:20                                                                         ` Miro Hodak
2013-01-18  7:04                                                                         ` Takashi Iwai
2013-01-18  7:31                                                                           ` Miro Hodak
2013-01-18  8:08                                                                             ` Manolo Díaz
2013-01-18  8:14                                                                               ` Miro Hodak
2013-01-18 10:17                                                                                 ` Takashi Iwai
2013-01-18 12:37                                                                                   ` Manolo Díaz
2013-01-18 13:49                                                                                     ` Takashi Iwai
2013-01-18 14:49                                                                                       ` Raymond Yau
2013-01-18 15:30                                                                                         ` Takashi Iwai
2013-01-18 16:48                                                                                           ` Manolo Díaz
2013-01-18 16:58                                                                                             ` Takashi Iwai
2013-01-18 17:51                                                                                               ` Manolo Díaz
2013-01-18 18:20                                                                                                 ` Manolo Díaz [this message]
2013-01-18 18:45                                                                                                   ` Takashi Iwai
     [not found]                                                                                                     ` <CA+S_cwrH6mjunDsn2w76Vpyk7XovOKpH0k_KoU_8SXjmisLAYw@mail.gmail.com>
2013-01-19  5:49                                                                                                       ` Raymond Yau
2013-01-19 11:12                                                                                                         ` Takashi Iwai
2013-01-19 11:11                                                                                                       ` Takashi Iwai
2013-01-20 19:54                                                                                                         ` Miro Hodak
2013-01-21  4:01                                                                                                           ` Raymond Yau
2013-01-21  8:18                                                                                                           ` Takashi Iwai
2013-01-21  8:54                                                                                                             ` Miro Hodak
2013-01-21  9:18                                                                                                               ` Raymond Yau
2013-01-21 17:08                                                                                                                 ` Miro Hodak
2013-01-21 17:29                                                                                                                   ` Takashi Iwai
2013-01-21 17:44                                                                                                                     ` Miro Hodak
2013-01-21 19:11                                                                                                                       ` Miro Hodak
2013-01-21 20:21                                                                                                                         ` Takashi Iwai
2013-01-22  7:05                                                                                                                           ` Takashi Iwai
2013-01-22  8:14                                                                                                                             ` Miro Hodak
2013-01-22  8:58                                                                                                                               ` Takashi Iwai
2013-01-22 10:06                                                                                                                                 ` Miro Hodak
2013-01-22 10:12                                                                                                                                   ` Takashi Iwai
2013-01-19  2:39                                                                                           ` Raymond Yau
2013-01-19 11:09                                                                                             ` Takashi Iwai
2013-01-19 12:37                                                                                               ` Raymond Yau
2013-01-19 16:56                                                                                                 ` Takashi Iwai
2013-01-18  7:43                                             ` Raymond Yau
2013-01-15  7:27             ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130118192047.403f52d0@gmail.com \
    --to=diaz.manolo@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=basinilya@gmail.com \
    --cc=mhodak127@gmail.com \
    --cc=superquad.vortex2@gmail.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).