You are not logged in.

#1 2020-03-03 02:19:15

cj360
Member
Registered: 2013-10-12
Posts: 67

[Solved] Pulse not loading ladspa-sink

So I'm trying to load the ladspa plugins and pulse seems to simply be skipping them?

/etc/pulse/default.pa:

#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif

### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

### Load several protocols
load-module module-dbus-protocol
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif


### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
load-module module-role-cork

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

### Make some devices default
#set-default-sink output
#set-default-source input

~/.config/pulse/default.pa:

.include /etc/pulse/default.pa

.ifexists module-ladspa-sink.so
.nofail
load-module module-ladspa-sink sink_name=shw_sc4 sink_master=alsa_output.pci-0000_0a_00.1.hdmi-stereo-extra2 plugin=sc4_1882 label=sc4 control=9,5,63,-6,15,3,49,,5, set-default-sink shw_sc4
.fail
.endif

$ pulseaudio -vvv:

I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
I: [pulseaudio] main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted
D: [pulseaudio] core-rtclock.c: Timer slack is set to 50 us.
D: [pulseaudio] core-util.c: RealtimeKit worked.
I: [pulseaudio] core-util.c: Successfully gained nice level -11.
I: [pulseaudio] main.c: This is PulseAudio 13.0
D: [pulseaudio] main.c: Compilation host: x86_64
D: [pulseaudio] main.c: Compilation CFLAGS: Not yet supported on meson
D: [pulseaudio] main.c: Running on host: Linux x86_64 5.5.7-19-tkg-pds #1 TKG SMP PREEMPT Sat, 29 Feb 2020 16:28:53 +0000
D: [pulseaudio] main.c: Found 12 CPUs.
I: [pulseaudio] main.c: Page size is 4096 bytes
D: [pulseaudio] main.c: Compiled with Valgrind support: no
D: [pulseaudio] main.c: Running in valgrind mode: no
D: [pulseaudio] main.c: Running in VM: no
D: [pulseaudio] main.c: Running from build tree: no
D: [pulseaudio] main.c: Optimized build: yes
D: [pulseaudio] main.c: All asserts enabled.
I: [pulseaudio] main.c: Machine ID is 9c1b2797021344efbecce04e6d1f2899.
I: [pulseaudio] main.c: Session ID is 1.
I: [pulseaudio] main.c: Using runtime directory /run/user/1000/pulse.
I: [pulseaudio] main.c: Using state directory /home/andrew/.config/pulse.
I: [pulseaudio] main.c: Using modules directory /usr/lib/pulse-13.0/modules.
I: [pulseaudio] main.c: Running in system mode: no
E: [pulseaudio] pid.c: Daemon already running.
E: [pulseaudio] main.c: pa_pid_file_create() failed.

$ pacmd list-sinks | awk /name:/

	name: <alsa_output.pci-0000_0a_00.1.hdmi-stereo-extra2>
	name: <alsa_output.pci-0000_0c_00.3.analog-stereo>

Seems like my module-ladspa-sink isn't being loaded as it should be listed under the list-sinks command right?

Last edited by cj360 (2020-03-06 15:40:32)

Offline

#2 2020-03-03 08:28:31

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,393

Re: [Solved] Pulse not loading ladspa-sink

You will likely want to put a newline between the ladspa definition and the default sink setting.

You should also check

journalctl -b --user-unit=pulseaudio

on whether it throws any errors. (Or properly stop it so that your -vvvv invocation doesn't immediately fail due to pulse already running https://wiki.archlinux.org/index.php/PulseAudio#Running )

Last edited by V1del (2020-03-03 08:34:34)

Offline

#3 2020-03-03 16:27:43

cj360
Member
Registered: 2013-10-12
Posts: 67

Re: [Solved] Pulse not loading ladspa-sink

(Why can't I remember to check journalctl more often...).

Thank you for the advise, as I had two things making the plugin fail. One was the default sink and after I move that to its own line, the config settings for the ladspa plugin were invalid. Here's my config now that its working.

~/.config/pulse/default.pa:

.include /etc/pulse/default.pa

#.ifexists module-ladspa-sink.so
#.nofail
load-module module-ladspa-sink sink_name=shw_sc4 sink_master=alsa_output.pci-0000_0a_00.1.hdmi-stereo-extra2 plugin=sc4_1882 label=sc4 control=1,1.5,401,-30,20,5,12
#set-default-sink shw_sc4
#.fail
#.endif

Since I'm setting the hdmi-stereo sink as master to the ladspa plugin am I correct that it'll only work with hdmi-stero sink?

Removing the sink_master from the ladspa-sink does let me switch it from monitor output or headphones but only by setting the headphone's sink or hdmi sink as the default sink then switching to the ladspa-sink.

Is there a method to set the ladspa-sink to just use the current default sink? Like how I have my volume shortcuts setup in sxhkd:

pactl set-sink-volume @DEFAULT_SINK@ +5%

Last edited by cj360 (2020-03-04 02:34:13)

Offline

#4 2020-03-04 06:56:33

digitalone
Member
Registered: 2011-08-19
Posts: 355

Re: [Solved] Pulse not loading ladspa-sink

I didn't understand the question correctly, but the ladspa sink works only setting a master, so if you set hdmi audio, the plugin will only work with it, not headphone. Unless you create another plugin setting a new master.

Anyway, I see you want a compressor. Why aren't you using PulseEffects?

I used to play with ladspa sink in the past to get a normalizer (similar to a compressor), but then switched to PulseEffects and I find it's more customizable and easy to use.

If you're interested, try this preset made by me: https://github.com/Digitalone1/PulseEffects-Presets

Offline

#5 2020-03-06 15:39:44

cj360
Member
Registered: 2013-10-12
Posts: 67

Re: [Solved] Pulse not loading ladspa-sink

Gotcha, I guess I'll checkout pulseeffects and mark as solved since the ladspa plugins are working.

Thanks everyone!

Last edited by cj360 (2020-03-06 15:40:18)

Offline

Board footer

Powered by FluxBB