CPU load with Purr-Data and GEM
Hi there,
I started dealing with GEM and implemented a very simple patch that simply plays back a video. When I run this patch with pd-gem the playback is all good. But with purr-data the playback stutters since the CPU load is too high. Please find attached screenshots of the patch and atop while running the patch with purr-data and pd-gem.
The pd version with purr-data and pd-gem is slightly different, but I assume that this is not the root cause. So, what is the problem with purr-data and how can I solve it?
Thank you in advance!
Andre
-- purr-data --
Purr-Data 2.19.3
Pd version 0.48.0
GEM version 0.94
-- pd-gem --
Pd version 0.52.1
GEM version 0.94
Ofelia: How to get pixel data?
Does the getColor() integrated into Ofelia have the index 'bug' mentioned here - https://github.com/openframeworks/openFrameworks/issues/5321? I'm able to retrieve values way beyond what I would expect in the image like so:
ofelia f;
m = require("abc");
pix = m.img:getPixels();
//both of these agree on the number of pixels
print("number of pixels:", pix:getWidth() * pix:getHeight());
print("number of pixels: ", pix:getTotalBytes() / pix:getNumChannels());
//but this returns a value????
numofPixels = pix:getWidth() * pix:getHeight();
print(pix:getColor(numofPixels + 1));
return(anything);
gem and big sur
@godinpants said:
I goofed. I fell for it again and upgraded my OS and destroyed GEM. But this time I can't see any solution to getting it running again.
Anyone had luck hacking your way through getting GEM running on Big Sur?
Yeah, my multimedia exam is screwed for one student because of this too.
I'd asked on github and received this suggestion:
i don't really know, but she could try changing the windowing backend, by changing the gemdefaultwindow.pd abstraction in the Gem/-folder and replacing the [gemmacoswindow] (or whatever is there) to one of the other
gem*window
options installed on your system. (just look out for any externals (.pd_darwin,...) in the Gem/-folder that match thegem*window
pattern).
possibly good choices are: [gemglfw3window], [gemglutwindow].
FWIW this is the nail in Gem's coffin for me. Too risky to try to keep it working for a room of 40-50 students.
hjh
Fast Prototyping for Ofelia
FWIW, I don't think it needs to be a replacement for GEM, or pretend to make the interfaces similar to GEM. As noted at the top of the thread, GEM is outdated.
If an obstacle is converting Ofelia's pixel system into something like GEM's normalized coordinates, then... why not simply abandon the idea of normalized coordinates? Unless it's really necessary for practical use. If the only reason to normalize the coordinates was to make it "similar to GEM," I'd say, don't waste time on it.
FWIW, I'm not going to be able to tolerate GEM for another year. Like today -- it took me over two hours to figure out how to extract the alpha channel from pixes. (Like, how many years has GEM existed, and nobody thought it would be useful to have an object to transfer the alpha channel to the main channel of a grayscale pix? Or, if you don't need an object for it, this still seems to me a pretty basic use case... but of course hard to find in the documentation...)
I realize that a set of abstractions on top of Ofelia is not likely to be fully-featured -- but I could cobble together enough Lua to add abstractions myself where needed (and contribute them back), whereas trying to add objects to Gem is impractical (1, my C is not that good and 2, I could build in Linux but not Mac or Windows). Even a partial set of abstractions might be a starting point to get around the kinds of problems I'm facing now, where the existing objects don't quite do what I want and there's not a good way to add functionality.
Otherwise, for this course, I might not have a choice but to jump ship and go to jitter (which some of the students have already done). It pains me to think of switching away from FLOSS but where I am right now is simply not sustainable.
TL;DR Even if the current state is incomplete, would you mind sharing so I could have a look?
hjh
Ubuntu 18, how to update Gem?
Ubuntu Studio 18.04 includes a package for "GEM: ver: 0.93.3 / GEM: compiled on 2018/02/01 at 21:58:19 UTC."
Current Gem is 0.94.
How do I update Gem on my system?
Deken's most recent Gem for Linux is from 2015 (seriously).
I searched for a PPA but I can't find one for this.
https://packages.debian.org/buster/gem -- compatible with Ubuntu or not?
(The immediate motivation is that, in the last 15 minutes or so, multiple Gem help patches caused Pure Data to crash. I suspect a conflict between new Pd 0.50 and old Gem 0.93...?)
hjh
[pix_share_read] and [pix_share_write] under windows
@whale-av, here is a log running pd with -lib Gem -verbose.
tried both 32bit and 64bit pd 0.48-1...
tried ./Gem.m_i386 and failed
tried ./Gem.dll and failed
tried ./Gem/Gem.m_i386 and failed
tried ./Gem/Gem.dll and failed
tried ./Gem.pd and failed
tried ./Gem.pat and failed
tried ./Gem/Gem.pd and failed
tried C:/Users/Raphael Isdant/Documents/Pd/externals/Gem.m_i386 and failed
tried C:/Users/Raphael Isdant/Documents/Pd/externals/Gem.dll and failed
tried C:/Users/Raphael Isdant/Documents/Pd/externals/Gem/Gem.m_i386 and failed
tried C:/Users/Raphael Isdant/Documents/Pd/externals/Gem/Gem.dll and failed
tried C:/Users/Raphael Isdant/Documents/Pd/externals/Gem.pd and failed
tried C:/Users/Raphael Isdant/Documents/Pd/externals/Gem.pat and failed
tried C:/Users/Raphael Isdant/Documents/Pd/externals/Gem/Gem.pd and failed
tried C:/Users/Raphael Isdant/AppData/Roaming/Pd/Gem.m_i386 and failed
tried C:/Users/Raphael Isdant/AppData/Roaming/Pd/Gem.dll and failed
tried C:/Users/Raphael Isdant/AppData/Roaming/Pd/Gem/Gem.m_i386 and failed
tried C:/Users/Raphael Isdant/AppData/Roaming/Pd/Gem/Gem.dll and failed
tried C:/Users/Raphael Isdant/AppData/Roaming/Pd/Gem.pd and failed
tried C:/Users/Raphael Isdant/AppData/Roaming/Pd/Gem.pat and failed
tried C:/Users/Raphael Isdant/AppData/Roaming/Pd/Gem/Gem.pd and failed
tried C:/Program Files/Common Files/Pd/Gem.m_i386 and failed
tried C:/Program Files/Common Files/Pd/Gem.dll and failed
tried C:/Program Files/Common Files/Pd/Gem/Gem.m_i386 and failed
tried C:/Program Files/Common Files/Pd/Gem/Gem.dll and failed
tried C:/Program Files/Common Files/Pd/Gem.pd and failed
tried C:/Program Files/Common Files/Pd/Gem.pat and failed
tried C:/Program Files/Common Files/Pd/Gem/Gem.pd and failed
tried D:/pd-0.48-1.windows.64bit/extra/Gem.m_i386 and failed
tried D:/pd-0.48-1.windows.64bit/extra/Gem.dll and failed
tried D:/pd-0.48-1.windows.64bit/extra/Gem/Gem.m_i386 and failed
tried D:/pd-0.48-1.windows.64bit/extra/Gem/Gem.dll and succeeded
D:\\pd-0.48-1.windows.64bit\\extra\\Gem\\Gem.dll: couldn't load
tried D:/pd-0.48-1.windows.64bit/extra/Gem.pd and failed
tried D:/pd-0.48-1.windows.64bit/extra/Gem.pat and failed
tried D:/pd-0.48-1.windows.64bit/extra/Gem/Gem.pd and failed
tried D:/pd-0.48-1.windows.64bit/doc/5.reference/Gem.m_i386 and failed
tried D:/pd-0.48-1.windows.64bit/doc/5.reference/Gem.dll and failed
tried D:/pd-0.48-1.windows.64bit/doc/5.reference/Gem/Gem.m_i386 and failed
tried D:/pd-0.48-1.windows.64bit/doc/5.reference/Gem/Gem.dll and failed
tried D:/pd-0.48-1.windows.64bit/doc/5.reference/Gem.pd and failed
tried D:/pd-0.48-1.windows.64bit/doc/5.reference/Gem.pat and failed
tried D:/pd-0.48-1.windows.64bit/doc/5.reference/Gem/Gem.pd and failed
Gem: can't load library```
3 shader adaptions: sonogram / vectorscope and conway
I realized recently that Gem has some very similar (and nice) shader examples, like a game of life, or a multi pass rendering (I learned that this is what I am doing with the effect chain in the video player).
And the timbreID library has some nice Gem patches for visualizing audio.
And Gem has of course a video player.
I ask myself now, because I do not want to reinvent the wheel, what are the advantages and disadvantages if I compare Gem to Ofelia?
I did some experiments with Gem some time ago but at a certain point I got stuck, whether because of my lacking knowledge or because the patch was getting slow.
So it could be possible to do exactly the same with both libraries?
Here I found a very old paper about Gem that states Gem is using openGL up to 1.2.
https://puredata.info/downloads/gem/documentation/manual/pub/zmoelnig2004gem.pdf
Has that changed? Or could that be a difference? I think the openGL versions that Ofelia can use depend only on the hardware.
What I like about ofelia so far is (in comparison to Gem):
To compile the patch as a standalone application.
To make nice interfaces.
(but I think those points are not openGL related...)
That it gives access to lua and open frameworks (which could make it easier to do complex graphics calculations / interfaces?).
Is anyone else in the position to compare those libraries, or has an opinion about them?
source package for gem
It depends if you're on Mac, Windows or Linux.
I'm on MacOS and I use Gem without Pd-extended. I just have to use Pd-Vanilla 32 bits (Pd-0.49-0-i386) and I've downloaded Gem via Help -> Find Externals -> Gem (in the research) and you choose the version from Deken Gem 0.93.3. Install it. Close Pure Data.
To load Gem when you're starting PureData : Open Pure data and go to Pd -> Preferences -> StartUp . In the StartUp Flags you tape Gem, 'Enter' and you juste have to close Pd and re-open and you can use Gem.
With cmd+B, you open the Help Browser and you have a Gem section with all the help you'll need to understand Gem (I've started two months ago).
Have Fun !
Trying to run Gem for Pd Windows 10 64 bit
@jeffgrips I have it running with vanilla in Windows7.... but it was hard...... and it's a long story....
I cannot see any reason that it would not work for widows10.
I have not found any other easier better solution.
(((SEE below though for the fact that the -lib needs to be declared...!
That could be your only problem? But I doubt it..!!! )))
I used the 64-bit GEM from here (0.94-test3.zip)..... https://github.com/avilleret/Gem/releases/
I unzipped it and put it in a folder (which I called "dot") on my desktop.
Because I am using many different versions of Pure Data I left it there, and I start Pd with a shortcut that also points to the GEM folder and loads it as a library (It has to be loaded at startup as a library...... and that could be why you don't have it working.... but probably not...).
This is the contents of the line "target" in the shortcut.......
"C:\Users\David\Desktop\Pd Vanilla\pd-0.47-1.msw\pd\bin\pd.exe" -lib C:\Users\David\Desktop\dot\0.94-test3/Gem -font-size 10 -font-face "Consolas"
Be careful with forward / backward slashes.
I am pretty sure that I tipped the contents of the "QT" folder out into the "0.94-test3 folder" where gem.dll is (from within the "QT" folder inside "0.94-test3").
If you find some .dlls are missing then post back with a list, and I can upload them....... but you might not have the correct C++ redistributables from Microsoft.
But if you want to start Pd normally by double-clicking a patch then you will need to declare the library in Pd.. edit....preferences.... startup......
If you have GEM in the extra folder you should only need to put "-lib Gem" where you see that I have put "-noautopatch".......
The gem abstractions could not be found though (the "parts of Gem... .like [pix_image] pix_video] [gemwin] etc. worked fine) I copied the contents of the Gem folder from "extended" into a folder on the desktop called "GemAbstr" and set a path to it in Pd preferences.
I removed gem.dll from that folder (no conflicts....!).
The abstractions now create, but the help files for embedded objects cannot be found (different "search" for embedded objects) so I have to open my "GemAbstr" folder and open them manually.
Everything works. All the patches from https://puredata.info/downloads/extended-view-toolkit create and run correctly. The camera on my computer even works (I had never had it working before).
And it works with Spout.
If you go this route then I wish you good luck.......
@zerino has confirmed that it can work with widows10........ https://forum.pdpatchrepo.info/topic/11450/pix-and-geometric-objects-not-being-loaded-in-pd-vanilla/7
........and resolved the "help" file problem.....
For the time being you are lucky that you are using Windows.
This solution is not available for other systems.
David.
Purr Data Linux-64 and GEM?
Ok, here in Puppy-Linux apt-get is not installed.
Now I installed libftgl2_2.1.3 successfully with the package manager.
Doing the same as before
[Gem] creates! Yes!
In the commandline (linux-console) [shortened]:
pd-l2ork -noprefs -nostdpath -nrt -verbose
Pd-L2Ork version 2.4.6 (20171213-rev.46ffba3)
compiled 22:30:53 Dec 13 2017
port 5401
guidir is /usr/lib/pd-l2ork/bin
"/usr/lib/pd-l2ork/bin"/nw/nw --user-data-dir="/root/.config/purr-data" "/usr/lib/pd-l2ork/bin" 5401 localhost pd-l2ork "/usr/lib/pd-l2ork/bin" xf3c100Waiting for connection request...
[0426/002010.733670:WARNING:chrome_main_delegate.cc(565)] final extension:
... connected
/etc/pd/gem.conf: No such file or directory
/root/.config/pure-data/gem.conf: No such file or directory
./gem.conf: No such file or directory
load plugins 'film' in '/usr/lib/pd-l2ork/extra/Gem/'
pattern : /usr/lib/pd-l2ork/extra/Gem/gem_film*.so
dylib loading file '/usr/lib/pd-l2ork/extra/Gem/gem_filmAVIPLAY.so'!
library loading returned: dlerror 'libaviplay-0.7.so.0: cannot open shared object file: No such file or directory'
dylib loading file '/usr/lib/pd-l2ork/extra/Gem/gem_filmGMERLIN.so'!
library loading returned: dlerror 'libgmerlin_avdec.so.1: cannot open shared object file: No such file or directory'
dylib loading file '/usr/lib/pd-l2ork/extra/Gem/gem_filmMPEG3.so'!
library loading returned: dlerror 'libmpeg3.so.2: cannot open shared object file: No such file or directory'
dylib loading file '/usr/lib/pd-l2ork/extra/Gem/gem_filmQT4L.so'!
library loading returned: dlerror 'libquicktime.so.2: cannot open shared object file: No such file or directory'
[...]
dylib loading file '/usr/lib/pd-l2ork/extra/Gem/gem_imageMAGICK.so'!
library loading returned: dlerror 'libMagick++-6.Q16.so.5: cannot open shared object file: No such file or directory'
[...]
dylib loading file '/usr/lib/pd-l2ork/extra/Gem/gem_imageMAGICK.so'!
library loading returned: dlerror 'libMagick++-6.Q16.so.5: cannot open shared object file: No such file or directory'
[...]
dylib loading file '/usr/lib/pd-l2ork/extra/Gem/gem_recordQT4L.so'!
library loading returned: dlerror 'libquicktime.so.2: cannot open shared object file: No such file or directory'
[...]
There are some more libs missing, maybe I should install them too?
All the examples of Gem seem to work now!
Even the teapod and openGL stuff.
And my final patches, also work. So nice!
Now I will review what those flags actually do:
https://puredata.info/docs/faq/commandline
But I am wondering, if I was lucky, that Gem is programmed for printing messages in the commandline and other non-working libraries probably won't do so?
Thank you so much