Installing USB Audio Drivers on the Linux Kernel

This guide was written using gentoo on 2022_02_22. Using the following system:

$ uname -a
Linux annic-gentoo 5.16.8-gentoo20220222131635 #4 SMP PREEMPT Tue Feb 22 13:16:54 -00 2022 x86_64 AMD Ryzen 7 2700X Eight-Core Processor AuthenticAMD GNU/Linux

This code should™ work on other Linux installations (other than gentoo) but the location of your kernel will probably be different!

Commands written in square brackets [] are entirely optional. Often, the sudo command is placed in [sudo] because if you are root you don't need this command. Don't know if you are root? Type: whoami

  1. If you don't already have them, download the linux kernel sources:

    [sudo] emerge [--ask] sys-kernel/gentoo-sources
  2. Enter the directory containing the linux kernel source:

    cd /usr/src/linux
  3. If you haven't compiled your kernel before, you will need to grab your current config file, this can be done with the following command:

    [sudo] cp /boot/config-$(uname -r) .config
  4. Now we will configure the Linux Kernel

    [sudo] make menuconfig
  5. Now you will need to navigate through the submenus to make the following changes:
    Scroll down to:
    Device Drivers -->
    And press enter
    Now scroll down a while until you see Sound Card Support: Sound Card Support --> Highlight it and press m. THis will make it a module.
    Now press enter on it.
    Scroll to Advanced linux Sound Architecture ---> and press m on it.
    Now press ENTER on it, and scroll down to Enable OSS Emulation
    Press SPACE on it until it turns to an asterisk: [*] Enable OSS Emulation.
    A new submenu should have appeared, press m on both OSS Mixer API amd OSS PCM (digital audio) API.
    Scroll down more until you reach USB Sound devices. Press SPACE on it, until it converts to [*] USB sound devices.
    Press ENTER on it, and scroll down to USB Audio/Midi Driver and press m on it!

    If you found that difficult to follow, my source writes it cleaner: SOURCE

    It reads:

    Device Drivers
     Sound
      [M] Sound Card Support
       [M] Advanced Linux Sound Architecture
        [M] OSS Mixer API
        [M] OSS PCM (digital audio) API
        [ ] OSS PCM (digital audio) API - Include plugin system
  6. Press save and save it as .config

  7. [sudo] make [-j8]

    If you don't know what the [-j8] command is for, ignore it and don't use it.

  8. [sudo] make modules_install
  9. [sudo] make install

    NOTE TO SELF (don't run the next command (in red) unless YOU KNOW WHAT YOU'RE DOING!):If you have ran out of space in your system, and your only linux install is gentoo:
    read -p "YOU MIGHT BREAK YOUR SYSTEM! ARE YOU SURE? " -n 1 -r; echo; if [[ $REPLY =~ ^[Yy]$ ]]; then rm /boot/System.map* /boot/vmlinuz*; else echo "Phew"; fi

  10. If you use initramfs and dracut. Get the version name of your newly installed directory:

    ls /lib/modules -l

    The kernel version is probably the most recently created folder (so at the bottom of the list)

    [sudo] dracut --kver=(kernel version you just copied)

    An example of this code being run is like this:

    $ sudo dracut --kver=5.16.8-gentoo20220222131635
  11. If you use grub:

    [sudo] grub-mkconfig -o /boot/grub/grub.cfg
  12. [sudo] reboot

Voila! You should now have USB Audio