cava icon indicating copy to clipboard operation
cava copied to clipboard

Cava has stopped working on Arch Linux

Open TheSoftwareWizard opened this issue 1 year ago • 2 comments

I just installed a new Arch Linux just to test if the failure was my fault or a bug.

I use polybar and have a custom module for cava which has always work perfectly without having to mess with cava's configuration file.

For the last couple of weeks, cava is not working properly.

I use PulseAudio and unless I use the method = pulse, doesn't work.

But my cava custom module on polybar doesn't work no matter what I do.

This is the cava.sh file:

#! /bin/bash bar="▁▂▃▄▅▆▇█" dict="s/;//g;" #creating "dictionary" to replace char with bar i=0 while [ $i -lt ${#bar} ] do dict="${dict}s/$i/${bar:$i:1}/g;" i=$((i=i+1)) done #write cava config config_file="/tmp/polybar_cava_config" echo " [general] bars = 10 [output] method = raw raw_target = /dev/stdout data_format = ascii ascii_max_range = 7 " > $config_file #read stdout from cava cava -p $config_file | while read -r line; do echo $line | sed $dict done

This is the custom module:

[module/cava] type = custom/script tail = true exec = $HOME/.config/polybar/cava.sh format = <label> format-font = 5 label = %output%

TheSoftwareWizard avatar Feb 15 '25 14:02 TheSoftwareWizard

I can not help with polybar or your own custom modules. You said it worked before, go back and figure out when it stopped working, find what commit (if any) that broke it.

karlstav avatar Feb 16 '25 10:02 karlstav

@Drakslab possibly try re-installing sdl3 My arch somehow got the wrong version of this and it caused cava to not launch due to SDL_StretchSurface missing from sdl3.

A quick re-install might resolve your issue.

nfowlie avatar Feb 18 '25 22:02 nfowlie

Issue: The cava.sh module in Polybar stopped working suddenly. The audio visualizer showed no activity even though CAVA ran without errors. Key symptoms:

CAVA only worked with method = pulse, but the custom script failed.

The script worked in the terminal but displayed no audio reactivity.

The CAVA instance did not appear as a "listener" in PulseAudio Volume Control.

Root Cause:

The script’s temporary CAVA configuration used method = raw under [output] but lacked proper PulseAudio input configuration.

The system (likely migrated to PipeWire/PulseAudio) required explicit specification of the PulseAudio monitor source.

The FIFO (/tmp/cava.fifo) had permission issues or was not properly recreated.

Solution:

Fixed CAVA Configuration:

    Added [input] section with method = pulse and the correct PulseAudio monitor device:
    ini
    Copy

    [input]
    method = pulse
    source = alsa_output.pci-0000_2a_00.6.analog-stereo.monitor

Environment Variables:

    Added export PULSE_SERVER="unix:${XDG_RUNTIME_DIR}/pulse/native" to ensure Polybar inherited PulseAudio access.

FIFO Handling:

    Forced FIFO recreation with rm -f "$pipe" and set proper permissions via mkfifo -m 600 "$pipe".

Font Compatibility:

    Switched to Unicode block characters (▁▂▃▄▅▆▇█) compatible with Maple Mono SC NF.

TheSoftwareWizard avatar Mar 19 '25 17:03 TheSoftwareWizard