Commit Graph

71 Commits

Author SHA1 Message Date
Sylvain Munaut 30dbdbde79 gr-fosphor/cmake: Fix FindFreetype2 to properly cache the include dir var
Without caching, this would cause a problem with headers not being found
if you did the cmake step twice because the FREETYPE2_FOUND var is cached
and so it wouldn't run through that script again and wouldn't set
FREETYPE2_INCLUDE_DIRS.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:40 +02:00
Sylvain Munaut b24ba23784 fosphor: Fix layout routing to avoid half pixel offset
'over' variable needs to be an integer or we'll end up shifting stuff
by half a pixel which causes weird render, especially for fonts.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:40 +02:00
Sylvain Munaut 5d9665c000 fosphor/gl_cmap_gen: Introduce a helper to set RGBA values from float R,G,B
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:40 +02:00
Sylvain Munaut 4c08178d89 fosphor/cl: Fix wrong length param when fetching CL_PROGRAM_BINARIES
This would cause a crash when using AMD's CPU OpenCL implementation

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:40 +02:00
Sylvain Munaut 4254a3a714 gr-fosphor: Export method to retrieve the underying QWidget
This is to allow usage in pure c++ flow graph

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:40 +02:00
Sylvain Munaut 2140ef7bb1 gr-fosphor: Add 'SPACE' as a 'freeze' control to pause the processing
In background samples are just discarded.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut 2fa5b6cf67 fosphor/gl: Fix the frequency axis when freq_{start,stop} are used
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut 223968ad8e fosphor: Automatically select the number of division depending on width
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut aa5b1de867 fosphor/gl_font: Add a method to compute the total width of a given string
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut 36cc3e2341 fosphor/axis: Allow variable number of divisions
Need to have an _even_ number of divisions though !

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut a176de27b8 fosphor/axis: Fix scaling of largest frequency
The largest frequency can be negative, make sure to account for this !

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut 351af1f7e5 gr-fosphor: Update to fosphor new 'render options' model and add zoom
Note that the d_zoom_* vars are kept as double to avoid error build-up
when changing them a lot from the UI.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut affd1a3eb7 fosphor: Update the test software to showcase the new display functions
Note that the zoom_* vars are kept as double to avoid error build-up
when changing them a lot from the UI.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut 4a97b3e5d0 fosphor: Add the concept of "channels" which are overlaid on the display
These are purely display things that allow to highligh chunks of spectrum
of interest. (like currently selected channel)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut 88227fea7f fosphor/cl: Properly release the FFT window memory buffer
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut 8fb8606c38 fosphor: Drawing code overhaul + Introduce 'render options'
There is a lot of parameters that have no influence on the internal
computations but solely affect the rendering call. The height / width
are the only two that were supported previously.

This commit re-structures the drawing code and introduces a lot more
of those parameters. Instead of just passing them all as arguments, a
'struct fosphor_render' is introduced to hold them.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:38 +02:00
Sylvain Munaut a6a5ad8616 fosphor/cl: Fix tex coordinate in bicubic color mapping shader
The texture coordinates didn't match what the normal OpenGL bilinear
mapper does. It was off by half a texel.

This is needed because the color in the texture is considered to be a
sample at the center of the texel. (hence 0.5f, 0.5f offset removed)

For more details on bilinear from OpenGL :

http://hacksoflife.blogspot.be/2009/12/texture-coordinate-system-for-opengl.html

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:38 +02:00
Sylvain Munaut 3dd8d53490 gr-fosphor: Introduce a new glctx_update call back to refresh context
This is required for OSX where you need to tell the GL context when resize
has occured and stuff like that.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-01-12 11:01:38 +01:00
Sylvain Munaut 4ca8954908 fosphor/main: Improve the error handling path of the benchmark utility
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-12-11 23:54:50 +01:00
Konstanty Bialkowski dadc1d14fa fosphor/build: Make clean target compatible with BSD
Author: Konstanty Bialkowski <konstanty@ieee.org>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-12-11 23:54:49 +01:00
Sylvain Munaut 4913fd79d9 fosphor/cl: Prefer AMD/NVidia GPUs
On system with an integrated gpu + external gpu, the integrated one looks
great "on paper". Plenty of local ram, plenty of compute units, ...

But in practice, it sucks against the external one. So here, we prefer
NVidia / AMD.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-12-11 23:54:49 +01:00
Michael Dickens 27ef84513e gr-fosphor/cmake: New FindFreetype2 to deal with include changes
This fixes build issues with newer freetype2 2.5 and above.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-12-06 13:35:07 +01:00
Michael Dickens bdd18cb2bc gr-fosphor/cmake: Use HINTS rather than PATHS for path from pkg-config
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-12-06 13:33:06 +01:00
Michael Dickens 5f7c5173ca gr-fosphor/cmake: Fix typo in FingGLFW3 status message
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-12-06 13:33:06 +01:00
Sylvain Munaut d58643fa89 gr-fosphor: Add proper dependency tracking in resource_data.c generation
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-12-06 13:28:44 +01:00
Sylvain Munaut f5cee5f826 fosphor: Fix double free in the init failure case
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-13 23:57:15 +01:00
Sylvain Munaut 32a28fc495 gr-fosphor/cmake: Require GNURadio 3.7.2
There is several things we need in it :

 - linux: the X multi-threading fixes
 - all: the flowgraph shutdown sequence fixes
 - all: the newest gr-fft window stuff

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-12 07:48:40 +01:00
Sylvain Munaut a2011455f4 gr-fosphor/cmake: Display install prefix in summary
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:07 +01:00
Sylvain Munaut fd3d6cf77d gr-fosphor: Allow to select custom FFT window from the gr::fft:window list
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:07 +01:00
Sylvain Munaut ce907419c7 fosphor: Make the FFT window dynamic
- It's not longer hardcoded / computed in the kernel, but computed
   once and read from constant memory
 - By default it uses a periodic Hamming window
 - But you can load any window as a simple array of float
 - Different types of window is deemed out-of-scope here. The default
   is provided just for convenience to have something valid.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:07 +01:00
