# Need help building my kernel. **SOLVED**

## todd93

I just finished a fresh install of Gentoo, got it up and running using genkernel. Now that I'm up and running, I'm looking at building the right kernel. In the past, I've used Pappy's seeds, and enjoyed using a variety of different kernels, I think my favorite in the day was vanilla-sources. It's been a while, and for the most part, I have forgotten how I got this stuff to really work. I was hoping someone could help guide me through the process, as I have always been confused on certain things built in, as opposed to build as Modules. I know that in certain circumstances, each are required at certain times, etc.... As I type this, I have no sound working, so I'm just sort of at a bare minimum here, like I said, the goal was to get up and running. I will say, my time is limited, I usually only have time to seriously work on this during the weekends... Occasionally throughout the week, but not often..

Thanks

ToddLast edited by todd93 on Mon Mar 28, 2022 12:42 pm; edited 1 time in total

----------

## figueroa

I am not the best user to guide another in configuring the kernel, but I do it and have my method and my opinions.

1. Use sys-kernel/gentoo-sources. It's the vanilla kernel with beneficial patches most users want.

2. Since everything is not yet working, you can try a couple of things to learn what it takes to get all your devices working. I suggest that you install the Gentoo binary kernel sys-kernel/gentoo-kernel-bin or the distribution kernel sys-kernel/gentoo-kernel and see if all your devices are working. If so, you can learn from it. For example, you can use lspci -v and lsusb -v to learn about your hardware and the modules that are making it work. With the output from lspci and lsusb you can do Internet searches with your hardware specific to learn further details about kernel settings for your devices. lsusb will show you the kernel modules that have been loaded.

Alternatively, you can boot from another general distribution like Ubuntu, or Linux-Mint, or MX-Linux, doing the same thing as suggested in the paragraph above.

Pay special attention to the modules that have been loaded with the output from lsmod. You could build in the hardware support for those modules, or build them as modules. Note, that sound and network devices may sometimes (or often) work better when built as modules that are loaded on-demand by udev.

3. You will likely also need to emerge sys-kernel/linux-firmware for some of your hardware.

