Friday, May 18, 2018

SoX on steroids - Part 2

As some people were asking me about sox performance on the RPI, I now did some testing.

I ran pretty much the same benchmarking tests on my PI3 as I did on the NUC.




My RPI3 was configured according to my earlier posted "optimised" OS settings.

The key-setting that's having a major impact on this exercise is the CPU clock that I'm running at 800MHz in "optimised" mode. And of course CPU throttling is turned off ("force_turbo=1"). 
With higher CPU clockrates you can expect a pretty linear increase on below results.

Again. I've been using three different sox binaries.

1. I installed LMS on my Arch Linux ARM system and took that statically linked sox binary
2. I installed the Arch Linux ARM distro supplied sox binary
3. I compiled my own sox binary

I used the same flac test-file and options as I've been using in the earlier sox benchmarking exercise on my NUC. A 44.1 flac converted to 352k8 at highest quality.

All concerned files have been stored on /tmp, which is mounted as tmpfs (ramdisk), to avoid slowdowns caused by sd-card access.

No other apps (LMS, squeezelite, etc.) were running.


Here are the results:

****************************
Binary = /tmp/sox-armhf-lms

real 26m35.521s
user 26m32.990s

sys 0m1.369s

****************************
Binary = /tmp/sox-arch

real 4m2.204s
user 2m36.392s
sys 0m3.082s

****************************
Binary = /tmp/sox-arm-compiled

real 2m38.489s
user 2m36.702s
sys 0m1.428s

****************************

26 and a half minute processing time is a devastating finding. I first thought my
PI hung up. Folks. This just doesn't work!!

A net conversion time shouldn't be longer than the duration of the actual song title.

The benchmark shows a factor 10 difference between my own compiled to the LMS supplied sox binary.
On my NUC machine it's been factor 7.5 beween LMS-sox and my compiled sox.

That's actually quite interesting. We're looking at pretty much the same ballpark. 
These rather huge factors look like a pattern to me. 

Just to keep things into perspective, on my NUC the conversion time was 15 seconds 
using my own compiled binary though. 
We basically look at another factor 10 slowdown from my i5 Broadwell NUC to RPI3.

It turns out, pretty much all RPI sox performances - at my chosen configuration - are pretty much off track.

Above results underline that advanced DSP work is all but recommended to be run on a PI - even on a PI3!

I'm pretty sure using the LMS-sox-binary will lock up the system in a realtime DSP environment. The other binaries will cause a CPU load that'll hit the roof.


*******************
Bottom line. If you run LMS on whatever machine -- at least switch the sox binaries!
Or tell the maintainers to do it!!!! 

On a PI you better avoid advanced DSP jobs using sox altogether!  

And actually...
...I'd recommend to buy a DAC that doesn't require external SRC in the first place.
Usually ESS Sabre based DACs didn't show any effects from SRC. 

Enjoy.



1 comment:

  1. funny you did this testing because I was about to ask you if your custom SOX was able to upsample from a RPi.... not a chance, I will keep my Intel server running. Is your Sox windows compatible?

    ReplyDelete