TIS/TSM ERROR & crash while looping()

edited May 2018 in Library Questions

anyone know why this is crashing right when it should loop?

import processing.sound.*;

// Declare the processing sound variables 
SoundFile sample;
Amplitude rms;

// Declare a scaling factor
float scale=1;

// Declare a smooth factor
float smooth_factor=0.25;

// Used for smoothing
float sum;

PImage img;       // The source image
int cellsize = 2; // Dimensions of each cell in the grid
int columns, rows;   // Number of columns and rows in our system

public void setup() {
  size(800, 1000, P3D); 
  img = loadImage("...");  // Load the image
  columns = img.width / cellsize;  // Calculate # of columns
  rows = img.height / cellsize;  // Calculate # of rows

    //Load and play a soundfile and loop it
    sample = new SoundFile(this, "...");

    // Create and patch the rms tracker
    rms = new Amplitude(this);


void draw() {
  // Begin loop for columns
  for ( int i = 0; i < columns; i++) {
    // Begin loop for rows
    for ( int j = 0; j < rows; j++) {
      int x = i*cellsize + cellsize/2;  // x position
      int y = j*cellsize + cellsize/2;  // y position
      int loc = x + y*img.width;  // Pixel array location
      color c = img.pixels[loc];  // Grab the color
      // Calculate a z position as a function of mouseX and pixel brightness
      //float z = width/2 * brightness(img.pixels[loc]) - 20.0;
        float rms_scaled=sum*width/10 * brightness(img.pixels[loc]) - 20.0;

     // smooth the rms data by smoothing factor
    sum += (rms.analyze() - sum) * smooth_factor;  

    // rms.analyze() return a value between 0 and 1. It's
    // scaled to height/2 and then multiplied by a scale factor

      // Translate to the location, set fill and stroke, and draw the rect
      //translate(x + 300, y + 250, rms_scaled);
      translate(x + 200, y + 200, rms_scaled);
      fill(c, 204);
      rect(0, 0, cellsize, cellsize);


  • crashing

    this could mean anything. please be more specific.

  • @koogs the pop up states that the sketch unexpectedly quit. here is all the info i'm receiving via console:

    2018-05-02 18:52:16.113 java[47767:190495] pid(47767)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
    ERROR: /synth/map/input: Audio input index 0 out of range for synth 2
    # A fatal error has been detected by the Java Runtime Environment:
    #  SIGSEGV (0xb) at pc=0x000000012f2b764a, pid=47767, tid=0x000000000001b603
    # JRE version: Java(TM) SE Runtime Environment (8.0_162-b12) (build 1.8.0_162-b12)
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.162-b12 mixed mode bsd-amd64 compressed oops)
    # Problematic frame:
    # C  [libmethcla.dylib+0xb64a]  Methcla::Audio::EnvironmentImpl::nodeEnded(Methcla::Audio::NodeId)+0x5a
    # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
    # An error report file with more information is saved as:
    # /Users/je5c/hs_err_pid47767.log
    # If you would like to submit a bug report, please visit:
    #   http://bugreport.java.com/bugreport/crash.jsp
    Could not run the sketch (Target VM failed to initialize).
    For more information, read revisions.txt and Help → Troubleshooting.
  • We've seen that before, the TIS/TSM thing. Look at the bug reports on the processing github site, links on the main processing website. Or search here.

  • I suggest you check if the minim library to see if you coulduse it as a replacement to the processing.sound lib.


  • knew i'd seen it:


    not sound related apparently, more video card...

    try using something other than P3D, maybe P2D. or leaving it blank.

  • (but, yes, minim is more mature and more stable than the sound library, so use that as well)

  • @koogs - thanks for the link! i will try something other than P3D... minim always works for me, but i just tried running a basic sketch and this happened :)] Screen Shot 2018-05-02 at 21.00.52

  • edited May 2018

    lousy pic ... it says the same TIS/TSM again:

    2018-05-02 21:00:39.907 java[66121:264097] pid(66121)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!

  • (using minim is an aside here... it's the P3D causing the TIS/TSM error)

Sign In or Register to comment.