Git Product home page Git Product logo

chicago-brick's Introduction

Chicago Brick: the Google Chicago Video Wall Software

Quick Start

To use this software, first download and install deno.

Next, clone the repo to your machine:

$ git clone https://github.com/google/chicago-brick.git

Then, to run the server in 1x1 mode with the gears module:

chicago-brick$ ./bin/run_1x1.sh -m gears

This should open a Chrome window to http://localhost:3000/?config=0,0,1920,1080. You should be able to see some gears rotating. If you don't see that, try running the npm install command again.

Or, to run the server in 2x2 mode with the gears module:

chicago-brick$ ./bin/run_2x2.sh -m gears

And open the client windows like so:

chicago-brick$ ./bin/start_2x2_clients.sh

You should be able to see the same thing with four browser windows instead.

You can play with different modules by substituting the gears argument with other names from chicago-brick/config/demo-playlist.json or from the various brick.json files within the demo_modules folder.

Geometry

The wall server needs to know the shape of the screens that make up the wall. At the moment, this shape must be a single polygon, though it can be concave. By default, the wall assumes that it's going to display on a 1920x1080 screen. To change this, you can use the --use_geometry flag to specify the shape in a turtle-like langauge. You can also specify the points in a JSON-formatted file and use the --geometry_file flag to pass the path to the file.

Modules

A chicago brick module is responsible for showing control across the wall. Modules are stored in a directory and contain a brick.json file with metadata about the module. The directory also contains the client and server parts to the module, which are executed on the clients or server respectively. These parts can be written in TypeScript or JavaScript, though TypeScript is strongly preferred. See examples in demo_modules.

The server learns about modules that can be shown via the --module_dir flag, which is scanned for any brick.json files. Playlists are only allowed to reference modules that the wall knows about.

Playlist

A playlist defines the order in which the wall should play modules. The playlist consists of layouts, each of which refers to either a specific list of modules or a pre-defined collection of modules. The layout will randomly select among its set of modules and play each for the specified module duration. After the layout duration expires, the next layout is shown. For example:

{
  "playlist": [
    {
      "modules": ["gears", "slither"],
      "duration": 600,
      "moduleDuration": 60
    },
    {
      "modules": ["matrix"],
      "duration": 600,
      "moduleDuration": 600
    }
  ]
}

Contributing

We welcome contributions of new modules and of improvements to the wall software itself! See the CONTRIBUTING file for some stuff you need to complete before you contribute.

Hopefully, this gets you developing!

โ€“ Chicago Brick Team

chicago-brick's People

Contributors

aarestad avatar applmak avatar artdent avatar bmt avatar dependabot[bot] avatar g-harel avatar iatkinson avatar jmegq avatar leadpipe avatar mattcruikshank avatar panfayang avatar pieps avatar plural avatar processprocess avatar wseng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chicago-brick's Issues

Write custom static-serve for modules.

The hack in webapp.js that wraps the module code in a define call (for proper use from the client) is terrible. We should write some real middleware for doing this.

Client network events are lost when running a single module

./bin/run_1x1.sh --module_duration 10 -m balls

Then open a client. The first module display works fine, but after transitioning (to balls again) the client display is all black. The logs show the client connecting for each module, but the server<-->client socket comms are spotty after the first module display.

From bit of digging into the network events it appears that the per-module socket connection is not being made (open event never fires).

Interestingly, if the playlist if modified to contain

  {
      "name": "balls",
      "path": "demo_modules/balls/balls.js",
      "title": "Bouncing Balls",
      "author": "Matt Handley"
  },
  {
      "name": "balls2",
      "path": "demo_modules/balls/balls.js",
      "title": "Bouncing Balls",
      "author": "Matt Handley"
  },

then ./bin/run_1x1.sh --module_duration 10 -m balls -m balls2 works as expected. Something about transitioning to a different module avoids the problem.

Note, issue manifests with other modules that use the network object too (first noticed for chicago-brick-live).

Allow for client-only and server-only modules

Right now, there's no good way to have client-only or server-only code. Add support for this, potentially disallowing shared code in the module with register by having two separate 'main' files.

As a first step, write down a design of such a thing and the tradeoffs there.

Introduce discontinuity API to state

Right now, we use tricks to infer discontinuities in the parametrized state space on the client (assigning null for a value, for example). state should support this explicitly, with specific behavior of each interpolator when inside of an interval of discontinuity.

Fix timer to work for long periods of time

When the server has been running for a while, we lose some timing resolution, which destroys our state interpolation on the clients. Implement a method for being able to reset the current time back down to some reasonable number.

Fix client state machines to be robust to concurrent loadModules

If two 'loadModule' events are sent to a client in rapid succession, some aspects of the global state management fail to execute properly. This is because we set up a bunch of these globals as soon as the event arrives, rather than as soon as the state machine is actually ready to show the module. This can result is all kinds of bugs, and is prerequisite to #45, which might generate loadModule events at a high rate.

