Latest commits (Ultibo core 2.0.029)

Releases, updates and announcements from the Ultibo team.
User avatar
Ultibo
Site Admin
Posts: 1476
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Latest commits (Ultibo core 2.0.029)

Postby Ultibo » Tue Sep 19, 2017 8:17 am

The latest commits for Ultibo core are now available on GitHub. Changes include VideoCore IV support including OpenGL ES, OpenVG, OpenMAX IL, MMAL, DispmanX, Camera, CEC and more plus many bug fixes and other enhancements.

Given the major focus of this commit is the inclusion of full support for the VideoCore IV GPU and hardware accelerated graphics then almost everything else will likely be somewhat overshadowed, there have been many other fixes and changes as well and they are detailed below for reference.

This commit is accompanied by a new release of the Ultibo core installer, not only does this installer bring us to the Beetroot release it also includes more than 20 examples to get you started with using all of this new functionality.

List of changes:

  • New VC4 unit to provide the necessary interface to the Userland libraries
  • New VC4VCHIQ protocol driver to communicate with the VC4 firmware
  • VC4V3D unit with definitions for most known registers
  • Enable GLES11 and GLES20 units from the OpenGLES package to build for Ultibo
  • Add DispmanX, EGL and OpenVG units to the Ultibounits package
  • Add port of libShapes to the Ultibounits package
  • Add new ConditionWait function for condition variables to wait without releasing a lock
  • Add new SpinLockPreempt / SpinUnlockPreempt to call the correct spin lock for the current scheduler
  • Fix build errors when USB_DEBUG defined
  • Allow built-in USB Hub/Keyboard/Mouse/Storage drivers to be disabled using GlobalConfig variables
  • Fix Syscalls open_r to pass ShareMode as FILE_SHARE_READ or FILE_SHARE_WRITE and allow simultaneous opens
  • Fix USBDeviceBind to check for bound interfaces before trying to perform device bind
  • Fix use of USB bNumEndpoints to allow for zero endpoints
  • Fix CreateFile with CREATE_ALWAYS to obey FILE_SHARE_* options
  • Update FileCreate function to support the overloaded version with ShareMode
  • Implement new Completion object similar to Linux completions
  • Fix nil pointer reference in pthread_create() function
  • Change PageTableGetEntry to return entry as a var parameter instead of result
  • Add new PageTableGetPageSize, PageTableGetPageFlags and PageTableGetPagePhysical functions
  • Add Linux compatible msleep() function to Syscalls
  • Fix size of Syscalls Tpthread_attr_t structure not matched to Newlib definition which caused stack corruption
  • Allow Syscalls pthread_mutex / pthread_cond / pthread_rwlock functions to initialize an object on first use
  • Add symlink, chmod, truncate and ftruncate functions to Syscalls
  • Fix ThreadDestroy not removing thread from termination queue if destroyed early
  • Add POSIX compatible socket functions to the Syscalls unit
  • Update FPC linker script to include __preinit_array, __init_array, __ctors and __dtors for C and C++ support
  • Fix PL2303, FTDISerial and USBCDCACM stop transmitting if buffer becomes full

VC4 and the Userland libraries

After many requests, a lot of discussion and a huge amount of reading and research we have completed the first known fully functional port of the VideoCore IV Userland libraries to a bare metal platform.

We should make it clear from the start that this is not any sort of radical reverse engineering of the VideoCore IV, quite simply we are just using the same interfaces that Raspbian uses to access this functionality, what that means is that the Ultibo support will remain current with all fixes and enhancements added by Broadcom and the RPF because we use the official interfaces and can take advantage of new features quickly.

There are multiple parts to the interface but essentially the Userland libraries provide all of the standard graphics interfaces such as OpenGL ES, OpenVG, OpenMAX IL and a number of less well known ones such as MMAL and DispmanX. All communication with the VideoCore IV GPU is handled by the VCHIQ protocol driver which has been directly implemented in pascal using Ultibo specific interfaces and functionality.

