syphon / processing Goto Github PK
View Code? Open in Web Editor NEWSyphon Implementation for Processing
License: Other
Syphon Implementation for Processing
License: Other
… only works properly when the sketch is run as a 32-bit application
If i stop the sketch (int IntelliJ) i get stuff like this:
2014-06-11 13:49:21.181 java[18352:8203] SYPHON DEBUG: SyphonServer: Retiring a server at code unload time because it was not properly stopped
In processing it's fine.
I saw there is already a dispose method:
This method is called automatically when the sketch is disposed, so making sure that the server is properly stopped and Syphon doesn't complain about memory not being properly released: https://github.com/Syphon/Processing/issues/4
For some reason if i run this in processing:
void setup() {
registerMethod("dispose", this);
registerMethod("exit", this);
registerMethod("quit", this);
registerMethod("stop", this);
}
void dispose() {
println("dispose");
}
void exit() {
println("exit");
}
void quit() {
println("quit");
}
void stop() {
println("stop");
}
Then dispose is printed when i start the sketch and exit is called when i close the sketch.
So i was thinking of binding the dispose to exit. But for some reason exit does not called in IntelliJ (i also had this with eclipse before).
Maybe it's they way of closing that depends (a call to exit, pressing command + q, pressing the red close icon).
I don't know but there might be a fix for it.
What steps will reproduce the problem?
What is the expected output? What do you see instead?
Alpha! No alpha.
//Code example
import codeanticode.syphon.*;
PGraphics canvas;
SyphonServer server;
void setup() {
size(400,400, P3D);
canvas = createGraphics(400, 400, P3D);
server = new SyphonServer(this, "Processing Syphon");
}
void draw() {
background(80,0,0,80);
stroke(0,255,0);
line(mouseX,mouseY,pmouseX,pmouseY);
server.sendImage(g);
}
From a fresh install of Processing 4 on an Apple M1, followed by installing the Syphon library via Processing, I get the following error in any Syphon example sketch:
UnsatisfiedLinkError: /Users/iml/Documents/Processing/libraries/Syphon/library/libJSyphon.jnilib: dlopen(/Users/iml/Documents/Processing/libraries/Syphon/library/libJSyphon.jnilib, 0x0001): tried: '/Users/iml/Documents/Processing/libraries/Syphon/library/libJSyphon.jnilib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
java.lang.UnsatisfiedLinkError: /Users/iml/Documents/Processing/libraries/Syphon/library/libJSyphon.jnilib: dlopen(/Users/iml/Documents/Processing/libraries/Syphon/library/libJSyphon.jnilib, 0x0001): tried: '/Users/iml/Documents/Processing/libraries/Syphon/library/libJSyphon.jnilib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
at processing.opengl.PSurfaceJOGL.lambda$initAnimator$2(PSurfaceJOGL.java:426)
at java.base/java.lang.Thread.run(Thread.java:833)
A library used by this sketch relies on native code that is not available.
UnsatisfiedLinkError: /Users/iml/Documents/Processing/libraries/Syphon/library/libJSyphon.jnilib: dlopen(/Users/iml/Documents/Processing/libraries/Syphon/library/libJSyphon.jnilib, 0x0001): tried: '/Users/iml/Documents/Processing/libraries/Syphon/library/libJSyphon.jnilib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
UnsatisfiedLinkError: /Users/iml/Documents/Processing/libraries/Syphon/library/libJSyphon.jnilib: dlopen(/Users/iml/Documents/Processing/libraries/Syphon/library/libJSyphon.jnilib, 0x0001): tried: '/Users/iml/Documents/Processing/libraries/Syphon/library/libJSyphon.jnilib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
Strangely, on a different Mac with M1 chip, it works.
I can not use syphon in my intellij, could anyone help me? I have this problem:
objc[1344]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
java.lang.ClassCastException: processing.awt.PGraphicsJava2D cannot be cast to processing.opengl.PGraphicsOpenGL
at codeanticode.syphon.SyphonServer.(Unknown Source)
at Main.setup(Main.java:27)
at processing.core.PApplet.handleDraw(PApplet.java:2393)
at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1540)
at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:316)
This counts for all RC's and i don't know if it's possible to fix coding wise.
Anyway, if someone get's this error (using eclipse or intelliJ):
java.lang.UnsatisfiedLinkError: no JSyphon in java.library.path
Then you have to add something like this in the VM options:
-java.library.path=/Users/doekewartena/Dropbox/Public/Processing/libraries/Syphon/library
I just drop this info here so you know.
I need to send different images to a client from one sketch.
If i run this and check with Simple Client (the app delivered with Syphon) then only one is updating. The other 2 are frozen.
import codeanticode.syphon.*;
PGraphics canvas;
SyphonServer[] servers;
int nServers = 3;
void setup() {
size(400,400, P3D);
canvas = createGraphics(400, 400, P3D);
// Create syhpon servers to send frames out.
servers = new SyphonServer[nServers];
for (int i = 0; i < nServers; i++) {
servers[i] = new SyphonServer(this, "Processing Syphon."+i);
}
}
void draw() {
canvas.beginDraw();
canvas.background(127);
canvas.lights();
canvas.translate(width/2, height/2);
canvas.rotateX(frameCount * 0.01);
canvas.rotateY(frameCount * 0.01);
canvas.box(150);
canvas.endDraw();
image(canvas, 0, 0);
int currentServer = frameCount % nServers;
servers[currentServer].sendImage(canvas);
}
Hello,
I've been very happily using Syphon for Processing since my last post and it has worked without fail. Now, all of a sudden, it started to throw this error. I've re-installed the Syphon library (i.e., deleted the Syphon folder in ~/Documents/Processing/Libraries). Still not working. I'm quite certain that no Mac update was run. It just fell over one day and can't get up again. The same error occurs with any of the Example sketches.
Is this due to an underlying library? I quite urgently need this to run for a live stream and I just need to know if there's a library I can reinstall.
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGILL (0x4) at pc=0x00007ff806708def, pid=1801, tid=11011
#
# JRE version: OpenJDK Runtime Environment Temurin-17.0.8+7 (17.0.8+7) (build 17.0.8+7)
# Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.8+7 (17.0.8+7, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Problematic frame:
# C [CoreFoundation+0x1cedef] CFEqual.cold.1+0xe
#
# No core dump will be written. 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:
# /var/folders/vp/s_91jgz16qq7vnnyhjtzhr_c0000gn/T//hs_err_pid1801.log
#
# If you would like to submit a bug report, please visit:
# https://github.com/adoptium/adoptium-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Could not run the sketch (Target VM failed to initialize).
For more information, read Help → Troubleshooting.
sendScreen() is not being founded.
I am attempting to use Syphon with the Processing IDE.
I have installed Processing 4 on a fresh Apple M1 running macOS Monterey.
I have installed the Syphon Library using the in built in Library Manager of the Processing IDE.
The Example sketches included in the library fails to compile (I have tried both getImage and ReceiveFrames)
Syphon 4.0 by Andres Colubri, Tom Butterworth, Anton Marini http://syphon.v002.info/ UnsatisfiedLinkError: no JSyphon in java.library.path: :/Applications/Processing.app/Contents/Java/core/library/macos-aarch64:/Users/ivy/Documents/Processing/libraries/Syphon/library:/Applications/Processing.app/Contents/MacOS java.lang.UnsatisfiedLinkError: no JSyphon in java.library.path: :/Applications/Processing.app/Contents/Java/core/library/macos-aarch64:/Users/ivy/Documents/Processing/libraries/Syphon/library:/Applications/Processing.app/Contents/MacOS at processing.opengl.PSurfaceJOGL.lambda$initAnimator$2(PSurfaceJOGL.java:409) at java.base/java.lang.Thread.run(Thread.java:833) A library used by this sketch relies on native code that is not available. UnsatisfiedLinkError: no JSyphon in java.library.path: :/Applications/Processing.app/Contents/Java/core/library/macos-aarch64:/Users/ivy/Documents/Processing/libraries/Syphon/library:/Applications/Processing.app/Contents/MacOS UnsatisfiedLinkError: no JSyphon in java.library.path: :/Applications/Processing.app/Contents/Java/core/library/macos-aarch64:/Users/ivy/Documents/Processing/libraries/Syphon/library:/Applications/Processing.app/Contents/MacOS
I have then installed Azul's Zulu JDK (18.0.1) macOS (ARM 64-bit v8), after initially thinking that perhaps java was not installed.
This has not made any difference and I am still receiving the same error.
Can you think of any reason this might be occurring? Would you expect it to work?
Many thanks,
Lee
I have a sketch that I want to capture using the SyphonRecorder but I get this error : OpenGL error 1282 at top endDraw(): invalid operation
Here is what my console spits out :
Listening for transport dt_socket at address: 8848
Syphon 2.0-RC2 by Andres Colubri http://andrescolubri.net/
2016-02-07 14:08:32.668 java[1951:124400] SYPHON DEBUG: SyphonServerConnectionManager: Start Connection
2016-02-07 14:08:32.673 java[1951:124400] SYPHON DEBUG: SyphonServerConnectionManager: Created connection with UUID: info.v002.Syphon.FD460121-D3CD-46E7-9EE5-D564D34C0C97
OpenGL error 1282 at top endDraw(): invalid operation
2016-02-07 14:08:32.750 java[1951:124352] SYPHON DEBUG: SyphonServerConnectionManager: Add info client: info.v002.Syphon.D1537031-4408-4A71-9D66-2AE583EC1495
2016-02-07 14:08:32.752 java[1951:124388] SYPHON DEBUG: SyphonServerConnectionManager: Adding frame client: info.v002.Syphon.D1537031-4408-4A71-9D66-2AE583EC1495
2016-02-07 14:08:43.421 java[1951:124400] SYPHON DEBUG: SyphonServerConnectionManager: stopping
2016-02-07 14:08:43.421 java[1951:124400] SYPHON DEBUG: SyphonServerConnectionManager: Releasing SyphonServerConnectionManager for server "info.v002.Syphon.FD460121-D3CD-46E7-9EE5-D564D34C0C97"
Finished.
[Finished in 18.9s]
Maybe you did it on purpose but with release 1.0rc2 i get debug info.
I think you left a boolean to true :)
Not that i care, i'm just the messenger.
2014-06-07 20:51:07.867 java[88575:d07] SYPHON DEBUG: SyphonServer: Got Discovery Request
2014-06-07 20:51:07.868 java[88575:d07] SYPHON DEBUG: SyphonServer: Got Discovery Request
2014-06-07 20:51:07.868 java[88575:d07] SYPHON DEBUG: SyphonServer: Got Discovery Request
2014-06-07 20:51:07.869 java[88575:d07] SYPHON DEBUG: SyphonServer: Got Discovery Request
2014-06-07 20:51:07.881 java[88578:d07] SYPHON DEBUG: SyphonClientConnectionManager: Registering for info updates
2014-06-07 20:51:07.882 java[88578:d07] SYPHON DEBUG: SyphonClientConnectionManager: Registering for info updates
2014-06-07 20:51:07.883 java[88578:d07] SYPHON DEBUG: SyphonClientConnectionManager: Registering for info updates
2014-06-07 20:51:07.883 java[88578:d07] SYPHON DEBUG: SyphonClientConnectionManager: Registering for info updates
2014-06-07 20:51:07.883 java[88575:d07] SYPHON DEBUG: SyphonServerConnectionManager: Add info client: info.v002.Syphon.09432D35-CB0C-40A1-8676-11FA1BBA3914
2014-06-07 20:51:07.884 java[88575:d07] SYPHON DEBUG: SyphonServerConnectionManager: Add info client: info.v002.Syphon.F8AE3C0A-B7C6-4DBA-9F56-3D9A486AB88B
2014-06-07 20:51:07.884 java[88575:d07] SYPHON DEBUG: SyphonServerConnectionManager: Add info client: info.v002.Syphon.F1A9D061-06EE-42B6-BDE0-0E433A497CF4
2014-06-07 20:51:07.884 java[88575:d07] SYPHON DEBUG: SyphonServerConnectionManager: Add info client: info.v002.Syphon.27473074-95CA-46CE-9F54-D221A6307146
2014-06-07 20:51:22.844 java[88575:e403] SYPHON DEBUG: SyphonServerConnectionManager: stopping
2014-06-07 20:51:22.844 java[88575:e403] SYPHON DEBUG: SyphonServerConnectionManager: Releasing SyphonServerConnectionManager for server "info.v002.Syphon.772FC9A9-48D4-4587-B0CB-B5AAE0FA01E6"
2014-06-07 20:51:22.845 java[88575:e403] SYPHON DEBUG: SyphonServerConnectionManager: stopping
2014-06-07 20:51:22.845 java[88575:e403] SYPHON DEBUG: SyphonServerConnectionManager: Releasing SyphonServerConnectionManager for server "info.v002.Syphon.BB56418E-4034-4916-A534-BB54FDCC2A3F"
2014-06-07 20:51:22.846 java[88575:e403] SYPHON DEBUG: SyphonServerConnectionManager: stopping
2014-06-07 20:51:22.846 java[88575:e403] SYPHON DEBUG: SyphonServerConnectionManager: Releasing SyphonServerConnectionManager for server "info.v002.Syphon.2C8BBF37-A322-4082-9EEE-7E1AD342F118"
2014-06-07 20:51:22.846 java[88575:e403] SYPHON DEBUG: SyphonServerConnectionManager: stopping
2014-06-07 20:51:22.847 java[88575:e403] SYPHON DEBUG: SyphonServerConnectionManager: Releasing SyphonServerConnectionManager for server "info.v002.Syphon.B07C0888-333D-488F-B2F5-74BE07C989B6"
Hello all, I send a post on Processing Forum about weird thing with Syphon and the camera() with a big background. When I work without Syphon the result is perfect, but When I use the syphon the background is like crazy !
http://forum.processing.org/two/discussion/1562/syphon-and-camera#Item_1
Right now there is no static URL that the Contributions Manager can consistently use to pull the release info.
Sorry to spam :)
In the default examples this never worked for me in ReceiveFrames:
client = new SyphonClient(this, "Simple Server");
Also this makes it look like a line is missing after the 'both:'
// A Syphon server can be specified by the name of the application that it contains it,
// its name, or both:
// Only application name.
//client = new SyphonClient(this, "SendFrames");
sorry i didn't report earlier
@vade, @bangnoise: If Processing initializes the GL context using a programmable pipeline (GL2ES2, GL2GL3, or getGL4ES3), then frames sent from a server in Processing are rendered as black (tested with simple client and MadMapper 2.0.1). Also running both the server and client from Processing, with a programmable pipeline, results in no image displayed by the client.
Is this a bug in Processing or Syphon?
Please add a release or a folder with a jar file so we don't have to create a build or self.
For the rest awesome job, i downloaded the build from google code and it works awesome :) !!!
Hello, I haven't had time to work on it lately, but in the last round of changes the constructor of SyphonClient allows you to specify different servers within the same app. Take a look at the comments in the ReceiveFrames example:
"A Syphon server can be specified by the name of the application that it contains it, its name, or both:
Only application name.
client = new SyphonClient(this, "SendFrames");
Both application and server names
client = new SyphonClient(this, "SendFrames", "Processing Syphon");
Only server name
client = new SyphonClient(this, "", "Processing Syphon");
An application can have several servers:
clientRaw = new SyphonClient(this, "Quartz Composer", "Raw Image");
clientScene = new SyphonClient(this, "Quartz Composer", "Scene");
"
These different constructors should be available in the last release (Public Beta 2 r7)
[ported from issue report in googlecode: https://code.google.com/p/syphon-implementations/issues/detail?id=25]
Sketches that use SyphonServer give the following error:
__NSAutoreleaseNoPool(): Object 0x125625370 of class NSCFDictionary autoreleased with no pool in place - just leaking
when closing. Maybe is an error in the native implementation of JSyphonServer (in the https://github.com/Syphon/Java project).
A client may have become inactive between calls to available()
and getImage()
. getImage()
should return an empty image in that case.
@vade and @bangnoise: I just uploaded 1.0-RC2 through the releases section on the GitHub repo, and marked the RC1 on the googlecode page as deprecated.
After a final round of testing/debugging, the next release should be 1.0 final. A few things:
2014-06-07 12:47:41.524 java[10617:d07] SYPHON DEBUG: SyphonServer: Got Discovery Request
2014-06-07 12:47:41.541 java[10619:d07] SYPHON DEBUG: SyphonClientConnectionManager: Registering for info updates
2014-06-07 12:47:41.542 java[10617:d07] SYPHON DEBUG: SyphonServerConnectionManager: Add info client: info.v002.Syphon.FAE0FFEC-8775-40FE-825F-714AD1B8F700
I have an alpha mask that I'm using on the canvas. It works fine in the processing image, but when viewing the syphon feed, I only see the base layer. The mask and anything after are not rendered.
import processing.video.*;
import codeanticode.syphon.*;
PGraphics canvas;
SyphonServer server;
PImage mask;
PImage lines;
PImage backdrop;
Movie background;
void setup() {
size(1920,1080, P3D);
canvas = createGraphics(1920, 1080, P3D);
mask = loadImage("alpha_mask.png");
backdrop = loadImage("white_backdrop.png");
background = new Movie(this, "finalimage_1.mov");
background.loop();
// Create syhpon server to send frames out.
server = new SyphonServer(this, "Processing Syphon");
}
void draw() {
canvas.beginDraw();
canvas.background(100);
canvas.image(background, 420, 0);
canvas.mask(mask);
canvas.image(backdrop, 0, 0);
canvas.endDraw();
image(canvas, 0, 0);
server.sendImage(canvas);
}
void movieEvent(Movie m) {
m.read();
}
Tested on Processing 2.1, Mac OSX 10.9, with the default Send/Receive frame examples. The sketches work ok from the PDE, but the exported applications give the following error:
Exception in thread "Animation Thread" java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: no JSyphon in java.library.path
at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58)
at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:103)
at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:206)
at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:172)
at javax.media.opengl.Threading.invoke(Threading.java:191)
at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:492)
at processing.opengl.PJOGL.requestDraw(PJOGL.java:626)
at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1598)
at processing.core.PApplet.run(PApplet.java:2177)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.UnsatisfiedLinkError: no JSyphon in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1088)
at jsyphon.JSyphonServerList.(Unknown Source)
at codeanticode.syphon.SyphonClient.listServers(Unknown Source)
at ReceiveFrames.setup(ReceiveFrames.java:28)
SyphonClient could expose access to JSyphonClient's isValid()
to report the existence of a corresponding server.
should be called something like newFrameAvailable()
to avoid confusion with the availability of the corresponding server.
I'm wondering if some additions to this library would be needed to support higher pixel densities.
In Processing 3 we are able to set pixelDensity(2);
(or detect the current display's density using pixelDensity(displayDensity())
). This results in a sharper GUI on high-resolution displays.
However when using the example img = client.getImage(img);
, results in this error:
Trying to copy texture to pixels array of wrong size
Is there a workaround to this?
Many thanks
It might be good to have an example to receive all servers (a bit like the Simple Server.app).
It can be easy for quick testing etc.
The reason i made it is that processing allows me to do way more then Simple Server.app and sometimes i like to test small things.
Here is a bad example, but good as start.
import codeanticode.syphon.*;
import java.util.Iterator;
import java.util.Map;
PGraphics[] canvas;
SyphonClient[] clients;
int nClients;
void setup() {
size(400, 400, P2D);
frameRate(1);
HashMap<String, String>[] allServers = SyphonClient.listServers();
int nServers = allServers.length;
canvas = new PGraphics[nServers];
clients = new SyphonClient[nServers];
for (int i = 0; i < allServers.length; i++) {
String appName = allServers[i].get("AppName");
String serverName = allServers[i].get("ServerName");
clients[i] = new SyphonClient(this, appName, serverName);
}
nClients = nServers;
}
void draw() {
background(0);
int targetIndex = frameCount % nClients;
SyphonClient targetClient = clients[targetIndex];
if (targetClient.available()) {
canvas[targetIndex] = targetClient.getGraphics(canvas[targetIndex]);
image(canvas[targetIndex], 0, 0, width, height);
}
}
The exported app crashes in the first or second time thru the draw(), I think.
import codeanticode.syphon.*;
PGraphics canvas;
SyphonServer server;
void settings() {
size(640, 240, P2D);
}
void setup() {
canvas = (PGraphics) createGraphics(640, 240, P2D);
server = new SyphonServer(this, "Processing Syphon");
}
void draw() {
canvas.beginDraw();
canvas.background(frameCount%255);
surface.setTitle("FRAME " + frameCount
+ " | " + nf(int(frameRate), 0) + " FPS"
);
image(canvas, 0, 0);
canvas.endDraw();
server.sendImage(canvas);
}
I don't know how to debug this to offer more info. It works when I run the app in the Processing IDE.
Any help is greatly appreciated!
Thanks
I can't run the new version (RC2) in IntelliJ (and probably also not eclipse).
I think you went to a more recent JDK.
http://stackoverflow.com/questions/12770622/java-lang-unsupportedclassversionerror
If it's me that should update then please tell me.
Exception in thread "Animation Thread" java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: jsyphon/JSyphonServer : Unsupported major.minor version 51.0
at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58)
at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:103)
at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:206)
at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:172)
at javax.media.opengl.Threading.invoke(Threading.java:191)
at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:541)
at processing.opengl.PJOGL.requestDraw(PJOGL.java:688)
at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1651)
at processing.core.PApplet.run(PApplet.java:2256)
at java.lang.Thread.run(Thread.java:695)
Caused by: java.lang.UnsupportedClassVersionError: jsyphon/JSyphonServer : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at codeanticode.syphon.SyphonServer.sendImage(Unknown Source)
at server.ImageInOutput.draw(ImageInOutput.java:160)
at processing.core.PApplet.handleDraw(PApplet.java:2386)
at processing.opengl.PJOGL$PGLListener.display(PJOGL.java:862)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:665)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:649)
at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1289)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1119)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:994)
at javax.media.opengl.awt.GLCanvas$11.run(GLCanvas.java:1300)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedClassVersionError: jsyphon/JSyphonServer
at codeanticode.syphon.SyphonServer.sendImage(Unknown Source)
at server.ImageInOutput.draw(ImageInOutput.java:160)
at processing.core.PApplet.handleDraw(PApplet.java:2386)
at processing.opengl.PJOGL$PGLListener.display(PJOGL.java:862)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:665)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:649)
at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1289)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1119)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:994)
at javax.media.opengl.awt.GLCanvas$11.run(GLCanvas.java:1300)
at javax.media.opengl.Threading.invoke(Threading.java:193)
at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:541)
at javax.media.opengl.awt.GLCanvas.paint(GLCanvas.java:595)
at javax.media.opengl.awt.GLCanvas.update(GLCanvas.java:795)
at sun.awt.RepaintArea.updateComponent(RepaintArea.java:267)
at sun.awt.RepaintArea.paint(RepaintArea.java:233)
at apple.awt.ComponentModel.handleEvent(ComponentModel.java:263)
at java.awt.Component.dispatchEventImpl(Component.java:4852)
at java.awt.Component.dispatchEvent(Component.java:4604)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:717)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:690)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:687)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Right now, users have to manually set the library attributes so that the library can load (#40).
MacBook Pro Retina Mid-2015
OSX 11.5.1
Processing 3.5.4
I am using the Syphon Processing library and I have found a possible issue when it comes to using the filter() function inside of the PGraphics canvas for sending out frames via a Syphon Server.
I have noted that the filters used, BLUR & INVERT, do appear correctly in the Processing window however they do not appear to be sent out correctly in the Syphon output.
Is there a reason for this?
Possible solution or fix?
Or, should I try to apply the filters in a different manner altogether?
Thank you for any tips or help!
Please see code and screenshot below:
import codeanticode.syphon.*;
PGraphics canvas;
SyphonServer server;
void setup() {
size(400,400, P3D);
canvas = createGraphics(400, 400, P3D);
frameRate(30);
// Create syhpon server to send frames out.
server = new SyphonServer(this, "Processing Syphon");
}
void draw() {
canvas.beginDraw();
canvas.background(127);
canvas.lights();
canvas.translate(width/2, height/2);
canvas.rotateX(frameCount * 0.01);
canvas.rotateY(frameCount * 0.01);
canvas.box(150);
canvas.filter(INVERT);
canvas.filter(BLUR, 3);
canvas.endDraw();
image(canvas, 0, 0);
server.sendImage(canvas);
}
The code bellow work on Processing 3.0a5 but not on Processing 3.0a10. I know this code is not the official example, but it's very easy to use, so maybe there is something to do in Syphon Library ?
That be awesome :)
import codeanticode.syphon.*;
SyphonServer server;
void setup() {
size(500, 500, P3D);
server = new SyphonServer(this, "#PParis15");
}
void draw() {
background(255 *abs(sin(frameCount *.01))) ;
server.sendScreen();
}
Right now, the frames sent out from Processing when using the SyphonServer object need to be drawn to an offscreen PGraphics buffer. It would be neat to just be able to do:
void draw() {
background(127);
lights();
translate(width/2, height/2);
rotateX(frameCount * 0.01);
rotateY(frameCount * 0.01);
box(150);
server.sendScreen();
}
This requires the server object getting the internal back buffer that the renderer uses to draw the main screen to. It is certainly possible, since this is what the filter(PShader) method does under the scenes.
[ported from issue report in googlecode: https://code.google.com/p/syphon-implementations/issues/detail?id=27]
What steps will reproduce the problem?
What is the expected output? What do you see instead?
Alpha! No alpha.
Ping Memo about this, he alerted me to the issue.
[ported from issue report in googlecode: https://code.google.com/p/syphon-implementations/issues/detail?id=22]
When I try to run this simple sketch with Processing 3.0.1, I always get this error message when trying to get the image. It doesn't matter if I use getGraphics
or getImage
.
import codeanticode.syphon.SyphonClient;
SyphonClient client;
PGraphics img;
void setup()
{
size(500, 500, P3D);
client = new SyphonClient(this, "Simple Server");
}
void draw()
{
if(client.active())
{
img = client.getGraphics(img);
image(img, 0, 0, width, height);
}
}
Syphon 2.0-RC2 by Andres Colubri http://andrescolubri.net/
2015-12-02 09:09:21.021 java[5970:532404] SYPHON DEBUG: SyphonClientConnectionManager: Registering for info updates
OpenGL error 1282 at top beginDraw(): invalid operation
Could not compile shader 35632:
ERROR: 0:11: Invalid call of undeclared identifier 'texture2DRect'
Am I doing something wrong or is it a bug?
The example for GetImage illustrates nicely the problem with the current SyphonClient implementation
Add a call to background(0)
at the start of draw()
and watch the output flicker....
It should properly do something like this
public void draw() {
Always background(0)
background(0);
active() should be added to expose JSyphonClient's isValid
if (client.active()) {
available()
should be renamed to something like newFrameAvailable()
if (client.newFrameAvailable()) {
// The first time getImage() is called with
// a null argument, it will initialize the PImage
// object with the correct size.
img = client.getImage(img); // load the pixels array with the updated image info (slow)
// img = client.getImage(img, false); // does not load the pixels array (faster)
}
If the client is active, draw every pass regardless of whether the frame is new
if (image.width() && image.height()) {
image(img, 0, 0, width, height);
}
}
I've written a custom fragment shader which is used to draw a shape. Now the syphon library does not send the image over. Only the first frame is sent to the syphon output.
And the image is flipped by 180°.
I send the image with following method:
void sendImageToSyphon()
{
updatePixels();
syphon.sendScreen();
}
I tried it with various methods, but even with sending the g
object it doesn't work. I think it is a problem with version 3.0 and higher.
Here is my shape code:
PShader colorShader;
PShape plane;
void init() {
println("loading shader...");
colorShader = loadShader("shader/colorMapFrag.glsl");
// creating plane
textureMode(NORMAL);
plane = createShape();
plane.beginShape();
plane.noStroke();
plane.vertex(0, 0, 0);
plane.vertex(width, 0, 0);
plane.vertex(width, height, 0);
plane.vertex(0, height, 0);
plane.endShape(CLOSE);
};
void render() {
background(0);
// set unform types
colorShader.set("time", (float)(millis() / 1000.0));
colorShader.set("resolution", (float)width, (float)height);
shader(colorShader);
shape(plane);
};
Here is an image of the problem. Lefthand is the simple syphon client, righthand the processing window.
Hi
i am new to this and very confused
i am trying to share a slit scan processing code to another software through SYPHON
can you help?
this is the SLITSCAN
import processing.video.*;
Capture video;
int x = 0;
void setup() {
size (1000, 720);
video = new Capture (this, 720, 780);
video.start ();
}
void captureEvent(Capture video) {
video.read();
}
void draw () {
//image (video, 0, 0);
int w = video.width;
int h = video.height;
copy (video, w/2, 0, 1, h, x, 0, 1, h);
x = x + 1;
if (x > width) {
x = 0;
}
}
As mentioned in the PR #33, following code should be considered as valid usage of the API (nothing prevents me as developer of doing it):
void sendImageIfNecessary(PImage img) {
if(syphon.hasClients())
syphon.sendImage(img);
}
But this is not working, because the JSyphon sever is lazy initialised in the sendImage
method. With the PR applied, syphon will never be initialised, because the server will never be initialised because sendImage
will never be called.
Why is the server lazy initialised and why is there no method to explicitly start the server? I think this would make a lot of sense, not only architecture-wise, but also performance-wise (initialise it in the beginning and not when the frame-sending should happen).
In the implementation there is following comment:
// The server needs to be created after setup and all the
// JOGL initialization has taken place. Otherwise frame
// sending doesn't work...
This makes totally sense, but it still would make sense to have the control, when the server is initialised.
Running the MultipleServers/Clients example pair has some issue in RC3. The server example runs fine, each individual server can be read a syphon client, but trying to read all servers at one from Processing hangs the sketch with this error in the console:
2017-09-10 10:40:25.598 java[74061:24550735] -[SyphonServerDirectory objectForKey:]: unrecognized selector sent to instance 0x7ffec2edbb20
2017-09-10 10:40:25.599 java[74061:24550735] -[SyphonServerDirectory objectForKey:]: unrecognized selector sent to instance 0x7ffec2edbb20
2017-09-10 10:40:25.608 java[74061:24550735] (
0 CoreFoundation 0x00007fff8d9fb452 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff9cc45f7e objc_exception_throw + 48
2 CoreFoundation 0x00007fff8da6518d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff8d96b4c1 ___forwarding___ + 1009
4 CoreFoundation 0x00007fff8d96b048 _CF_forwarding_prep_0 + 120
5 libJSyphon.jnilib 0x000000011e8a69f7 -[SyphonNameboundClient parametersMatchDescription:] + 183
6 libJSyphon.jnilib 0x000000011e8a6d4c -[SyphonNameboundClient handleServerAnnounce:] + 156
7 CoreFoundation 0x00007fff8d986b0c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
8 CoreFoundation 0x00007fff8d986a9f ___CFXRegistrationPost_block_invoke + 63
9 CoreFoundation 0x00007fff8d986a17 _CFXRegistrationPost + 407
10 CoreFoundation 0x00007fff8d986782 ___CFXNotificationPost_block_invoke + 50
11 CoreFoundation 0x00007fff8d943592 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1922
12 CoreFoundation 0x00007fff8d9427e5 _CFXNotificationPost + 693
13 Foundation 0x00007fff936b8f9a -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
14 Syphon 0x000000011e8beb99 -[SyphonServerDirectory handleServerAnnounce:] + 745
15 CoreFoundation 0x00007fff8d986b0c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
16 CoreFoundation 0x00007fff8d986a9f ___CFXRegistrationPost_block_invoke + 63
17 CoreFoundation 0x00007fff8d99040c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
18 CoreFoundation 0x00007fff8d96fc55 __CFRunLoopDoBlocks + 341
19 CoreFoundation 0x00007fff8d96f9bb __CFRunLoopRun + 2347
20 CoreFoundation 0x00007fff8d96ee28 CFRunLoopRunSpecific + 296
21 HIToolbox 0x00007fff8a757935 RunCurrentEventLoopInMode + 235
22 HIToolbox 0x00007fff8a75776f ReceiveNextEventCommon + 432
23 HIToolbox 0x00007fff8a7575af _BlockUntilNextEventMatchingListInModeWithFilter + 71
24 AppKit 0x00007fff91cd6df6 _DPSNextEvent + 1067
25 AppKit 0x00007fff91cd6226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
26 libosxapp.dylib 0x00000001195373aa -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:] + 124
27 AppKit 0x00007fff91ccad80 -[NSApplication run] + 682
28 libosxapp.dylib 0x000000011953714d +[NSApplicationAWT runAWTLoopWithApp:] + 156
29 libawt_lwawt.dylib 0x00000001194c3edf -[AWTStarter starter:] + 905
30 Foundation 0x00007fff93728dfe __NSThreadPerformPerform + 279
31 CoreFoundation 0x00007fff8d9907e1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
32 CoreFoundation 0x00007fff8d96ff0c __CFRunLoopDoSources0 + 556
33 CoreFoundation 0x00007fff8d96f42f __CFRunLoopRun + 927
34 CoreFoundation 0x00007fff8d96ee28 CFRunLoopRunSpecific + 296
35 java 0x0000000100544465 CreateExecutionEnvironment + 871
36 java 0x000000010054018c JLI_Launch + 1952
37 java 0x00000001005464c2 main + 101
38 java 0x000000010053f9e4 start + 52
39 ??? 0x000000000000000e 0x0 + 14
)
2017-09-10 10:40:25.619 java[74061:24551234] SYPHON DEBUG: SyphonClientConnectionManager: Registering for info updates
getImage() simply returns a black image, see corresponding example. Tested on Processing 2.2.1, latest revision from repo.
when launching a sketch that includes the release version3 (29 Dec 2019) of syphon/processing on Big Sur
the syphon library fails to load
processing - console log output snippet
not valid for use in process using library validation: library load disallowed by system policy
in mac/system prefernces/security and privacy I can accept the code from unknown developer
this time upon starting the sketch an osx alert window states that
("Syphon" is damaged and can't be opened. You should move it to the bin)
and only has options of "move to bin" or "cancel"
sudo xattr -cr ~/Documents/Processing/libraries/Syphon/library/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.