# problem with hda_intel audio on Asus G1 laptop

## bernieb

I am trying to get audio working on my laptop and am having some issues doing so.

First, I tried using the intel_hda modules from the installed kernel, 2.6.19-hibernate2.  Unfortunately, the module kernel paniced upon loading it.

I then attempted to use hda_intel from the separate alsa-driver package.

I was not able to build versions 1.0.12 or 1.0.13 as the compile failed with gcc not being able to find 'linux/config.h'.  However, I was able to get the experimental 1.0.14 to build.

This time, the modules did not panic upon loading.  However, despite the modules successfully loading, I get this message when trying to start alsamixer:

```

alsamixer: function snd_ctl_open failed for default: No such device

```

This is what I find in dmesg when I loaded the alsa modules with alsasound init script:

```

hda_codec: num_steps = 0 for NID=0x15

ACPI: PCI Interrupt 0000:00:1b.0[A] -> GSI 21 (level, low) -> IRQ 21

PCI: Setting latency timer of device 0000:00:1b.0 to 64

```

Any help in this will be greatly appreciated.

----------

## mjrosenb

IIRC I had some random problems with 2.6.19-suspend2 either not compiling or panicing immediately. I'm now using 2.6.19-suspend2-r1, and I have everything working.  Have you tried compiling it into the kernel rather than having it as a module? I've never actually had my sound as a module on a suspend2 kernel.

----------

## bernieb

I'm sorry if I caused any confusion, I've managed to report my kernel version incorrectly.

I meant to say suspend2, not hibernate2, and yes, it actually is r1.

My output from uname -a:

```

Linux localhost 2.6.19-suspend2-r1 #7 SMP Sat Dec 23 21:05:03 EST 2006 x86_64 Intel(R) Core(TM)2 CPU         T7200  @ 2.00GHz GenuineIntel GNU/Linux

```

And as far as compiling into my kernel, I would much rather have it as a module as it is a peripheral.

Besides, I'm not sure if I can compile it in as I believe it requires options to be loaded from modules.conf.  How would that work if it was compiled into the kernel?

For instance, I need to specify this in /etc/modules.d/alsa:

```

options snd_hda_intel model=asus

```

I believe that option specifies just how many outputs or channels are available.

----------

## mjrosenb

hmm, I've never seen that module used with parameters.  You may want to try it without anything, but I doubt it'll help.  I'll keep looking into it.  Also, what message is given when it panics?

----------

## Gusar

 *bernieb wrote:*   

> Besides, I'm not sure if I can compile it in as I believe it requires options to be loaded from modules.conf.  How would that work if it was compiled into the kernel?
> 
> For instance, I need to specify this in /etc/modules.d/alsa:
> 
> ```
> ...

 

If you compile stuff into the kernel (as opposed to modules) you specify module options on the kernel commandline (in grub) in the form of modulename.parameter=value

In your case you would add this:

```
snd_hda_intel.model=asus
```

----------

## alphamaennchen

try this:

1. SOUND:

My problem was an annoying whistle with almost every config I used. jasn helped me with that:

You have to use alsa-drivers and not the modules from the kernel.

Just enable Sound support in the Kernel config, but disable ALSA and OSS.

Then unmask the testing Version ~amd64 by typing

$ echo "media-sound/alsa-driver ~amd64" >> /etc/portage/package.keywords

$ echo "media-lib/alsa-lib ~amd64" >> /etc/portage/package.keywords

$ echo "media-sound/alsa-utils ~amd64" >> /etc/portage/package.keywords

and then emerge alsa-driver

$ emerge alsa-driver

Then run alsaconf, configure your sound card and add the following line to /etc/modules.d/alsa:

options snd-hda-intel position_fix=1 model=3stack

run modules-update and reboot your machine! Sound works flawlessly!  :Very Happy: 

from:

https://forums.gentoo.org/viewtopic-t-524965-highlight-a8jp.html

----------

## bernieb

I am trying those drivers.

The drivers I have installed are alsa-drivers-1.0.14.  I did not install the libs and utils from that version, they were still the 1.0.13 versions that were marked as stable.  I just tried upgraded them to the experimental 1.0.14 versions now, but that did not help.  I didn't think that would solve it as loading the driver does not even create the device nodes necessary.

I tried the position_fix option, but to no avail.  I had not expected it to work as it was intended to solve a completely different problem.

Thanks for the suggestion though.

----------

## bernieb

I found a workaround.

I removed the separate alsa-drivers and downgraded my kernel from 2.6.19-r1 to 2.6.18-r2.

The hda_intel modules in this kernel version now works.  I have sound now  :Smile: 

The only minor issue left is that I can not mute a channel.

Going into alsamixer and selecting 'm' to mute the channel (trying master) does nothing.  Trying to do the equivalent with amixer with

amixer -c 0 set Master [mute|unmute|toggle]

just outputs the current mixer status (volume levels, etc.).

That said, this issue is relatively minor.  I even managed to setup acpi events to change volume levels with the keyboard hotkeys.

Thanks to all of you that gave me suggestions on how to fix this.

----------

## tanisek

I have exactly the same issue with AMD64 system.

Using alsa drivers built-in in kernel 2.6.19 (gentoo-sources)

produced kernel error while loading hda_codec.

I tried several parameters to the module, but nothing helped.

So I tried alsa-driver outside the kernel, version 1.0.14_rc2.

It loaded, but produced "hda_codec: Unknown model for ALC861, trying auto-probe from BIOS"

message. Also, tried different model=X parameters, and position_fix, but nothing helped.

Neither amixer or alsamixer were working, complaing about missing device.

Then I have found your post and downgraded to 2.6.18 and removed alsa-driver.

It is working, but there are only two sliders in alsamixer - one for master playback, one for capture.

I wonder what can we do to make this card working with new alsa drivers?

----------

## Fascination

Aside from the above sound issues, does Gentoo play nicely with the Asus G1, or is there a few more 'toys out the pram' problems?

----------

## tanisek

Well, I just started playing with it.

From what I have found so far:

- I had problems installing Gentoo using 2006.1 amd64 live cd - ethernet card was not working. It was working when I booted from kubuntu or arch32/64, but in kubuntu kernel produced oops, because of hda-intel built-in driver. Arch CD on the other hand didn't have bzip2, so I had problems unpacikg stage and portage snapshot. So I used arch to download stage and snapshot, then used gentoo CD to unpack it, and again arch64 CD to proceed with the installation  :Wink: 

Now I have simple system (no X yet), based on 2006.1 (amd64), wifi is working, ethernet is working.

Acpi events work - lid/power button. acpi4asus doesn't know this model (but it is possible to switch on mail LED), I have already filled bugreport with DSDT data. lspci is similar (almost identical) to the one from Asus A8Js, which is fully supported, so I hope to get most of the devices working, but haven't done all of that myself yet. As for the webcam, I have found some info, that the chipset driver is beeing developed.

ACPI battery status works fine.

----------

## Fascination

Excuse my idiocy, buy why are you using the amd64 strain? The G1 is a dual core centrino 64.

----------

## bernieb

The only issue I came upon was the sound issue.

I had better success with the 2.6.18 kernel though, sound works on that.  However, I had odd stability issues with nvidia driver and multiple monitors with it.

I actually took the 2.6.18 alsa drivers and replaced the 2.6.19 ones with them.  Took some work to merge them in there, but now I have a more stable kernel with regards to the nvidia driver and sound as well.  If anyone wants a copy of my customized kernel, I'll see if I can upload it to the forums or failing that, atleast post a diff file of it.

Another minor issue is that I can't get suspend to disk (hibernate) working anymore.  I had it working at first, but for some reason it stopped working.  Even with the original uncustomized kernel, it no longer works.  It will suspend fine, but upon boot will immediately reboot instead of loading the saved image.

I had actually started a gentoo-wiki page on the G1 when I first got the laptop.  I should probably update it.

----------

## Fascination

 *bernieb wrote:*   

> I had actually started a gentoo-wiki page on the G1 when I first got the laptop.  I should probably update it.

 

Would be much appreciated.  :Razz: 

----------

## tanisek

AMD64 is for all 64bit cpus.

Asus G1 has T7200 cpu, which is Merom: http://en.wikipedia.org/wiki/Intel_Core_2#Merom

Merom "belongs" to EM64T Intel's architecture (http://en.wikipedia.org/wiki/EM64T),

which is almost identical to AMD64 (Intel bought it from AMD and introduced some small changes).

So Intel's cpus work with AMD64  :Smile: 

There are also some posts somewhere in forum, stating the same  :Smile: 

----------

## Fascination

 *tanisek wrote:*   

> AMD64 is for all 64bit cpus.
> 
> Asus G1 has T7200 cpu, which is Merom: http://en.wikipedia.org/wiki/Intel_Core_2#Merom
> 
> Merom "belongs" to EM64T Intel's architecture (http://en.wikipedia.org/wiki/EM64T),
> ...

 

Thank you, that clears things up  :Razz: 

----------

## tanisek

 *bernieb wrote:*   

> I actually took the 2.6.18 alsa drivers and replaced the 2.6.19 ones with them.  Took some work to merge them in there, but now I have a more stable kernel with regards to the nvidia driver and sound as well.  If anyone wants a copy of my customized kernel, I'll see if I can upload it to the forums or failing that, atleast post a diff file of it.

 

Wouldn't it be easier to prepare custom alsa-driver ebuild?

And it probably should work with future kernel releases, so I think that would be the right way to go.

2.6.18 came with 1.0.12_rc1 version of alsa. I tried to use 1.0.14rc2 ebuild renamed to 1.0.12_rc1,

but something must have changed in kernel headers, and it doesn't compile at all.

I prefer 2.6.19, because it changes a lot of things, like SATA/PATA stuff. And I can have ipw3945-1.1.3-r2

driver without ieee80211 package and removing headers from kernel tree, which is nice  :Smile: 

----------

## tanisek

 *bernieb wrote:*   

> I had actually started a gentoo-wiki page on the G1 when I first got the laptop.  I should probably update it.

 

That would be nice  :Smile: 

But where is it? I can't find it...

If you don't mind I would like to contribute to the information on such a page  :Smile: 

----------

## tanisek

bernieb: just to confirm that you have exactly the same card,

could you check your /proc/asound/card0/codec#0 file?

Does your codec have the same system and revision ID?

/proc/asound/card0/codec#0:

```
Codec: Realtek ALC660

