# ALSA not recognizing soundcard

## yxprogramming

Hello, I'm new to Gentoo, and am in the process of finalizing my desktop setup.

For some reason I can't get ALSA to recognize my sound card.

I ran 

```
lspci -v
```

 and found 

```

00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 02)

        Subsystem: Dell Optiplex 755

        Flags: fast devsel, IRQ 16

        Memory at fe9dc000 (64-bit, non-prefetchable) [size=16K]

        Capabilities: <access denied>

        Kernel driver in use: snd_hda_intel

```

However, when I run 

```
aplay -L
```

 I get 

```
aplay: device_list:274: no soundcards found...
```

I don't really know what  the problem is, it seems like the appropriate kernel driver is loaded, and my sound card is recognized by lspci.

Is there something I'm missing? I can provide more information if necessary.

Thanks in advance!

----------

## Buffoon

Welcome to forums!

You need also add support for codec chip. Boot with some generic Linux and run aplay -l, top lines will tell you what chip is in use. Then add it to your kernel.

----------

## yxprogramming

Fortunately I still have the Gentoo installation medium, so I was able to get this from "aplay -l"

```

card 0: Intel [HDA Intel], device 0: AD1984 Analog

```

plus some extra lines that didn't appear to be relevant.

I then rebooted and went to my kernel config

```

Device Drivers

    Sound Card Support

        Advanced Linux Sound Architecture

            HD Audio

```

I then selected every codec setting because I couldn't find anything related specifically to "AD1984." After recompiling my kernel and reconfiguring GRUB running aplay still gives the same output. I'm wondering if it needs to be compiled as a module, so I'll try that next. If not, is there anything else that could be causing the problem?

----------

## yxprogramming

A quick update, making the codecs as modules did not work

----------

## Buffoon

You should enable "Analog Devices HD-audio codec support", then you should properly install new kernel, run uname -v after reboot to verify you are running your new kernel. Now aplay should show your device. If there is still no sound run amixer and make sure all necessary channels are enabled.

----------

## yxprogramming

Okay so I tried running "uname -v" to see if my kernel is up to date, and found that it is not. I tried correcting it by running "make clean" on my kernel and recompiling it. I also recreated the GRUB config file, but "uname -v" still shows a kernel from my install period. According to the wiki running "make && make modules_install" along with "grub-mkconfig -o /boot/grub/grub.cfg" should be all that's necessary to recompile the kernel. Is there a step I'm missing?

----------

## Buffoon

Perhaps your fstab is set not to mount /boot automatically, it does not need to be mounted for normal operation of Gentoo. Needs to be mounted for kernel upgrade ...

----------

## yxprogramming

When I run "mount /boot" it says "mount: /boot: /dev/sda2 already mounted on /boot" which is what it should do. I've also confirmed that my fstab does in fact mount my boot partition on startup too. I'm not sure where the problem could be though... my install seems fairly standard for a Gentoo installation, I didn't make any radical changes from the install guide.

----------

## Buffoon

I don't know then. I do not use "make install" and also I do not use Grub. Thus it is hard to guess for me what might be wrong there. Check out Gentoo kernel upgrade Wiki page, perhaps you can figure out your problem.

----------

## yxprogramming

Ah after running a world set update it seems that there is a new kernel version that was released. It's possible this is the source of my problems

----------

## NeddySeagoon

yxprogramming,

Please post the output of 

```
uname -a
```

----------

## Buffoon

 *yxprogramming wrote:*   

> Okay so I tried running "uname -v" to see if my kernel is up to date, and found that it is not. I tried correcting it by running "make clean" on my kernel and recompiling it. I also recreated the GRUB config file, but "uname -v" still shows a kernel from my install period. According to the wiki running "make && make modules_install" along with "grub-mkconfig -o /boot/grub/grub.cfg" should be all that's necessary to recompile the kernel. Is there a step I'm missing?

 

Actually I just noticed yxprogramming is missing "make install" step.

----------

## NeddySeagoon

Buffoon,

```
mount /boot
```

may be required before make install.

----------

## Buffoon

NeddySeagoon,

this already has been discussed in this thread.