4. I use /etc/portage/package.mask in order to not be inundated with bleeding edge kernel updates and I don't need the grief from following the bleeding edge. I decide what LTS kernel version to follow and keep up with that series whenever Gentoo upstream provides an update, roughly every six weeks or so. I'm currently following the 5.10 series and running 5.10.103. Here is my current mask entry for gentoo-sources. (On several machines, I'm still following the 4.9 series.)

```
>=sys-kernel/gentoo-sources-5.11
```

5. Here is my personal README file/cheat-sheet for the steps I follow in upgrading my kernel. These steps contain all of the basics other than configuration. I do quite a few things manually, even where Gentoo provides tools to "make things easier." Doing things manually keeps my memory fresh and builds muscle memory.

```
$ cat kernel.txt

# Install your new kernel sources. Using 4.9.233 throughout as example.

emerge -a gentoo-sources

Additional references:

https://forums.gentoo.org/viewtopic-p-2431534.html#2431534

http://kernel-seeds.bloodnoc.org/

Also Forums: Unsupported Software for Pappy's preconfigs and seeds

or, to install a specific version by specifying the version:

emerge -a =sys-kernel/gentoo-sources-4.9.233

# NB: /usr/src/linux should currently be a symlink to your current kernel sources.

# Copy the .config from your current kernel sources to your new kernel sources, i.e.

cd /usr/src/

cp linux/.config linux-4.9.233-gentoo/

# Remove the (old) symlink.

rm linux

# Create a new "linux" symlink to your new kernel sources, i.e.

ln -s linux-4.9.233-gentoo linux

# Alternatively, you can change/set the symlink using eselect. Example:

eselect kernel list

Available kernel symlink targets:

  [1]   linux-4.9.221-gentoo

  [2]   linux-4.9.228-gentoo *

  [3]   linux-4.9.233-gentoo

eselect kernel set 3

# Be sure to check your work with:

eselect kernel list

Available kernel symlink targets:

  [1]   linux-4.9.221-gentoo

  [2]   linux-4.9.228-gentoo

  [3]   linux-4.9.233-gentoo *

or

ls -l

lrwxrwxrwx  1 root     root           20 Aug 24 13:20 linux -> linux-4.9.233-gentoo/

drwxr-xr-x 26 root     root         4096 May  5 22:58 linux-4.9.221-gentoo/

drwxr-xr-x 26 root     root         4096 Aug  9 23:11 linux-4.9.228-gentoo/

drwxr-xr-x 26 root     root         4096 Aug 24 13:41 linux-4.9.233-gentoo/

# Change to the new kernel sources directory using,

cd linux/

# Update .config according to new kernel options.

make oldconfig

# Configure the new kernel.

make menuconfig

# Compile the new kernel and install the modules.

make && make modules_install

# Copy important kernel boot files to /boot

cp .config /boot/config-4.9.233-gentoo

cp System.map /boot/System.map-4.9.233-gentoo

cp arch/x86/boot/bzImange /boot/kernel-4.9.233-gentoo

# Alternatively, I understand instead of manually copying files to /boot, one

# can run "make install" which will do it for you automatically. I've never

# done it that way. My way contributes to developing muscle memory.

# remove old symlink "vmlinuz" to old /boot/kernel-n.n.nnn-gentoo and create new

# symlink "vmlinuz" to new kernel file

cd /boot

rm vmlinuz

ln -s kernel-4.9.233-gentoo vmlinuz

# Configure boot loader (grub assumed).

grub-mkconfig -o /boot/grub/grub.cfg

Reference: https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Kernel

Note: https://www.kernel.org/doc/html/v5.4/admin-guide/pm/cpufreq.html

Note: https://www.kernel.org/doc/html/v5.10/admin-guide/pm/cpufreq.html
```

----------

## Juippisi

If I remember correctly, 'genkernel --install all' should pretty much build all in to get a working kernel. But you have other alternatives too. Like installing gentoo-kernel or gentoo-kernel-bin to get a working system. Start stripping unneeded modules from there. 

You can do this with 'genkernel --kernel-config=/path/to/your/previous-kernel.config --menuconfig --install all' or by editing savedconfig from gentoo-kernel.

https://wiki.gentoo.org/wiki/Savedconfig

https://wiki.gentoo.org/wiki/Project:Distribution_Kernel#Modifying_kernel_configuration

----------

## NeddySeagoon

todd93,

Here's my very old method.

The method is still valid but much of the detail has changed.

Pappy expanded on that with his kernel seeds project.

Again, the method is correct but the detail has changed.

You need very little in the kernel to be able to boot.

The following need to be built in.

1. The partition table driver,

2. Either, the SCSI stack, including the driver for your HDD chipset, or NVMe support.

3. The driver for your root filesystem.

That will get you to a login: prompt.

4. To see the prompt, you need a console driver too.  

To actually log in, a keyboard driver is useful, plus the driver for the hardware its attached to. However, modules work there and for almost everything else.

----------

## todd93

I've seen some great advice here, I've gleaned a few things from it, one, it's best to get a working kernel and just stick with it for as long as possible... In order to do that, I would have to be shown how to mask all kernels after the version I'm using, until I'm ready to upgrade the kernel, which won't be too often. One problem I had in my previous installation is that it seems like I was configuring kernels a lot more than I really should have been. 

Another that is quite helpful is what actually has to be built into the kernel. I see it's a relatively small list of things, which is good. I do realize that I can build other things in that would probably work better being built in, but for the most part, modules seem to be the best route. 

I don't have any sound in my user account, I think it may be because I haven't added the correct permissions for that..

----------

## figueroa

For masking, see my #4 in my post above.

EDITED -- ADDED: I'm not sure about "as long as possible." I think one's kernel version or series should be thoughtfully considered. Here are the things I think about regarding kernel version:

1. I do want a custom-built Gentoo kernel, therefore sys-kernel/gentoo-sources

2. I want a kernel that supports all my hardware.

3. I want a kernel that behaves well.

4. I want an LTS kernel series I can keep a long time. See: https://www.kernel.org/category/releases.html

5. I want a kernel that is currently supported; still gets bug fixes and security updates.

I was happy for a long time with the 4.9 series on my main desktop computer (and I'm still running 4.9 on everything else), but I knew about a year ago I would need to learn new things and move ahead or eventually get left behind. I'd moved up to 4.14 for a while, then, 4.19 for a couple of months, then 5.4 for even longer, then settled on 5.10 for the long haul. The whole transition took place over about six months. I expect I'll be running the 5.10 series for 2-4 years.

----------

## Goverp

 *todd93 wrote:*   

> I've seen some great advice here, I've gleaned a few things from it, one, it's best to get a working kernel and just stick with it for as long as possible... 
> 
> ...

 

Get a working "longterm stable" kernel.  Longterm  kernels are typically the last one of a year.  They're really meant for distributions that do a lot of kernel tailoring to get a single kernel that will work for all users (thing Ubuntu, Red Hat and the like), but if you want to minimize "make oldconfig" you too can use them.  The list of "longterm" kernels is on https://www.kernel.org/.

Note that there are still essential updates to longterm kernels, to fix security bugs.  So if you choose say kernel 5.15 you will still see occasional updates for it, and you should apply them.  You should run "make oldconfig" and "make" etc., but it's unlikely you'd have to actually change any configuration settings.

Note also that the most recent "longterm" kernel is what's used to build unkeyworded gentoo-sources (along with a few Gentoo-specific patches); keyworded gentoo-sources corresponds to "stable" kernel.org.  So a good way to keep your system secure while minimizing kernel configuration changes is to stick to unkeyworded gentoo-sources.  But you knew that  :Wink: 

The Gentoo packages site page for gentoo-sources has all the longterm kernels in green, meaning unkeyworded.  I presume that means you can choose to follow one of these kernels by installing the kernel slotted - something like:

```
emerge sys-kernel/gentoo-sources:5.10
```

though I've never tried it.

----------

## todd93

 *NeddySeagoon wrote:*   

> todd93,
> 
> Here's my very old method.
> 
> The method is still valid but much of the detail has changed.
> ...

 

One question, I'm having a little trouble decoding lspci... I used to use the decoder on the pappy's seeds page, however, that's no longer working apparently... I am having trouble decoding the output of "lspci-n"

----------

## NeddySeagoon

todd93,

Try 

```
lspci -nnk
```

for one random device, get  

```
08:00.0 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 51)

   Subsystem: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901]

   Kernel driver in use: ahci
```

lspci -n is only the numbers 

```
08:00.0 0106: 1022:7901 (rev 51)
```

The 1022:7901 is the vendor and device IDs, which is what you need to seach for.

Put  1022:7901 pci linux into your search engine and look for hits from cateee.net.

That's auto generated from the kernel sources. Something similar works for USB too.

That will give you the hardware driver you need.  

Do read the depends on:, here its only CONFIG_PCI. The depends on: must be true or the the option will be hidden

The method fails when you need a class driver, not a specific hardware driver. That's more a USB thing though.

The menuconfig search normally only shows results for options that can be selected.

Press the 'z' key to toggle the display and search of hidden options.

----------

## pietinger

todd93,

forget pappy's seeds. You dont need it and you can do a kernel configuration by yourself. Also dont try to work with "lspci -n"; do an "lspci -k" (after booting with minimalCD or rescueCD) and write down all used modules (do the same with "lsmod" after). Do you know how to search with / in "make menuconfig" ? If yes, this is all you need ... and a list of links:

1. For choosing an appropriate kernel read: https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Selecting_a_convenient_kernel_version

2. To be sure clean all recent you have done with "make distclean" and then go into "make menuconfig".

3. The first article you need is our amd64 handbook: https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Kernel

4. You can read also:

https://wiki.gentoo.org/wiki/Kernel/Gentoo_Kernel_Configuration_Guide

https://wiki.gentoo.org/wiki/Kernel/Configuration

5. Then you need some wiki articles. Here is a link list in my german guide: https://forums.gentoo.org/viewtopic-t-1112778.html

(if you want you can translate with google; dont use my basic options because it works only for a NO-Multilib installation; In this guide nr.5 says: Search with / for your ethernet module and activate it; nr. 6 says: Do the same with all other modules you have found with "lspci -k")

----------

## todd93

 *NeddySeagoon wrote:*   

> todd93,
> 
> Try 
> 
> ```
> ...

 

Ok, that was quite helpful... This is the output of "lspci -nnk":

```
# lspci -nnk

00:00.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Root Complex [1022:1450]

   Subsystem: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Root Complex [1022:1450]

00:00.2 IOMMU [0806]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) I/O Memory Management Unit [1022:1451]

   Subsystem: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) I/O Memory Management Unit [1022:1451]

