This project builds BruteFIR with PulseAudio support as addon for LibreELEC.tv based distributions.
As the patches to BruteFIR are not yet ready for inclusion in the official BruteFIR release, i do NOT use the orignal sources from Anders Torger's homepage for BruteFIR, but my own integration-repository.
The packaged BruteFIR supports the following IO modules:
pulse
for connecting to a PulseAudio-serveralsa
for traditional ALSA supportfile
for file-/pipe-supporteq
cli
Mixing different input-/output-modules has NOT been tested yet.
As there is no addon-repository available the addon and its requirements have to be installed via ZIP-file.
Copy resulting zip-file to libreelec-host or some other (USB-)storage-device.
Install addon using the menu Install from ZIP-file
.
FFTW3 has to be available as a shared library. It is provided as two separate addons that have to be installed.
BruteFIR loads its configuration from file /storage/.brutefir_config
.
The provided example in brutefir_config.example
will be copied in place if no existing config-file is found.
By configuring a PulseAudio device
-name the sound-server will auto-connect the sink-inputs and source-outputs to the configured and available sinks and sources.
Configure different application-names via param app_name
if you have multiple instances of BruteFIR connecting to the same PulseAudio-server.
The described audio-setup is provided by script /storage/.kodi/addons/brutefir/usr/share/brutefir/startup.sh
, which is executed on service-startup.
The loaded modules are then stored in /storage/.brutefir-pulseaudio.modules
.
The modules are unloaded on service-shutdown or -failure by /storage/.kodi/addons/brutefir/usr/share/brutefir/shutdown.sh
.
I've choosen this setup as it gives me a short and constant delay in audio-output when playing media in KODI.
Kernel-module snd-aloop
is missing, so the audio-signal is routed through PulseAudio.
By giving a null-sink the name BruteFIR
we get a monitoring output named BruteFIR.monitor
in PulseAudio.
This output will be picked up by BruteFIR's IO-module pulse
.
The filtered output from BruteFIR is available as a PulseAudio source-output, which has to be connected to an output for actual sound, e.g. the ALSA-device "default".
Load null-sink to loopback KODI-output to BruteFIRs input-stream
pactl load-module module-null-sink sink_name="BruteFIR"
Provide ALSA-card to PulseAudio by loading module module-alsa-sink
. The resulting sink will be named alsa_output.default
.
pactl load-module module-alsa-sink device=default
Declare null-sink as default output, BruteFIR will pickup audio from its monitor-out BruteFIR.monitor
.
pactl set-default-sink BruteFIR
You should hear sounds when reboot is completed.
In KODI settings Settings -> System -> Audio
the previously available ALSA-devices should be gone, because the PulseAudio module module-als-sink
already uses them.
If you don't hear any sounds by now, use the menu Settings -> System -> Audio
to switch KODI output to PulseAudio.
Sometimes the plugin fails to install. I'm not sure yet what ist causing this. Reboot and try again, it helped most of time. Or try deleting all plugin-files manually.
A short list of helpful commands for pulseaudio
pactl list sinks
pactl list sources
pactl list sink-inputs
pactl list source-outputs
systemctl start brutefir.service
systemctl stop brutefir.service
systemctl restart brutefir.service
Happy filtering :)