I've been using Brutefir on an Odroid-XU4 sucessfully for a couple of years but only for the equalizer and it works well.
I recently obtaimed a UMIK-1 calibrated USB microphone so I could try doing room correction using REW. I've carried out left and
right tone sweeps and created filters using REW but REW creates .wav files and not .pcm although the filters are .pcm signed.
I tried converting .wav -> .pcm without much luck but eventually found that stripping off the first 44 bytes from the .wav converted
it into a .pcm. Suffice to say, I tried the .wav files natively, tried renaming to .pcm and then tried converting the .wav -> .pcm
and Brutefir produced no output with any of those files. so I went back to first principles and tried using the filters provided
with the example files. That didn't work either! There must be a fundamental problem somewhere!
Here is the config file I used - basically the one provided in the example files with only paths changed...
------------------------------------------------------------------------------------------------------------------------------------
## DEFAULT GENERAL SETTINGS ##
float_bits: 32; # internal floating point precision
sampling_rate: 48000; # sampling rate in Hz of audio interfaces. Must match sample rate of filter .pcm if present in config
filter_length: 16384,4; # length of filters
overflow_warnings: true; # echo warnings to stderr if overflow occurs
show_progress: false; # echo filtering progress to stderr
max_dither_table_size: 0; # maximum size in bytes of precalculated dither
allow_poll_mode: false; # allow use of input poll mode
modules_path: "/usr/lib/brutefir"; # extra path where to find BruteFIR modules
monitor_rate: false; # monitor sample rate
powersave: true; # pause filtering when input is zero
lock_memory: false; # try to lock memory if realtime prio is set
convolver_config: "/usr/share/squeezeboxserver/BrutefirDrc/wisdom/.brutefir_convolver"; # location of convolver config file
coeff "drc_l" {
filename: "/usr/share/squeezeboxserver/BrutefirDrc/filters/null-65k48-l.pcm";
format: "FLOAT_LE"; # file format
attenuation: 0.0; # attenuation in dB
blocks: -1; # how long in blocks
skip: 0; # how many bytes to skip
shared_mem: false; # allocate in shared memory
};
coeff "drc_r" {
filename: "/usr/share/squeezeboxserver/BrutefirDrc/filters/null-65k48-r.pcm";
format: "FLOAT_LE"; # file format
attenuation: 0.0; # attenuation in dB
blocks: -1; # how long in blocks
skip: 0; # how many bytes to skip
shared_mem: false; # allocate in shared memory
};
## INPUT DEFAULTS ##
input "l_in","r_in" {
device: "file" {path: "/dev/stdin";}; # module and parameters to get audio
sample: "S24_LE"; # sample format
channels: 2/0,1; # number of open channels / which to use
delay: 0,0; # delay in samples for each channel
maxdelay: -1; # max delay for variable delays
mute: false,false; # mute active on startup for each channel
};
## OUTPUT DEFAULTS ##
output "l_out","r_out" {
device: "file" {path: "/dev/stdout";}; # module and parameters to put audio
sample: "S24_LE"; # sample format
channels: 2/0,1; # number of open channels / which to use
delay: 0,0; # delay in samples for each channel
maxdelay: -1; # max delay for variable delays
mute: false,false; # mute active on startup for each channel
dither: false; # apply dither
};
# Digital room correction
filter "l_drc" {
from_inputs: "l_in"/0.00;
to_outputs: "l_out";
process: -1; # process index to run in (-1 means auto)
coeff: "drc_l";
delay: 0; # predelay, in blocks
crossfade: false; # crossfade when coefficient is changed
};
filter "r_drc" {
from_inputs: "r_in"/0.00;
to_outputs: "r_out";
process: -1; # process index to run in (-1 means auto)
coeff: "drc_r";
delay: 0; # predelay, in blocks
crossfade: false; # crossfade when coefficient is changed
};
# filter_attenuation=0.00
------------------------------------------------------------------------------------------------------------------------------------
And here is the relavent output from the log file...
======== brutefirwrapper rev 12 starting at 1497507338 2017-06-15 06:15:38
Resampling brutefir filter from 48000 to 44100
Patching brutefir input format from S24_LE to S16_LE
Patching brutefir output format from S24_LE to S16_LE
Traceback (most recent call last):
touch: cannot touch '/usr/share/squeezeboxserver/.brutefir_config': Permission denied
File "/usr/share/squeezeboxserver/Plugins/BrutefirDrc/Bin/brutefirwrapper", line 466, in read_tail
age = time.time()-os.stat(tail_filename).st_mtime
OSError: [Errno 2] No such file or directory: '/tmp/.BrutefirDrc-123/tail-00_1e_06_31_09_e8.pcm'
Output follows (1.775s)
BruteFIR v1.0m (November 2013) (c) Anders Torger
Internal resolution is 32 bit floating point.
Creating 4 FFTW plans of size 32768...finished.
Loading 2 coefficient sets...Memory allocation failure (0 bytes), terminating program.
Output complete (1.798s)
------------------------------------------------------------------------------------------------------------------------------------
In the log file the only relavent information, I think, is...
Loading 2 coefficient sets...Memory allocation failure (0 bytes), terminating program.
Output complete (1.798s)
That error was present using the files I converted from .wav -> .pcm as well. Bearing in mind that the equalizer alone works I'm fairly sure Brutefir is working properly so I'm guessing something is wrong with the config
file. I've tried with filters+eq and filters alone as shown above.
Any help or suggestions or advice appreciated.
Bob
Bob
Bob
======== brutefirwrapper rev 12 starting at 1497785525 2017-06-18 11:32:05
Resampling brutefir filter from 192000 to 44100
ignoring tail; it is 54s old
Output follows (0.443s)
BruteFIR v1.0m (November 2013) (c) Anders Torger
Internal resolution is 32 bit floating point.
Creating 4 FFTW plans of size 8192...finished.
Loading coefficient set...finished.
Warning: internal resolution not high enough to dither (outputs 0 - 1).
Warning: no support for clock cycle counter on this platform.
Timers for benchmarking may be unreliable.
Filters in process 0: 0
Filters in process 1: 1
Creating inverse inplace FFTW plan of size 16384 using wisdom...finished
Audio processing starts now
Readahead complete (0.774s)
peak: 0/0/-0.30 1/30/+0.93
peak: 0/0/-0.22 1/35/+0.93
peak: 0/0/-0.22 1/44/+0.93
peak: 0/193/+2.40 1/122/+1.88
peak: 0/304/+2.40 1/186/+1.88
peak: 0/304/+2.40 1/190/+1.88
peak: 0/317/+2.40 1/199/+1.88
peak: 0/416/+2.40 1/233/+1.88
peak: 0/485/+2.40 1/316/+2.15
peak: 0/489/+2.40 1/320/+2.15
peak: 0/498/+2.40 1/320/+2.15
peak: 0/498/+2.40 1/330/+2.15
peak: 0/498/+2.40 1/334/+2.15
peak: 0/559/+2.40 1/402/+2.16
peak: 0/715/+2.40 1/549/+2.16
peak: 0/750/+2.40 1/588/+2.16
peak: 0/758/+2.40 1/638/+2.16
peak: 0/759/+2.40 1/638/+2.16
peak: 0/779/+2.40 1/644/+2.16
peak: 0/779/+2.40 1/647/+2.16
peak: 0/806/+2.40 1/704/+3.16
Finished!
Output complete (209.603s)
and where would I put them in the following (my standard EQ config)?
## DEFAULT GENERAL SETTINGS ##
float_bits: 32; # internal floating point precision
sampling_rate: 192000; # sampling rate in Hz of audio interfaces
filter_length: 16384,4; # length of filters
overflow_warnings: true; # echo warnings to stderr if overflow occurs
show_progress: false; # echo filtering progress to stderr
max_dither_table_size: 0; # maximum size in bytes of precalculated dither
allow_poll_mode: false; # allow use of input poll mode
modules_path: "/usr/lib/brutefir"; # extra path where to find BruteFIR modules
monitor_rate: false; # monitor sample rate
powersave: true; # pause filtering when input is zero
lock_memory: false; # try to lock memory if realtime prio is set
convolver_config: "/usr/share/squeezeboxserver/BrutefirDrc/wisdom/.brutefir_convolver"; # location of convolver config file
logic:
"eq" {
{
coeff: "equalizer";
bands: 20, 40, 60, 100, 800, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 12000, 16000;
magnitude: 20/0.0, 40/5.0, 60/5.0, 100/5.0, 800/0.0, 1000/0.0, 2000/0.0, 3000/0.0, 4000/0.0, 5000/0.0, 6000/0.0, 7000/0.0, 8000/0.0, 9000/0.0, 10000/0.0, 12000/0.0, 16000/-3.0;
};
};
coeff "equalizer" {
filename: "dirac pulse";
shared_mem: true;
blocks: 4;
};
## INPUT DEFAULTS ##
input "l_in","r_in" {
device: "file" {path: "/dev/stdin";}; # module and parameters to get audio
sample: "S24_LE"; # sample format
channels: 2/0,1; # number of open channels / which to use
delay: 0,0; # delay in samples for each channel
maxdelay: -1; # max delay for variable delays
mute: false,false; # mute active on startup for each channel
};
## OUTPUT DEFAULTS ##
output "l_out","r_out" {
device: "file" {path: "/dev/stdout";}; # module and parameters to put audio
sample: "S24_LE"; # sample format
channels: 2/0,1; # number of open channels / which to use
delay: 0,0; # delay in samples for each channel
maxdelay: -1; # max delay for variable delays
mute: false,false; # mute active on startup for each channel
dither: true; # apply dither
};
# Add equalizer
filter "eq_l" {
from_inputs: "l_in"/0.00;
to_outputs: "l_out";
process: -1; # process index to run in (-1 means auto)
coeff: "equalizer";
delay: 0; # predelay, in blocks
crossfade: false; # crossfade when coefficient is changed
};
filter "eq_r" {
from_inputs: "r_in"/0.00;
to_outputs: "r_out";
process: -1; # process index to run in (-1 means auto)
coeff: "equalizer";
and is it just as above or should it be two entries...
from_inputs:"l_in"/3.2
from_inputs:"r_in"/3.2
Bob
Bob
Bob
Bob
I've got my NUC set up now and have been trying brutefir EQ and Filters. EQ works fine but Filters still does not work.
Filter is using the examples only - sample_filter_no_eq.txt, null-65k48-l.pcm, null-65k48-r.pcm,with no changes other than paths.
Here is the log output for both with EQ first followed by filter...
======== brutefirwrapper rev 12 starting at 1498464742 2017-06-26 08:12:22
Resampling brutefir filter from 48000 to 44100
ignoring tail; it is 58s old
Output follows (2.066s)
BruteFIR v1.0m (November 2013) (c) Anders Torger
Internal resolution is 32 bit floating point.
SSE capability detected -- optimisation enabled.
Creating 4 FFTW plans of size 32768...finished.
Loading coefficient set...finished.
Warning: internal resolution not high enough to dither (outputs 0 - 1).
Estimated CPU clock rate is 3092.907 MHz. CPU count is 4.
Filters in process 0: 0
Filters in process 1: 1
Creating inverse inplace FFTW plan of size 65536 using wisdom...finished
Audio processing starts now
Readahead complete (3.002s)
Finished!
Output complete (119.831s)
======== brutefirwrapper rev 12 starting at 1498406520 2017-06-25 16:02:00
Resampling brutefir filter from 48000 to 44100
Traceback (most recent call last):
File "/usr/share/squeezeboxserver/Plugins/BrutefirDrc/Bin/brutefirwrapper", line 579, in <module>
main()
File "/usr/share/squeezeboxserver/Plugins/BrutefirDrc/Bin/brutefirwrapper", line 123, in main
filter_name = patch_filter(filter_name,client_id,samplerate,in_format,opts.copy_sample_format)
File "/usr/share/squeezeboxserver/Plugins/BrutefirDrc/Bin/brutefirwrapper", line 181, in patch_filter
filter_body = patch_samplerate(filter_body,samplerate)
File "/usr/share/squeezeboxserver/Plugins/BrutefirDrc/Bin/brutefirwrapper", line 231, in patch_samplerate
filter_body,junk = re.subn(r'\bfilename\s*:\s*"(.*)"\s*;',resample_filter,filter_body)
File "/usr/lib/python2.7/re.py", line 166, in subn
return _compile(pattern, flags).subn(repl, string, count)
File "/usr/share/squeezeboxserver/Plugins/BrutefirDrc/Bin/brutefirwrapper", line 225, in resample_filter
'rate','-v',str(samplerate),
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
Thank you for the plugin and instructions for use. I tried them out as per instructions and couldn't get LMS to restart. All that was shown in the LMS logs was failure to start and continuous attempts to restart. I've reverted to my previous install to get LMS running again and will investigate by following your instructions one step at a time, restart LMS before going to the next step and look at the logs to see if they show anything of use. I'll try it out when I have lots of time so that I can take much more care. I'll get back to you when I've found the problem.
Bob