Ubuntu – Alsa snd-aloop kernel module for 16.04 or 14.04 server

alsasound

I'm trying to record audio from an application on a server with FFmpeg. Apparently, I need an Alsa loopback driver for this. I've read that this should work on Ubuntu 14.04:

modprobe snd-aloop

Unfortunately, that isn't available on my kernel:

modprobe: FATAL: Module snd-aloop not found.

Is this a difference between server and desktop distributions of Ubuntu?

How can I get this driver installed?

Googling leads me here: https://wiki.ubuntu.com/Audio/InstallingLinuxAlsaDriverModules

That page then says I need to go here: https://wiki.ubuntu.com/Audio/UpgradingAlsa

That page sensibly says to use DKMS: https://wiki.ubuntu.com/Audio/UpgradingAlsa/DKMS

However, the DKMS instructions only list Intel drivers: https://code.launchpad.net/~ubuntu-audio-dev/+archive/ubuntu/alsa-daily/+packages

Am I missing something?

Best Answer

  • Well, I could try loading it in Ubuntu 16.04 Desktop Edition (VirtualBox with disabled audio card). As you can see, it is installed with linux-image-extra package which may be you don't have already.

    ~$ modinfo snd-aloop
    
    filename:       /lib/modules/4.4.0-42-generic/kernel/sound/drivers/snd-aloop.ko
    license:        GPL
    description:    A loopback soundcard
    author:         Jaroslav Kysela <perex@perex.cz>
    srcversion:     0A4CE16C028DAB4BC8260D3
    depends:        snd-pcm,snd
    intree:         Y
    vermagic:       4.4.0-42-generic SMP mod_unload modversions 
    parm:           index:Index value for loopback soundcard. (array of int)
    parm:           id:ID string for loopback soundcard. (array of charp)
    parm:           enable:Enable this loopback soundcard. (array of bool)
    parm:           pcm_substreams:PCM substreams # (1-8) for loopback driver. (array of int)
    parm:           pcm_notify:Break capture when PCM format/rate/channels changes. (array of int)
    
    ~$ dpkg -S /lib/modules/4.4.0-42-generic/kernel/sound/drivers/snd-aloop.ko
    
    linux-image-extra-4.4.0-42-generic: /lib/modules/4.4.0-42-generic/kernel/sound/drivers/snd-aloop.ko
    
    ~$ sudo modprobe snd-aloop
    ~$ alsa-info.sh --stdout
    
    upload=true&script=true&cardinfo=
    !!################################
    !!ALSA Information Script v 0.4.64
    !!################################
    
    !!Script ran on: Thu Mar 23 10:28:23 UTC 2017
    
    
    !!Linux Distribution
    !!------------------
    
    Ubuntu 16.04 LTS \n \l DISTRIB_ID=Ubuntu DISTRIB_DESCRIPTION="Ubuntu 16.04 LTS" NAME="Ubuntu" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 16.04 LTS" HOME_URL="http://www.ubuntu.com/" SUPPORT_URL="http://help.ubuntu.com/" BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/" UBUNTU_CODENAME=xenial
    
    
    !!DMI Information
    !!---------------
    
    Manufacturer:      innotek GmbH
    Product Name:      VirtualBox
    Product Version:   1.2
    Firmware Version:  VirtualBox
    
    
    !!Kernel Information
    !!------------------
    
    Kernel release:    4.4.0-42-generic
    Operating System:  GNU/Linux
    Architecture:      x86_64
    Processor:         x86_64
    SMP Enabled:       Yes
    
    
    !!ALSA Version
    !!------------
    
    Driver version:     k4.4.0-42-generic
    Library version:    1.1.0
    Utilities version:  1.1.0
    
    
    !!Loaded ALSA modules
    !!-------------------
    
    snd_aloop
    
    
    !!Sound Servers on this system
    !!----------------------------
    
    Pulseaudio:
          Installed - Yes (/usr/bin/pulseaudio)
          Running - Yes
    
    
    !!Soundcards recognised by ALSA
    !!-----------------------------
    
     0 [Loopback       ]: Loopback - Loopback
                          Loopback 1
    
    
    !!PCI Soundcards installed in the system
    !!--------------------------------------
    
    
    
    !!Advanced information - PCI Vendor/Device/Subsystem ID's
    !!-------------------------------------------------------
    
    
    
    !!Modprobe options (Sound related)
    !!--------------------------------
    
    snd_pcsp: index=-2
    snd_usb_audio: index=-2
    snd_atiixp_modem: index=-2
    snd_intel8x0m: index=-2
    snd_via82xx_modem: index=-2
    snd_atiixp_modem: index=-2
    snd_intel8x0m: index=-2
    snd_via82xx_modem: index=-2
    snd_usb_audio: index=-2
    snd_usb_caiaq: index=-2
    snd_usb_ua101: index=-2
    snd_usb_us122l: index=-2
    snd_usb_usx2y: index=-2
    snd_cmipci: mpu_port=0x330 fm_port=0x388
    snd_pcsp: index=-2
    snd_usb_audio: index=-2
    
    
    !!Loaded sound module options
    !!---------------------------
    
    !!Module: snd_aloop
        enable : Y,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N
        id : (null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null)
        index : -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
        pcm_notify : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
        pcm_substreams : 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
    
    
    !!ALSA Device nodes
    !!-----------------
    
    crw-rw----+ 1 root audio 116,  2 Mar 23 11:18 /dev/snd/controlC0
    crw-rw----+ 1 root audio 116,  4 Mar 23 11:18 /dev/snd/pcmC0D0c
    crw-rw----+ 1 root audio 116,  3 Mar 23 11:18 /dev/snd/pcmC0D0p
    crw-rw----+ 1 root audio 116,  6 Mar 23 11:18 /dev/snd/pcmC0D1c
    crw-rw----+ 1 root audio 116,  5 Mar 23 11:18 /dev/snd/pcmC0D1p
    crw-rw----+ 1 root audio 116,  1 Mar 23 11:18 /dev/snd/seq
    crw-rw----+ 1 root audio 116, 33 Mar 23 11:18 /dev/snd/timer
    
    /dev/snd/by-path:
    total 0
    drwxr-xr-x 2 root root  60 Mar 23 11:18 .
    drwxr-xr-x 3 root root 200 Mar 23 11:18 ..
    lrwxrwxrwx 1 root root  12 Mar 23 11:18 platform-snd_aloop.0 -> ../controlC0
    
    
    !!Aplay/Arecord output
    !!--------------------
    
    APLAY
    
    **** List of PLAYBACK Hardware Devices ****
    card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
      Subdevices: 8/8
      Subdevice #0: subdevice #0
      Subdevice #1: subdevice #1
      Subdevice #2: subdevice #2
      Subdevice #3: subdevice #3
      Subdevice #4: subdevice #4
      Subdevice #5: subdevice #5
      Subdevice #6: subdevice #6
      Subdevice #7: subdevice #7
    card 0: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
      Subdevices: 8/8
      Subdevice #0: subdevice #0
      Subdevice #1: subdevice #1
      Subdevice #2: subdevice #2
      Subdevice #3: subdevice #3
      Subdevice #4: subdevice #4
      Subdevice #5: subdevice #5
      Subdevice #6: subdevice #6
      Subdevice #7: subdevice #7
    
    ARECORD
    
    **** List of CAPTURE Hardware Devices ****
    card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
      Subdevices: 8/8
      Subdevice #0: subdevice #0
      Subdevice #1: subdevice #1
      Subdevice #2: subdevice #2
      Subdevice #3: subdevice #3
      Subdevice #4: subdevice #4
      Subdevice #5: subdevice #5
      Subdevice #6: subdevice #6
      Subdevice #7: subdevice #7
    card 0: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
      Subdevices: 8/8
      Subdevice #0: subdevice #0
      Subdevice #1: subdevice #1
      Subdevice #2: subdevice #2
      Subdevice #3: subdevice #3
      Subdevice #4: subdevice #4
      Subdevice #5: subdevice #5
      Subdevice #6: subdevice #6
      Subdevice #7: subdevice #7
    
    !!Amixer output
    !!-------------
    
    !!-------Mixer controls for card 0 [Loopback]
    
    Card hw:0 'Loopback'/'Loopback 1'
      Mixer name    : 'Loopback Mixer'
      Components    : ''
      Controls      : 97
      Simple ctrls  : 1
    Simple mixer control 'PCM',0
      Capabilities: pvolume
      Playback channels: Front Left - Front Right
      Limits: Playback 0 - 255
      Mono:
      Front Left: Playback 255 [100%] [0.00dB]
      Front Right: Playback 255 [100%] [0.00dB]
    ...
    
  • For general solution, look at:

    How do I find the package that provides a file?

  • Just checked a fresh Ubuntu 16.04.1 Server. It has the snd-aloop module. linux-image-extra* package was installed as dependency of linux-image-generic meta package which is also a dependency of linux-generic meta package. So a quick fix:

    sudo apt install linux-generic
    
Related Question