Closed tmiw closed 1 year ago
Apparently with this PR LPCNet is basically real time on the Pi 4B now. lpcnet_enc
seems to only take 0.3-0.4s and wia.wav is 4.2s long (per Audacity).
Of course, it's just real time, so it still might not perform well enough without bringing in additional changes from upstream.
Thanks @tmiw - did you listen to a few sample files to confirm it is working OK?
Thanks @tmiw - did you listen to a few sample files to confirm it is working OK?
Seems to work okay with wia.wav and all.wav but I don't detect much if any difference in the resulting audio (which is probably a good thing).
However, I did notice a compiler error on the Raspberry Pi 3 but that may be because I'm running an older OS on it. Will need to confirm with a newer SD card.
Turns out that the compiler errors were due to the new vec_* files containing some aarch64 specific code. After removing that, the Pi 3B+ gives me the following results for master:
master:
pi@piaware:~/LPCNet/build/src $ time (sox ../../wav/wia.wav -t raw -r 16000 - | ./lpcnet_enc -s | ./lpcnet_dec -s > /dev/null)
...
real 0m50.840s
user 0m53.434s
sys 0m0.135s
pi@piaware:~/LPCNet/build/src $ time (sox ../../wav/wia.wav -t raw -r 16000 - | ./lpcnet_enc -s | ./lpcnet_dec -s > /dev/null)
...
real 0m51.135s
user 0m53.744s
sys 0m0.144s
pi@piaware:~/LPCNet/build/src $ time (sox ../../wav/wia.wav -t raw -r 16000 - | ./lpcnet_enc -s | ./lpcnet_dec -s > /dev/null)
...
real 0m51.307s
user 0m53.776s
sys 0m0.250s
pi@piaware:~/LPCNet/build/src $
=> 51.094s average
vs. this PR:
pi@piaware:~/LPCNet/build/src $ time (sox ../../wav/wia.wav -t raw -r 16000 - | ./lpcnet_enc -s | ./lpcnet_dec -s > /dev/null)
...
real 0m35.547s
user 0m38.187s
sys 0m0.204s
pi@piaware:~/LPCNet/build/src $ time (sox ../../wav/wia.wav -t raw -r 16000 - | ./lpcnet_enc -s | ./lpcnet_dec -s > /dev/null)
...
real 0m35.562s
user 0m38.273s
sys 0m0.220s
pi@piaware:~/LPCNet/build/src $ time (sox ../../wav/wia.wav -t raw -r 16000 - | ./lpcnet_enc -s | ./lpcnet_dec -s > /dev/null)
...
real 0m37.578s
user 0m39.662s
sys 0m0.560s
pi@piaware:~/LPCNet/build/src $
=> 36.229s average (30% improvement)
This PR integrates the latest
vec_*.h
files from the upstream repo. As a result, we end up with the following performance improvements:macOS x86_64 (2019 MacBook Pro):
master
:=> 1.412s average
This PR:
=> 1.255s average (~10% speedup)
macOS aarch64 (M1 Mac Mini)
master
:=> 0.871s average
This PR:
=> 0.611s average (~30% speedup)
Raspberry Pi 4 (aarch64)
master
:=> 6.634s average
This PR:
=> 4.405s average (~30% speedup)