Stop time winding backwards in the module interface

Occasionally, time can wind backwards from the perspective of the client (as when the server is restarted). Rather than forcing module implementors to handle negative deltas, we should detect this situation and prevent this annoying detail from leaking into the module's tick/draw methods.

Fix server->client initialization messages getting dropped

Messages sent from server via network are dropped if clients haven't yet opened a connection on the same namespace. This makes initialization things (that one would normally put in willBeShownSoon) super annoying. Fix this by queuing such messages until the client actually connects.

Setup Travis CI (or equivalent) for chicago-brick

Tests are currently run with a githook before commit. Having a Travis job would make PR review easier (no leap of faith or need to run branch locally) and will keep chicago-brick healthy an easier task as development continues.

Simplify module state machines

Rather than having to pass a bunch of random individual fields around to the next state, create a struct that better represents "a module that is being displayed".

Improve status page

This issue tracks improvements to the status page:

  • Add ops to the page, like rebooting specific clients or the server process itself.
  • Add a better UI to modify the playlist
  • Add better monitoring about what the server is doing, including data like current RAM or CPU usage. Bonus points if we can track it over time and also mark transitions to help detect leaks, etc.

Pull title card config into "title" key in the config

Right now, it's tricky to add more options to the title card generator, as 'title' and 'author' are plumped specially through the whole module set manager on the server & client. Instead, just blindly copy 'title' everywhere, and move 'author' (along with 'path') as a key inside of the 'title' object. This should have the effect of removing a bunch of code & making it easier to extend the title card with more options later.

Allow modules to publish their duration

Right now, there's no way for modules that only want to display for a specific duration to do that without hacking an estimated duration into the playlist. Fix this so that, say, the video module can report its intended duration to the framework.

Support multi-file modules

Right now, multi-file modules don't work, because we eval a blob of code from the client. Fixing #83 should get us to the point where we are serving up modules over HTTP and requesting them via requirejs, which is a first step. In fact, after that issue is closed, the client should work with multi-file modules with no problem.

That is not true for the server, however, which still uses the old safeEval method. Even weirder, the safeEval method uses the built-in node require method to do ITS requiring, which caches loaded files. A dep from modules/a.js to modules/b.js will result in the client getting the freshest a and b, due to our cache limits and the server getting the newest a (because we manually read it from the fs), but the OLDEST b (because node's require cached it).

So, when requiring via node's require, we must wipe any deps after the module is finished loading. This should be easier than in the client, because node's require is synchronous.

Remove all implicit globals in module definitions

Implicit globals were initially a big speed improvement, but they affect debugging because they change the line numbers in the client-side eval'd module.

Fix this by removing the remaining implicit globals.

Add a client-perf mode

Add a mode to the clients (via url param, perhaps) that will log a warning if a client draw is too slow (> 16ms).

Improve module debuggability by using custom eval wrapper

Our current eval wrapper ( @artdent's fork of vm-shim) adds a bunch of:

var NAME = sandbox['NAME'];

lines to the top and bottom of the eval'd script. This makes line numbers in Errors basically worthless. Switch to using a custom eval wrapper, which does a better job of handling these line numbers.

Add more cleanup assertions & guarantees to client

To help ensure that things are always disposed when a module fades out, write the necessary wrappers around methods like setInterval to ensure that the framework can dispose of various timers. Furthermore, check to ensure that the number of DOM elements doesn't change.

Simplify module loading

I attempted to work on #45, but the module/playlist loading code is just WAY TOO COMPLICATED. This bug will track the work necessary to really fix this.

Make chicago-brick modules into npm modules

Setting up a new chicago-brick install could be as simple as:

npm install --save chicago-brick 
npm install --save my-cool-brick-module

This would then produce a package.json file that describes the chicago-brick installation (yay for easy sharing). The package.json file could also be expanded to include any module configuration (e.g., configure the slideshow to show specific media).

chicago-brick/module versioning can (and should) be managed using npm peer dependencies. This also keep modules from breaking when chicago-brick introduces a major revision (breaking change).

Fix /status page playlist update

During applmak@'s big module refactoring, /status's playlist updates stopped working, because we error out when attempting to define a new module with a name that's already registered. Fix this by clearing out the already-registered modules when performing a playlist update (or reusing the ones that are already defined).

repo needs instructions for API keys for youtube, flickr, drive, etc

right now, config/demo-playlist.json plays a bunch of stuff that doesn't work unless you go and configure API keys. The docs for that are bad and the feedback for it is bad.

In addition to better instructions, the modules should have a way to say they are unhealthy and be skipped by the server if their API keys aren't available, for example.

Fix debug channel coloring

This should make it easier to debug issues, because we can rely on certain channels being a certain color.

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.