Exporting from Linux to Pi

(mint13 to raspbian jessy in this case)

trying to export something from Linux to run on the Pi. The application is successfully created (as application.linux-armv6hf) and copied over.

running it on the Pi gives me the following though

Invalid maximum heap size: -Xmx4096m
The specified size exceeds the maximum representable size.
Error: could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

changing the value in the generated script fixes this. 2048 is still too much. 1024 works.

However, i then get another error

java: symbol lookup error: /media/tmp/jogamp_0000/file_cache/jln.../jln.../libnewt.so: 
    undefined symbol: bcm_host_init

which apparently is required if you want to use opengl (which i do)

Comments

  • i'll post the code here:

    NoddyShader.pde

    // Noddy GLSL Shader
    PShader shader;
    
    void setup() {
      size(400, 400, P2D);
      shader = loadShader("frag.glsl", "vert.glsl");
    }
    
    void draw() {
      background(0);
      shader.set("time", frameCount * 2.0); 
      shader(shader);
      rect(0, 0, 400, 400);
    }
    

    data/frag.glsl

    #ifdef GL_ES
    precision mediump float;
    precision mediump int;
    #endif
    
    uniform float time;
    
    void main() {
      float t = .5 * (gl_FragCoord.x - gl_FragCoord.y);
      float r = .5 + .5 * sin(radians((t + 2.1 * time) * .35 + 30));
      float g = .5 + .5 * sin(radians((t + -3.2 * time) * .41 + 90));
      float b = .5 + .5 * sin(radians((t + 4.6 * time) * .57 + 45));
      gl_FragColor = vec4(r, g, b, 1.0);
    }
    

    data/vert.glsl

    #define PROCESSING_COLOR_SHADER
    
    uniform mat4 transform;
    
    attribute vec4 vertex;
    
    void main() {
      gl_Position = transform * vertex;    
    }
    
  • which brings me to another problem: when i run the above in processing on the PI itself i get

    Cannot link shader program: Unknown error 
    

    do i need a version number in there? are the libraries different?

  • edited March 2016

    #version 110 didn't work, nor #version 130

  • ok, i tried the new opengl drivers mentioned here

    https://github.com/processing/processing/wiki/Raspberry-Pi#graphics

    and that was more helpful, telling me that version 100 and 120 were supported. i changed it to 120 and that is now working!

  • note to self, don't run things in fullscreen until you know they don't lock up

    in summary then:

    Exporting glsl sketches from linux to pi isn't great at the moment.

    GLSL sketches run from processing on the pi work with the Feb 2016 raspbian update, see wiki link above

Sign In or Register to comment.