waybar-cava - Man Page

cava module

Description

cava module for karlstav/cava project. See it on github: https://github.com/karlstav/cava.

Files

$XDG_CONFIG_HOME/waybar/config
Per user configuration file

Additional Files

libcava lives in:

  1. /usr/lib/libcava.so or /usr/lib64/libcava.so
  2. /usr/lib/pkgconfig/cava.pc or /usr/lib64/pkgconfig/cava.pc
  3. /usr/include/cava

Configuration

OptionTypeofDefaultDescription
cava_configstringPath where cava configuration file is placed to
framerateinteger30rames per second. Is used as a replacement for interval
autosensinteger1Will attempt to decrease sensitivity if the bars peak
sensitivityinteger100Manual sensitivity in %. It's recommended to be omitted when autosens = 1
barsinteger12The number of bars
lower_cutoff_freqlong integer50Lower cutoff frequencies for lowest bars the bandwidth of the visualizer
higher_cutoff_freqlong integer10000Higher cutoff frequencies for highest bars the bandwidth of the visualizer
sleep_timerinteger5Seconds with no input before cava main thread goes to sleep mode
methodstringpulseAudio capturing method. Possible methods are: pipewire, pulse, alsa, fifo, sndio or shmem
sourcestringautoSee cava configuration
sample_ratelong integer44100See cava configuration
sample_bitsinteger16See cava configuration
stereobooltrueVisual channels
reverseboolfalseDisplays frequencies the other way around
bar_delimiterinteger0Each bar is separated by a delimiter. Use decimal value in ascii table(i.e. 59 = ";"). 0 means no delimiter
monstercatboolfalseDisables or enables the so-called "Monstercat smoothing" with of without "waves"
wavesboolfalseDisables or enables the so-called "Monstercat smoothing" with of without "waves"
noise_reductiondouble0.77Range between 0 - 1. The raw visualization is very noisy, this factor adjust the integral and gravity filters to keep the signal smooth. 1 - will be very slow and smooth, 0 - will be fast but noisy
input_delayinteger2Sets the delay before fetching audio source thread start working. On author machine Waybar starts much faster then pipewire audio server, and without a little delay cava module fails due to pipewire is not ready
ascii_max_rangeinteger7It's impossible to set it directly. The value is dictated by the number of icons in the array format-icons
data_formatstringasciIt's impossible to set it. Waybar sets it to = asci for internal needs
raw_targetstring/dev/stdoutIt's impossible to set it. Waybar sets it to = /dev/stdout for internal needs

Configuration can be provided as:

  • The only cava configuration file which is provided through cava_config. The rest configuration can be skipped
  • Without cava configuration file. In such case cava should be configured through provided list of the configuration option
  • Mix. When provided both And cava configuration file And configuration options. In such case waybar applies configuration file first then overrides particular options by the provided list of configuration options

Actions

StringAction
modeSwitch main cava thread and fetching audio source thread from/to pause/resume

Dependencies

  • iniparser
  • fftw3

Solving Issues

  1. On start Waybar throws an exception "error while loading shared libraries: libcava.so: cannot open shared object file: No such file or directory". It might happen when libcava for some reason hasn't been registered in the system. sudo ldconfig should help
  2. Waybar is starting but cava module doesn't react on the music

1. In such case for at first need to make sure usual cava application is working as well

2. If so, need to comment all configuration options. Uncomment cava_config and provide the path to the working cava config 3. You might set too huge or too small input_delay. Try to setup to 4 seconds, restart waybar and check again 4 seconds past. Usual even on weak machines it should be enough 4. You might accidentally switched action mode to pause mode

Rising Issues

For clear understanding: this module is a cava API's consumer. So for any bugs related to cava engine you should contact to Cava upstream(https://github.com/karlstav/cava)
with the one Exception. Cava upstream doesn't provide cava as a shared library. For that this module author made a fork libcava(https://github.com/LukashonakV/cava).
So the order is:

  1. cava upstream
  2. libcava upstream.

In case when cava releases new version and you're wanna get it, it should be raised an issue to libcava(https://github.com/LukashonakV/cava) with title
[Bump]x.x.x where x.x.x is cava release version.

Examples

  "cava": {
  	//"cava_config": "$XDG_CONFIG_HOME/cava/cava.conf",
  	"framerate": 30,
  	"autosens": 1,
  	//"sensitivity": 100,
  	"bars": 14,
  	"lower_cutoff_freq": 50,
  	"higher_cutoff_freq": 10000,
  	"method": "pulse",
  	"source": "auto",
  	"stereo": true,
  	"reverse": false,
  	"bar_delimiter": 0,
  	"monstercat": false,
  	"waves": false,
  	"noise_reduction": 0.77,
  	"input_delay": 2,
  	"format-icons" : ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" ],
  	"actions": {
  		"on-click-right": "mode"
  	}
  },

Referenced By

waybar(5).

2023-08-16 User Manual