Address: 0

Vendor Id: 0x10ec0660

Subsystem Id: 0x10430000

Revision Id: 0x100001
```

----------

## bernieb

Looks like someone removed the wiki page!  Thats really disappointing.

My /proc/asound/card0/codec#0 looks a little different:

```

Codec: Realtek ID 660

(Address, vender and revision is the same)

Subsystem Id: 0x10ec0662

```

If you're having trouble loading the module, there's an option you can add to the modules.conf file that will prevent the driver from probing bios for that info.

Try this:

```

options snd-card-0 model=3stack-660

```

in your /etc/modules.d/alsa file.

I hope this helps.

----------

## tanisek

Tried that.

And all the other models. Didn't help  :Sad: 

Strange, maybe there can be two different codecs in the same laptop?

Which 'flavour' do you have? Mine is G1 AK005P, bought in Poland.

----------

## bernieb

Odd that you're having so much difficulty.  Which kernel version do you have?

Like I said, I was only able to get intel_hda working on the 2.6.18 and not the 2.6.19.

Unfortunately, the kernel build system apears to have changed from 2.6.18 to 2.6.19 (they stopped using config.h header files), which is why any of the

alsa-drivers that should work will not build with this kernel.

I found it easier just to merge the alsa drivers from 2.6.18 into 2.6.19 rather than try to figure out and fix the alsa build system from the older system.

Either way, the old alsa drivers will not work with this kernel anyway.  The new kernel version appears to have removed some of the filesystem read and write functions (check fs.h).  The alsa drivers would need to be modified to fix this eitherway.

I'll see if I can post a diff file of it later today.

----------

## tanisek

Well, my only problem is that I don't want to use 2.6.18 kernel  :Smile: 

Probably your way with porting alsa driver from 2.6.18 to 2.6.19 is the easiest way to go,

but it is very temporary fix (you don't want to do the same for 2.6.20, 2.6.21, and so on).

The perfect solution would be to get current alsa driver working  :Smile: 

Probably the hardest too :/

I tried using older alsa driver with 2.6.19, but as you have noticed a lot of things changed between 2.6.18 and 2.6.19 :/

Anyway, I really would like to try your kernel fix if you could just post the diff, or upload kernel somehow, somewhere  :Smile: 

----------

## tanisek

I have found another, very easy fix for 2.6.19-r4:

Open /usr/src/linux-2.6.19-gentoo-r4/sound/pci/hda/hda_generic.c file,

and change 488 line in the file (inside the get_input_type function). This piece of code looks like this:

```
        case AC_JACK_MIC_IN:

                if (node->pin_caps &

                    (AC_PINCAP_VREF_80 << AC_PINCAP_VREF_SHIFT))

                        *pinctl |= AC_PINCTL_VREF_80;
