# Alsa not recognizing sound card [solved]

## mystified

I don't have any sound so I ran alsaconf and it couldn't detect my sound card.  When I run lspci it's there.  I install alsa-gui to see what I could get and I get the following: 

```
alsamixer: function_snd_ctl open failed for default:  No such file or directory
```

I have a built in sound card that uses the Intel AC 97 driver and this is properly compiled into my kernel the way it always has.  I don't know exactly when I lost sound because I very rarely use it on this box.

ThanksLast edited by mystified on Mon Oct 27, 2008 9:04 am; edited 1 time in total

----------

## NeddySeagoon

mystified,

What is the lspci output for your sound card?

----------

## mystified

00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)

----------

## NeddySeagoon

mystified,

That needs the snd-intel8x0 module. With that module loaded, or built into the kernel, you should have files in /dev/snd. Thats your real ALSA sound interface with the kernel. 

You may also have files in /dev/sound, which are the emulated OSS interface files, however, they depend on on /dev/snd too, so if its not present or empty, nothing will work.

----------

## mystified

At the risk of sounding stupid how do I build that into my kernel?

----------

## RedSquirrel

 *mystified wrote:*   

> I don't have any sound so I ran alsaconf and it couldn't detect my sound card.  When I run lspci it's there.  I install alsa-gui to see what I could get and I get the following: 
> 
> ```
> alsamixer: function_snd_ctl open failed for default:  No such file or directory
> ```
> ...

 

Possibly a long shot, but:

Did you run 'alsamixer' as root or as your regular user? If your regular user is not in the *audio* group and your run 'alsamixer', you will see the error message you posted.

----------

## mystified

My user wasn't added to audio so I added it.  This time I got alsamixer to work.  But alsaconf still can't find my sound card.Last edited by mystified on Sun Oct 26, 2008 5:17 pm; edited 1 time in total

----------

## keet

To build snd-intel8x0 into your kernel, you have a couple options.  This falls into the category of editing your kernel.  It's in the Gentoo guide here:

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=7

Basically, you need to install the Gentoo Linux kernel sources by doing this (if you haven't already):

# emerge gentoo-sources

The way I edit my kernel is by using the graphical interface in the terminal, by doing this:

# cd /usr/src/linux

# make menuconfig

This should load a menu system which allows you to install various system components into your kernel.  Here's a guide which helps with general ALSA configuration:

http://www.gentoo.org/doc/en/alsa-guide.xml

In the kernel configuration menu, you'll want to go to "Device Drivers" >> "Sound" >>"Advanced Linux Sound Architecture" >> "PCI Devices"

Here, find your sound card in the submenu.  I think it's this one: "Intel/SiS/nVidia/AMD/ALi AC97 Controller".  Press enter a couple times and make sure that <M> is next to it, so that it's set up as a module.

Now go back to the first menu and choose to save your kernel into the .config configuration file.  After making sure that you've saved it, exit the menu.  You'll be back at the command prompt/console.  Now run this:

#make && make modules_install

This will compile your kernel and modules.  It might take a few minutes, maybe longer, depending on how fast your system is.  But we're Gentoo users, so it's ok if we wait a few hours, right?  :Smile:   Seriously, this shouldn't take a few hours unless you have a 386.  You're almost done!

Now, back up your previous kernel in case you made a mistake somewhere, and copy your new kernel into the /boot directory:

#cp /boot/kernel-2.6.25-gentoo-r7 /boot/kernel-2.6.25-gentoo-r7-old  (assuming you have version 2.6.25-r7)

#cp /usr/src/linux/arch/i386/boot/bzImage /boot/kernel-2.6.25-gentoo-r7  

(this assumes that you're using the x86/i386 architecture.  If you're not, replace "i386" with your architecture.  For example, for me, it's "x86_64" because I'm using a 64-bit system, installed from the AMD64 cd.)

Now you're going to edit /etc/modules.autoload.d/kernel-2.6 (assuming that you're using kernel version 2.6.x) to tell it to load the snd-intel8x0 module.  This file tells the system which modules to load at startup.  Just edit the file as root and enter snd-intel8x0 at the end.

#nano /etc/modules.autoload.d/kernel-2.6

go to the end and type "snd-intel8x0" without parentheses.

Ok, you should be all set.  I might have missed something, but I think this is pretty comprehensive.  You're ready to reboot and see if your sound works.

----------

## mystified

I had everything compiled like that except I had it compiled as a driver and not a module.  Once I changed it to module I now have sound.

Thanks so much for the help!

----------

## keet

Great!

By the way, since your problem is solved, you should put [Solved] in the topic subject.

----------

## krenshala

I'm running into this exact problem (integrated nVidia audio that uses the same AC97 driver), right down to having the audio configured in the kernel as a driver and not as a module.

Is there any particular reason it won't work as a compiled in driver, and must be a module?

----------

## NeddySeagoon

krenshala,

It should work either way.  Check your uname -a.

Is the date and time shown the date and time of your most recent kernel build ?

If not, you are not running the kernel you think you are.

----------

## krenshala

uname -a shows the correct kernel info and date.  lspci also lists that the audio chipset is being seen,  but like the OP I get a "no hardware found" error when I try to configure/use audio for ALSA.

I actually double checked the kernel to make sure I hadn't forgotten to include the audio (I originally set up a bare-bones kernel, as I didn't have my speakers unboxed after a move) but it has the Intel/blah/blah/nVidia AC97 audio built in and not as a module.

----------

## NeddySeagoon

krenshala,

Please post the content of /dev/snd and /dev/sound

