Page 1 of 1

Convolution FIR files with MPD

Posted: March 8th, 2020, 1:18 am
by Ran
What will be the best way to use convolution FIR files (as wav) with MPD?

Thanks!

Re: Convolution FIR files with MPD

Posted: March 8th, 2020, 1:32 pm
by max
What's that?

Re: Convolution FIR files with MPD

Posted: March 8th, 2020, 4:46 pm
by Ran
Convolution files are used within various DSP solutions when you want to address room correction acoustics. You can create these files to be used with ffmpeg. For example, you can pass the following string:

ffmpeg convOut=-i conv_file.wav -lavfi afir

You can look at this as equalization in the digital domain. In essence, MPD will just have to pass these parameters to ffmpeg. It will not need to create these files.

More info here:

https://minimstreamer.com/userguide.htm ... 0filtering

https://en.wikipedia.org/wiki/Finite_impulse_response

Re: Convolution FIR files with MPD

Posted: March 9th, 2020, 8:11 am
by max
Can you use MPD's "ffmpeg" filter plugin for that? https://www.musicpd.org/doc/html/plugin ... er-plugins

Re: Convolution FIR files with MPD

Posted: March 9th, 2020, 3:49 pm
by Ran
Is there a way to pass various parameters to ffmpeg in the decoder plugin settings?

Something like:

decoder {
plugin "ffmpeg"
enabled "yes"
options "convOut=-i /filters/*.wav -lavfi afir"
}

Re: Convolution FIR files with MPD

Posted: March 9th, 2020, 6:54 pm
by max
Don't mix up the "ffmpeg" command-line tool and the "FFmpeg" library. You can't use command-line options, but you can use the full filtergraph syntax.

Re: Convolution FIR files with MPD

Posted: March 9th, 2020, 7:39 pm
by Ran
Can you provide an example?

Re: Convolution FIR files with MPD

Posted: March 10th, 2020, 7:07 am
by max
No, I'm not an FFmpeg expert. The MPD manual link I gave you has a link to the FFmpeg documentation.

Re: Convolution FIR files with MPD

Posted: March 10th, 2020, 11:45 am
by Ran
I don't need help with the syntax. I need help understanding where to use it.

Re: Convolution FIR files with MPD

Posted: March 10th, 2020, 2:53 pm
by max

Re: Convolution FIR files with MPD

Posted: March 10th, 2020, 3:05 pm
by Ran
So based on the documentation, this is what I should include in the conf file?

filter {
plugin "dsp"
name "Convolution"
}

And then include the filter in the audio output:

audio_output {
type "alsa"
name "my ALSA device"
device "hw:0"
filter "Convolution"
}


So, if this is right, do I need to develop a new plugin called dsp that will apply the convolution files?

Re: Convolution FIR files with MPD

Posted: March 10th, 2020, 3:18 pm
by max
Yes, you could do that, if the ffmpeg plugin can't do that already.
Note it's called "filters" not "filter".

Re: Convolution FIR files with MPD

Posted: March 10th, 2020, 3:29 pm
by Ran
Developing new plugin is way over my head. Hopefully someone with ffmpeg expertise can chime in. Thanks.