ok, another try... this time using a library that generally looks interesting, as has other dsp stuff
https://github.com/cycfi/Q
its very modern, so needs c++17, you cannot compile in bela IDE - I cross compiled it
in repo at : https://github.com/TheTechnobear/BelaPatches/tree/dev/c%2B%2B/pitchd
ok, comparison ... Im a little confused about :
so I look at stats with
top - top -p pgrep pitchd
and
sched/stat watch -n 0.5 cat /proc/xenomai/sched/stat
heres is what i get:
dywapitchtracker
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
8896 root 20 0 17132 14616 4492 S 49.7 2.9 0:14.01 pitchd
CPU PID MSW CSW XSC PF STAT %CPU NAME
0 0 0 37850266 0 0 00018000 85.6 [ROOT]
0 9213 5 5 13 0 000600c0 0.0 pitchd
0 9223 1 1 2 0 000600c0 0.0 pt_task_
0 9226 1 434530 434532 0 00048046 12.5 bela-audio
0 0 0 21776915 0 0 00000000 0.7 [IRQ16: [timer]]
0 0 0 217354 0 0 00000000 0.8 [IRQ180: rtdm_pruss_irq_irq]
so I think thats...
50% - linux
12.5% bela audio .. , 85.6% root
what is root?
note: IDE said something like 77% ??
q lib
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
9867 root 20 0 15868 14244 4508 S 0.0 2.8 0:00.12 pitchd
CPU PID MSW CSW XSC PF STAT %CPU NAME
0 0 0 38558036 0 0 00018000 77.6 [ROOT]
0 9867 1 1 6 0 000600c0 0.0 pitchd
0 9876 1 119946 119948 0 00048046 20.4 bela-audio
0 0 0 22172066 0 0 00000000 0.8 [IRQ16: [timer]]
0 0 0 60024 0 0 00000000 0.9 [IRQ180: rtdm_pruss_irq_irq]
ok, so thats zero in linux space.
20.4 in bela-audio , and 77.6 in root?
ive no idea what the IDE would say, since i cannot run it in the ide π
this is not that surprising, since with q_lib all processing is done in the audio thread,
whereas dywapitchtracker its all done in a separate low priority thread.
there is no reason, I cannot move q_lib to a separate thread.
note: there is a test tone being generated in exactly the same way in both examples.
for dywapitchtracker the ONLY thing done apart from the test tone, is to copy samples to an array.
SO... id say 12.5% is basically producing the test tones.
in which case - Im assuming that means the qlib pitchtracker is only taking 8%?
thoughts?
EDIT: i'm using a 16 sample buffer (-p 16)
EDIT: ah...i remember talking to @giuliomoro about ROOT before...
this is just 'left over' xenomai , so yeah, Im only interested in bela-audio
and looking at bela-audio, on the simple examples , min cpu is about 12% so that tallies.
if Im reading @giuliomoro comments about overhead in above post - 8% is pretty reasonable.
Im wondering about dywapitchtracker if its on the audio thread... since although its reporting high load, that is presumably partly because its being run at a very low priority?!
EDIT: nah, that has underruns, and kills the board π
EDIT : Wow....
drop qlib down to using a 64 sample buffer (-p 64) , and Im down to 14.8% - thats seems to be just a 2.3.% overhead!
I think thats enough for me to call this done π