Bug 156494

Summary: Intel hda pci-id 8086:27d8 does not work
Product: [openSUSE] SUSE Linux 10.1 Reporter: Forgotten User DUEUE5uAES <forgotten_DUEUE5uAES>
Component: SoundAssignee: Takashi Iwai <tiwai>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: f-perret
Version: Beta 9   
Target Milestone: ---   
Hardware: Other   
OS: SuSE Linux 10.1   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: /proc/asound/card0/codec#0
/proc/asound/card0/codec#1
/etc/asound.state
lspci -nv
A fix patch for hda-generic parser
STAC7661 VAIO support patch
/proc/asound/card0/codec#0
A new patch for VAIO with STAC7661
Yet another patch
alsamixer screen shot

Description Forgotten User DUEUE5uAES 2006-03-09 15:06:39 UTC
I purchased a Sony Vaio VGN-FE550G which has many of the newest Intel centrino stuff in it.  The Intel High Definition Audio PCI device is recognized, but only the PCM device is available from alsamixer and I have no sound.  I will attach the relevant information.

I have tried with a kernel built from kernel.org and gotten the same results.
Comment 1 Forgotten User DUEUE5uAES 2006-03-09 15:07:53 UTC
Created attachment 71996 [details]
/proc/asound/card0/codec#0
Comment 2 Forgotten User DUEUE5uAES 2006-03-09 15:08:49 UTC
Created attachment 71999 [details]
/proc/asound/card0/codec#1
Comment 3 Forgotten User DUEUE5uAES 2006-03-09 15:09:12 UTC
Created attachment 72000 [details]
/etc/asound.state
Comment 4 Forgotten User DUEUE5uAES 2006-03-09 15:09:59 UTC
Created attachment 72002 [details]
lspci -nv
Comment 5 Takashi Iwai 2006-03-09 17:01:16 UTC
Looks like the BIOS setup is pretty broken.  The driver cannot work with such a state.

Any BIOS update is available?
Comment 6 Forgotten User DUEUE5uAES 2006-03-09 17:47:54 UTC
I could not find any BIOS updates available on the Sony site.  I did see some
discussion about older (2002-2003) AMD sony vaio laptops and BIOS settings.  I
will reboot now to see if anything can be configured.

What about the BIOS setup is broken?  Is this something that a driver could detect and work around or is it beyond hope?  I will take any suggestion.

I have now installed FC4 and FC5 Test 3 and sound does not work there either.
Comment 7 Forgotten User DUEUE5uAES 2006-03-09 17:57:58 UTC
Nothing to set in BIOS setup.  The version that is installed appears to be
R0050J3.
Comment 8 Takashi Iwai 2006-03-09 18:35:20 UTC
After looking more closely, the BIOS pin-setup looks OK.
Actually this codec chips has no volume control at all.  So, it's correct that you have only PCM control, which is a software volume attenuator.

Do you get also no sound from headphone output?
Comment 9 Forgotten User DUEUE5uAES 2006-03-09 19:50:10 UTC
No sound from headphone at all.  Shouldn't there also be a microphone control?
Comment 10 Takashi Iwai 2006-03-10 11:42:21 UTC
The input has a volume control (but not for output).  It wasn't simply parsed well by the generic codec parser.
Comment 11 Forgotten User DUEUE5uAES 2006-03-10 11:57:09 UTC
Is there a patched version you would like me to try?
Comment 12 Takashi Iwai 2006-03-10 12:34:28 UTC
I can provide a test patch if you can recompile the kernel or build alsa-driver CVS version manually...  Attached below.  (Also I misread the codec tree -- it has also output volume control, defined as default amp capabilities.)

It's a fix for the HDA generic parser.  This might not be perfect even after fix.  For the better mixer representation, we'll need a dedicated codec suport code.
Comment 13 Takashi Iwai 2006-03-10 12:36:39 UTC
Created attachment 72240 [details]
A fix patch for hda-generic parser
Comment 14 Forgotten User DUEUE5uAES 2006-03-10 14:41:23 UTC
That got a master volume control slider to show up.  It was initially muted.
When I unmute and adjust volume, there still is no sound.  Same when using
headphones.

I just applied the patch to /usr/src/linux-2.6.16-rc5-git2-2 and rebuilt
modules in sound/pci/hda then copied them into /lib/modules/2.6.16-rc5-git2-2.
I assume that was the correct thing to do.
Comment 15 Takashi Iwai 2006-03-10 14:44:09 UTC
Thanks.  Then we need more guess work, namely, which pin corresponds to which I/O, and possible other parameters.  I'll prepare a patch for testing later.
Comment 16 Takashi Iwai 2006-03-10 15:33:18 UTC
Could you try the patch below?