The feature set of these libraries is enormous so we haven't tested every function, however everything that has been tested works including OpenGL 3D graphics, OpenVG 2D graphics, OpenMAX multimedia interfaces such as video and audio playback and encoding and the Broadcom specific MMAL abstraction layer which not only provides multimedia functions but also directly interfaces to the official Raspberry Pi camera (both version 1 and version 2).

At this point there are still some outstanding items, we have not yet completed the VCSM (VideoCore Shared Memory) driver and associated interfaces so any attempt to use zero copy between pipeline components in an MMAL application will currently fail. As of now no Free Pascal interfaces are available to access either the OpenMAX IL or MMAL libraries, these are very large APIs with a significant amount of functionality so creating pascal translations will require some additional work.

There are also a number of smaller libraries and internal interfaces which we have not provided Free Pascal units for at this stage, some will be completed as work continues whereas others may be left to those who require them.

Of course the VC4 support works only with the Raspberry Pi (all models) because it relies on the hardware contained in the chip.


GLES11, GLES20, DispmanX, EGL and OpenVG

Because the VC4 unit and Userland libraries provide a complete implementation of several standard graphics APIs we have included Ultibo ports of the interfaces required to use them, both OpenGL ES 1.1 and 2.0 are available as well as OpenVG, EGL and DispmanX.

The GLES11 and GLES20 units are part of the OpenGLES package and the OpenVG, DispmanX and EGL units have been added to the Ultibounits package and are now available for use by default.

We’ve also included two pure pascal OpenGL ES examples that show all of the necessary steps to create an OpenGL ES application in Ultibo.


Port of libShapes to Ultibo

As part of the work to port the VideoCore IV interfaces to Ultibo we have also created a Free Pascal port of the shapes library by A J Starks, this is a very useful utility library for working with 2D vector graphics as it provides a host of predefined shapes that can be drawn with little more than a single function call.

The library also handles all of the details of setting up the required DispmanX and EGL handles and initializing OpenVG as well as providing a method to use almost any True Type font for displaying text on screen. You can make use of the new VGShapes unit by simply including it in your project, see the new OpenVG examples for the basics of getting started.

Refer to the project page on GitHub for more details and examples and a description of each of the available functions in the library.


Completion objects

While not anywhere near as exciting as the VC4 support, we have implemented a new completion object type to add to the extensive list of synchronization functions already included in Ultibo. This one was added specifically to support the VCHIQ driver which relies heavily on these objects but they are now available for any suitable purpose.

The new functions are all contained within the Threads unit and include the following:

  • CompletionCreate - Create a new completion object
  • CompletionDestroy - Destroy an existing completion object
  • CompletionState - Get the current state of a completion object
  • CompletionWait - Wait on a completion object
  • CompletionTryWait - Try a completion object to see if it is completed but don't wait for it
  • CompletionReset - Reset (uncomplete) the state of a completion object
  • CompletionComplete - Set (complete) the state of a completion object and release one waiting thread
  • CompletionCompleteAll - Set (complete) the state of a completion object and release all waiting threads

For details of how to apply the latest source to your Ultibo core installation and rebuild your run time library see the wiki page Building from Source or watch the Building the RTL video on YouTube.
Ultibo.org | Make something amazing
https://ultibo.org
pik33
Posts: 576
Joined: Fri Sep 30, 2016 6:30 pm
Location: Poland
Contact:

Re: Latest commits (Ultibo core 2.0.029)

Postby pik33 » Tue Sep 19, 2017 8:59 am

WOW !!!
hansotten
Posts: 17
Joined: Thu Feb 04, 2016 7:07 am

Re: Latest commits (Ultibo core 2.0.029)

Postby hansotten » Tue Sep 19, 2017 9:02 am

Impressive, leaves me speechless! Thank you!
Gavinmc42
Posts: 1003
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Latest commits (Ultibo core 2.0.029)

