greatscottgadgets / hackrf

low cost software radio platform
https://greatscottgadgets.com/hackrf/
GNU General Public License v2.0
6.24k stars 1.48k forks source link

Run fftw_execute() once on an empty buffer (Fix #1366), add option to save wisdom and specify plan (#863) #1368

Closed ai6aj closed 8 months ago

ai6aj commented 8 months ago

Runs fftw_execute() once on an empty buffer to make sure the plan is generated before streaming begins. Fixes #1366 and should fix #1260.

Implements #863, with some changes:

  1. Adds a -W option to specify a wisdom file. If the necessary wisdom does not exist (either because the file does not exist, or an equivalent or better plan does not exist in the file) we attempt to save it at program exit.

  2. Adds a -P option to specify the planner flags (estimate, measure, patient, exhaustive).

  3. There is no reason to use the WISDOM_ONLY flag; FFTW will automatically use the best plan it can find in the wisdom file that meets or exceeds the requested plan type. If one cannot be found, it will be generated and the associated wisdom will be saved for future use (see point 1) if the -W option is specified.

  4. FFTW already has a notion of a default system-wide wisdom file. If the -W option is not specified we attempt to load it; if it does not exist we don't complain. We do not attempt to update the system-wide wisdom file.

Some notes:

ai6aj commented 8 months ago

No idea what the firmware failures are all about as I haven't touched that code at all

martinling commented 8 months ago

This looks great! I've asked the folks from #1260 to test if it fixes the failure on the Pi Zero 2 W.

The build failures aren't your fault. It looks like the latest arm-none-eabi-gcc package in Homebrew is failing to build libopencm3 due to a missing header. It's happening on the master branch too.

mossmann commented 8 months ago

Thank you so much for the contribution!