This will give more detailed mixers (if it doesn't hang up :)

First, unmute and adjust 'NODE-xx' volumes on alsamixer, and check the output via "aplay something.wav".  If you hear any sound, figure out which control corresponds what output.

For capture controls, you can choose 'Capture' and 'Mic-In' volumes and switches.    I don't know whether it's from an internal mic (if any) or a mic-in jack.  The connection can be chosen in NID 0x15 (line 1165), currently indicating 0x2.  Try to change to 1.
Comment 17 Takashi Iwai 2006-03-10 15:34:40 UTC
Created attachment 72294 [details]
STAC7661 VAIO support patch
Comment 18 Forgotten User DUEUE5uAES 2006-03-10 17:05:49 UTC
It didn't hang, but there is nothing in alsamixer and only the sigmatel oss
mixer with a master volume control.  I have run out of time to work on this
today, but can look into it more over the weekend.  I can try additional patches,
but will not have time to look into much more.

I took a quick look over the four files I attached earlier and only asound.state
has changed and that was from your first patch when the master volume control showed up.
Comment 19 Takashi Iwai 2006-03-10 17:21:27 UTC
Please check whether patch_stac9761() is called and the vaio hack is enabled.  I might have added typos.  Try to pass model=vaio module option for snd-hda-intel to be sure, too.
Comment 20 Forgotten User DUEUE5uAES 2006-03-11 10:13:41 UTC
I put some printk's around the patch_stac7661 function and we do get into the case STAC7661_VAIO:

This was in the logs:
Mar 10 17:50:31 robinlt kernel: hda_codec: num_steps = 0 for NID=0x15

I added the following printk in snd_hda_mixer_amp_volume_info right after
the query_amp_caps:
        printk("<0> Robin: query_amp_caps(..., %d, %d) returned 0x%x\n", nid, dir, caps);

Without the vaio patch, I get the following:
Mar 10 21:08:59 robinlt kernel:  Robin: query_amp_caps(..., 3, 1) returned 0x80027f7f
Mar 10 21:08:59 robinlt kernel:  Robin: query_amp_caps(..., 3, 1) returned 0x80027f7f


With the vaio patch, I get the following:
Mar 10 21:14:50 robinlt kernel:  Robin: query_amp_caps(..., 7, 0) returned 0x80050f00
Mar 10 21:14:50 robinlt kernel:  Robin: query_amp_caps(..., 21, 0) returned 0x0
Comment 21 Forgotten User DUEUE5uAES 2006-03-11 10:32:20 UTC
I commented out the following:
//      HDA_CODEC_VOLUME("Mic-In Capture Volume", 0x15, 0, HDA_INPUT),
//      HDA_CODEC_VOLUME("Mic-In Capture Switch", 0x15, 0, HDA_INPUT),

That got the alsamixer opening.  Even with all the output volume sliders,
I get no sound from either the speakers or headphones.
Comment 22 Forgotten User DUEUE5uAES 2006-03-11 10:50:31 UTC
Keep in mind that I have no clue what I am doing, but I changed the patch_sigmatel.c to include the following:

        HDA_CODEC_VOLUME("NODE-10 Playback Volume", 0x10, 0, HDA_OUTPUT),
        HDA_CODEC_MUTE("NODE-10 Playback Switch", 0x10, 0, HDA_OUTPUT),
        HDA_CODEC_VOLUME("Master Volume Control", 0x15, 0, HDA_OUTPUT),
        HDA_CODEC_VOLUME("Master Volume Control", 0x15, 0, HDA_OUTPUT),

I am not sure if it is important, but I kept them in the order they appear in the codec#0 file.  Now I can get sound from the headphones if I have unmute NODE-02 and the speakers if I unmute NODE-05.  Not sure what is so important about the 0x15 entry, but that seems to be the one that got this working.

Curiously, I do not see any entry for Master Volume Control.
Comment 23 Forgotten User DUEUE5uAES 2006-03-11 12:16:51 UTC
OK.  Master Volume Control didn't show up because the last time I had compiled it was still commented out.  When I uncomment, the module load fails with
Mar 11 04:51:28 robinlt kernel: ALSA sound/core/control.c:327: control 2:0:0:Master Volume Control:0 is already present

On a seperate note, when I enable all the portions in the Volume Control preferences, "Capture" shows up on the playback tab.
Comment 24 Takashi Iwai 2006-03-13 16:13:32 UTC
The widget 0x15 is an audio selector as the recording source with the amp capabilities.  So, it should have nothing to do with the output.
The error message from query_amp_caps are still strange.  According to your codec#0 proc file, NID 0x15 has surely the amp bits and nsteps != 0.

Anyway, it's good to know that NID 02h = HP and NID 05h = speaker.
Is the speaker automatically toggled when you plug the HP jack?
Comment 25 Takashi Iwai 2006-03-13 16:22:25 UTC
For re-checking, could you attach codec#0 proc file?
Comment 26 Forgotten User DUEUE5uAES 2006-03-13 16:40:39 UTC
Not sure what you mean by automatically toggled.  Inserting headphones disables the speakers, but that does not appear to be reflected in alsamixer.  I will attach another copy of codec#0 in a few seconds.
Comment 27 Forgotten User DUEUE5uAES 2006-03-13 16:47:23 UTC
Created attachment 72603 [details]
/proc/asound/card0/codec#0

Here is /proc/asound/card0/codec#0 again.
Comment 28 Takashi Iwai 2006-03-13 16:59:31 UTC
OK, then that's fine.  Some laptops need the manual handling of muting per plug state, but yours does on hardware.

So, what's still missing?  Did you try the recording from mic?  Does it have internal mic in addition to a mic-in jack?
Comment 29 Takashi Iwai 2006-03-13 17:04:32 UTC
A new patch is attached below.

If you still get errors with num_steps and NID 0x15, comment out two elements "Mic-In Capture Volume" and "Mic-In Capture Switch" in vaio_mixer[].
Comment 30 Takashi Iwai 2006-03-13 17:05:13 UTC
Created attachment 72611 [details]
A new patch for VAIO with STAC7661
Comment 31 Takashi Iwai 2006-03-13 17:28:58 UTC
Or better try the newer patch below.

With this patch, you'll have a single "Master" control for both HP and speaker.  Also, it has a selection of "capture source" for testing.
Comment 32 Takashi Iwai 2006-03-13 17:29:33 UTC
Created attachment 72617 [details]
Yet another patch
Comment 33 Forgotten User DUEUE5uAES 2006-03-13 18:46:16 UTC
I had to un-static/extern snd_hda_codec_amp_update.  Trying it soon.
Comment 34 Takashi Iwai 2006-03-13 18:50:06 UTC
It was changed recently.  Get the latest KOTD from suse ftp, and copy the sound/* and include/sound directories.
Comment 35 Forgotten User DUEUE5uAES 2006-03-15 04:45:45 UTC
OK.  I finally got some time to download the latest kernel, install, patch and rebuild the sound/pci/hda directory.  Results are the same.  I am going to save myself some time and attach a screenshot from the alsamixer screen.  Sound works, master control has no effect on sound, but pcm does.
Comment 36 Forgotten User DUEUE5uAES 2006-03-15 04:46:34 UTC
Created attachment 72888 [details]
alsamixer screen shot
Comment 37 Perret Florian 2006-03-19 15:59:53 UTC
Is this patch include in beta 8 ? I have no sound on my Sony Vaio SZ.
Comment 38 Forgotten User DUEUE5uAES 2006-03-20 12:29:20 UTC
> Is this patch include in beta 8 ? I have no sound on my Sony Vaio SZ.

To the best of my knowledge, it is not included anywhere yet.  It is
really not quite working at this point, but it gets me sounds ;)

If you grab the second patch (# 72294), apply it to a work area, comment
out the following two lines and build just the sound/pci/hda directory
unload the original hda modules and load these you might have sound.

        HDA_CODEC_VOLUME("Mic-In Capture Volume", 0x15, 0, HDA_INPUT),
        HDA_CODEC_VOLUME("Mic-In Capture Switch", 0x15, 0, HDA_INPUT),


What needs to be done from here is we need to map out what which sliders
are which devices and probably tweak some other stuff as well.  Currently,
I have no audio CD playback, but I can rip it and play the flac files
just fine.  Movies work as well, but again they are not being played
by the drive, but rather the cpu.
Comment 39 Forgotten User DUEUE5uAES 2006-03-21 01:54:36 UTC
Takashi, I hope to have some time here this week to try and get this working. Is there any documentation I can look at which describes the values I should be playing with?  At this point in time, I am back to the STAC7661 vaio patch.  Any direction would be greatly appreciated.
Comment 40 Takashi Iwai 2006-03-24 17:33:44 UTC
I'm not sure about the CD.  It's highly possible that the machine has no analog CD connection like many other laptops.

Anyway, the patch is on kernel CVS, so will be available on rc1.
Comment 41 Forgotten User DUEUE5uAES 2006-03-24 17:44:06 UTC
I am a little confused about which patch and where.  Are you saying it is in Linus' kernel.org git tree?  Which patch?  Your most recently posted one does not work well for me.  Have you made a newer patch?
Comment 42 Perret Florian 2006-04-01 12:23:17 UTC
Sound now works on my Vaio SZ with beta 9.
Comment 43 Forgotten User DUEUE5uAES 2006-04-05 16:30:21 UTC
I finally got a chance to test beta-9.  I have a master volume control
which works for either speaker or headphone jack.  There is a pcm and
capture selections available, but neither gets the microphone working and
there does not appear to be any way to control/enable cd sound.
Comment 44 Bodo Bauer 2006-04-28 07:04:36 UTC
Please retestwith beta11/rc2
Comment 45 Takashi Iwai 2006-04-28 08:15:00 UTC
This chip has no analog loopback from mic -> output, so you don't hear directly.
It's a known problem that the mic capture doesn't work properly on this laptop.  A patch is already there but not applied to SUSE kernel yet.
Comment 46 Takashi Iwai 2006-05-26 13:21:05 UTC
STAC7661 code in kernel CVS HEAD is identical with the latest ALSA tree.
So I suppose it's fixed now.