Wednesday, October 22, 2008

Back in the saddle again... kinda.

After nearly 3 weeks of not writing any code, I finished making some changes to VideoOutputDevice class. The class methods LoadVideoData and FlushVideoData are lock-free with respect to each other. This means that while I'm writing data into a bitmap, I can write the previous bitmap into the screen.

In any case, tomorrow's my last day at my current job, and I really don't know how late i'll be returning from home. And this Friday I'll go visit my new job. I need to return early home because then we'll have the October meeting for the Saya devs.

Let's hope my new job gives me enough time to work on the project. Wish me luck!

Sunday, October 12, 2008

Finished installing and customizing Mepis. Hurray!

I finished making the necessary modifications and software installations to my distro. You know what? I actually had to read the Saya-VE developers' guide for GNU/Linux :P. In any case, I already managed to compile and run Saya.

Hurray! Now I can continue developing... on GNU/Linux. I won't be able to debug the Windows version until I install VirtualBox, tho.

Friday, October 10, 2008

From PCLinuxOS to Mepis: Painful, but worth it!

If you've installed PCLinuxOS with an advanced partitioning, prepare for a painful surprise. SimplyMEPIS (up to 8.0 beta 2) doesn't let you install /usr, /var and /tmp into the partitions of your preference.

Which means that once you've logged in, you need to enter the console (through ctrl-f1), mount the other partitions, delete their contents, cp -a /usr /your-usr-partition-mount-point, rename the other partition, edit fstab, etc. etc. etc.

It's not something that you can do while in the LiveCD (I've tried to an extent and I failed miserably).

Also, if you've used a non-standard file system such as XFS, just forget about it. You need to mkfs.ext3 the other partition (in this case, /tmp) and then proceed. Speaking about /tmp, an additional step is required: You need to delete /tmp, which is a symlink to /var/tmp.


But after I managed to do all that manual installation work so that I retain the structure of my partitions (which I carefully tuned), I'm actually enjoying it.

For starters, you get nVidia support right out of the box. I booted the LiveCD in 1280x1024 with no problems whatsoever.

The KDE provided with Mepis 8 is awesome. It's not KDE4, but 3.5.9, and that gives you stability. But this KDE is better configured than the one with PCLinuxOS 2007. I can pump the volume up and down with my multimedia keys. In PCLOS, I had to set up the mixer manually (not without the help of some friends on slashdot and irc) and add some lines in some obscure alsa config file.

The kernel: PCLOS2007 ships with 2.6.19, and the latest upgrade is 2.6.22. Mepis 8 ships with 2.6.26, which also means support for tons of more wireless and external devices.

Package management: The Synaptic package manager is also provided as default (yay!), but Mepis provides an excellent addition: The actual applet tells you how many upgrades are available. And finally, there's no "pay-for-upgrade" policy. The latest packages are already available for no additional price (like Firefox 3.0.3, which I just downloaded an hour ago), and the repositories are based on Debian, one of the most community-supported repos. Try to beat that, Tex!

In short:

If you're stuck in PClinuxOS and want to try a debian-based distro, the upgrade is painful (unless you happen to have installed in only one partition), and you need to delete your packages - for compatibility - anyway. But it's really worth the upgrade, provided you manage to install prettier themes. Personally, the default ones suck - but hey, it's a beta version. And no crashes! :)

If you're undecided between PCLinuxOS and Mepis, go for Mepis. Nothing beats getting connected to the default Debian repos.

Thursday, October 9, 2008

Mandriva, distro headaches... and Mepis 8.0 beta 2

Sigh. I only finished downloading the Mandriva 2008 ISO so I could burn it tonight and install it. I chose Mandriva because its configuration is the closest to PCLinuxOS.

First bad news: I realized that I didn't download the most recent 2008.1, but the outdated 2008.0! ACK! 4 hours wasted.

Second bad news: Mandriva 2009 is out, and yet, it has lots of bugs. I'm not going to upgrade to a distro which freezes the GUI every now and then. What is this, Windows?. Also, I couldn't find the 2008.1 isos because the mandriva guys made them unavailable from the web. I had to use Google to find it. Now it's nearly 34% complete.