Some of the autodetect error messages are misleading when you have your sound modules built it.

----------

## RedSquirrel

 *krenshala wrote:*   

> I'm running into this exact problem (integrated nVidia audio that uses the same AC97 driver), right down to having the audio configured in the kernel as a driver and not as a module.
> 
> Is there any particular reason it won't work as a compiled in driver, and must be a module?

 

Are you running alsaconf to setup ALSA? alsaconf is only needed if you are using modules.

If you have everything built into the kernel, you can skip that step and proceed to the remaining steps (adding the alsasound init script to the boot runlevel, etc.).

```
# rc-update add alsasound boot

# gpasswd -a <username> audio

# /etc/init.d/alsasound start

# alsamixer

```

----------

## krenshala

 *NeddySeagoon wrote:*   

> krenshala,
> 
> Please post the content of /dev/snd and /dev/sound
> 
> Some of the autodetect error messages are misleading when you have your sound modules built it.

 

ls -l /dev/s* returns:

```
crw-rw---- 1 root audio 14,   1 Dec  5 14:06 /dev/sequencer

crw-rw---- 1 root audio 14,   8 Dec  5 14:06 /dev/sequencer2

/dev/snd:

total 0

crw-rw---- 1 root audio 116,  1 Dec  5 14:06 seq

crw-rw---- 1 root audio 116, 33 Dec  5 14:06 timer
```

I'll try the additional ALSA settings (from the post above this one) when I get a chance as I'm not at the box right now.

[edit] RedSquirrel, I tried the settings you gave me, and I got the following error when I tried to start alsasound.

```
root@kitsune:~ # /etc/init.d/alsasound start

 * Loading ALSA modules ...

 *   Could not detect custom ALSA settings.  Loading all detected alsa drivers.

 *   Unable to find any ALSA drivers. Have you compiled alsa-drivers correctly?

 *   ERROR: Failed to load necessary drivers                              [ ok ]

 * Restoring Mixer Levels ...

 * No mixer config in /var/lib/alsa/asound.state, you have to unmute you  [ ok ]
```

Root is in the audio group (as are the two normal users on the system), and I've added alsasound to rc-update with no problems.  alsamixer, of course, errors out because it can't find alsasound (or so I'm assuming).

Does it shound like I need to recompile the kernel?

[edit2] I decided to recompile the kernel anyway.  At the worst, I do something while waiting for an answer.  :Wink: 

----------

## NeddySeagoon

krenshala,

You are either running the wrong kernel or the right kernel with the wrong sound options.

Your /dev/snd/controlC0 file is missing (and most of the others) which are all created when the kernel binds to your hardware,

Look at your uname -a  is the build date/time right for your last kernel build ?

do zgrep 8X0 /proc/config.zp what does the output say about CONFIG_SND_INTEL8X0 ?

----------

## krenshala

 *NeddySeagoon wrote:*   

> krenshala,
> 
> You are either running the wrong kernel or the right kernel with the wrong sound options.
> 
> Your /dev/snd/controlC0 file is missing (and most of the others) which are all created when the kernel binds to your hardware,
> ...

 

It definitely behaves like I've got it misconfigured, but I double checked it last night and even recompiled just to be sure.  I'm running the "new" kernel right now and the zgrep output is:

```
root@kitsune:~ # zgrep 8X0 /proc/config.gz

CONFIG_SND_INTEL8X0=y

# CONFIG_SND_INTEL8X0M is not set
```

... but I still get the error about the audio hardware not being found (alsasound is in rc-update now) when I booted.

----------

## NeddySeagoon

krenshala,

Your kernel is ok. What does lspic show ?

----------

## krenshala

 *NeddySeagoon wrote:*   

> What does lspic show ?

 

```
root@kitsune:~ # lspci

00:00.0 RAM memory: nVidia Corporation Device 0754 (rev a2)

00:01.0 ISA bridge: nVidia Corporation Device 075c (rev a2)

00:01.1 SMBus: nVidia Corporation Device 0752 (rev a1)

00:01.2 RAM memory: nVidia Corporation Device 0751 (rev a1)

00:01.3 Co-processor: nVidia Corporation Device 0753 (rev a2)

00:01.4 RAM memory: nVidia Corporation Device 0568 (rev a1)

00:02.0 USB Controller: nVidia Corporation Device 077b (rev a1)

00:02.1 USB Controller: nVidia Corporation Device 077c (rev a1)

00:04.0 USB Controller: nVidia Corporation Device 077d (rev a1)

00:04.1 USB Controller: nVidia Corporation Device 077e (rev a1)

00:06.0 IDE interface: nVidia Corporation Device 0759 (rev a1)

00:07.0 Audio device: nVidia Corporation Device 0774 (rev a1)

00:08.0 PCI bridge: nVidia Corporation Device 075a (rev a1)

00:09.0 IDE interface: nVidia Corporation Device 0ad0 (rev a2)

00:0b.0 PCI bridge: nVidia Corporation Device 0569 (rev a1)

00:10.0 PCI bridge: nVidia Corporation Device 0778 (rev a1)

00:12.0 PCI bridge: nVidia Corporation Device 075b (rev a1)

00:13.0 PCI bridge: nVidia Corporation Device 077a (rev a1)

00:14.0 PCI bridge: nVidia Corporation Device 077a (rev a1)

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

01:07.0 Ethernet controller: Lite-On Communications Inc LNE100TX (rev 20)

01:08.0 Ethernet controller: Lite-On Communications Inc LNE100TX (rev 21)

02:00.0 VGA compatible controller: nVidia Corporation Device 0849 (rev a2)
```

----------

