linux
Matlab, Octave and FreeMat
2008-11-18I will be implementing an LV2 plugin as a school project in the near future. So far I have however only been tinkering around with Matlab-work-alikes in Linux. The plan was to do some fast prototyping before doing the actual coding in C++. The problem is that fast prototyping isn't fast if you use for-loops and Octave or a stable version of FreeMat....
I first tried working with Octave but found out that compared to Matlab, it takes some thousand times more time to perform a function utilizing a for-loop I made for manipulating audio files. This made it unusable for me. I was told to use matrix operations instead of for-loops on IRC, but that kind of messed up the whole idea of fast prototyping of algorithms.
The principal problem with for-loops being slow is the fact the Matlab language is interpreted. However, for-loops can be made fast with JIT. This is where FreeMat kicks in.
FreeMat has a JIT implementation which utilizes the LLVM compiler infrastructure (which seems like an interesting project). There was no FreeMat package in (K)Ubuntu, so I had to compile it myself. FreeMat 3.6 is supposed to have some JIT-functionality, but I just couldn't get it to work. So, next up for trial was the svn version of FreeMat 4 (not released yet), in which I got JIT to work. The speedup with for-loops was very impressive! Though alas, FreeMat 4 still has lots of other bugs and incomplete parts in it for it to be truly useful.
Until FreeMat 4 is out (or Octave gets JIT) I gues I will have to use Matlab over remote X or in our school computer classes (which are fortunately open 24/7)...
nVidia FX5200 + BenQ G2400W = bad EDID :(
2008-02-07So, yesterday I bought myself a nice new 24" wide screen monitor, but unfortunately it took me many hours to get it to work with full resolution. With a default setup I could only get a resolution of 1600x1200. After a little of googling around I found out that nVidia cards have problems with EDID information, but it is also not uncommon for screens to give false information.
Well, whatever the cause was, I finally got it fixed. After trying various options, it seemed that the only problem was the maximum pixel clock value. Everything else was fine, so using the nVidia Linux driver I only had to add the following line into my xorg.conf under the "Display" section:
Option "ModeValidation" "NoMaxPClkCheck"
Now I can enjoy 1080p HD-material
...as long as it is low quality enough. It seems my 2,8GHz pentium4 has problems decoding too-high-quality video. I'm afraid I might have set up a cycle of upgrades to my computer :/
Making binary packages in Linux
2008-01-16My school c++-project work was a game that uses ClanLib. I tried to show it to my friends, but it seems most distros don't have ClanLib version 0.8.0 available. The next obvious thing to do was to build a package with the libraries in it. I'm not quite sure I did it the best way possible, but at least I got the job done. This is how I did it:
Just built it like always, copied all necessary .so-files to ./libs and made a script for starting it:
(Where ./binary is your executable)
#!/bin/bash
export LD_LIBRARY_PATH=./libs
./binary
I spent quite a long time searching for examples on how to do this, but didn't find anything. Hopefully this helps someone...