```

Just add pin && to if( line, so it look like this:

```
        case AC_JACK_MIC_IN:

                if (pinctl && node->pin_caps &

                    (AC_PINCAP_VREF_80 << AC_PINCAP_VREF_SHIFT))

                        *pinctl |= AC_PINCTL_VREF_80;
```

It fixed my kernel, so it doesn't produce an oops any more. And the sound works  :Smile: 

This is only temporary fix - alsa driver 1.0.14 is broken in a different way, so probably all the following drivers won't work

unless someone corrects the real bug.

----------

## tanisek

Another solution is to comment out almost last line in alsa-kernel/pci/hda/patch_realtek.c file in 1.0.14rc2 driver.

You can comment out this line: { .id = 0x10ec0660, .name = "ALC660", .patch = patch_alc861 },

It will remove your codec from the list of known codecs, so the driver will use some kind of generic

configuration, which, apparently, is better than any of the available configurations for ALC660.

----------

## bernieb

I'm glad you figured out a way to get around the sound issue.

Finding a simple way to share a 1M gzipped patch file was proving somewhat difficult.

I am surprised you're using the gentoo-sources.  I went with the suspend2-sources as I figured it would be rather useful for a laptop.  Either way, I don't think it will matter, I doubt the sound driver is any different between the two sources.

Now if only I can figure my suspend to disk issue. . .

----------

## tanisek

If you are interested - try this acpi4asus driver:

http://xf.iksaif.net/acpi4asus/experimental/asus_acpi-0.33-experimental-20070113.tar.bz2

It works really nice - you can control backlight power, switch on/off bluetooth and wlan radio, switch on/off mail led, and even switch off/on the "evil eye" LED (next to the touchpad).

I have managed to modify it, and I am now able to control even those green "gaming" LEDs on sides of the screen  :Smile: 

----------

## DeathCarrot

 *tanisek wrote:*   

> I have found another, very easy fix for 2.6.19-r4:
> 
> Open /usr/src/linux-2.6.19-gentoo-r4/sound/pci/hda/hda_generic.c file,
> 
> and change 488 line in the file (inside the get_input_type function). This piece of code looks like this:
> ...

 

Thank you so much  :Shocked:  that fixed all my audio problems (my thread: https://forums.gentoo.org/viewtopic-t-534793.html), now I can even record audio, which I wasn't able to do on the 2.6.18 modules   :Razz: 

----------