00:01.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]

00:01.3 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) PCIe GPP Bridge [1022:1453]

   Kernel driver in use: pcieport

00:02.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]

00:03.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]

00:03.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) PCIe GPP Bridge [1022:1453]

   Kernel driver in use: pcieport

00:04.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]

00:07.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]

00:07.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Internal PCIe GPP Bridge 0 to Bus B [1022:1454]

   Kernel driver in use: pcieport

00:08.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]

00:08.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Internal PCIe GPP Bridge 0 to Bus B [1022:1454]

   Kernel driver in use: pcieport

00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 59)

   Subsystem: Gigabyte Technology Co., Ltd FCH SMBus Controller [1458:5001]

   Kernel modules: i2c_piix4, sp5100_tco

00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge [1022:790e] (rev 51)

   Subsystem: Gigabyte Technology Co., Ltd FCH LPC Bridge [1458:5001]

00:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 0 [1022:1460]

00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 1 [1022:1461]

00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 2 [1022:1462]

00:18.3 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 3 [1022:1463]

   Kernel driver in use: k10temp

   Kernel modules: k10temp

00:18.4 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 4 [1022:1464]

00:18.5 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 5 [1022:1465]

00:18.6 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 6 [1022:1466]

00:18.7 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 7 [1022:1467]

01:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] X370 Series Chipset USB 3.1 xHCI Controller [1022:43b9] (rev 02)

   Subsystem: ASMedia Technology Inc. X370 Series Chipset USB 3.1 xHCI Controller [1b21:1142]

   Kernel driver in use: xhci_hcd

01:00.1 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] X370 Series Chipset SATA Controller [1022:43b5] (rev 02)

   Subsystem: ASMedia Technology Inc. X370 Series Chipset SATA Controller [1b21:1062]

   Kernel driver in use: ahci

01:00.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] X370 Series Chipset PCIe Upstream Port [1022:43b0] (rev 02)

   Kernel driver in use: pcieport

02:00.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)

   Kernel driver in use: pcieport

02:02.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)

   Kernel driver in use: pcieport

02:03.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)

   Kernel driver in use: pcieport

02:04.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02)

   Kernel driver in use: pcieport

03:00.0 USB controller [0c03]: ASMedia Technology Inc. ASM1143 USB 3.1 Host Controller [1b21:1343]

   DeviceName: Broadcom 5762

   Subsystem: Gigabyte Technology Co., Ltd ASM1143 USB 3.1 Host Controller [1458:5007]

   Kernel driver in use: xhci_hcd

04:00.0 Ethernet controller [0200]: Intel Corporation I211 Gigabit Network Connection [8086:1539] (rev 03)

   Subsystem: Gigabyte Technology Co., Ltd I211 Gigabit Network Connection [1458:e000]

   Kernel driver in use: igb

   Kernel modules: igb

05:00.0 Ethernet controller [0200]: Qualcomm Atheros Killer E2500 Gigabit Ethernet Controller [1969:e0b1] (rev 10)

   Subsystem: Gigabyte Technology Co., Ltd Killer E2500 Gigabit Ethernet Controller [1458:e000]

   Kernel driver in use: alx

   Kernel modules: alx

07:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] [10de:1c82] (rev a1)

   Subsystem: eVga.com. Corp. GP107 [GeForce GTX 1050 Ti] [3842:6255]

   Kernel driver in use: nouveau

   Kernel modules: nouveau

07:00.1 Audio device [0403]: NVIDIA Corporation GP107GL High Definition Audio Controller [10de:0fb9] (rev a1)

   Subsystem: eVga.com. Corp. GP107GL High Definition Audio Controller [3842:6255]

   Kernel driver in use: snd_hda_intel

   Kernel modules: snd_hda_intel

08:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Zeppelin/Raven/Raven2 PCIe Dummy Function [1022:145a]

   Subsystem: Advanced Micro Devices, Inc. [AMD] Zeppelin/Raven/Raven2 PCIe Dummy Function [1022:145a]

08:00.2 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Platform Security Processor [1022:1456]

   Subsystem: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Platform Security Processor [1022:1456]

   Kernel driver in use: ccp

   Kernel modules: ccp

08:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) USB 3.0 Host Controller [1022:145c]

   Subsystem: Gigabyte Technology Co., Ltd Family 17h (Models 00h-0fh) USB 3.0 Host Controller [1458:5007]

   Kernel driver in use: xhci_hcd

09:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Zeppelin/Renoir PCIe Dummy Function [1022:1455]

   Subsystem: Advanced Micro Devices, Inc. [AMD] Zeppelin/Renoir PCIe Dummy Function [1022:1455]

09:00.2 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 51)

   Subsystem: Gigabyte Technology Co., Ltd FCH SATA Controller [AHCI mode] [1458:b002]

   Kernel driver in use: ahci

