diegobernardes
Posts: 5
Joined: Wed Feb 12, 2014 5:47 pm

It is possible to have a smooth gui with raspberry?

Thu Jan 22, 2015 2:21 am

I need to create a "simple" project, it is simple, but the gui need to be very smooth.
The interface need to be similar to this one:
Image
The photos can be replaced by new ones and with nice effects.
If i click in one photo it should zoom and display some informations and buttons, one of this buttons is to print the image.
Its kind easy to do this in jquery, but raspberry browser isnt fast enougth.

So what is my options with raspberry?
Program direct on OpenMAX? SDL? Any other?

Thanks!!!

BillStephenson
Posts: 256
Joined: Thu May 17, 2012 1:25 am
Location: SW Missouri Ozarks
Contact: Website

Re: It is possible to have a smooth gui with raspberry?

Thu Jan 22, 2015 3:45 am

Have you tried over clocking your Pi?

cleverca22
Posts: 815
Joined: Sat Aug 18, 2012 2:33 pm

Re: It is possible to have a smooth gui with raspberry?

Thu Jan 22, 2015 4:43 am

dispmanx would get you flat 2d scaling with virtually zero CPU cost, no rotation
openmax is purely for video decoding last i looked
SDL, i dont have much experience with this

BillStephenson
Posts: 256
Joined: Thu May 17, 2012 1:25 am
Location: SW Missouri Ozarks
Contact: Website

Re: It is possible to have a smooth gui with raspberry?

Thu Jan 22, 2015 5:41 am

I've done some pretty smooth HTML5 animations in the Pi web browser. I don't know how that UI is set up, or what it's using to do the transitions, but I would think it's certainly possible to build a UI that's similar. Perhaps doing the "zoom" transition is a bit too intensive, but there should be ways to do it that are still aesthetically pleasing.

I'd think that if they're preloading all those full size images you're probably going to choke a Pi on that, so I'd not take that approach. I'd either use a single composite image, or thumbnails, and load the full sized selected image after the user selects it, and then do the transition.

And I'd over clock the Pi to "Turbo".

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: It is possible to have a smooth gui with raspberry?

Thu Jan 22, 2015 6:22 am

• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
Fidelius
Posts: 460
Joined: Wed Jan 01, 2014 8:40 pm
Location: Germany

Re: It is possible to have a smooth gui with raspberry?

Thu Jan 22, 2015 8:25 am

Diegobernardes, do you know a programming language already? Maybe you learnt Java in school/university? If so, you could use Raspbian's Java 8, where its 2D/3D API named JavaFX uses the Pi's video chip (=GPU) to do OpenGL-ES. All in a very high-level way, no need to worry about the low-level details.

If interested, please take a look at some Java 8 demos which come with soure code. Downloadable from Oracle's Java page: Java SE Development Kit 8 Update 31 Demos and Samples.

There the package "Linux x64 jdk-8u31-linux-x64-demos.tar.gz" will do. Then untar the archive on your Pi and start a demo via:

Code: Select all

java -jar <Demoname>.jar
Java programs you can develop and run on any platform, it's always the same binary code. On PCs you could use a fat IDE like Netbeans, and on the Pi you could use a lightweight IDE like BlueJ.

diegobernardes
Posts: 5
Joined: Wed Feb 12, 2014 5:47 pm

Re: It is possible to have a smooth gui with raspberry?

Thu Jan 22, 2015 1:00 pm

BillStephenson wrote: by BillStephenson » Thu Jan 22, 2015 12:45 am
Have you tried over clocking your Pi?
Yes, but don't change much :/
cleverca22 wrote:dispmanx would get you flat 2d scaling with virtually zero CPU cost, no rotation
openmax is purely for video decoding last i looked
SDL, i dont have much experience with this
didn't know dispmanx. looking into this wiki (http://elinux.org/Raspberry_Pi_VideoCor ... spmanx_.2A) seams like dispmanx is geting replaced by OpenWF.
but, anyway, gonna take a look at that.
ghans wrote:Ever thought of learning C++ and Qt5 ?
http://www.youtube.com/watch?v=wulbR2R1GpM
http://www.youtube.com/watch?v=SeJxQN-W2uA
ghans
looking now :]
this videos are awesome, amazing how fast raspberry can be with qt and c++
Fidelius wrote:Diegobernardes, do you know a programming language already? Maybe you learnt Java in school/university? If so, you could use Raspbian's Java 8, where its 2D/3D API named JavaFX uses the Pi's video chip (=GPU) to do OpenGL-ES. All in a very high-level way, no need to worry about the low-level details.

If interested, please take a look at some Java 8 demos which come with soure code. Downloadable from Oracle's Java page: Java SE Development Kit 8 Update 31 Demos and Samples.

There the package "Linux x64 jdk-8u31-linux-x64-demos.tar.gz" will do. Then untar the archive on your Pi and start a demo via:

Code: Select all

java -jar <Demoname>.jar
Java programs you can develop and run on any platform, it's always the same binary code. On PCs you could use a fat IDE like Netbeans, and on the Pi you could use a lightweight IDE like BlueJ.
i tried some demos with javafx, well, they run, but i cant say it was smooth.
gonna try to increase the gpu memory and try again.

User avatar
Fidelius
Posts: 460
Joined: Wed Jan 01, 2014 8:40 pm
Location: Germany

Re: It is possible to have a smooth gui with raspberry?

Thu Jan 22, 2015 1:29 pm

diegobernardes wrote:i tried some demos with javafx, well, they run, but i cant say it was smooth.
gonna try to increase the gpu memory and try again.
Yes, you've to set gpu_mem=128 via raspi-config (or in the /boot/config.txt ), otherwise JavaFX doesn't use OpenGL-ES at all because the latter runs out of video memory.
(Java then brings an "error message glGetError 0x505" or so. I've mentioned it some time ago in the Java sub-forum.)

Once JavaFX uses the GPU correctly, your Java application shows arcade-like frame rates, please see my little Pi-Sprite video for a mini demo.


P.S. Overclocking the Pi to its max (ARM @ 1000 MHz & RAM @ twice the speed) via raspi-config usually runs well and brings a good speed improvement, in particular when you're shifting a lot of memory like with moving pictures.

cleverca22
Posts: 815
Joined: Sat Aug 18, 2012 2:33 pm

Re: It is possible to have a smooth gui with raspberry?

Thu Jan 22, 2015 9:43 pm

from my experience, dispmanx would use the least cpu/memory and give the best performance, but its not exactly the most noob-friendly API

in terms of memory usage, each displayed image must be in GPU memory uncompressed, so just width*height*bitsperpixel/8 == bytes used

and in terms of cpu usage, all your doing is telling the GPU what x/y/width/height to render the image at, the GPU then does all drawing on the fly, for every frame of output

the only expensive part, is uploading images into the GPU and uncompressing the PNG files, which you can schedule to happen ahead of time

in theory, you could also wrap dispmanx up with JNI, and create a java friendly API for it, then you can do everything from java
the same could be done for python or javascript(node) as well, just pick a language you know

Return to “Graphics, sound and multimedia”