From: Takashi Iwai Subject: Re: No sound with nVidia Corporation MCP79 High Definition Audio (rev b1) (Macbook Pro 5, 5) Date: Mon, 06 Jul 2009 17:13:29 +0200 Message-ID: References: <4A493A56.1050504@gmail.com> <200907061636.10288.nutz@unfoog.de> <200907061703.52699.nutz@unfoog.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 1113B2460E for ; Mon, 6 Jul 2009 17:13:30 +0200 (CEST) In-Reply-To: <200907061703.52699.nutz@unfoog.de> 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: Andreas =?ISO-8859-1?Q?N=FC=DFlein?= Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Mon, 6 Jul 2009 17:03:52 +0200, Andreas N=FC=DFlein wrote: > = > On Monday 06 July 2009 16:47:48 you wrote: > > At Mon, 6 Jul 2009 16:36:09 +0200, > > > > Andreas N=FC=DFlein wrote: > > > On Monday 06 July 2009 16:16:06 you wrote: > > > > At Mon, 6 Jul 2009 16:03:04 +0200, > > > > > > > > Andreas N=FC=DFlein wrote: > > > > > On Monday 06 July 2009 15:39:09 you wrote: > > > > > > At Mon, 6 Jul 2009 14:59:09 +0200, > > > > > > > > > > > > Andreas N=FC=DFlein wrote: > > > > > > > On Monday 06 July 2009 14:44:56 you wrote: > > > > > > > > At Mon, 6 Jul 2009 12:19:11 +0200, > > > > > > > > > > > > > > > > Andreas N=FC=DFlein wrote: > > > > > > > > > On Monday 06 July 2009 12:08:11 you wrote: > > > > > > > > > > At Mon, 6 Jul 2009 11:45:07 +0200, > > > > > > > > > > > > > > > > > > > > Andreas N=FC=DFlein wrote: > > > > > > > > > > > [1 ] > > > > > > > > > > > > > > > > > > > > > > On Monday 06 July 2009 09:23:07 you wrote: > > > > > > > > > > > > At Sun, 5 Jul 2009 12:30:52 +0200, > > > > > > > > > > > > > > > > > > > > > > > > > however i was able to reproduce the "bad kfree", = by > > > > > > > > > > > > > changing the volumes in alsamixer. it always gave= me > > > > > > > > > > > > > the same "called from ID" so i tried "while (true= ) do > > > > > > > > > > > > > cat /proc/kallsyms | grep ffffffffa001b08b; done"= and > > > > > > > > > > > > > then changed the volume, but the grep never retur= ned > > > > > > > > > > > > > anything, dmesg of course got more and more of th= ose > > > > > > > > > > > > > kfree-errors. > > > > > > > > > > > > > > > > > > > > > > > > The address won't match exactly in /proc/kasllsyms. > > > > > > > > > > > > But you can guess which function by address. First > > > > > > > > > > > > sort /proc/kallsyms then check the position that fi= ts > > > > > > > > > > > > with the given address. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Takashi > > > > > > > > > > > > > > > > > > > > > > well i'm not really sure _I_ can guess ;) i guess = it's > > > > > > > > > > > either "t snd_ctl_ioctl [snd]" or "t > > > > > > > > > > > snd_ctl_ioctl_compat [snd]". > > > > > > > > > > > > > > > > > > > > > > here are the greps, "snd: bad kfree (called from > > > > > > > > > > > ffffffffa001b08b)" being the error: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > $ cat /proc/kallsyms | sort | grep ffffffffa001a > > > > > > > > > > > ffffffffa001a045 t snd_ctl_elem_info [snd] > > > > > > > > > > > ffffffffa001a17a t copy_ctl_value_from_user [snd] > > > > > > > > > > > ffffffffa001a34f t snd_ctl_elem_read [snd] > > > > > > > > > > > ffffffffa001a413 t snd_ctl_elem_write [snd] > > > > > > > > > > > ffffffffa001a515 T snd_ctl_rename_id [snd] > > > > > > > > > > > ffffffffa001a5b5 T snd_ctl_activate_id [snd] > > > > > > > > > > > ffffffffa001a66e T snd_ctl_remove_id [snd] > > > > > > > > > > > ffffffffa001a6ed T snd_ctl_add [snd] > > > > > > > > > > > ffffffffa001a6ed u snd_ctl_add [snd_hda_codec] > > > > > > > > > > > ffffffffa001a947 t snd_ctl_elem_add [snd] > > > > > > > > > > > ffffffffa001abd3 t snd_ctl_elem_add_compat [snd] > > > > > > > > > > > ffffffffa001ad37 t snd_ctl_elem_add_user [snd] > > > > > > > > > > > ffffffffa001ada6 t snd_ctl_ioctl [snd] > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > $ cat /proc/kallsyms | sort | grep ffffffffa001b > > > > > > > > > > > ffffffffa001b4c4 t snd_ctl_ioctl_compat [snd] > > > > > > > > > > > ffffffffa001b9ba T snd_ctl_new1 [snd] > > > > > > > > > > > ffffffffa001b9ba u snd_ctl_new1 [snd_hda_codec] > > > > > > > > > > > ffffffffa001b9ba u snd_ctl_new1 [snd_hda_codec_cirrus] > > > > > > > > > > > ffffffffa001bb30 T snd_pci_quirk_lookup [snd] > > > > > > > > > > > ffffffffa001bb30 u snd_pci_quirk_lookup [snd_hda_code= c] > > > > > > > > > > > ffffffffa001bb30 u snd_pci_quirk_lookup [snd_hda_inte= l] > > > > > > > > > > > ffffffffa001bb93 T snd_verbose_printk [snd] > > > > > > > > > > > ffffffffa001bb93 u snd_verbose_printk [snd_hda_code= c] > > > > > > > > > > > ffffffffa001bb93 u snd_verbose_printk [snd_hda_inte= l] > > > > > > > > > > > ffffffffa001bb93 u snd_verbose_printk [snd_hwdep] > > > > > > > > > > > ffffffffa001bb93 u snd_verbose_printk [snd_pcm] > > > > > > > > > > > ffffffffa001bb93 u snd_verbose_printk [snd_timer] > > > > > > > > > > > ffffffffa001bc7b T release_and_free_resource [snd] > > > > > > > > > > > ffffffffa001bcd4 t snd_device_register_all [snd] > > > > > > > > > > > ffffffffa001bd76 T snd_device_register [snd] > > > > > > > > > > > ffffffffa001bd76 u snd_device_register [snd_pcm] > > > > > > > > > > > ffffffffa001be67 t snd_device_disconnect [snd] > > > > > > > > > > > ffffffffa001bf5d t snd_device_disconnect_all [snd] > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > hope that helps =3D) > > > > > > > > > > > > > > > > > > > > Maybe the patch below can give a better clue. > > > > > > > > > > This will spew stack traces when this error is triggere= d. > > > > > > > > > > Don't be surprised. > > > > > > > > > > > > > > > > > > oki - new output =3D) > > > > > > > > > > > > > > > > > > > > > > > > > > > [16306.365597] snd: bad kfree (called from ffffffffa001b0= 8f) > > > > > > > > > [16306.365604] Pid: 26533, comm: alsamixer Tainted: P = = > > > > > > > > > W 2.6.30.1 #2 [16306.365610] Call Trace: > > > > > > > > > [16306.365632] [] ? > > > > > > > > > snd_ctl_ioctl+0x2e5/0x71e [snd] [16306.365645] = > > > > > > > > > [] ? > > > > > > > > > __inc_zone_state+0x20/0x9b [16306.365655] = > > > > > > > > > [] ? alloc_page_vma+0x197/0x1e1 > > > > > > > > > [16306.365666] [] ? > > > > > > > > > __lru_cache_add+0x93/0xdd [16306.365676] = > > > > > > > > > [] ? vfs_ioctl+0x35/0x97 > > > > > > > > > [16306.365686] [] ? > > > > > > > > > do_vfs_ioctl+0x432/0x482 [16306.365696] [] > > > > > > > > > ? > > > > > > > > > _spin_lock_irqsave+0x28/0x5c [16306.365705] = > > > > > > > > > [] ? do_page_fault+0x272/0x29e > > > > > > > > > [16306.365715] [] ? sys_ioctl+0x4d/0x81 > > > > > > > > > [16306.365726] [] ? > > > > > > > > > system_call_fastpath+0x16/0x1b > > > > > > > > > > > > > > > > Try the very latest alsa-driver-unstable snapshot. > > > > > > > > This bug should have been fixed, also possibly with CS420x > > > > > > > > parser bug, too. > > > > > > > > > > > > > > > > > > > > > > > > Takashi > > > > > > > > > > > > > > so dmesg knows the following: > > > > > > > > > > > > > > [18042.848549] HDA Intel 0000:00:08.0: PCI INT A -> Link[LAZA= ] -> > > > > > > > GSI 23 (level, low) -> IRQ 23 [18042.848623] HDA Intel > > > > > > > 0000:00:08.0: setting latency timer to 64 [18043.007568] ALSA > > > > > > > /home/nutz/tmp/alsa/alsa-driver-unstable/pci/hda/../../alsa-k= erne > > > > > > >l/pc i/hd a/hda_codec.c:3851: autoconfig: line_outs=3D1 > > > > > > > (0xa/0x0/0x0/0x0/0x0) [18043.007584] ALSA > > > > > > > /home/nutz/tmp/alsa/alsa-driver-unstable/pci/hda/../../alsa-k= erne > > > > > > >l/pc i/hd a/hda_codec.c:3855: speaker_outs=3D1 > > > > > > > (0xb/0x0/0x0/0x0/0x0) [18043.007596] ALSA > > > > > > > /home/nutz/tmp/alsa/alsa-driver-unstable/pci/hda/../../alsa-k= erne > > > > > > >l/pc i/hd a/hda_codec.c:3859: hp_outs=3D1 (0x9/0x0/0x0/0x0/= 0x0) > > > > > > > [18043.007608] ALSA > > > > > > > /home/nutz/tmp/alsa/alsa-driver-unstable/pci/hda/../../alsa-k= erne > > > > > > >l/pc i/hd a/hda_codec.c:3860: mono: mono_out=3D0x0 [18043.0= 07618] > > > > > > > ALSA > > > > > > > /home/nutz/tmp/alsa/alsa-driver-unstable/pci/hda/../../alsa-k= erne > > > > > > >l/pc i/hd a/hda_codec.c:3863: dig-out=3D0x10/0x15 [18043.00= 7628] > > > > > > > ALSA > > > > > > > /home/nutz/tmp/alsa/alsa-driver-unstable/pci/hda/../../alsa-k= erne > > > > > > >l/pc i/hd a/hda_codec.c:3871: inputs: mic=3D0xd, fmic=3D0x0, > > > > > > > line=3D0xc, fline=3D0x0, cd=3D0x0, aux=3D0x0 > > > > > > > [18043.007642] ALSA > > > > > > > /home/nutz/tmp/alsa/alsa-driver-unstable/pci/hda/../../alsa-k= erne > > > > > > >l/pc i/hd a/hda_codec.c:3873: dig-in=3D0x12 [18043.121187] = ALSA > > > > > > > /home/nutz/tmp/alsa/alsa-driver-unstable/acore/control.c:337: > > > > > > > control 2:0:0:IEC958 Capture Switch:0 is already present > > > > > > > [18043.121204] hda_codec: cannot build controlsfor #0 (error = -16) > > > > > > > > > > > > > > > > > > > > > and i don't have a mixer anymore ;) > > > > > > > > > > > > It's because your chip was uninitialized by BIOS or whatever, t= he > > > > > > another state you got sometimes. > > > > > > > > > > > > Now fixed in the driver to force to initialize pins. > > > > > > Try the latest tarball again. > > > > > > > > > > > > > > > > > > Takashi > > > > > > > > > > TAKASHIIIIIIIIIIIII =3D) > > > > > !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! > > > > > > > > > > digital out is working... i tried the new snapshot (eventhough, as > > > > > you said my subsystem is now again uninitialized) and i got back= the > > > > > alsamixer- capabilities; > > > > > > > > > > i ran mplayer test.wav and started playing around with the > > > > > mixer-controls. > > > > > > > > > > when i reached IEC958 and turned it on, my out-jack began to glow= red > > > > > =3D) so that works. i rushed over to my dorm-partners speakersy= stem > > > > > and plugged it in - voila that actually works! (i tried a DTS vid= eo > > > > > with mplayer -vc hwdts ) > > > > > > > > > > that is SO cool =3D) > > > > > > > > > > however as you might've figured out, analog out is not working, y= et > > > > > ;( i tried the built-in speakers as well as the headphones (and of > > > > > course all the > > > > > > > > Hm, so you don't get any output although no errors with aplay? > > > > > > > > Please give alsa-info.sh output with the latest driver to be sure. > > > > > > > > > > > > Takashi > > > > > > and here is the alsa-info with the "correct" subsystem id. > > > > > > i also was able to get the wrong subsystem id again: i did > > > /etc/init.d/alsasound stop && modprobe snd-hda-intel - that changed > > > it. (i'll have a look into init.d/alsasound to see if there are any > > > clues) > > > > Interesting. So, resetting the controller alone can change the > > SSID. It doesn't happen on other systems. > > > > > > Could you try to apply the patch below on alsa-kernel directory with > > -p2? This will disable the additional COEF setups, which I blindly > > copied from older cs4207 patch. > > > > > > thanks, > > > > Takashi > > > > --- > > diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c > > index b1fd183..fda83b2 100644 > > --- a/sound/pci/hda/patch_cirrus.c > > +++ b/sound/pci/hda/patch_cirrus.c > > @@ -933,7 +933,7 @@ static void init_input(struct hda_codec *codec) > > change_cur_input(codec, spec->cur_input, 1); > > if (spec->mic_detect) > > cs_automic(codec); > > - > > +#if 0 > > coef =3D 0x000a; /* ADC1/2 - Digital and Analog Soft Ramp */ > > if (is_active_pin(codec, CS_DMIC2_PIN_NID)) > > coef |=3D 0x0500; /* DMIC2 enable 2 channels, disable GPIO1 */ > > @@ -943,6 +943,7 @@ static void init_input(struct hda_codec *codec) > > * IDX_SPDIF_CTL. > > */ > > cs_vendor_coef_set(codec, IDX_ADC_CFG, coef); > > +#endif > > } > > > > static struct hda_verb cs_coef_init_verbs[] =3D { > > @@ -980,10 +981,10 @@ static int cs_init(struct hda_codec *codec) > > { > > struct cs_spec *spec =3D codec->spec; > > > > - snd_hda_sequence_write(codec, cs_coef_init_verbs); > > + /*snd_hda_sequence_write(codec, cs_coef_init_verbs);*/ > > init_output(codec); > > init_input(codec); > > - init_digital(codec); > > + /*init_digital(codec);*/ > > return 0; > > } > = > = > wow okay... > so aplay test.wav didn't give me any sound, but when i tried to stop it = (Ctrl-C) i couldn't and i had to kill it from another term, which resulted = in this: When you run like below % aplay -Dplughw -vvv somefile.wav does it proceed? If not, it means that the DMA got stuck somewhere. If it goes, then the problem is in another place. Takashi