mpxgen icon indicating copy to clipboard operation
mpxgen copied to clipboard

reduce CPU load?

Open hayguen opened this issue 4 years ago • 3 comments

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?

hayguen avatar May 03 '20 18:05 hayguen

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 avatar May 03 '20 22:05 Anthony96922

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

Anthony96922 avatar Aug 23 '20 21:08 Anthony96922

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.

Anthony96922 avatar Aug 01 '21 01:08 Anthony96922