• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Page Information

    Loading...
  1. Dashboard
  2. Undefined Space
  3. OpenJFX
  4. OpenJFX on the Raspberry Pi

Page History

Versions Compared

Old Version 11

changes.mady.by.user Daniel Blaukopf

Saved on Oct 31, 2013

compared with

New Version 12

changes.mady.by.user David Hill

Saved on Apr 24, 2014

  • Previous Change: Difference between versions 10 and 11
  • Next Change: Difference between versions 12 and 13
  • View Page History

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Then open /boot/cmdline.txt in an editor and add on the same line as the other options dwc_otg.speed=1. Run sudo sync and reboot. This drops USB speeds from 480Mbits/s to 12Mbits/s, which is known to resolve issues with a variety of USB devices on the Raspberry Pi.

Running a JDK

...

You can get download a ARM based SE 8 JDK. (Linux ARM v6/v7 Hard Float ABI). You could also try the development mainline JDK9 early access.

This downloaded early access build for ARM hard float from http://jdk8.java.net/download.html. This bundle should be unpacked on the Pi. For example,

Code Block
themeMidnight
languagebash
sudo tar zxvf jdk-8-ea-b97-linux-arm-vfp-hflt-03_jul_2013xxxxxx.tar.gz -C /opt

To check that the JDK is installed correctly, run:

...

This should show that you are running an EA build of JDK 8. If the VM won't even start, you might be running a hard-float VM on a soft-float system.

...

Warning

The JAVAFX_DEBUG environment variable is only for use in development and you shouldn't rely on it for deployment of your application. In the future this functionality might be specified differently or be removed.

Raspberry Pi Memory Split

The older versions Raspberry Pi Raspian preallocates a fixed amount of the system memory for use by the video engine (VRAM).  The utility raspi_config can be used to alter how much memory is allocated to VRAM.

Newer versions of Raspian can dynamically allocate system memory for use as VRAM.

JavaFX applications tend to need significant VRAM to operate properly, particularly applications that use large images, but also for fonts and gradients.

The minimum recommended memory split for JFX on the Pi is 128mb, with many applications requiring 256mb.

JavaFX contains a texture caching mechanism that attempts to work within a limit of VRAM. Unfortunately, there is not an standard means of determining how much VRAM is available to start, nor is there a way to estimate the efficiency of that allocation. This is similar to standard malloc() which employs bucket mechanisms for efficiency but means that a small allocation will consume the nearest minimum bucket size. 

This JFX texture caching mechanism currently defaults to 256 MB - a value that will likely exceed what is available on the Pi. Remember that the allocated VRAM will also be consumed by the framebuffer (width * height * 2 byte per pixel * 2 for swapping) as well as any other system needs.

Given the limited amount of VRAM on the Pi, it is quite possible that an image intensive application might fail when the cache exceeds the available system limit.

The property -Dprism.maxvram=90M can be used to set the JFX texture cache limit, and in this example, setting it to 90 MB. This value would be a good starting value for a memory split of 256MB for VRAM.

To debug the JFX application failure, -Dprism.poolstats=true can be used to monitor the texture pool to better determine the upper limit.

In general, JFX will try to use no more than -Dprism.targetvram=xx, freeing textures when this value is exceeded. Least used textures will be discarded, and recreated on need. The default for this setting is calculated as 50% of the  maxvram setting, equal to 45M for the example of 90M. This setting may be overly aggressive for some applications, and experimentation with a larger value and  -Dprism.poolstats=true may result in more performance.

Touch events

A touch screen attached to the Raspberry Pi generates both TouchEvents and MouseEvents. Only a single touch point is supported by default, but there is experimental support for multitouch events. To enable multitouch, set the system property -Dcom.sun.javafx.experimental.embedded.multiTouch=true on the Java command line.

Overview
Content Tools
ThemeBuilder

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.21
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 320, "requestCorrelationId": "1d4b3ccd97a6da1a"}