Search code examples
audiokernel-modulealsagentoojack

modprobe: ERROR: could not insert 'snd_aloop': No such device


I'm trying to make a Jack-ALSA bridge on gentoo, but I cannot load the snd_aloop module.

Kernel:

$ uname -a
Linux MalfattiTux 4.6.7-rt-rt11 #1 SMP Thu Sep 22 14:54:42 BRT 2016 x86_64 Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz GenuineIntel GNU/Linux

snd_aloop compiled as a module:

$ cat /usr/src/linux-4.6.7-rt11/.config | grep ALOOP
CONFIG_SND_ALOOP=m

snd_aloop info:

$ sudo modinfo snd_aloop
filename:       /lib/modules/4.6.7-rt-rt11/kernel/sound/drivers/snd-aloop.ko
license:        GPL
description:    A loopback soundcard
author:         Jaroslav Kysela <[email protected]>
depends:        snd-pcm
intree:         Y
vermagic:       4.6.7-rt-rt11 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)

Settings for the snd_aloop module:

$ cat /etc/modprobe.d/alsa.conf | grep aloop
options snd-aloop id=Loopback index=0 pcm_substreams=2 enable=1
alias snd-card-0 snd-aloop

Audio devices:

$ sudo lspci | grep -i audio
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)

$ sudo lspci -k -s 00:03.0
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
    Subsystem: Lenovo Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller
    Kernel driver in use: snd_hda_intel
    Kernel modules: snd_hda_intel

$ sudo lspci -k -s 00:1b.0
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)
    Subsystem: Lenovo 8 Series/C220 Series Chipset High Definition Audio Controller
    Kernel driver in use: snd_hda_intel
    Kernel modules: snd_hda_intel

All looks ok. But then:

$ sudo modprobe snd_aloop
modprobe: ERROR: could not insert 'snd_aloop': No such device

I also tried compiling it not as a module, but included in the kernel. Then, I had loopback devices, but I had no control over them (like number of substreams, for example).

Is there any specific setting needed for this module to work on gentoo?

Thanks :)


Solution

  • The index option of a sound driver specifies the card number it should use. However, this does not work if another driver is already loaded at the same index.

    So you have to set matching index options on all drivers that are used (and might be used in the future, such as USB audio).

    A better idea is to drop all index options, and to use the slots options of the snd module to specify that only a specific driver can use a specific index:

    options snd slots=snd-aloop,snd-hda-intel,snd-hda-intel
    

    or if the loopback driver should not be the first (default) one:

    options snd slots=snd-hda-intel,snd-hda-intel,snd-aloop