Use ladspa plugin in Volumio

Hello everyone,

as the stereo craze has got me I would like to improve the sound of my volumio system, using a ladspa plugin for implementing a crossover between my mains and sub as well as a bit of equalization. On my windows system I have already implemented and measured the configuration using equalizerAPO.

To now implement the filters on my Volumio system I installed the bmc0/dsp plugin from https://github.com/bmc0/dsp .
I have created a lowpass filter in the config file for the plugin and have tried to adapt the asound.config file as described in the manual of the plugin but ALSA does not seem to load the plugin at all.
As I have very limited experience with the audio system on linux I would appreciate every help to get the plugin up and running.
Below I have attached my asound.config file.

pcm.softvolume {
    type             plug
    slave.pcm       "softvol"
}

pcm.softvol {
    type            softvol
    slave {
        pcm         "plughw:5,0"
    }
    control {
        name        "SoftMaster"
        card        5
        device      0
    }
max_dB 0.0
min_dB -50.0
resolution 100
}

pcm.dsp {
        
        type plug
        slave {
                format FLOAT
                rate unchanged
                pcm {
                        type ladspa
                        channels 6
                        path "/usr/lib/ladspa"
                        playback_plugins [{
                                label "ladspa_dsp"
                        }]
                        slave.pcm{
                                type plug
                                slave{
                                        card "plughw:5,0"
                                        rate unchanged
                                        channels unchanged
                                }
                        }
                }
        }
}

pcm.!default{
        type copy
        slave.pcm "dsp"
}

ctl.!default {
        type copy
        slave.pcm "dsp"
}

Beeing out of ideas I also tried modifying the mdp.conf file, but sadly (or luckily) it didn’t change anything. Below is my modified file content.

#metadata_to_use        "artist,album,title,track,name,genre,date,composer,performer,disc"
auto_update    "yes"
#auto_update_depth "3"
###############################################################################
# Symbolic link behavior ######################################################
follow_outside_symlinks "yes"
follow_inside_symlinks          "yes"
###############################################################################
# Input #######################################################################
#
input {
        plugin "curl"
#       proxy "proxy.isp.com:8080"
#       proxy_user "user"
#       proxy_password "password"
}
###############################################################################

# Decoder ################################################################

###############################################################################

# Audio Output ################################################################

resampler {
                plugin "soxr"
                quality "high"
                threads "1"
}

audio_output {
                type            "alsa"
                name            "alsa"
                device          "hw:5,0"
                dop             "yes"

}

audio_output {
                type            "alsa"
                name            "dsp"
                device          "plug:dsp"
}

audio_output {
    type            "fifo"
    enabled         "no"
    name            "multiroom"
    path            "/tmp/snapfifo"
    format          "44100:16:2"
}


#replaygain                     "album"
#replaygain_preamp              "0"
volume_normalization            "yes"
###############################################################################

# MPD Internal Buffering ######################################################
audio_buffer_size               "12288"
buffer_before_play              "10%"
###############################################################################


# Resource Limitations ########################################################
#connection_timeout             "60"
max_connections                 "20"
max_playlist_length             "81920"
max_command_list_size           "81920"
max_output_buffer_size          "81920"
###############################################################################

# Character Encoding ##########################################################
filesystem_charset              "UTF-8"
id3v1_encoding                  "UTF-8"

Thanks a lot

Hi,
so after a lot of trial and error I have managed to get the plugin working when playing a test file with aplay and selecting the dsp pcm as the output device.

But what I am still struggling with is how to get volumio to play the sound through the created dsp output device. It would be great if someone could give me a hint on how to set the playback in volumio up so that the output sound is routed to the alsa plugin instead of the hardware device directly.

As of now I have created a script that overwrites the default asound.config as well as mpd.config files with the attached customized asound and mpd config files on startup. The script works as intended and I can use the dsp pcm as output afterwards. All thats left would be routing the Volumio sound output into the dsp device.

pcm.dsp {
        type plug
        hint.show on
        hint.description "DSP'd output"
        slave {
                format FLOAT
                rate unchanged
                pcm {
                        type ladspa
                        channels 6
                        path "/usr/lib/ladspa"
                        playback_plugins [{
                                label "ladspa_dsp"
                        }]
                        slave.pcm {
                                type plug
                                slave {
                                        pcm "hw:5,0"
                                        rate unchanged
                                        channels unchanged

                                }
                        }
                }
        }
}

ctl.!default {
        type hw
        card 5
}

pcm.!default {
        type copy
        slave.pcm "dsp"
}

pcm.softvolume {
    type             plug
    slave.pcm       "softvol"
}

pcm.softvol {
    type            softvol
    slave {
        pcm         "plughw:5,0"
    }
    control {
        name        "SoftMaster"
        card        5
        device      0
    }
max_dB 0.0
min_dB -50.0
resolution 100
}

[code]# Volumio MPD Configuration File

Files and directories

music_directory “/var/lib/mpd/music”
playlist_directory “/var/lib/mpd/playlists”
db_file “/var/lib/mpd/tag_cache”
#log_file “/var/log/mpd/mpd.log”
#pid_file “/var/run/mpd/pid”
#state_file “/var/lib/mpd/state”
#sticker_file “/var/lib/mpd/sticker.sql”
###############################################################################

General music daemon options

user “mpd”
group “audio”
bind_to_address “any”
#port “6600”
#log_level “default”
gapless_mp3_playback “no”
#save_absolute_paths_in_playlists “no”
#metadata_to_use “artist,album,title,track,name,genre,date,composer,performer,disc”
auto_update “yes”
#auto_update_depth “3”
###############################################################################

Symbolic link behavior

follow_outside_symlinks “yes”
follow_inside_symlinks “yes”
###############################################################################

Input

input {
plugin “curl”

proxy “proxy.isp.com:8080

proxy_user “user”

proxy_password “password”

}
###############################################################################

Decoder

###############################################################################

Audio Output

resampler {
plugin “soxr”
quality “high”
threads “1”
}

audio_output {
type “alsa”
name “dsp”
device “plug:dsp”
dop “yes”

}

audio_output {
type “fifo”
enabled “no”
name “multiroom”
path “/tmp/snapfifo”
format “44100:16:2”
}

#replaygain “album”
#replaygain_preamp “0”
volume_normalization “yes”
###############################################################################

MPD Internal Buffering

audio_buffer_size “12288”
buffer_before_play “10%”
###############################################################################

Resource Limitations

#connection_timeout “60”
max_connections “20”
max_playlist_length “81920”
max_command_list_size “81920”
max_output_buffer_size “81920”
###############################################################################

Character Encoding

filesystem_charset “UTF-8”
id3v1_encoding “UTF-8”
###############################################################################
[/code]

Please have a look at the equalizer plugin or binaural plugin or stereo2mono plugin.