[alsa-devel] Regression post-ALSA 1.0.22 for Lenovo G555 Internal mic
Dear All,
I have been told I should send an email to this list from this bughttps://bugtrack.alsa-project.org/alsa-bug/view.php?id=5367 (0005367).
There is a regression in ALSA 1.0.23 and above for Lenovo sound. The internal mic no longer works. A helpful guy 'Raymond' on the bug identified that pin-ctls is correct in ALSA 1.0.21 and 1.0.22, but incorrect in higher versions due to SND_PCI_QUIRK_VENDOR. This is based on alsa-info.sh run on systems using different versions of ALSA but on the same system.
The jacksense has never actually worked but I have always managed to use hda-verb to do this for me - the main issue is the regression with the internal mic.
Regards Andrew
At Mon, 23 May 2011 16:58:39 +0100, Roo - Andrew Baines wrote:
Dear All,
I have been told I should send an email to this list from this bughttps://bugtrack.alsa-project.org/alsa-bug/view.php?id=5367 (0005367).
There is a regression in ALSA 1.0.23 and above for Lenovo sound. The internal mic no longer works. A helpful guy 'Raymond' on the bug identified that pin-ctls is correct in ALSA 1.0.21 and 1.0.22, but incorrect in higher versions due to SND_PCI_QUIRK_VENDOR. This is based on alsa-info.sh run on systems using different versions of ALSA but on the same system.
The jacksense has never actually worked but I have always managed to use hda-verb to do this for me - the main issue is the regression with the internal mic.
Try the latest alsa-driver snapshot from ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/alsa-driver-snapshot.tar.gz
and pass model=auto. If this doesn't work, please give alsa-info.sh output at this state.
thanks,
Takashi
I have tried the latest snapshot, and placed "options snd-hda-intel model=auto" in /etc/modprobe.d/alsa-base.conf
Still no sound into the mic, although sometimes when I open "PulseAudio Volume Meter (Capture)" it now shows a lot of noise for about half a second before nothing.
Also, I used to have to put "/usr/local/bin/hda-verb /dev/snd/hwC0D0 0x19 SET_PIN_WIDGET_CONTROL 0x40" in /etc/rc.local to turn on the headphone socket at boot, but this happens by itself now. The problem is that the daemon "pinsensedhttp://ubuntuforums.org/showpost.php?p=9599525&postcount=152" I was using no longer mutes the speakers when the headphones are plugged in.
I have attached the new alsa-info.sh output (I hope attachments are allowed on the mailing list)
Thanks Andrew
On 23 May 2011 17:14, Takashi Iwai tiwai@suse.de wrote:
At Mon, 23 May 2011 16:58:39 +0100, Roo - Andrew Baines wrote:
Dear All,
I have been told I should send an email to this list from this bughttps://bugtrack.alsa-project.org/alsa-bug/view.php?id=5367 (0005367).
There is a regression in ALSA 1.0.23 and above for Lenovo sound. The internal mic no longer works. A helpful guy 'Raymond' on the bug
identified
that pin-ctls is correct in ALSA 1.0.21 and 1.0.22, but incorrect in
higher
versions due to SND_PCI_QUIRK_VENDOR. This is based on alsa-info.sh run
on
systems using different versions of ALSA but on the same system.
The jacksense has never actually worked but I have always managed to use hda-verb to do this for me - the main issue is the regression with the internal mic.
Try the latest alsa-driver snapshot from
ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/alsa-driver-snapshot.tar.gz
and pass model=auto. If this doesn't work, please give alsa-info.sh output at this state.
thanks,
Takashi
At Mon, 23 May 2011 18:07:09 +0100, Roo - Andrew Baines wrote:
I have tried the latest snapshot, and placed "options snd-hda-intel model=auto" in /etc/modprobe.d/alsa-base.conf
Still no sound into the mic, although sometimes when I open "PulseAudio Volume Meter (Capture)" it now shows a lot of noise for about half a second before nothing.
Also, I used to have to put "/usr/local/bin/hda-verb /dev/snd/hwC0D0 0x19 SET_PIN_WIDGET_CONTROL 0x40" in /etc/rc.local to turn on the headphone socket at boot, but this happens by itself now. The problem is that the daemon "pinsensedhttp://ubuntuforums.org/showpost.php?p=9599525&postcount=152" I was using no longer mutes the speakers when the headphones are plugged in.
The driver should do auto-muting without such a daemon. If it still doesn't, check whether the unsolicited event is triggered at plugging by adding some debug prints.
I have attached the new alsa-info.sh output (I hope attachments are allowed on the mailing list)
I fixed a couple of obvious bugs now. Please try alsa-driver snapshot again later with model=auto.
thanks,
Takashi
With the latest snapshot, the mic does not work still.
What has also changed from the previous snapshot provided is that when the headphones are plugged in, no sound comes through the headphones, but still through the speakers - before it came through both.
I have attached a verbose pulse log of about 15 seconds when i plugged in and unplugged my headphones - I couldnt work out how to do an ALSA one.
Thanks Andrew
On 23 May 2011 20:23, Takashi Iwai tiwai@suse.de wrote:
At Mon, 23 May 2011 18:07:09 +0100, Roo - Andrew Baines wrote:
I have tried the latest snapshot, and placed "options snd-hda-intel model=auto" in /etc/modprobe.d/alsa-base.conf
Still no sound into the mic, although sometimes when I open "PulseAudio Volume Meter (Capture)" it now shows a lot of noise for about half a
second
before nothing.
Also, I used to have to put "/usr/local/bin/hda-verb /dev/snd/hwC0D0 0x19 SET_PIN_WIDGET_CONTROL 0x40" in /etc/rc.local to turn on the headphone socket at boot, but this happens by itself now. The problem is that the daemon "pinsensed<
http://ubuntuforums.org/showpost.php?p=9599525&postcount=152%3E"
I was using no longer mutes the speakers when the headphones are plugged
in.
The driver should do auto-muting without such a daemon. If it still doesn't, check whether the unsolicited event is triggered at plugging by adding some debug prints.
I have attached the new alsa-info.sh output (I hope attachments are
allowed
on the mailing list)
I fixed a couple of obvious bugs now. Please try alsa-driver snapshot again later with model=auto.
thanks,
Takashi
At Mon, 23 May 2011 23:24:48 +0100, Roo - Andrew Baines wrote:
With the latest snapshot, the mic does not work still.
Hrm OK, could you give alsa-info.sh output again?
What has also changed from the previous snapshot provided is that when the headphones are plugged in, no sound comes through the headphones, but still through the speakers - before it came through both.
Weird, there is no change regarding this since the last time. It looks like something is unstable with jack-sensing.
I have attached a verbose pulse log of about 15 seconds when i plugged in and unplugged my headphones - I couldnt work out how to do an ALSA one.
Don't use PulseAudio for the primary testing. Use alsa-native, e.g. "arecord -Dplughw -vv foo.wav". You can avoid PA by wrapping with pasuspender.
% pasuspender arecord -Dplughw -vv foo.wav
Also, try the patch below on alsa-driver/alsa-kernel directory with patch -p2 option. This will give a few debug prints. See "XXX ..." kernel messages at initialization and upon plugging/unplugging HP/mic jacks.
thanks,
Takashi
--- diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index e8dc736..1095bbb 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -3484,11 +3484,16 @@ static void cx_auto_update_speakers(struct hda_codec *codec) struct auto_pin_cfg *cfg = &spec->autocfg; int on;
+ printk("XXX cx_auto_update_speakers: auto_mute=%d, hp_present=%d, line_present=%d\n", spec->auto_mute, spec->hp_present, spec->line_present); if (!spec->auto_mute) - on = 0; + on = 1; else - on = spec->hp_present | spec->line_present; + on = spec->hp_present; cx_auto_turn_eapd(codec, cfg->hp_outs, cfg->hp_pins, on); + if (!spec->auto_mute) + on = 0; + else + on |= spec->detect_line && spec->line_present; do_automute(codec, cfg->speaker_outs, cfg->speaker_pins, !on);
/* toggle line-out mutes if needed, too */ @@ -3508,6 +3513,7 @@ static void cx_auto_hp_automute(struct hda_codec *codec) struct conexant_spec *spec = codec->spec; struct auto_pin_cfg *cfg = &spec->autocfg;
+ printk("XXX cx_auto_hp_automute\n"); if (!spec->auto_mute) return; spec->hp_present = detect_jacks(codec, cfg->hp_outs, cfg->hp_pins); @@ -3519,6 +3525,7 @@ static void cx_auto_line_automute(struct hda_codec *codec) struct conexant_spec *spec = codec->spec; struct auto_pin_cfg *cfg = &spec->autocfg;
+ printk("XXX cx_auto_line_automute\n"); if (!spec->auto_mute || !spec->detect_line) return; spec->line_present = detect_jacks(codec, cfg->line_outs, @@ -3703,6 +3710,8 @@ static int cx_auto_mux_enum_update(struct hda_codec *codec, return 0; if (idx >= imux->num_items) idx = imux->num_items - 1; + printk("XXX cx_auto_mux_enum_update idx=%d, adc=%x, pin=%x\n", + idx, spec->imux_info[idx].adc, spec->imux_info[idx].pin); if (spec->cur_mux[0] == idx) changed = 0; adc = spec->imux_info[idx].adc; @@ -3757,6 +3766,7 @@ static void cx_auto_automic(struct hda_codec *codec) { struct conexant_spec *spec = codec->spec;
+ printk("XXX cx_auto_automic\n"); if (!spec->auto_mic) return; if (!select_automic(codec, spec->auto_mic_ext, true))
I tried the patch but for some reason it fails, am i using patch wrong? When I try and open it in Kompare it says its not a valid diff file.
shark alsa-kernel # patch -p2 </home/roo/alsa-patch patching file pci/hda/patch_conexant.c Hunk #1 FAILED at 3484. Hunk #2 FAILED at 3508. Hunk #3 FAILED at 3519. Hunk #4 FAILED at 3703. Hunk #5 FAILED at 3757. 5 out of 5 hunks FAILED -- saving rejects to file pci/hda/patch_conexant.c.rej
New alsa-info.sh output is attached also.
When I ran arecord with pasuspender I got an error 'D is not a valid option' so I killed pulse and did arecord. What I got was a 0.00 second long recording even if i specified --duration=10.
There are no alsa records in /var/log/messages at all when I grep for ALSA, alsa, conexant, snd, sound.
Thanks Andrew
On 24 May 2011 10:38, Takashi Iwai tiwai@suse.de wrote:
At Mon, 23 May 2011 23:24:48 +0100, Roo - Andrew Baines wrote:
With the latest snapshot, the mic does not work still.
Hrm OK, could you give alsa-info.sh output again?
What has also changed from the previous snapshot provided is that when
the
headphones are plugged in, no sound comes through the headphones, but
still
through the speakers - before it came through both.
Weird, there is no change regarding this since the last time. It looks like something is unstable with jack-sensing.
I have attached a verbose pulse log of about 15 seconds when i plugged in and unplugged my headphones - I couldnt work out how to do an ALSA one.
Don't use PulseAudio for the primary testing. Use alsa-native, e.g. "arecord -Dplughw -vv foo.wav". You can avoid PA by wrapping with pasuspender.
% pasuspender arecord -Dplughw -vv foo.wav
Also, try the patch below on alsa-driver/alsa-kernel directory with patch -p2 option. This will give a few debug prints. See "XXX ..." kernel messages at initialization and upon plugging/unplugging HP/mic jacks.
thanks,
Takashi
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index e8dc736..1095bbb 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -3484,11 +3484,16 @@ static void cx_auto_update_speakers(struct hda_codec *codec) struct auto_pin_cfg *cfg = &spec->autocfg; int on;
printk("XXX cx_auto_update_speakers: auto_mute=%d, hp_present=%d,
line_present=%d\n", spec->auto_mute, spec->hp_present, spec->line_present); if (!spec->auto_mute)
on = 0;
on = 1; else
on = spec->hp_present | spec->line_present;
on = spec->hp_present; cx_auto_turn_eapd(codec, cfg->hp_outs, cfg->hp_pins, on);
if (!spec->auto_mute)
on = 0;
else
on |= spec->detect_line && spec->line_present; do_automute(codec, cfg->speaker_outs, cfg->speaker_pins, !on); /* toggle line-out mutes if needed, too */
@@ -3508,6 +3513,7 @@ static void cx_auto_hp_automute(struct hda_codec *codec) struct conexant_spec *spec = codec->spec; struct auto_pin_cfg *cfg = &spec->autocfg;
printk("XXX cx_auto_hp_automute\n"); if (!spec->auto_mute) return; spec->hp_present = detect_jacks(codec, cfg->hp_outs, cfg->hp_pins);
@@ -3519,6 +3525,7 @@ static void cx_auto_line_automute(struct hda_codec *codec) struct conexant_spec *spec = codec->spec; struct auto_pin_cfg *cfg = &spec->autocfg;
printk("XXX cx_auto_line_automute\n"); if (!spec->auto_mute || !spec->detect_line) return; spec->line_present = detect_jacks(codec, cfg->line_outs,
@@ -3703,6 +3710,8 @@ static int cx_auto_mux_enum_update(struct hda_codec *codec, return 0; if (idx >= imux->num_items) idx = imux->num_items - 1;
printk("XXX cx_auto_mux_enum_update idx=%d, adc=%x, pin=%x\n",
idx, spec->imux_info[idx].adc, spec->imux_info[idx].pin); if (spec->cur_mux[0] == idx) changed = 0; adc = spec->imux_info[idx].adc;
@@ -3757,6 +3766,7 @@ static void cx_auto_automic(struct hda_codec *codec) { struct conexant_spec *spec = codec->spec;
printk("XXX cx_auto_automic\n"); if (!spec->auto_mic) return; if (!select_automic(codec, spec->auto_mic_ext, true))
At Tue, 24 May 2011 11:57:16 +0100, Roo - Andrew Baines wrote:
I tried the patch but for some reason it fails, am i using patch wrong? When I try and open it in Kompare it says its not a valid diff file.
Did you save it as a raw file? Otherwise gmail interface breaks lines and spaces badly.
shark alsa-kernel # patch -p2 </home/roo/alsa-patch patching file pci/hda/patch_conexant.c Hunk #1 FAILED at 3484. Hunk #2 FAILED at 3508. Hunk #3 FAILED at 3519. Hunk #4 FAILED at 3703. Hunk #5 FAILED at 3757. 5 out of 5 hunks FAILED -- saving rejects to file pci/hda/patch_conexant.c.rej
New alsa-info.sh output is attached also.
When I ran arecord with pasuspender I got an error 'D is not a valid option' so I killed pulse and did arecord.
Then pass like "pasuspender -- arecord ....". Depending on PA version, you need "--".
What I got was a 0.00 second long recording even if i specified --duration=10.
There are no alsa records in /var/log/messages at all when I grep for ALSA, alsa, conexant, snd, sound.
You have the following kernel messages: [ 3798.888009] ALSA hda_intel.c:717: azx_get_response timeout, switching to polling mode: last cmd=0x001f000a [ 3799.892016] ALSA hda_intel.c:756: hda_intel: azx_get_response timeout, switching to single_cmd mode: last cmd=0x001f000a
This is rather a fatal error, which makes impossible to get unsolicited events from the codec.
And, judging from alsa-info.sh output, you are still using the old driver. With the new driver, you must have "Auto-Mute" enum mixer element. That is, the installation from the snapshot tarball failed somehow. Double-check what went wrong. The error above should have been fixed in the recent version.
BTW, I fixed another issue in auto-mute mode, so try the latest snapshot tarball again.
thanks,
Takashi
Ah, ok, so I opened the email as raw text and I'm getting somewhere... I have attached the patch I am trying to apply, I apologise I have really very little idea.
shark alsa-kernel # patch -p2 </home/roo/patch patching file pci/hda/patch_conexant.c Hunk #1 FAILED at 3484. Hunk #2 succeeded at 3330 with fuzz 2 (offset -178 lines). Hunk #3 FAILED at 3520. Hunk #4 FAILED at 3704. Hunk #5 succeeded at 3363 with fuzz 2 (offset -395 lines). 3 out of 5 hunks FAILED -- saving rejects to file pci/hda/patch_conexant.c.rej
I have also attached the latest alsa-info. In alsamixer I dont seem to have the auto-mute mixer, but I think I am running the latest snapshot:
roo@shark ~ $ cat /proc/asound/version Advanced Linux Sound Architecture Driver Version 1.0.24.13.g953fe.286.ge539e. Compiled on May 24 2011 for kernel 2.6.38-2-amd64 (SMP).
I am compiling as follows:
./configure --with-cards=hda-intel --with-sequencer=yes make make install
If I include --with-card-options=hda-codec-conexant it doesnt seem to make a difference.
Thanks Andrew
On 24 May 2011 12:07, Takashi Iwai tiwai@suse.de wrote:
At Tue, 24 May 2011 11:57:16 +0100, Roo - Andrew Baines wrote:
I tried the patch but for some reason it fails, am i using patch wrong?
When
I try and open it in Kompare it says its not a valid diff file.
Did you save it as a raw file? Otherwise gmail interface breaks lines and spaces badly.
shark alsa-kernel # patch -p2 </home/roo/alsa-patch patching file pci/hda/patch_conexant.c Hunk #1 FAILED at 3484. Hunk #2 FAILED at 3508. Hunk #3 FAILED at 3519. Hunk #4 FAILED at 3703. Hunk #5 FAILED at 3757. 5 out of 5 hunks FAILED -- saving rejects to file pci/hda/patch_conexant.c.rej
New alsa-info.sh output is attached also.
When I ran arecord with pasuspender I got an error 'D is not a valid
option'
so I killed pulse and did arecord.
Then pass like "pasuspender -- arecord ....". Depending on PA version, you need "--".
What I got was a 0.00 second long recording even if i specified --duration=10.
There are no alsa records in /var/log/messages at all when I grep for
ALSA,
alsa, conexant, snd, sound.
You have the following kernel messages: [ 3798.888009] ALSA hda_intel.c:717: azx_get_response timeout, switching to polling mode: last cmd=0x001f000a [ 3799.892016] ALSA hda_intel.c:756: hda_intel: azx_get_response timeout, switching to single_cmd mode: last cmd=0x001f000a
This is rather a fatal error, which makes impossible to get unsolicited events from the codec.
And, judging from alsa-info.sh output, you are still using the old driver. With the new driver, you must have "Auto-Mute" enum mixer element. That is, the installation from the snapshot tarball failed somehow. Double-check what went wrong. The error above should have been fixed in the recent version.
BTW, I fixed another issue in auto-mute mode, so try the latest snapshot tarball again.
thanks,
Takashi
At Tue, 24 May 2011 13:04:22 +0100, Roo - Andrew Baines wrote:
Ah, ok, so I opened the email as raw text and I'm getting somewhere... I have attached the patch I am trying to apply, I apologise I have really very little idea.
shark alsa-kernel # patch -p2 </home/roo/patch patching file pci/hda/patch_conexant.c Hunk #1 FAILED at 3484. Hunk #2 succeeded at 3330 with fuzz 2 (offset -178 lines). Hunk #3 FAILED at 3520. Hunk #4 FAILED at 3704. Hunk #5 succeeded at 3363 with fuzz 2 (offset -395 lines). 3 out of 5 hunks FAILED -- saving rejects to file pci/hda/patch_conexant.c.rej
I have also attached the latest alsa-info. In alsamixer I dont seem to have the auto-mute mixer, but I think I am running the latest snapshot:
roo@shark ~ $ cat /proc/asound/version Advanced Linux Sound Architecture Driver Version 1.0.24.13.g953fe.286.ge539e.
Where did you get the snapshot tarball from? It must be: ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/alsa-driver-snapshot.tar.gz
Note that this is different from the tarball in alsa-project.org. The one in alsa-project.org is far behind the latest version. It explains why the patch failed.
(BTW, try the above tarball first without patching.)
Compiled on May 24 2011 for kernel 2.6.38-2-amd64 (SMP).
I am compiling as follows:
./configure --with-cards=hda-intel --with-sequencer=yes make make install
In general, it's recommended to build all drivers, and use the update directory. The partial builds cause often dependency problems. As mentioned in INSTALL, a safe combination is:
% ./configure --with-debug=full --enable-dynamic-minors \ --with-moddir=updates
This will install the resultant modules into /lib/modules/$VERSION/updates/*. So, you can remove these files easily and back to the original state.
Takashi
Ah, I was using the snapshot from alsa-project.org.
Sorry about that. The (actual) latest snapshot couldnt work better. I have attached this alsa-info.
Thank you ever so much for your help!
Andrew
On 24 May 2011 13:16, Takashi Iwai tiwai@suse.de wrote:
At Tue, 24 May 2011 13:04:22 +0100, Roo - Andrew Baines wrote:
Ah, ok, so I opened the email as raw text and I'm getting somewhere... I have attached the patch I am trying to apply, I apologise I have really
very
little idea.
shark alsa-kernel # patch -p2 </home/roo/patch patching file pci/hda/patch_conexant.c Hunk #1 FAILED at 3484. Hunk #2 succeeded at 3330 with fuzz 2 (offset -178 lines). Hunk #3 FAILED at 3520. Hunk #4 FAILED at 3704. Hunk #5 succeeded at 3363 with fuzz 2 (offset -395 lines). 3 out of 5 hunks FAILED -- saving rejects to file pci/hda/patch_conexant.c.rej
I have also attached the latest alsa-info. In alsamixer I dont seem to
have
the auto-mute mixer, but I think I am running the latest snapshot:
roo@shark ~ $ cat /proc/asound/version Advanced Linux Sound Architecture Driver Version 1.0.24.13.g953fe.286.ge539e.
Where did you get the snapshot tarball from? It must be:
ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/alsa-driver-snapshot.tar.gz
Note that this is different from the tarball in alsa-project.org. The one in alsa-project.org is far behind the latest version. It explains why the patch failed.
(BTW, try the above tarball first without patching.)
Compiled on May 24 2011 for kernel 2.6.38-2-amd64 (SMP).
I am compiling as follows:
./configure --with-cards=hda-intel --with-sequencer=yes make make install
In general, it's recommended to build all drivers, and use the update directory. The partial builds cause often dependency problems. As mentioned in INSTALL, a safe combination is:
% ./configure --with-debug=full --enable-dynamic-minors \ --with-moddir=updates
This will install the resultant modules into /lib/modules/$VERSION/updates/*. So, you can remove these files easily and back to the original state.
Takashi
At Tue, 24 May 2011 14:25:17 +0100, Roo - Andrew Baines wrote:
Ah, I was using the snapshot from alsa-project.org.
Sorry about that. The (actual) latest snapshot couldnt work better.
Are you sure? What doesn't work better? And how did you test it?
As far as I see, the connection from internal-mic to ADC is OK. But you set all volumes to max, and this would result in too overloaded signal, anyway.
And, the HP auto-muting should work now.
Takashi
Haha, no sorry, it couldnt work better - as in its working perfectly and could not be better!
I have reduced the volumes now.
Sorry for the confusion, and thanks for the help.
Andrew
On 24 May 2011 16:02, Takashi Iwai tiwai@suse.de wrote:
At Tue, 24 May 2011 14:25:17 +0100, Roo - Andrew Baines wrote:
Ah, I was using the snapshot from alsa-project.org.
Sorry about that. The (actual) latest snapshot couldnt work better.
Are you sure? What doesn't work better? And how did you test it?
As far as I see, the connection from internal-mic to ADC is OK. But you set all volumes to max, and this would result in too overloaded signal, anyway.
And, the HP auto-muting should work now.
Takashi
At Tue, 24 May 2011 16:25:45 +0100, Roo - Andrew Baines wrote:
Haha, no sorry, it couldnt work better - as in its working perfectly and could not be better!
I have reduced the volumes now.
Sorry for the confusion, and thanks for the help.
Huh, that relieves me ;)
Takashi
participants (2)
-
Roo - Andrew Baines
-
Takashi Iwai