Just had a crash, did happen a few times before.
traps: spectrumserver[141947] general protection fault ip:55880a042f60 sp:7f0655cba6c0 error:0 in spectrumserver[558809f7e000+db000]
I found that error:0 implies a devide by zero in the code.
I have looked in the code you changed....and I found this....can this be the problem?
float peak_sample = max();
float desired_gain = std::min(desired_level / (peak_sample + 1e-15f), max_gain);
Not sure, but if the (peak_sample + 1e-15f) part becomes 0 it could happen.
No idea if it helps. Found it in utils/audioprocessing.cpp
The + 1e-15f is only there to make it never divide through zero :)
Why not check if peaksample is 0? If so make it the value 1e-15f.
Then it can never be 0. The way you do it now can cause 0 because of rounding.
Small chance it does, but I do believe it happens from time to time and causing the spectrumserver to crash.
You're way it can become 0 when peak_sample is -1e-15f, counted together they become 0.
Just a thought, I normally don't program with floating because of these problems.
Very rare edge case, may happen but you cant just dont code with floating point because of that. Especially not in DSP
In future version will be changed.
I code in drivers, like the Airspy_tcp or the RSP_tcp, they do not need floating to output 8bit ;)
That didn't take long, it crashed again, took less then 10 minutes:
[30847.925132] traps: spectrumserver[141947] general protection fault ip:55880a042f60 sp:7f0655cba6c0 error:0 in spectrumserver[558809f7e000+db000]
Location is the same....so it must be happening elsewhere....
And again....it's happening faster now...every few minutes...
That is good...
I have noticed that when it happens the RX888 is having messages in dmesg...
It may not be related but the USB ports where on auto-powersafe (=default!)...so I turned them ON all the time in my start-script.
# Turn USB on all the time.
echo on | sudo tee /sys/bus/usb/devices/*/power/control > /dev/null