----------

## yxprogramming

Running "uname -a" gives me

```
 Linux yxdesk 5.4.66-gentoo #1 SMP Sat Oct 17 15:20:43 MST 2020 x86_64 Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz GenuineIntel GNU/Linux 
```

I have yet to finish my kernel upgrade but this is the kernel that is booting from my install period

----------

## NeddySeagoon

yxprogramming,

Keep an eye on that command output.  Sat Oct 17 15:20:43 MST 2020 is the build time of the running kernel.

After you update your kernel and reboot, it will be the build time of you new kernel if all is well.

If not, the kernel install went wrong or you have several kernel in grub.cfg and booted the wrong one.

----------

## Buffoon

I'm giving up. My posts are obviously ignored, so there is no point making them. I thought it was a wrong idea to come back here.

----------

## yxprogramming

Alright I'll be sure to do that. I can't work on it until later today but I think once I finish upgrading the kernel and clean up all of my older kernels and remake my GRUB config the issue should hopefully be solved.

----------

## yxprogramming

Sorry I didn't notice this until now, but I have been running "make install" I just forgot to include it in my process

----------

## NeddySeagoon

yxprogramming,

Have you been mounting /boot ?

----------

## yxprogramming

Yes, based on a recomendation from Buffoon I added /dev/sda2 (my boot partition) to my fstab file and it's now mounting /boot on startup. I think the issue lies in the GRUB config file, but I have to finish upgrading the kernel before I can fix it.

----------

## Dominique_71

I always compile the ALSA driver as modules. It make much more easier to solve issues or change the ALSA configuration. With modules, You can use /etc/conf.d/modules and an alsa.conf file in /etc/modprobe.d instead of using kernel parameters in grub command line.

```
Device Drivers ->

  <M> Sound card support ->

    <M> Advanced Linux Sound Architecture ->

      {*} Generic sound devices ->
```

----------

## yxprogramming

Thank you for the tip, that does sound a lot easier than messing with kernel parameters. I'll be sure to try that once I get the chance to work on my desktop again.

----------

## yxprogramming

I'm very confused now, my kernel is still not updated and I'm not sure what the issue is. I removed all of the old sources, the old boot images in /usr/src and modules in /lib/modules and removed and reconfigured GRUB, where it claims that it configured for the new kernel. However, when I reboot it boots back into my previous kernel. What am I missing?

----------

## yxprogramming

Okay now I'm REALLY confused. I decided to check my /boot/grub/grub.cfg config and found no references to my old kernel at all. My GRUB is configured for kernel 5.4.72, and my old kernel is 5.4.66. The new kernel has the configuration changes I need but I have no clue why it won't boot properly. Is this a common issue, or is something wrong with how I installed Gentoo in the first place?

----------

## halcon

 *yxprogramming wrote:*   

> I removed all of the old sources, the old boot images in /usr/src and modules

 

You should remove old boot images from /boot, not from /usr/src. What is the output of this?

```
ls -al /boot
```

Further, the first lines of dmesg will show which kernel image file is being used (with its location), and also all kernel command line options being used:

```
dmesg | grep ' Command line'
```

This image file and these command line options should match those in GRUB: 

```
grep 'menuentry ' /boot/grub/grub.cfg -A10
```

If they do not match, then it is interesting. You could try to search with `grep -r` in which configuration files (in /etc and in /boot) the kernel image from dmesg is mentioned.

EDIT

Also please check that you don't have two /boot directories (that you don't have files in /boot after unmounting /boot).

----------

## yxprogramming

Your suggestion to unmount boot and check for a duplicate directory turned out to be correct. However, I deleted the rendundant boot directory and GRUB no longer boots. I attempted to fix it in the installation media but was unsuccessful. I've decided to reinstall but now that I know what caused the issue I can prevent it from happening again. Thank you!

----------

## NeddySeagoon

yxprogramming.

You can chroot in and fix your install. 

Everything in /boot exists elsewhere on your system.

----------

## yxprogramming

Alright after a quick install I have fixed ALSA support. This is more of a kernel management issue than anything, but thank you everyone for your help in solving this issue!

----------

