Elsewhere there are things that we all miss, yet it takes just one to notice...

Time to get personal…

With a long weekend coming up due to the Easter break and a lot of ideas in my head, I’ve decided to start some more experiments with some serious coding.

Various online profiles will be updated too.

Watch this space…

!false is funny because it's true

Variable names are important

For the last two days I’ve been working on decoding video frames and displaying them. The idea is to run against the system clock which I’ve had working everytime so far. This time though, I decided to make a general decoder so that I didn’t have to worry about FFMpeg’s video decoded format which up until now has always been YUV420 which I just had a GL using SL shader convert on the fly. Everything gets converted to an RGBA bitmap so I don’t have to worry about it.

Anyway, variable names…

I buffer up the frames and then test them against the current system clock for a frame that’s ready to be presented. I had two variable names, frame and frame_temp which are pretty innocent. Unfortunately though, and which I kept missing whilst going through the code, I was grabbing a pointer in frame_temp and testing it. If it fell below the current system time then it would then be assigned to frame. If there was a previous frame then it would be cleared from the buffer queue and added to the unused buffer queue.

Now this is what I missed.

Frame_temp is first used, frame is unitialised (actually null), the tests are done on frame_temp and if failed then just exits with a null pointer. Fair enough.

It was a “typo”.

Hidden between four lines of code using frame_temp I had used the variable frame instead (which is null to start with). When I accessed a method on that class it would crash.

The error message was very obscure and nothing on google search or anywhere else was any help.

My mistake…

Most of the time I rely on debug log outputs. And whilst running this code, everything was running just as it should. It’s hard to follow multiple threads in debug output.

Finally, I ran it through gdb which took me straight to the line of code where it crashed. The line right after the “typo”.

Lesson learnt…

New laptop and Linux Mint dual boot

A few weeks ago I bought a laptop, a Dell Precision 4500, i7 2Ghz, 4Gb memory, Quadro 1800M and a 320Gb hard disk, pre-installed with Windows 7.

The first thing I did was to shrink the volume which gave me about 130Gb which I installed Linux Mint 18.3. The dual boot worked fine until I updated the nVidia drivers and lost the resolution of 1920×1080. This is after installing everything, all my programming stuff, 3D stuff, etc. I tried the workarounds online with no joy, I was losing performance.

Anyway, I had a 9.5mm draw replacement which I could remove the DVD drive and put in my SSD drive.

The first three installs of Linux and it freezing randomly, plus sussing out out why in the end the GRUB bootloader was on the wrong drive, I finally figured a way to get it up and running. Initially, after reading that on an SSD you don’t need a swap partition, the last install I went back to the swap partition with the install. And it is now working.

I’ve yet to update the nVidia drivers which I will do sometime soon.

At the moment, I can boot into Windows off the normal HD and Linux off my SSD. It runs sweet. Programming stuff is installed but not yet used. I need a long holiday to really get this beast going. The graphics on this laptop actually run better than my PC (i7 4790, nVidia GTX 730).

The only thing that slows this laptop down is the hard drive and Windows.

Maybe tomorrow I will actually bravely update the nVidia drivers for Linux Mint because I soon want to start experimenting with 3D graphics API’s for desktop and mobile again. And as usual I wish I had just a minute more time to focus on my personal projects.

It’s been a while

Yes, most definitely it has been some time since I last posted anything on my blog. That’s because this last month I have hardly had any real chill time to myself. Well, I have had some, but it never lasts for long enough.

Anyway, I’ve still been faffing about. I recently purchased CopperCube so that I could delve deeper into WebGL. Plus I’m familiar with Irrlicht, and CopperLicht makes working with 3D graphics a doddle.

I’ve also found that I can actually call myself a full-stack developer considering recent projects I’ve been working on. One project involves a C/C++ TCP/UDP server for communications, A Java TCP server to use Java AWT graphics, GWT for a web interface instead of installing software. The server does many things, too many to mention, but I’m well chuffed with it.

Setting up the server involves freshly installing Linux. Then installing Apache Tomcat. Making a few modifications to the system and then installing the software.

Device connect on the network via ethernet or wifi and will automatically detect the location of the server because of the UDP heart beat. Clever stuff really. Probably not, but all the same, it works great.

I’ve also played around with having a home TCP server which can be made use of from my mobile phone while I am out, my tablet or a PC, as well as a GWT web interface.

After playing around with all of this, there’s lot’s more I want to play with. Maybe Vaadin or similar. Move on to desktop 3D graphics again instead of openGLES 2.

I’ve also finally got myself an i7 laptop with nVidia graphics. Cheap off eBay! So I can develop on the go. That’s if the battery is good in it.

There’s other things over this last month that have tickled my fancy, but I won’t mentioned that here. Tempting though.

Hopefully this weekend I will have a long one as I’m booking Friday and Monday off because I seriously need to relax a little.

Until next time…

Online GL shader editor

Just so I don’t lose or forget about it, I’ve found a very handy online openGL shader editor…


From basic shaders including texturing and lighting right up to procedural shaders and more.

All I need now is to run a sample project in Qt to test out some of these and then transfer them to GWT and Parallax. Good stuff can now be done.

Good and bad for embedded and Android

Embedded Linux is the bees knees for doing a lot of things, especially when you really don’t want the Android overhead on top of it. For a device such as the Odroid range which can be used as a headless server providing and IPTV gateway and a web interface for controls, linux is the better option.

When it comes to graphical applications, for example decoding video streams and openGL rendering, it always becomes a toss up between Linux and Android. A lot of people who are familiar with Java will automatically pick Java and I have to say, I do actually like the Java Virtual Machine. The JVM is handy whilst developing because a crashed application just gets cleared out.

Qt can also be used for developing mobile applications and has a very extensive framework and because it’s C++, time critical code isn’t a problem.

The only issue I have with Qt is that when it comes the day when I do want to release and application for whatever it is I finally do, packaging it up for all OS’s becomes a pain.

Qt for Android is easy, just build the project and get the APK. Just one file and it can be copied to any Adroid device.

Qt for Windows is a nuisance because you have to faff about with the terminal (which is awful in Windows) to package all the required libraries, and then it’s not guaranteed to run straight out of the box. For Windows you have to use a dependency walker to find the missing libraries.

Qt for Linux isn’t too bad unless you want the latest libraries. At this moment you can install Qt5.5 from the Linux repositories and away you go. Unfortunately, the latest version of Qt is 5.7 with some very nice additions so it’s back to packaging stuff up.

For embedded Linux it would have to be Qt from the Linux repositories.

For Android it is still a toss up between Qt and Android Studio + NDK. Although if I could get away with it I would use Qt and Linux unless it was going to be an application for the Android market.

Posts navigation

1 2 3 7 8 9 10 11 12
Scroll to top