Sylvain Munaut c9b6b9fd93 gr-fosphor/cmake: Import a copy of GnuradioConfig as FindGnuradio.cmake
The one currently shipped with GR is broken ... so don't depend on it.

The name change is needed for it to take precendence over the one in
the system directories.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:07 +01:00
Sylvain Munaut 3779600868 gr-fosphor/cmake: Switch to the new recommended GnuradioConfig
Rather than using our own copy of FindGnuradioRuntine

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:07 +01:00
Sylvain Munaut 8378696eea gr-fosphor/lib: Add the new source file "axis.c" to source list
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:07 +01:00
Sylvain Munaut 6d9396f686 gr-fosphor: Add frequency range (center/span) awareness
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:07 +01:00
Sylvain Munaut ba6024ee5f gr-fosphor: Setup a mechanism to apply settings in the processing thread
The setters can be called from any thrad and will just set the
member variables and a flag asking the main processing thread to apply
the new settings on the next iteration.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:07 +01:00
Sylvain Munaut 010face67b fosphor/gl: Add a proper "smart" frequency axis
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:07 +01:00
Sylvain Munaut 8e89f9cd8b fosphor/gl: Use the new glf_printf instead of manual sprintf/glf_draw_str
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:06 +01:00
Sylvain Munaut 7e12d64a69 fosphor/gl_font: Introduce new glf_printf convenience function
This avoids having to do a sprintf then a draw_str myself every time.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:06 +01:00
Sylvain Munaut 81a9ad16fd fopshor: Add frequency range (center/span) awareness
Although this is not actually used anywhere yet, but will be used in the
drawing routines to draw a proper scale.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:06 +01:00
Sylvain Munaut a2318a5994 gr-fosphor: Use the new fosphor_set_power_range call
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:06 +01:00
Sylvain Munaut ca3f391976 fosphor: Store the selected power range in the top level 'struct fosphor'
The CL code keeps its own copy since those values are tweaked to be
applied in the kernel. We may also need the callback in the future if
instead of storing them we reconfigure the kernel at that point.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:06 +01:00
Sylvain Munaut 3ccf1aa52d fosphor: Refactor to introduce more shared state between global/cl/gl
Originally I wanted the CL/GL part to be as separate as possible and
have no shared data. But it's too inconvenient since a beside the
CL / GL objects there is also configuration data that should be shared
and distributed between the two.

So instead we still have separate gl/cl state that are restricted but
the function act on a shared 'struct fosphor' object that contains
everything that's shared and exposed to both cl.c and gl.c

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:06 +01:00
Sylvain Munaut 68f0302bce fosphor: Misc typo & whitespace fixes
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:06 +01:00
Sylvain Munaut dfb5081b91 gr-fosphor: Link to python libraries if python is enabled
This is required for OSX. And although not strictly required for linux,
it doesn't hurt.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-06 18:53:34 +01:00
Sylvain Munaut e53ee91fef gr-fosphor/python: Improve error reporting is wx_sink_c failed import
Originally the symbol would just not be defined.

Now we keep the original import error context and re-raise it if we're
asked to instanciate the block. This should give the user better
visibility on what's wrong.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-05 09:43:07 +01:00
Sylvain Munaut 0ea1177108 gr-fosphor: Submit data for processing in adaptative batch sizes
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-04 22:24:22 +01:00
Sylvain Munaut 3e35c83ded fosphor/gl_cmap_gen: Use the float version of round
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-04 22:01:48 +01:00
Sylvain Munaut 4066201ca8 fosphor/fft: Fix the window formula
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-04 22:01:27 +01:00
Sylvain Munaut 869ba4d156 fosphor/cl: Use OpenCL 1.1 API for everything except OSX
It seems that some linux distro ship OpenCL 1.2 headers but a OpenCL 1.1
ICD ...

So we just use OpenCL 1.1 API everywhere and disable 1.1 deprecated
warnings.

OSX OTOH doesn't allow to disable the deprecated but at least ships
consistent headers/ICD so we use 1.2 is available.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-04 22:00:48 +01:00
Sylvain Munaut 180fd0042a gr-fosphor: Make the different GUI version optional
You'd don't have to have glfw, qt and wx all at once, you can select
which variant you want built.

Python support is also make fully optional

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-26 21:09:50 +02:00