Cava not working (snd_aloop is not by default loaded)

I am facing the problem of cava not working , it requres snd_aloop
so I loaded it through

sudo modprobe snd_aloop

but then the cava was not working properly because whenever I played any music it’s output won’t detected by cava and bars won’t move up and down .
then for resolving that I installed ALSA and jack support
the bars properly started moving
but there is one thing I want to do

I want to load snd_aloop at startup

trying to find it from internet mostly either the cava problem is not solved or if it’s solved then the user got it solved by installing it from aur and something happened miracle and got it solved :person_shrugging: ?

garuda inxi

 ╭─ankur@ankur in ~ 
 ╰─λ garuda-inxi
  Kernel: 6.5.5-273-tkg-linux-tkg-pds-generic_v3 arch: x86_64 bits: 64
    compiler: gcc v: 13.2.1 clocksource: tsc available: hpet,acpi_pm
    parameters: intel_pstate=passive split_lock_detect=off
    root=UUID=4db91e48-f647-49c5-9e3e-ea266109ffe7 rw rootflags=subvol=@
    quiet loglevel=3 ibt=off
  Desktop: Hyprland info: waybar vt: 1 dm: SDDM Distro: Garuda Linux
    base: Arch Linux
  Type: Laptop System: Dell product: Inspiron 7570 v: N/A
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: Dell model: 06K08K v: A00 serial: <superuser required> UEFI: Dell
    v: 1.25.0 date: 07/13/2022
  ID-1: BAT0 charge: 6.6 Wh (100.0%) condition: 6.6/42.0 Wh (15.7%)
    volts: 12.6 min: 11.4 model: Samsung SDI DELL CYMGM79 type: Li-ion
    serial: <filter> status: full
  Info: model: Intel Core i7-8550U bits: 64 type: MT MCP arch: Coffee Lake
    gen: core 8 level: v3 note: check built: 2017 process: Intel 14nm family: 6
    model-id: 0x8E (142) stepping: 0xA (10) microcode: 0xF4
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB
    L3: 8 MiB desc: 1x8 MiB
  Speed (MHz): avg: 516 high: 828 min/max: 400/4000 scaling:
    driver: intel_cpufreq governor: ondemand cores: 1: 828 2: 400 3: 400 4: 400
    5: 400 6: 807 7: 400 8: 500 bogomips: 32026
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities: <filter>
  Device-1: Intel UHD Graphics 620 vendor: Dell driver: i915 v: kernel
    arch: Gen-9.5 process: Intel 14nm built: 2016-20 ports: active: eDP-1
    empty: DP-1,DP-2,HDMI-A-1 bus-ID: 00:02.0 chip-ID: 8086:5917
    class-ID: 0300
  Device-2: NVIDIA GM108M [GeForce 940MX] vendor: Dell driver: nvidia
    v: 535.113.01 alternate: nouveau,nvidia_drm non-free: 535.xx+
    status: current (as of 2023-09) arch: Maxwell code: GMxxx
    process: TSMC 28nm built: 2014-19 pcie: gen: 1 speed: 2.5 GT/s lanes: 4
    link-max: gen: 3 speed: 8 GT/s bus-ID: 01:00.0 chip-ID: 10de:134d
    class-ID: 0302
  Device-3: Sunplus Innovation Integrated_Webcam_HD driver: uvcvideo
    type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-5:3
    chip-ID: 1bcf:28c1 class-ID: 0e02
  Display: wayland server: v: with: Xwayland v: 23.2.1
    compositor: Hyprland driver: X: loaded: modesetting,nvidia unloaded: nouveau
    alternate: fbdev,intel,nv,vesa dri: iris gpu: i915 display-ID: 1
  Monitor-1: eDP-1 model: BOE Display 0x06b4 built: 2016 res: 1920x1080
    hz: 60 dpi: 142 gamma: 1.2 scale: 1 size: 344x194mm (13.54x7.64")
    diag: 395mm (15.5") ratio: 16:9 modes: 1920x1080
  API: Vulkan v: 1.3.264 layers: 9 device: 0 type: integrated-gpu name: Intel
    UHD Graphics 620 (KBL GT2) driver: mesa intel v: 23.2.1-arch1.1
    device-ID: 8086:5917 surfaces: xcb,xlib,wayland device: 1
    type: discrete-gpu name: NVIDIA GeForce 940MX driver: nvidia v: 535.113.01
    device-ID: 10de:134d surfaces: xcb,xlib,wayland device: 2 type: cpu
    name: llvmpipe (LLVM 16.0.6 256 bits) driver: mesa llvmpipe
    v: 23.2.1-arch1.1 (LLVM 16.0.6) device-ID: 10005:0000
    surfaces: xcb,xlib,wayland
  API: EGL Message: EGL data requires eglinfo. Check --recommends.
  Device-1: Intel Sunrise Point-LP HD Audio vendor: Dell driver: snd_hda_intel
    v: kernel alternate: snd_soc_skl,snd_soc_avs bus-ID: 00:1f.3
    chip-ID: 8086:9d71 class-ID: 0403
  API: ALSA v: k6.5.5-273-tkg-linux-tkg-pds-generic_v3 status: kernel-api
    with: aoss type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: sndiod v: N/A status: off tools: aucat,midicat,sndioctl
  Server-2: PipeWire v: 0.3.80 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Dell driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1
    port: d000 bus-ID: 02:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp2s0 state: down mac: <filter>
  Device-2: Intel Wireless 7265 driver: iwlwifi v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 bus-ID: 03:00.0 chip-ID: 8086:095a class-ID: 0280
  IF: wlp3s0 state: up mac: <filter>
  Device-1: Intel Bluetooth wireless interface driver: btusb v: 0.8 type: USB
    rev: 2.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-7:4 chip-ID: 8087:0a2a
    class-ID: e001
  Report: btmgmt ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 4.2
    lmp-v: 8 status: discoverable: no pairing: no class-ID: 6c010c
  Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci
    v: 3.0 port: f060 bus-ID: 00:17.0 chip-ID: 8086:282a rev: N/A class-ID: 0104
  Local Storage: total: 1.14 TiB used: 33.24 GiB (2.8%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/sda maj-min: 8:0 vendor: Seagate model: ST1000LM035-1RK172
    size: 931.51 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    tech: HDD rpm: 5400 serial: <filter> fw-rev: SDM3 scheme: GPT
  ID-2: /dev/sdb maj-min: 8:16 vendor: Micron model: 1100 SATA 256GB
    size: 238.47 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    tech: SSD serial: <filter> fw-rev: L003 scheme: GPT
  ID-1: / raw-size: 931.22 GiB size: 931.22 GiB (100.00%)
    used: 33.24 GiB (3.6%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 576 KiB (0.2%) fs: vfat dev: /dev/sda1 maj-min: 8:1
  ID-3: /home raw-size: 931.22 GiB size: 931.22 GiB (100.00%)
    used: 33.24 GiB (3.6%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
  ID-4: /var/log raw-size: 931.22 GiB size: 931.22 GiB (100.00%)
    used: 33.24 GiB (3.6%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
  ID-5: /var/tmp raw-size: 931.22 GiB size: 931.22 GiB (100.00%)
    used: 33.24 GiB (3.6%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
  Kernel: swappiness: 133 (default 60) cache-pressure: 50 (default 100)
    zswap: no
  ID-1: swap-1 type: zram size: 7.5 GiB used: 0 KiB (0.0%) priority: 100
    comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 8 dev: /dev/zram0
  System Temperatures: cpu: 59.0 C mobo: 53.0 C sodimm: SODIMM C
  Fan Speeds (rpm): cpu: 3546
  Processes: 238 Uptime: 1m wakeups: 2 Memory: total: 8 GiB available: 7.5 GiB
  used: 1.22 GiB (16.3%) Init: systemd v: 254 default: graphical
  tool: systemctl Compilers: gcc: 13.2.1 clang: 16.0.6 Packages: pm: pacman
  pkgs: 1579 libs: 424 tools: pamac,paru Shell: fish v: 3.6.1 running-in: foot
  inxi: 3.3.30
Garuda (2.6.16-1):
  System install date:     2023-09-17
  Last full system update: 2023-10-01
  Is partially upgraded:   Yes
  Relevant software:       snapper NetworkManager dracut nvidia-dkms
  Windows dual boot:       Probably (Run as root to verify)
  Failed units:            

To automatically load any module on boot

  • create a file under /etc/modules-load.d/ such as using
sudo vim /etc/modules-load.d/cava.conf

The name of file doesn’t matter it should have a .conf extension at end. This file should contain following line


To insert this line press i to enter insert mode type the module name or if you have it in clipboard press Esc then type :r !xsel -o -b to paste clipboard text.

Once done press Esc following this ZZ (yes they are capital z) to save and exit.

Now reboot and check. Hopefully this vim tutorial was helpful :wink:

You can check if module is available or not using

lsmod | grep snd_aloop

Mmm… actually you don’t need to give me a tutorial of vim :sweat_smile:
I am using neovim for almost 3 years now
BTW, you seems to have a much more experience than me of vim :slightly_smiling_face:
I would just press i to insert and the press ctr+shift+v to paste :grin:
and :wq to save and exit
BTW, I am very noobi :stuck_out_tongue:
using mouse in “visual” mode :sweat_smile:

Okay , so I did whatever you said :

 ╭─ankur@ankur in ~ took 8ms
 ╰─λ lsmod | ugrep snd_aloop
snd_aloop              40960  1
snd_pcm               204800  10 snd_soc_avs,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_compress,snd_soc_core,snd_aloop,snd_soc_skl,snd_hda_core,snd_pcm_dmaengine
snd_timer              53248  4 snd_seq,snd_hrtimer,snd_aloop,snd_pcm
snd                   155648  20 snd_ctl_led,snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_compress,snd_soc_core,snd_aloop,snd_pcm

cava is now running but there is a problem, it seems like cava only detects sound when I install or uninstall ALSA and don’t restart , when I restart it again the bars of cava stop moving up and down :

It seems like something (maybe some components of ALSA itself) gets activated when I install or uninstall the ALSA support . But when I restart those components may not get loaded .

Why simple, when it is also complicated possible with vim.
I could bet @tbg can make a one-liner out of this too. :smiley:

echo -e snd_aloop >> /etc/modules-load.d/cava.conf

or use micro or kate :rofl:

1 Like

I see you are a man of culture. I use “vim” btw, not neovim here I had to create the ctrl+shift + v keybinding to paste contents of my clipboard to vim

vnoremap <C-C> :w !xsel -i -b<CR>
vnoremap <C-V> :r !xsel -o -b<CR>

This sounds very challenging…

I have tried them before but any text editor just makes me cringe so hard at this point that I end up throwing my work away and setting up vim first the convenience of it’s key bindings is mind altering. Unless it’s something that needs libreoffice I prefer using vim or at-least setup vim keybindings.


Open kate- new document- paste snd_aloop- save as file under /etc/modules-load.d/cava.conf- type sudo passwd, ready.

On server I use micro. :slight_smile:

I started with vim actually , I used to setup my own configs , which included some minor things like test highlighting and :set number command in .vimrc
then I found neovim and yeah all keybindings that I used where same plus it was already configured that way I liked so I settled down there .(few months ago I was a boy of culture now I am legally a man of culture :grin: )

BTW I was just trying to restart ALSA ,
it gives me something like :

 ╭─ankur@ankur in ~ 
 ╰─λ sudo /etc/init.d/alsa-utils stop
     sudo alsa force-reload
     sudo /etc/init.d/alsa-utils start
[sudo] password for ankur:            
sudo: /etc/init.d/alsa-utils: command not found
sudo: alsa: command not found
sudo: /etc/init.d/alsa-utils: command not found

IDK , if I am doing it right :slightly_smiling_face:

I thiught you would might be a person with long white beard using emacs :grin:

Hmm these are the binaries that alsa-utils provides

pacman -Ql alsa-utils | grep /usr/bin/
alsa-utils /usr/bin/
alsa-utils /usr/bin/aconnect
alsa-utils /usr/bin/
alsa-utils /usr/bin/alsabat
alsa-utils /usr/bin/
alsa-utils /usr/bin/alsactl
alsa-utils /usr/bin/alsaloop
alsa-utils /usr/bin/alsamixer
alsa-utils /usr/bin/alsatplg
alsa-utils /usr/bin/alsaucm
alsa-utils /usr/bin/amidi
alsa-utils /usr/bin/amixer
alsa-utils /usr/bin/aplay
alsa-utils /usr/bin/aplaymidi
alsa-utils /usr/bin/arecord
alsa-utils /usr/bin/arecordmidi
alsa-utils /usr/bin/aseqdump
alsa-utils /usr/bin/aseqnet
alsa-utils /usr/bin/axfer
alsa-utils /usr/bin/iecset
alsa-utils /usr/bin/nhlt-dmic-info
alsa-utils /usr/bin/speaker-test

Apart from that perhaps it’s something related to these services,

pacman -Ql alsa-utils | grep systemd
alsa-utils /usr/lib/systemd/
alsa-utils /usr/lib/systemd/system/
alsa-utils /usr/lib/systemd/system/alsa-restore.service
alsa-utils /usr/lib/systemd/system/alsa-state.service
alsa-utils /usr/lib/systemd/system/
alsa-utils /usr/lib/systemd/system/
alsa-utils /usr/lib/systemd/system/

Sorry can’t really help much since I don’t know anything about alsa.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.