Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # bash is required for the <<<
- sinkdata=$(pacmd list-sinks)
- listsink_rv=$?
- if [ $listsink_rv -ne 0 ]
- then notify-send "pulse plugins" "pulseaudio isn't running"
- exit
- fi
- if grep -q "<null>" <<< $sinkdata
- then notify-send "pulse plugins" "already activated"
- exit
- fi
- # Add ladspa sinks
- # LADSPA_PATH didn't work for me
- pacmd load-module module-ladspa-sink sink_master=0 sink_name=lowfre_butt \
- plugin=/usr/local/lib/ladspa/butterworth_1902.so label=buttlow_iir control=50,
- #~ plugin=butterworth_1902 label=buttlow_iir control=50,
- pacmd load-module module-ladspa-sink sink_master=0 sink_name=lowfre_tsche \
- plugin=/usr/local/lib/ladspa/lowpass_iir_1891.so label=lowpass_iir control=40,3
- #~ plugin=lowpass_iir_1891 label=lowpass_iir control=40,3
- # Add null sink, loopback the ladspa sinks into it, set the null sink as default
- # and adjust volume ratios
- # code (modified) provided by georgC (via irc)
- pacmd load-module module-null-sink
- # adjust_time=0 avoids the latency offsets, however with this enabled, in time
- # the overall latency grows bigger and bigger
- # increasing latency_msec also didn't seem to fix the problem
- pactl load-module module-loopback latency_msec=30 adjust_time=1 \
- source=null.monitor sink=lowfre_butt
- pactl load-module module-loopback latency_msec=30 adjust_time=1 \
- source=null.monitor sink=lowfre_tsche
- pactl load-module module-loopback latency_msec=30 adjust_time=1 \
- source=null.monitor sink=0
- pacmd set-default-sink null
- lowfre_index=$(pacmd list-sink-inputs | ag "<lowfre_butt>" -B4 | head -n1 | \
- cut -f2 -d":")
- pacmd set-sink-input-volume $lowfre_index 0x10000
- pacmd set-sink-input-volume $((lowfre_index+1)) 0x18675
- #~ pacmd set-sink-input-volume $((lowfre_index+1)) 0x10000
- pacmd set-sink-input-volume $((lowfre_index+2)) 0x7800
- #~ pacmd set-sink-input-volume $((lowfre_index+1)) 0x7800
- notify-send "pulse plugins" "activated"
- # module-combine-sink also shows the latency offset problem(s)
- # it also doesn't remember the volume configurations
- # the problem also appears with two (instead of three) sinks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement