# Processing 3 running slow on Pi4

**URL:** https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362
**Category:** Processing for Pi
**Created:** [December 13, 2019, 6:55am UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362 "2019-12-13T06:55:37Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![klitsner](https://avatars.discourse-cdn.com/v4/letter/k/e5b9ba/32.png) [@klitsner](https://discourse.processing.org/u/klitsner)
#### Post date: [December 13, 2019, 6:55am UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/1 "2019-12-13T06:55:37Z")

</div>

I recently got a 4GB Ram Pi4 to build a sampler pad to use for performances. After a fresh install of Raspian Buster (using NOOBS) I downloaded the latest Processing (ARM) to the pi, however I immediately began experiencing choppiness in the IDE from things as simple as scrolling. I then tried to run some of the example sketches from the Sound library, and I experience what seems like low frame rate and extremely choppy audio. I am wondering if there is some recommended setup for the pi that I may have missed. The pi is connected through HDMI to a 1980x1080 display, and I have tried playing the audio through HDMI, an external soundcard, and the 3.5 mm jack. I can provide any video, screenshots, or output that may help diagnose the issue.

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [December 13, 2019, 8:09am UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/2 "2019-12-13T08:09:39Z")

</div>

sorry i only have a RPI 3B+  
and yes a Raspberry Pi is a small/cheap computer

i use

2019-09-26-raspbian-buster-full.zip

install processing 3.5.3 with

```auto
curl https://processing.org/download/install-arm.sh | sudo sh

```

and use it via HDMI or remote VNC

`sudo raspi-config` 7 advanced options / A3 memory split / 128 MB

* * *

and yes , like the start of processing is painful slow

my own stresstest/info

```auto
float rset=120, r;
int x = 0;
int w = 400;
int h = 200;
int grid=20, many = grid*grid;
boolean stressenable=true;

void settings() {
  size(w, h); // default use JAVA2D 
  // size(w, h,FX2D);
  // size(w, h,P2D);
  // size(w, h,P3D);
}

void setup() {
  frameRate(rset);
  background(200, 200, 0);
  numinfo();
  sysinfo();
  println("\nstresstest ( "+grid+"*"+grid+" = "+many+" ) points, [+][-] grid +-5" );
}

void draw() {
  surface.setTitle("SYS INFO set "+rset+": "+ nf(r, 0, 1)+" FPS" );
  if ( stressenable ) stress();
  r = frameRate;
  if ( r > 30 ) stroke(0, 200, 0); 
  else stroke(200, 0, 0);
  line(x, height-2, x, height-2-r); // FPS graph
  x++;
  if ( x > width ) { 
    x = 0; 
    background(200, 200, 0);
  }
}

void stress() {
  push();
  for ( int i=0; i<grid; i++) {
    for ( int j=0; j<grid; j++) {
      stroke(random(255), random(255), random(255) );
      point(5+i, 5+j);
    }
  }
  pop();
}

void sysinfo() {
  println( "__SYS INFO :");
  println( "System : " + System.getProperty("os.name") + " " + System.getProperty("os.version") );// + " " + System.getProperty("os.arch") );
  println( "JAVA : " + System.getProperty("java.home") + " rev: " +javaVersionName);
  //println( System.getProperty("java.class.path") );
  //println( "\n" + isGL() + "\n" );
  println( "OPENGL : VENDOR " + PGraphicsOpenGL.OPENGL_VENDOR+" RENDERER " + PGraphicsOpenGL.OPENGL_RENDERER+" VERSION " + PGraphicsOpenGL.OPENGL_VERSION+" GLSL_VERSION: " + PGraphicsOpenGL.GLSL_VERSION);
  println( "user.home : " + System.getProperty("user.home") );
  println( "user.dir : " + System.getProperty("user.dir") );
  println( "user.name : " + System.getProperty("user.name") );
  println( "sketchPath : " + sketchPath() );
  println( "dataPath : " + dataPath("") );
  println( "dataFile : " + dataFile("") );
  println( "frameRate : target "+nf(rset, 0, 1)+" actual "+nf(r, 0, 1));
  println( "canvas : width "+width+" height "+height+" pix "+(width*height));
}

void numinfo() {
  println( "__NUM INFO :");
  println( "byte "+Byte.SIZE+ " bit | min: "+Byte.MIN_VALUE+ "\t\t\t max: "+Byte.MAX_VALUE);
  println( "short "+Short.SIZE+ " bit | min: "+Short.MIN_VALUE+ "\t\t\t max: "+Short.MAX_VALUE);
  println( "int "+Integer.SIZE+" bit | min: "+Integer.MIN_VALUE+"\t\t max: " +Integer.MAX_VALUE);
  println( "long "+Long.SIZE+ " bit | min: "+Long.MIN_VALUE+ "\t max: " +Long.MAX_VALUE);
  println( "float "+Float.SIZE+ " bit | min: "+Float.MIN_VALUE+ "\t\t\t max: "+Float.MAX_VALUE);
  println( "double "+Double.SIZE+ " bit | min: "+Double.MIN_VALUE+ "\t\t\t max: "+Double.MAX_VALUE);
}

void keyPressed() {
  if ( key == 's' ) stressenable = ! stressenable;
  if ( key == '+' ) {
    grid +=5;
    many = grid*grid;
    println("stresstest ( "+grid+"*"+grid+" = "+many+" ) points" );
  }
  if ( key == '-' ) {
    grid -=5;
    many = grid*grid;
    println("stresstest ( "+grid+"*"+grid+" = "+many+" ) points" );
  }
}

```

give me after a few seconds 70FPS  
key [s] without stress i see 120FPS

also it is known that on bigger canvas settings it get slower as you might be used from a  
PC ( with 10 times the prize )

so for compare ( like FPS ) we need to run same code.

* * *

for the SOUND,  
did you install SOUND 2.2.3 lib,  
( what is mostly not working here )

or Minim,… what example?

like Minim / Audioplayer / loop / key [l]  
sounds same for my ( play via HDMI cable to a small TV )  
like from my PC ( same connection )

you say " choppy " like bad sound quality or like not play smooth?

* * *

so my point is that it is not clear if you are disappointed by your first RPI  
or if there are real issues / esp. processing issues?

how about when you run browser and YouTube video, same sound problem?

---

<div class="post-metadata">

### Author: ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)
#### Post date: [December 13, 2019, 3:04pm UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/3 "2019-12-13T15:04:22Z")

</div>

I have a RaspberryPI4 (4G ram), that I use to test [picrate](https://ruby-processing.github.io/PiCrate/) a ruby implementation of processing (using JRuby). I haven’t tried running the processing ide (using instead geany as my ide). If you haven’t already done so I recommend you install latest updates:-

1. sudo apt-get update
2. sudo apt-get dist-upgrade

I also suggest using FakeKMS option, for video I use the latest processing [video library](https://discourse.processing.org/t/video-library-problem-with-rp4/16372) see also [USB Camera Capture on RaspberryPI](https://discourse.processing.org/t/usb-camera-capture-on-raspberrypi/15811). For my application I use Debian Buster open-jdk8 (the processing download includes a modified oracle jdk8). You should bear in mind processing was designed with RasberryPI3 in mind.

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [December 13, 2019, 3:08pm UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/4 "2019-12-13T15:08:38Z")

</div>

> [@monkstone](#):
>
> RaspberryPI4

did you try install

> [@kll](#):
>
> SOUND 2.2.3 lib

and run example?  
( just try first time and its useless here RPI3.  
must be a reason why its not included )

---

<div class="post-metadata">

### Author: ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)
#### Post date: [December 13, 2019, 3:53pm UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/5 "2019-12-13T15:53:11Z")

</div>

Yeah sound library useless here on RaspberryPI4, get warning of amplitude of zero means this sound is not audible now. Sounds from web eg BBC Radio 3 absolutely fine, so its not the PI.

---

<div class="post-metadata">

### Author: ![klitsner](https://avatars.discourse-cdn.com/v4/letter/k/e5b9ba/32.png) [@klitsner](https://discourse.processing.org/u/klitsner)
#### Post date: [December 13, 2019, 7:39pm UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/6 "2019-12-13T19:39:54Z")

</div>

KII, I installed the SOUND library. I tried running the examples included, to test basic soundfile playback. I will try to run the test and see what comes up.

Are you saying you are having better luck with Minim?

Monkstone thank you, I will make sure to install the latest updates. I have also noticed the “amplitude is zero” warnings. And yes, other audio from Chromium is absolutely fine. The Processing user experience overall seems to be

I took the MicroSD card from my RPI4 and put it into my RPi2. Everything boots up fine, but when I run processing and try to run the sketch things are even slower than on the RPI2.

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [December 14, 2019, 3:10am UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/7 "2019-12-14T03:10:04Z")

</div>

-0- you installed a sound library, but not tell,  
lucky i exactly try that ( via HDMI )  
as i usually play ( via VNC ) no sound.

-1- MINIM 2.2.2 run well on both BUSTER Images ( on RPI3 )

-2- typing not understandable,

- 
  - user experience ?

- 
  - RPI2 slower as RPI2 ?

-3- did you try my stress code and can you give the 2 FPS numbers ( with & without stress )  
so we see your system is ( should be ) faster as my RPI3 ( 70/120 )

---

<div class="post-metadata">

### Author: ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)
#### Post date: [December 14, 2019, 9:00am UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/8 "2019-12-14T09:00:09Z")

</div>

minim also plays well on my RaspberryPI4 with my [picrate gem](https://ruby-processing.github.io/PiCrate/) see screenshot (sketch run from geany):-

 ![playing](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/1c05e6b3edf0ea1ee7894923a3d4c052e12b16b7.png)

---

<div class="post-metadata">

### Author: ![klitsner](https://avatars.discourse-cdn.com/v4/letter/k/e5b9ba/32.png) [@klitsner](https://discourse.processing.org/u/klitsner)
#### Post date: [December 17, 2019, 11:40pm UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/9 "2019-12-17T23:40:47Z")

</div>

I ended up trying out the Beads library for Processing and things are running very smoothly! The Beads library also offers a larger toolkit for managing many samples, although it took me a couple hours of playing with it to really understand out to connect things together. Sound is playing out of my RPi4 without any hiccups. Thank you for the help everyone

---

<div class="post-metadata">

### Author: ![klitsner](https://avatars.discourse-cdn.com/v4/letter/k/e5b9ba/32.png) [@klitsner](https://discourse.processing.org/u/klitsner)
#### Post date: [December 17, 2019, 11:45pm UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/10 "2019-12-17T23:45:38Z")

</div>

-0- I am referring to the standard Processing Sound library, which is called just that. [https://processing.org/reference/libraries/sound/index.html](https://processing.org/reference/libraries/sound/index.html)

-1- thank you, I was going to try this if the Beads library did not work.

-2- typing not understandable,

- 
  - user experience ?

Sorry it looks llike I left out the end of that sentence. The User Experience in processing on the RPi4 is still very laggy.

- 
  - RPI2 slower as RPI2 ?

This was a mistake, I meant that the RPI2 was slower than the RPI4,

---

<div class="post-metadata">

### Author: ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)
#### Post date: [December 24, 2019, 9:16am UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/11 "2019-12-24T09:16:03Z")

</div>

@kll @klitsner  
OK I think I’ve got a fix, pulseaudio is not installed by default:-

```bash
sudo apt-get install pulseaudio
# and it might be an idea to install gstreamer plugin whilst you are at it.
sudo apt-get install gstreamer1.0-pulseaudio
 

```

Sound library now working for me on raspberrypi4

---

<div class="post-metadata">

### Author: ![klitsner](https://avatars.discourse-cdn.com/v4/letter/k/e5b9ba/32.png) [@klitsner](https://discourse.processing.org/u/klitsner)
#### Post date: [December 24, 2019, 7:33pm UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/12 "2019-12-24T19:33:50Z")

</div>

thats awesome! i am away from home but I will definitely try this when I am back. Although now that i have started using the beads library I may stick with it, it seems very versatile. I think i will try to compare performance and see if one runs better thn the other

---

<div class="post-metadata">

### Author: ![jbirdlebough](https://avatars.discourse-cdn.com/v4/letter/j/9d8465/32.png) [@jbirdlebough](https://discourse.processing.org/u/jbirdlebough)
#### Post date: [January 17, 2020, 8:32am UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/13 "2020-01-17T08:32:56Z")

</div>

one other trick is to put /tmp and /var/log in tmpfs (ram) that cuts R/W cycles on the Sd card way down and improves performance. By default that is not setup in the /etc/fstab file.

---

<div class="post-metadata">

### Author: ![Simmonsstummer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/simmonsstummer/32/7949_2.png) [@Simmonsstummer](https://discourse.processing.org/u/Simmonsstummer)
#### Post date: [January 29, 2020, 9:17am UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/14 "2020-01-29T09:17:22Z")

</div>

i’m struggling with slow performance too. Even if is not an audio project. Just testing a bouncing ball and particle system and i’ve seen framerate of 5 or 7 fps.  
Even a really really simple sketch.

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [January 29, 2020, 11:18am UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/15 "2020-01-29T11:18:37Z")

</div>

if you post your code i could try it on RPI3 and might find small things to improve,  
but i just guess you run your

> [@Simmonsstummer](#):
>
> really really simple sketch

in fullscreen?

---

<div class="post-metadata">

### Author: ![Simmonsstummer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/simmonsstummer/32/7949_2.png) [@Simmonsstummer](https://discourse.processing.org/u/Simmonsstummer)
#### Post date: [January 29, 2020, 11:38am UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/16 "2020-01-29T11:38:32Z")

</div>

yes but even in small window like 600x600. Does not change much.  
The simplest sketch on earth something like:

```auto
void setup(){
fullScreen();
}
void draw(){
ellipse(mouseX,mouseY,20,20);
}

```

it was meant just to see how it works on raspberry pi… and the results were disappointing

---

<div class="post-metadata">

### Author: ![Simmonsstummer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/simmonsstummer/32/7949_2.png) [@Simmonsstummer](https://discourse.processing.org/u/Simmonsstummer)
#### Post date: [January 29, 2020, 12:14pm UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/17 "2020-01-29T12:14:15Z")

</div>

So i’ve made some test with the frame rate. At fullscreen i grt around 6fps, at 800x800 i get 19 fps,  
And 40 at 400x400.  
Is Raspberry Pi really so limitated?

---

<div class="post-metadata">

### Author: ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)
#### Post date: [January 30, 2020, 10:40am UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/18 "2020-01-30T10:40:22Z")

</div>

I thing there must be something wrong. With my PICrate gem (processing in ruby which usually runs a bit slower than vanilla processing) my fibonaacci\_sphere.rb sketch runs at at least 11 fps 1024 \* 760 and 2000 points (updated every frame).

 ![frame_rate](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/c/cbf91d9292b4b44d5b0b57a0ad067a71190bb286.png)

---

<div class="post-metadata">

### Author: ![Simmonsstummer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/simmonsstummer/32/7949_2.png) [@Simmonsstummer](https://discourse.processing.org/u/Simmonsstummer)
#### Post date: [January 30, 2020, 10:58am UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/19 "2020-01-30T10:58:40Z")

</div>

yeah, that’s why i’m here.  
I’ve seen in the manual that in the settings i can toggle the 4k screen support if i attach an HD screen and this could improve performances. I’ll test that.

---

<div class="post-metadata">

### Author: ![Simmonsstummer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/simmonsstummer/32/7949_2.png) [@Simmonsstummer](https://discourse.processing.org/u/Simmonsstummer)
#### Post date: [January 30, 2020, 9:25pm UTC](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362/20 "2020-01-30T21:25:59Z")

</div>

Ok so seems there is no such thing in the settings. Maybe is something that appear only if you connect a 4k screen.

So, is there any way to perform a full screen sketch with a decent framerate?

[Next page](https://discourse.processing.org/t/processing-3-running-slow-on-pi4/16362.md?page=2)
