bmc0 / dsp

An audio processing program with an interactive mode.
ISC License
219 stars 31 forks source link

Issues with effect paths and environment variables #44

Closed NextDesign1 closed 4 years ago

NextDesign1 commented 5 years ago

Hi there, I'm currently getting dsp set up, but have run into an issue where it doesn't seem to be discovering my configuration files properly.

I have the following files:

$ ls /home/user/.config/ladspa_dsp
config  eq.txt
$ cat /home/user/.config/ladspa_dsp/config
effects_chain=@eq.txt
$ cat /home/user/.config/ladspa_dsp/eq.txt
gain -7.4 lowshelf 62 0.9 7.0 eq 145 4.0 2.0 eq 670 4.5 -7.0 eq 740 4.5 6.0 eq 1820 1.5 -5.0 eq 3000 1.8 5.4 eq 3450 6.0 -2.3 eq 4800 2.0 3.5 highshelf 6000 1.2 -4.7

The environment variables that are referenced in the documentation seem to be correct:

$ echo $XDG_CONFIG_HOME
/home/user/.config
$ echo $HOME
/home/user

Yet if I try to plot the effect, I get the following:

$ ./dsp -pn @eq.txt | gnuplot
./dsp: info: failed to load effects file: eq.txt: No such file or directory

If I specify a direct path, I run into another error:

$ ./dsp -pn /home/user/config/ladspa_dsp/eq.txt 
./dsp: ffmpeg: error: could not find an audio stream
./dsp: error: failed to open input: /home/user/.config/ladspa_dsp/eq.txt

However I can apply the effect to a file in the following way without issue:

$ ./dsp /home/user/Desktop/audio.flac gain -7.4 lowshelf 62 0.9 7.0 eq 145 4.0 2.0 eq 670 4.5 -7.0 eq 740 4.5 6.0 eq 1820 1.5 -5.0 eq 3000 1.8 5.4 eq 3450 6.0 -2.3 eq 4800 2.0 3.5 highshelf 6000 1.2 -4.7

And I can plot the response:

$ ./dsp -pn gain -7.4 lowshelf 62 0.9 7.0 eq 145 4.0 2.0 eq 670 4.5 -7.0 eq 740 4.5 6.0 eq 1820 1.5 -5.0 eq 3000 1.8 5.4 eq 3450 6.0 -2.3 eq 4800 2.0 3.5 highshelf 6000 1.2 -4.7
set xlabel 'frequency (Hz)'
set ylabel 'amplitude (dB)'
set logscale x
set samples 500
set grid xtics ytics
...

I've run the application through strace, and I don't see any mention of environment variables being read - not even the verbose flags.

Has anyone else run into these issues? I'm using bash on Ubuntu 18.04.

bmc0 commented 5 years ago

Only the LADSPA plugin reads environment variables and loads configuration files.

If I specify a direct path, I run into another error:

Effects file paths must be prefixed with the @ character. Your command causes the program to attempt to read the file as audio data. The correct command would be:

$ ./dsp -pn @~/.config/ladspa_dsp/eq.txt

Your ladspa_dsp configuration looks fine, so the plugin should work.

NextDesign1 commented 4 years ago

Thank you for your help, that did it.

Thanks!