Postby Gavinmc42 » Tue Sep 19, 2017 10:59 am

Yep wow, er just one complaint - beetroot is not green ;)
Actually- lots of complaints, I now have no excuse not to learn all that stuff.
Where is all my OpenGxxx books?
I was just about keeping up, my head is going to hurt from now on :lol:

What to do first? Fastest booting camera system?
markokrajnc
Posts: 37
Joined: Sat Feb 06, 2016 11:50 pm
Location: Slovenia
Contact:

Re: Latest commits (Ultibo core 2.0.029)

Postby markokrajnc » Tue Sep 19, 2017 11:28 am

T-H-A-N-K - Y-O-U !!!!!
Gavinmc42
Posts: 1003
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Latest commits (Ultibo core 2.0.029)

Postby Gavinmc42 » Tue Sep 19, 2017 11:51 am

Nice clean install on Linux under Wine.

USB booting a Zero hellotiger example works as it does not requires extra files on a C drive. :D
Probably going to need modified a rpiboot like burtyb's to make ram drive and load files via USB onto it?

Ok not the fastest boot camera, Camera LED stays on for a long time, colour balance etc maybe?
Tested on a 2, A+ and Zero :D Going to need a ram drive too if I go SD cardless ;)

I guess my gaming post is going to get a big kick up the ar.. too:lol:
Google time for OpenGLES games?
Hey if it uses latest Raspbian libs then OpenGL too?
pik33
Posts: 576
Joined: Fri Sep 30, 2016 6:30 pm
Location: Poland
Contact:

Re: Latest commits (Ultibo core 2.0.029)

Postby pik33 » Tue Sep 19, 2017 12:18 pm

What to do first? Fastest booting camera system?


Write a program which will display a rolling, bouncing, box, or Amiga ball....
...then rewrite the window manager from scratch :) :) :)
Gavinmc42
Posts: 1003
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Latest commits (Ultibo core 2.0.029)

Postby Gavinmc42 » Tue Sep 19, 2017 12:52 pm

Just tried teapot example, it works :D
I guess that slideshow project just got a boost, can do all sorts of stuff now.
Any of those hellovc examples use the HVS?
Going take me sometime to get used to this release
Gavinmc42
Posts: 1003
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Latest commits (Ultibo core 2.0.029)

Postby Gavinmc42 » Tue Sep 19, 2017 1:39 pm

Been trying most of the other examples.
That Zero MP3 idea just became a video player too, time to rip the old faulty CD player out of the car?

Hmm, does this mean the Free Pascal LCL library stuff just got one giant step closer.
SDL next?
My head hurts, it's not even xmas or my birthday - a giant present from Ultibo.
Even more convinced now, Garry does not sleep.

Interesting, Big Buck Bunny was my test video for an ARSandbox AP I have just been doing on big Mint box.
Is there any Pi OpenGL examples around?
ARSandbox on a Pi3, doable?
develone
Posts: 188
Joined: Wed Dec 28, 2016 7:40 pm
Location: El Paso Tx USA

Re: Latest commits (Ultibo core 2.0.029)

Postby develone » Thu Sep 21, 2017 5:33 pm

https://gist.github.com/develone/64699415f299abe4b443e0fafd1a4993

has a copy of the kernel7.img & video.h264
Converting avi to h264

https://github.com/develone/EKIS/blob/master/videos/video.avi


avconv -i video.avi -y -c:v libx264 video.h264


Modified line 62 Hellovideo.lpr

argv:=AllocateCommandLine('C:\test.h264',argc);

argv:=AllocateCommandLine('C:\video.h264',argc);

Run/Compile
copied the kernel7.img & video.h264 to sd-card

cp kernel7.img /media/vidal/FB25-444F/


cp ~/video.h264 /media/vidal/FB25-444F/



WOW this new version is very impressive.
:D :D :D

Return to “Ultibo”

Who is online

Users browsing this forum: No registered users and 1 guest