09:00.3 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) HD Audio Controller [1022:1457]

   Subsystem: Gigabyte Technology Co., Ltd Family 17h (Models 00h-0fh) HD Audio Controller [1458:a0b8]

   Kernel driver in use: snd_hda_intel

   Kernel modules: snd_hda_intel
```

When I search for those particular drivers, they're already built in, or are modules...  I did have to choose my processor, which is normal, and I had to make NTFS a module, as I use ntfs3g for my windows drive mounting... The things I'm having trouble with is my sound, it's not working in the genkernel, I think I may have pinpointed it, and emerged the proper alsa package, set it to start at system boot, etc, but haven't rebooted the kernel yet, and I'm having trouble seeing what network device I have, and seeing what I need for USB.  Please forgive me, it's been a while since I did this stuff, so a lot of things are fuzzy for me...

----------

## todd93

Actually, I overlooked the ethernet controller, it is built in as well

----------

## NeddySeagoon

todd93,

```
04:00.0 Ethernet controller [0200]: Intel Corporation I211 Gigabit Network Connection [8086:1539] (rev 03)

   Subsystem: Gigabyte Technology Co., Ltd I211 Gigabit Network Connection [1458:e000]

   Kernel driver in use: igb

   Kernel modules: igb

05:00.0 Ethernet controller [0200]: Qualcomm Atheros Killer E2500 Gigabit Ethernet Controller [1969:e0b1] (rev 10)

   Subsystem: Gigabyte Technology Co., Ltd Killer E2500 Gigabit Ethernet Controller [1458:e000]

   Kernel driver in use: alx

   Kernel modules: alx 
```

You need igb and alx. One will be in the Inter submenu, the other in the Qualcomm sub menu.

There is no Wifi there and only USB3.

For usb devices, we need to the the output of 

```
lsusb
```

.

Sound needs some user space tools and maybe some configuration too.

```
07:00.1 Audio device [0403]: NVIDIA Corporation GP107GL High Definition Audio Controller [10de:0fb9] (rev a1)

   Subsystem: eVga.com. Corp. GP107GL High Definition Audio Controller [3842:6255]

   Kernel driver in use: snd_hda_intel

   Kernel modules: snd_hda_intel 

09:00.3 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) HD Audio Controller [1022:1457]

   Subsystem: Gigabyte Technology Co., Ltd Family 17h (Models 00h-0fh) HD Audio Controller [1458:a0b8]

   Kernel driver in use: snd_hda_intel

   Kernel modules: snd_hda_intel
```

Your default sound card will be your video card. However it will have lots of sound outputs, so its unlikely to 'just work'.

What do you have in /proc/asound/devices?

Which sound output do you want to use by default?

Is your normal user in the audio group?

----------

## todd93

Ok, major snag...

```
 lsusb

bash: lsusb: command not found
```

I'm not sure how I get this error, I have emerged the gentoolkit, but I may have missed something else? 

Also, igb and alx are modules should they be built in? 

My user is in the audio group, so that's not an issue, here's /proc/asound/devices:

```
# cat /proc/asound/devices 

  2: [ 0- 3]: digital audio playback

  3: [ 0- 7]: digital audio playback

  4: [ 0- 8]: digital audio playback

  5: [ 0- 9]: digital audio playback

  6: [ 0-10]: digital audio playback

  7: [ 0-11]: digital audio playback

  8: [ 0- 0]: hardware dependent

  9: [ 0]   : control

 10: [ 1- 0]: digital audio playback

 11: [ 1- 0]: digital audio capture

 12: [ 1- 1]: digital audio playback

 13: [ 1- 2]: digital audio capture

 14: [ 1- 4]: digital audio playback

 15: [ 1- 4]: digital audio capture

 16: [ 1- 0]: hardware dependent

 17: [ 1- 1]: hardware dependent

 18: [ 1]   : control

 33:        : timer
```

I'm not sure what it's telling me here...

----------

## todd93

Ok, I forgot to emerge usbutils lol....

```
# lsusb

Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 005 Device 005: ID 10d5:000d Uni Class Technology Co., Ltd HA2-A3

Bus 005 Device 004: ID 04f2:1829 Chicony Electronics Co., Ltd USB Wireless Keyboard

Bus 005 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver

Bus 005 Device 002: ID 05e3:0608 Genesys Logic, Inc. Hub

Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 006: ID 05dc:b050 Lexar Media, Inc. USB_3_0 Reader 

