Anthony96922 / mpxgen

Command-line FM Stereo encoder with RDS (WIP)
GNU General Public License v3.0
21 stars 4 forks source link

reduce CPU load? #4

Open hayguen opened 4 years ago

hayguen commented 4 years ago

CPU load on Raspberry Pi 3B+ and 4B is around 70% or a bit below. a friend reported CPU load of 1 core just below 80% on Raspberry Pi 3B - without the "+".

i noticed fractional interpolations factor for both 44.1 kHz and 48.0 kHz input. is it possible to reduce the CPU load? - probably by using non-fractional interpolations somwhow?

Anthony96922 commented 4 years ago

Due to RDS encoder's design, this runs internally at a sample rate of 228 kHz. I don't know how this would be rewritten to run at 192 kHz.

Anthony96922 commented 4 years ago

The high CPU load is because both interpolations run on a single thread. Maybe someone can implement threading.

Anthony96922 commented 3 years ago

I've rewritten much of the code so it uses threading. I've also implemented a resampler for the RDS encoder so the MPX signal path runs at 192 kHz. This means integer interpolation is used for 48 kHz audio. The new code isn't finished yet, but should hopefully speed things up and reduce CPU usage. Please see the pthread branch for the changes.