Giter Club home page Giter Club logo

Comments (3)

Notou avatar Notou commented on June 8, 2024

Hummm, yes, I do see this error message.
The surprising thing is that I recall trying opening multiple windows before (same version) without this issue.

This will need to be investigated.

from gr-bokehgui.

Notou avatar Notou commented on June 8, 2024

It would seem that only the waterfall sink (complex and float), and label blocks cause this error.
Unfortunately, I won't be able to look into it more in the next week or so.

from gr-bokehgui.

Notou avatar Notou commented on June 8, 2024

Skip to the end for the workaround
It may not seem like it, but I did not completely forget about the issue, and I believe I found where the problem is.
I'll try do describe it here for future reference:

Currently, the bokehgui code for one plot is separated in 2 (one could even say 3) components:

  • A c++ block that interfaces with gnuradio, receives new samples to display, if necessary does some processing (like FFT), and store data points in a buffer.
  • A python object that does the link between the c++ block, and the bokeh api. Creates bokeh plot objects, updates its parameters when required, and defines how to update the data points.
  • The actual bokeh objects.

When a user connects, the bokeh server create a brand new session for that user, and asks the bokehgui python code to populate a blank document with plots and widgets to display on the user's browser.
At that time, the python code creates a new instance of the bokeh plot object (plus, if applicable, an object to stream it data), stores the plot object into its plot attribute, and register a callback to be called at regular intervals (the update period).
Most plots have it so the callback function contains explicit reference to the plot object (and its data stream), so it does not need to refer to the self.plotattribute.
But the waterfall does not. It thus tries to feed new data to whatever object is currently stored. And, when a second session is created (by reloading the page, or opening a new one), the python code only stores the most recent one, but the callback of the older one keeps being called (at least for a while), so it tries to feed data to the wrong object, without having acquired the lock for it, hence the error.

The most basic fix should be to have the callback for the waterfall take the correct plot object as argument, like the other plots do.
But that would not solve the following underlying problem:
When a display parameter needs to be changed from the gnuradio side, like for instance the x axis of a frequency plot when center frequency is changed, the python code can only operate on the plot object it has stored, so only the latest opened tab would see it.
For that, the python code would need to store all the created bokeh plot objects, and a way to remove them from storage when the related session gets destroyed so we don't keep on piling up objects.

I believe I know how to do that, and it should not take too long.
But in the mean time, there actually is a workaround: Since the error is created when multiple sessions exists, one just need to make sure only one session is ever created.
For that, you need to supply a session id in the url you connect to for all browser windows, such as: http://localhost:5006/?bokeh-session-id=test_bokehgui
Here, you can put whatever string in place of test_bokehgui.

from gr-bokehgui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.