Bus 002 Device 005: ID 2109:0812 VIA Labs, Inc. VL812 Hub

Bus 002 Device 004: ID 2109:0812 VIA Labs, Inc. VL812 Hub

Bus 002 Device 003: ID 0bda:0301 Realtek Semiconductor Corp. multicard reader

Bus 002 Device 002: ID 05e3:0612 Genesys Logic, Inc. Hub

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 001 Device 006: ID 2109:2812 VIA Labs, Inc. VL812 Hub

Bus 001 Device 005: ID 2109:2812 VIA Labs, Inc. VL812 Hub

Bus 001 Device 004: ID 0a5c:21e8 Broadcom Corp. BCM20702A0 Bluetooth 4.0

Bus 001 Device 003: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS

Bus 001 Device 002: ID 05e3:0612 Genesys Logic, Inc. Hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
```

----------

## NeddySeagoon

todd93,

Your default audio device is

```
    8: [ 0- 0]: hardware dependent 
```

which is on your video card.

Your video card has six outputs, they may not all be brought to the outside world but the kernel can see them.

I can tell its your video card as there are no audio capture entries.

In detail ..

```
# cat /proc/asound/devices

  2: [ 0- 3]: digital audio playback
```

minor device number, here 2

[ 0- 3] card and device number on the card. Here card 0, device 3.

Its a digital audio playback device.

Alsa uses card 0 device 0 by default.

Your analogue sound is at 

```
10: [ 1- 0]: digital audio playback 
```

You didn't say which sound output you want to use.

If you swap your sound card order the analogue sound will become [0- 0] 

If you want to use a different sound device, you need a /etc/asound.conf file.

Run

```
alsamixer -c0
```

to see all the sound controls on your video card.

```
alsamixer -c1
```

will show your motherboard sound controls.

----------

## todd93

 *NeddySeagoon wrote:*   

> todd93,
> 
> Your default audio device is
> 
> ```
> ...

 

Ok, this is quite helpful, I would prefer to swap my sound card order, and use my motherboard sound, which is  Realtek ALC1220... So I guess i need to figure out how to swap my sound card order

----------

## NeddySeagoon

todd93,

Both ways work.

Sound card order swapping is done with a module parameter. How you apply the module parameter depends on how snd_hda_intel is configured.

The parameter has to be passed at code initialisation time.

Meanwhile, a /etc/asound.conf file containing

```
defaults!pcm.card 1

defaults!pcm.device 0

defaults!ctl.card 1
```

will work.

That points alsa at card1 device 0, using the controls on card 1.

No reboot required. That file is consulted every time alsa is used.

----------

## todd93

NeddySeagoon,

That didn't seem to work either, I'm going to put the sound issue on hold a bit, I have configured a new kernel, hopefully it will boot without too much of an issue (unlikely), it's compiling now, I'll see if I can get that up and running, possibly it will fix it. I know that I have modularized quite a bit , and I know that ALSA is compiled as a module in the new kernel, that may help to fix my problem... Stay tuned lol.

Todd

----------

## NeddySeagoon

todd93,

As well as the above, you need to set the sound card knobs correctly.

All of of the IEC or S/PDIF controls must be muted.

If fact, mute everything except Master, Front and PCM. Set their sliders to about 70%

If you have a Headphones control, some card swap Front with Headphones, so you need to do two tests

----------

## todd93

NeddySeagoon,

OK, I did that, emerged an MP3 player, and when I open an MP3, it gives the following error:

```
ALSA error: snd_pcm_open failed: No such file or directory.

```

----------

## todd93

 *todd93 wrote:*   

> NeddySeagoon,
> 
> OK, I did that, emerged an MP3 player, and when I open an MP3, it gives the following error:
> 
> ```
> ...

 

I got rid of this error by emerging pulseaudio... Now I have sound playing MP3s with Audacious, however I have no sound in Firefox, sites like YouTube, etc... I must be missing a setting somewhere...

On a side note, I compiled my new kernel, and it booted on the first attempt, seems to be running fine... So far

----------

## todd93

Ok, everyone, I'm going to mark this as "SOLVED"... I'm still having trouble with my sound, but only in web browsers, it's working fine on the rest of the system... So, I'll make a new thread there, only after I have exhausted searches trying to find the answer in existing threads..

Thanks again for all the help, I greatly appreciate it!

----------