Third bad news: 2008.1 also has some bugs, and it's definitely annoying that the guys don't have the time to release a 2008.2 with all the bugs fixed - and no new features. No, instead they chose to go for KDE 4, an unstable branch of the Linux kernel, and lots of bells and whistles. I don't want to cut my hand with a bleeding-edge distro. I want something that JUST WORKS!

Therefore, I decided I'll use MEPIS.

Why Mepis?

1) It uses KDE! :D And the 3.5 branch! :D :D

2) At first it used the Ubuntu repository, but now it switched to the latest Debian - can't be any more stable than that!

3) It's a debian distro! Lots of packages are distributed as .debs.

4) According to this Linux discussion, Mepis is even more stable than Mandriva. And this other discussion gives me the impression that Mepis has surpassed Ubuntu.

In fact, I would be going with Ubuntu (most popular distro these days), if not for their negligence towards KDE.

Ah, here's a Mepis 8 review at deviceguru. Just what I was looking for. Hey, what do you know? The review's login screenshot says "Rick". Must be a sign ;-)

For the impatient ones: MEPIS 8 beta 2 (32-bit) torrent - courtesy of

I'm tired of waiting, I'll leave my computer on to finish the download.

Wednesday, October 8, 2008

Switching to Mandriva 2008.1

Tonight I'll make a bold step: I'll switch away from PCLinuxOS 2007, and move to Mandriva 2008.1 "one". The PCLinuxOS repositories are simply too small and too slow. Plus, Mandriva has the newest kernel.

This will help me with a lot of things - for example, I can try out the latest version of Kdenlive (for research purposes and maybe for making 1 or 2 short AMVS ;-) ). I'll also be able to use the latest GIMP. I tried compiling it on PCLinuxOS, but I just can't figure out how to tell it to compile right.

Anyway, I'll need to back up the important Saya stuff. *GASP* I need to back up my media, too! :( Ugh! Good thing I have a fresh 8GB Flash drive around.

If things don't go well, this may stall Saya development for a couple of weeks. Wish me luck! :)

I decided I'll use PortAudio

After a little research (actually a web search and a chat), I decided I'll be going to use PortAudio for the audio output. That should complete the components required for Audio Output.

Speaking of audio, I need to deal with using a different number of channels for the input and the output. With the help of Stefano D'Angelo, of, I managed a way to specify to the audio buffers some parameters for conversion. But I doubt I'll have that ready soon - first I need to complete the playback functionality. Later I'll worry about channel conversion.

Tuesday, October 7, 2008

Google Tech Talks on Youtube!

I hadn't known this, but it turns out that Google has been posting their tech talks for more than a year.

Two particular talks got me interested: The first, is a presentation made nearly a year ago about the new features in the upcoming C++0x standard. (Warning: 1 hour video!)

The next talk concerns us more - it's a fast lock-free implementation of a hash table. Hash tables are used in all kinds of programs, but if many threads try to access a hash table, they need to have exclusive access. With a lock-free hash table, you don't need exclusive access to add or remove an item from the table. In fact, you don't even need exclusive access to read the table! (warning: another one-hour video!). Here's the lock-free hash table presentation in PDF format.

The Java source code is available on Sourceforge:


Thursday, October 2, 2008

Fixed first thread bugs... and improving :)

I'm fond to announce that the threads module NOW WORKS! :D

The first test made by Rigo was pretty simple, and I've added a few things here and there. But I've managed to get the module to be more stable than the wxWidgets implementation!

For example, I've added a function that allows you to know if a thread is detached or not. If the thread was deleting itself, under wxWidgets, you could crash the system. The new implementation simply adds the thread to a detached threads list. So we now keep a joinable list and a detached list.

Also, when deleting a detached thread, we remove it from the list (with carefully-placed mutexes) so that you can't really double-delete a thread, even if you try.

I've also fixed a couple of bugs in the pause/resume methods (a stupid bug, I had used a sentry object but the object was never created, I had just invoked the constructor with no object to construct, doh :P ).

So this means I'll now be able to keep working on the playback base module.

In the future I have planned to make the modules separate shared libraries.