From d199a74b2a5274120259b3ee964761fb2cf22208 Mon Sep 17 00:00:00 2001 From: Christophe Jacquet Date: Sat, 19 Apr 2014 23:25:13 +0200 Subject: [PATCH] Add compilation options to use the Pi's FPU and vector unit. This lessens CPU usage greatly --- README.md | 6 +++--- src/Makefile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 57000d8..b81cabb 100644 --- a/README.md +++ b/README.md @@ -99,8 +99,8 @@ Reception works perfectly with all the devices above. RDS Surveyor reports no gr CPU usage is as follows: * without audio: 9% -* with mono audio: 42% -* with stereo audio: 54% +* with mono audio: 33% +* with stereo audio: 40% CPU usage increases dramatically when adding audio because the program has to upsample the (unspecified) sample rate of the input audio file to 228 kHz, its internal operating sample rate. Doing so, it has to apply an FIR filter, which is costly. @@ -135,4 +135,4 @@ The samples are played by `pi_fm_rds.c` that is adapted from Richard Hirst's [Pi -------- -© [Christophe Jacquet](http://www.jacquet80.eu/) (F8FTK), 2014. Released under the GNU GPL v3. \ No newline at end of file +© [Christophe Jacquet](http://www.jacquet80.eu/) (F8FTK), 2014. Released under the GNU GPL v3. diff --git a/src/Makefile b/src/Makefile index 2e595d9..9afb03e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ CC = gcc -CFLAGS = -Wall -std=gnu99 -c -g -O2 +CFLAGS = -Wall -std=gnu99 -c -g -O3 -march=armv6 -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math app: rds.o waveforms.o pi_fm_rds.o fm_mpx.o $(CC) -o pi_fm_rds rds.o waveforms.o pi_fm_rds.o fm_mpx.o -lm -lsndfile