From: Takashi Iwai Subject: Re: Alsa 1.0.13 (and others) does not work on ALC880 Date: Wed, 06 Jun 2007 14:54:40 +0200 Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id B3507243E1 for ; Wed, 6 Jun 2007 14:54:40 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: acallan.alsa@ugnet.org Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Wed, 6 Jun 2007 01:07:15 -0500 (CDT), acallan.alsa@ugnet.org wrote: > > cat /proc/asound/card0/codec#1 works just fine, and sound still works > fine even after that. Looking at the function print_codec_info() > (hda_proc.c), there is already the check: > if (! codec->afg) > return; > after the vendor, subsystem, and revision are retrieved but before the > pcm, amp caps, and node information are retrieved. Oh silly me. I guess the following patch works alone. Could you test it? Takashi diff -r 8bc69e73a655 pci/hda/hda_codec.c --- a/pci/hda/hda_codec.c Wed Jun 06 14:48:52 2007 +0200 +++ b/pci/hda/hda_codec.c Wed Jun 06 14:52:15 2007 +0200 @@ -562,7 +562,7 @@ int __devinit snd_hda_codec_new(struct h return -ENODEV; } - if (read_widget_caps(codec, codec->afg ? codec->afg : codec->mfg) < 0) { + if (codec->afg && read_widget_caps(codec, codec->afg) < 0) { snd_printk(KERN_ERR "hda_codec: cannot malloc\n"); snd_hda_codec_free(codec); return -ENOMEM; diff -r 8bc69e73a655 pci/hda/hda_local.h --- a/pci/hda/hda_local.h Wed Jun 06 14:48:52 2007 +0200 +++ b/pci/hda/hda_local.h Wed Jun 06 14:53:03 2007 +0200 @@ -274,7 +274,7 @@ static inline u32 get_wcaps(struct hda_c if (nid < codec->start_nid || nid >= codec->start_nid + codec->num_nodes) return snd_hda_param_read(codec, nid, AC_PAR_AUDIO_WIDGET_CAP); - return codec->wcaps[nid - codec->start_nid]; + return codec->wcaps ? codec->wcaps[nid - codec->start_nid] : 0; } int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,