Convolution FIR files with MPD

Cool stuff you can do with MPD. A place for you to put your hacks and patches, or be inspired by others'.
Post Reply
Ran
Posts: 151
Joined: February 25th, 2013, 3:47 am

Convolution FIR files with MPD

Post by Ran »

What will be the best way to use convolution FIR files (as wav) with MPD?

Thanks!

max
Forum team
Posts: 1108
Joined: January 15th, 2013, 3:43 pm

Re: Convolution FIR files with MPD

Post by max »

What's that?

Ran
Posts: 151
Joined: February 25th, 2013, 3:47 am

Re: Convolution FIR files with MPD

Post 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

max
Forum team
Posts: 1108
Joined: January 15th, 2013, 3:43 pm

Re: Convolution FIR files with MPD

Post by max »

Can you use MPD's "ffmpeg" filter plugin for that? https://www.musicpd.org/doc/html/plugin ... er-plugins

Ran
Posts: 151
Joined: February 25th, 2013, 3:47 am

Re: Convolution FIR files with MPD

Post 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"
}

max
Forum team
Posts: 1108
Joined: January 15th, 2013, 3:43 pm

Re: Convolution FIR files with MPD

Post 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.

Ran
Posts: 151
Joined: February 25th, 2013, 3:47 am

Re: Convolution FIR files with MPD

Post by Ran »

Can you provide an example?

max
Forum team
Posts: 1108
Joined: January 15th, 2013, 3:43 pm

Re: Convolution FIR files with MPD

Post by max »

No, I'm not an FFmpeg expert. The MPD manual link I gave you has a link to the FFmpeg documentation.

Ran
Posts: 151
Joined: February 25th, 2013, 3:47 am

Re: Convolution FIR files with MPD

Post by Ran »

I don't need help with the syntax. I need help understanding where to use it.

max
Forum team
Posts: 1108
Joined: January 15th, 2013, 3:43 pm

Re: Convolution FIR files with MPD

Post by max »


Ran
Posts: 151
Joined: February 25th, 2013, 3:47 am

Re: Convolution FIR files with MPD

Post 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?

max
Forum team
Posts: 1108
Joined: January 15th, 2013, 3:43 pm

Re: Convolution FIR files with MPD

Post by max »

Yes, you could do that, if the ffmpeg plugin can't do that already.
Note it's called "filters" not "filter".

Ran
Posts: 151
Joined: February 25th, 2013, 3:47 am

Re: Convolution FIR files with MPD

Post by Ran »

Developing new plugin is way over my head. Hopefully someone with ffmpeg expertise can chime in. Thanks.

Post Reply