OpenGL directly to Linux framebuffer without X-Server - linux

I have a small OpenGL application that has been developed using GLUT. What are my best options to render directly to a Linux framebuffer (fbdev) with OpenGL, without an X-Server? I understand that GLUT needs X, so I'm not looking for ways to use GLUT without X.
The framebuffer device I intend to use is confirmed working with fbi and mplayer.
I have done (or I'd like to think that I have done) a pretty exhaustive research, and found some resources and libraries that might work. But most of the info is a bit outdated, and I'm not sure what to trust.
DirectFB looks good, exactly what I'm looking for, but does not seem to be in active development.
I'm inclined to try this out on my target device: https://github.com/mcdoh/glGears-on-DirectFB-with-OpenGL-ES - but again, this is the only example code I can find, and it's six years old.
Mesa is another interesting candidate, but I can't seem to find any recent information.
This looks interesting: http://www.mesa3d.org/glfbdev-driver.html - but I can not find any example code to go from.
So, while a lot of SO answers mention DirectFB and Mesa as solutions, I can't bring myself to be confident in those options while so little material can be found.
So, if you can point me in the right direction here, give me any examples to go from, that would be highly appreciated. What am I missing?
Edit due to question being marked as duplicate:
The answer to the related question recommends using DRM. I intend to run my code on an Allwinner H3-based embedded computer that does not yet support the mainline Linux kernel. Currently, it's running on kernel version 3.14, which I believe does not have DRM support.
So, are there any alternatives?

Related

How to develop GTK app with Vulkan for Linux?

I'd like to develop an application targeting modern popular Linux distributions that uses GTK for its UI, but also the Vulkan API to render a 3D model. Ideally I'd like to use the gtkmm C++ wrapper for GTK, and the Vulkan C++ API.
What ways do I currently have to do this?
I know that I can get a Vulkan context using SDL2 and other similar low level libraries, and I can get an OpenGL context using GTK. But I haven't found resources for combining these two approaches.
To start, I'm not limited to developing on or targeting any particular Linux distribution. Although any insights into why a particular environment makes this easier or more difficult are appreciated.
Edit:
I'm aware of this question: What is the Vulkan equivalent of the GtkGLArea widget (GTK+)?
However, many months have passed since its most recent update. My Google searching does not indicate that the state of affairs has changed, but I would like to be proven wrong. In addition, I intentionally phrased my question more broadly. I don't necessarily want just a GtkVulkanArea widget. I want to know of any valid way to combine Gtk and Vulkan. For example, is it possible to embed a Gtk event loop and widgets in an SDL2 window? What about the other way around? Again, my Google searching has not been very helpful, and I hope someone knowledgeable on this topic will answer.

Mac Firebreath plugin port to Linux dependencies

I have Firebreath plugin for Mac that I need to port to Linux
I am trying to find the replacement dependencies for the Linux version. Here is the dependencies I have in my cmake for Mac:
find_library(COCOA_F Cocoa)
find_library(FOUNDATION_F Foundation)
find_library(APPKIT_F AppKit)
find_library(COREDATA_F CoreData)
find_library(AGL_F AGL)
find_library(CARBON_F Carbon)
find_library(AUDIOTOOLBOX_F AudioToolbox)
find_library(COREAUDIO_F CoreAudio)
find_library(AUDIOUNIT_F AudioUnit)
find_library(QUARTZCORE_F QuartzCore)
find_library(QUICKTIME_F QuickTime)
find_library(OPENGL_F OpenGL)
find_library(QTKIT_F QTKit)
So far,
OpenGL => freeglut3 ?
Cocoa => GLFW ?
any suggestions for the other dependencies?
It is very unlikely that there are many direct replacements for these. Rather than looking for direct replacements for each library, figure out what functionality you need and find libraries that provide it.
For example, Carbon covers so many different types of things that it's impossible to guess what libraries on linux you'd actually need. CoreAudio is a little more clear, as it deals with sound, but are you doing sound playback or some other type of sound manipulation?
Better to look for libraries that provide the functionality you need. For example, for sound playback you'll likely want alsa. OpenCV or video4linux both give you webcam access, etc.
Once you have broken it down to what functionality you need a bit of google searching will almost certainly answer your questions without needing to rely on outside help and you can save your questions for specific problems you may run into while doing the port.

Tutorial for openCL and openMP--locations?

I am looking for tutorials on openCL and openMP. I didn't see a thread on this in past, not to say it's not there.
I'm going to be developing in linux with i7-740QM, and nvidia gtx 285M.
Google hasn't helped me out on this one.
OpenCL: http://www.macresearch.org/opencl is a very well explained set of videos with slides and sample code. Unlike the URL could suggest, this is not restricted to mac. He starts from scratch assuming no knowledge of GPU programming and goes up to memory access optimizations. I recommend watching the whole podcast. His optimizations are GPU-specific though ; you didn't specify what device you want to use.
OpenMP is pretty straightforward. This will get you started (and has more links on the bottom) and this goes further. These were on the first page of googling "OpenMP tutorial".
Note: in your next question, please specify the programming language you want to use or, if yo don't care, say so.

Linux kernel/os source code documentation?

Is there a Linux distro (other than Minix) with good documentation for the source code? Or, is there some good documentation to describe the general Linux source code?
I have downloaded the Kernel source code, but, it is (unsurprisingly) a little overwhelming to find my way around and I wondered if there were some higher-level documentation to go with how the Linux kernel works?
Have you tried having a look on The linux documentation project I've find it quietly exhaustive regarding linux
They have a section The Linux Kernel wich is an online book that explains
how the linux kernel works and why it does behaves in certain ways, you should deffinitely
look into it because it's very well made.
Some of the Linux kernel code has decent commenting as documentation, but if you're going to be getting into kernel development, I'd recommend picking up a good book. A good, relatively easy-to-read one is Linux Kernel Development, by Robert Love. I got started on the Second Edition when I was in college, and keep a copy of the third on my bookshelf now.
I also find the Linux Cross Reference site helpful in jumping around the kernel source code. It's nice for tracking down functions that are in different files, and getting at what you need.
If you want to learn about operating systems and their basics, I strongly suggest you to start with a small kernel and then ramp up to learn about Linux. Starting with an operating system like Linux would be overwhelming in terms of code and documentation.
There is XV6 operating system which follows the basic Unix notion of files and processes. You can get the code listing and the documentation explaining the code properly. Here is a link to it. link.
Since academia is using this course as a baseline, I think you should get good support for understanding the same.
Linux Core Kernel Commentary is a little dated, but is still an excellent source of info.
For something which is not obsolete (like kernel.org/doc is), you may see:
Free Electrons Linux/Documentation/ (3.8)
Linux Cross Reference kernel/Documentation/
kernel-doc (3.6.10)
The first is the one I prefer personally (clean, readable, pleasant, up‑to‑date).
The second is the most well known.
The third, is for download, if you wish to browse and search it off‑line (may be handy in some case).
My two cents as a side note before I leave: I feel it's weird how for such a famous stuff as the Linux kernel is, when you search the web for documentation, you get masses of obsolete documentations, and how the rather up‑to‑date ones seems to be rather hidden and far from the top position of search engines.

Which Linux RTOS solution should I choose?

I'm preparing myself to build RTOS solution on top of Linux this going to work on embedded device. I've done some investigation by myself but still I'm a bit confused.
Those are my criteria:
Easy to run on Samsung s3c2440 ARM9 machine
Open Source
Works together with Linux
Good community support
I've seen RTLinux and Xenomai. Xenomai looks more like thing for me, but still I'm confused.
Any good advice, pro's and cons?
I have not done any work with Real Time systems, but I know if this and this. I hope it helps or that it can at least put you in the right track.
The question is do you really need hard RTOS?
You may be able to get away with something like uClinux http://www.uclinux.org/
Check out montavista if you need commercial support.
If you have decided on a processor, I suggest you find a development board or kit and use the recommended operating environment. Including development tools and OS.
With the aid of FCSE enabled by Xenomai, Linux with the real-time extension can work pretty weel on ARM9 based boards like S3C2440.
This presentation covers some concepts: http://www.slideshare.net/jserv/realtime-linux
If you need free and absolutely stable out of the box with the lowest latencies, consider something like RTEMS (not Linux based, but does provide POSIX functions).
If you can afford it and want something absolutely stable out of the box with very low latencies and have a general purpose OS with all the bells and whistles, check out QNX - its got the same GNU userland/toolchains you're used to and is POSIX compliant.
RTLinux is best avoided - very buggy. Xenomai/RTAI can have decent success, although it has more limitations than QNX. Everything else is going to bleed you for large sums of money so you might as well choose the best option :-).

Resources