Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hackrf_sweep: add fftw wisdom support #863

Closed
gozu42 opened this issue Mar 23, 2021 · 1 comment · Fixed by #1368
Closed

hackrf_sweep: add fftw wisdom support #863

gozu42 opened this issue Mar 23, 2021 · 1 comment · Fixed by #1368
Labels
enhancement potential new feature

Comments

@gozu42
Copy link
Contributor

gozu42 commented Mar 23, 2021

(mainly a tracking issue to keep my thoughts/code and potential feedback on this in one place, not sure i can tag it enhancement myself)

currently hackrf_sweep uses fttw plans generated at startup, in MEASURE mode.
this leads to serious delays for some binwidth on some platforms (raspi).
for an example binwidth of 10kHz (fftsize 2004) the delay is ~33sec on a raspi, on a pc the same only takes 200ms.

fftw has a "wisdom" mechanism that allows saving fft plans to disk.
it handles "does this wisdom work for the requested fft config" on its own, so the same wisdom file could be used even when changing binwidth.

while at it, i would like to expose the different planner flags (estimate, measure, patient, exhaustive) as a commandline option.
and also add an option that prints the current plan. (fftw provides a mechanism for that)

the fftw wisdom api is a bit awkward, so the only way i see is to first try to plan with the WISDOM_ONLY flag, which returns NULL if no matching plan is found in wisdom, and in that case plan again without WISDOM_ONLY and write the now-new wisdom out to the given file.

a commandline way to study the planner performance outside of hackrf_sweep is: time fftwf-wisdom -m cof2004

@straithe straithe added the enhancement potential new feature label Mar 24, 2021
@gozu42
Copy link
Contributor Author

gozu42 commented Jan 27, 2022

trying to summarize the discussion we just had about this on discord.

  • a commandline option to set a wisdom file name like "-W wfn"
  • the wfn default to something in platform-specific tempdir
  • defaulting to tempdir means users are less likely to end up with an outdated/bogus wisdom file
  • it also means after each reboot (or other clearing of tempdir) the first sweep will be "slow" again
  • handle errors during save+load gracefully (there is just too much that can go wrong in all kinds of weirds way, just print an oops and move on, but dont fail hard)

ai6aj added a commit to ai6aj/hackrf that referenced this issue Oct 26, 2023
Fixes greatscottgadgets#1366
Add options to use/save to an FFTW wisdom file and specify plan
Addresses greatscottgadgets#863
mossmann pushed a commit that referenced this issue Nov 2, 2023
… save wisdom and specify plan (#863) (#1368)

* Call fftw_execute once prior to starting IQ streaming
* Add options to use/save to an FFTW wisdom file and specify plan
* Fix bug where using -P would also enable one-shot mode

Fixes #1366
Fixes #1260
Addresses #863
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement potential new feature
Projects
None yet
2 participants