BruteFIR is a convolver-application to manipulate audio-streams for e.g. equalizing, Digital-Room-Correction, active crossover of passive speakers, etc.
OSMC is limited to the ALSA sound API. This explains how to insert BruteFIR into the ALSA audio-chain on OSMC:
OSMC/KODI -> ALSA plug-in "plug" -> ALSA loopback-device "BruteFIR" -> BruteFIR -> ALSA soundcard
Insert into /etc/asound.conf:
#
#
# OSMC/KODI cannot connect an audio-stream directly to BruteFIR via a PIPE
# and BruteFIR uses a fixed number of channels, format and sampling-rate.
# The sampling-rate/format-conversion in OSMC/KODI is a CPU-hog
# which renders it unusable on low-power machines like the Raspberry PI 2B.
#
# So we need to connect the output of OSMC/KODI via the ALSA loopback-device to
# the input of BruteFIR and the ALSA plug-in "plug" for sampling-rate/format-conversion.
#
#
# OSMC/KODI -> ALSA plug-in "plug" -> ALSA loopback-device "BruteFIR" -> BruteFIR -> ALSA soundcard
#
#
# Run the following commands as root to load the ALSA loopback-device on boot automatically:
#
# echo 'snd-aloop' > /etc/modules-load.d/brutefir-alsa-loopback.conf
# echo 'options snd-aloop id=BruteFIR enable=1 pcm_substreams=1 pcm_notify=1' > /etc/modprobe.d/brutefir-alsa-loopback.conf
#
#
# Corresponding BruteFIR input configuration:
#
# input 0,1,2,3,4,5,6,7 {
# device: "alsa" { device: "hw:BruteFIR,1"; ignore_xrun: true; };
# sample: "S32_LE";
# channels: 8;
# };
#
# Create an ALSA default audio-device for the ALSA loopback-device.
pcm.!default {
# Use the ALSA plug-in "plug" for rate-/format-conversion.
type plug
# Forward the audio stream of OSMC/KODI to the ALSA loopback-device
slave {
pcm {
# Direct hardware access
type hw
# Loopback card name
#
# Has to match "id" in the options of the snd-aloop module
card "BruteFIR"
# Loopback device ID
device 0
# Number of audio channels
#
# Has to match the number of channels in OSMC/KODI (e.g. 7.1 -> 8)
# and "channels" in the BruteFIR input configuration
channels 8
# Format of audio stream
#
# Has to match the format defined in the "sample"-tag
# of the BruteFIR input configuration
format "S32_LE"
# Sampling-rate of audio stream
#
# Has to match the sampling-rate defined in the global "sampling_rate"-tag
# of the global BruteFIR configuration
rate 96000
}
}
}
# Create an ALSA default control-device for the ALSA loopback-device.
ctl.!default {
# Direct hardware access
type hw
# Loopback card name
#
# Has to match "id" in the options of the snd-aloop module
card "BruteFIR"
}
Add an output-configuration for your soundcard to the BruteFIR-configuration like:
output 0,1,2,3,4,5,6,7,8,9 {
device: "alsa" { device: "hw:FCA610,0"; ignore_xrun: true; };
sample: "S32_LE";
channels: 10;
};
Create filters in the BruteFIR-configuration connecting the input- and output-channels:
##### Line/headphone A (Downmix 7.1 -> 2.0 Stereo)
filter "Front-/Rear-/Center-/LFE-/Side-Left" { from_inputs: 0,2,4/0.5,5/0.5,6; to_outputs: 0; coeff: -1; };
filter "Front-/Rear-/Center-/LFE-/Side-Right" { from_inputs: 1,3,4/0.5,5/0.5,7; to_outputs: 1; coeff: -1; };
##### Line surround (Downmix 7.1 -> 5.0)
filter "Line Front-/LFE-Left" { from_inputs: 0/0.5,5/0.25; to_outputs: 2; coeff: -1; };
filter "Line Front-/LFE-Right" { from_inputs: 1/0.5,5/0.25; to_outputs: 3; coeff: -1; };
filter "Line Rear-/Side-Left" { from_inputs: 2/0.5,6/0.5; to_outputs: 4; coeff: -1; };
filter "Line Rear-/Side-Right" { from_inputs: 3/0.5,7/0.5; to_outputs: 5; coeff: -1; };
filter "Line Center" { from_inputs: 4/0.5; to_outputs: 6; coeff: -1; };
Start BruteFIR as root-user, e.g.
sudo /usr/bin/brutefir -nodefault /home/osmc/.brutefir_config