tag:blogger.com,1999:blog-310630962024-02-08T19:28:05.312+02:00Open source talkTalk about open source software, specially embedded Linux.Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.comBlogger41125tag:blogger.com,1999:blog-31063096.post-49954885371440503082013-03-30T15:56:00.000+02:002013-03-30T15:57:01.507+02:00QGraphicsWidgetUsually it's easy to get things working with Qt (<a href="http://qt-project.org">http://qt-project.org</a>), but recently I encoutered an issue when trying to implement simple component derived from QGraphicsWidget.
My initial idea was to use QGraphicsItem, so I made this little class:
<pre>
class TestItem : public QGraphicsItem
{
public:
TestItem(QGraphicsItem *parent=0) : QGraphicsItem(parent) {}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
virtual QRectF boundingRect () const;
protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
};
void TestItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
qDebug() << __PRETTY_FUNCTION__ << "press";
}
void TestItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
qDebug() << __PRETTY_FUNCTION__ << "release";
}
void TestItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Q_UNUSED(option)
Q_UNUSED(widget)
painter->fillRect(boundingRect(), QColor(255,0,0,100));
}
QRectF TestItem::boundingRect () const
{
return QRectF(-100, -40, 100, 40);
}
</pre>
Everything was working like expected, but in order to use a QGraphicsLayout, I wanted to derive that class from QGraphicsWidget. The naive way was to make minimal changes:
<pre>
class TestWid : public QGraphicsWidget
{
Q_OBJECT
public:
TestWid(QGraphicsItem *parent=0) : QGraphicsWidget(parent) { }
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
virtual QRectF boundingRect () const;
protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
};
void TestWid::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
qDebug() << __PRETTY_FUNCTION__ << "press";
}
void TestWid::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
qDebug() << __PRETTY_FUNCTION__ << "release";
}
void TestWid::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Q_UNUSED(option)
Q_UNUSED(widget)
painter->fillRect(boundingRect(), QColor(0,0,255,100));
}
QRectF TestWid::boundingRect () const
{
return QRectF(-100, -40, 100, 40);
}
</pre>
<p>Pretty straightforward, isn't it? It showed and painted things like expected, but I didn't get any mouse events. Wait what?
</p>
<p>
I spent hours just trying out things and googling this problem. I knew I had this very same issue earlier but didn't remember how I solved it.
Until I figured out a very crucial thing, in case of QGraphicsWidget you must <b>NOT</b> implement boundingRect(). Instead use setGeometry for the object.
</p>
<p>
So the needed changes was to remote the boundingRect() method, and to call setGeometry in TestWid constructor:
</p>
<pre>setGeometry(QRectF(-100, -40, 100, 40));</pre>
<p>After these very tiny little changes I finally got everthing working.
That all thing made me really frustrated. Solving this issue didn't cause good feeling, I was just feeling stupid.
Sometimes programming is a great waste of time.</p>Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-77186054796643736822012-08-31T22:50:00.001+03:002012-08-31T22:57:17.151+03:00Adventures in Ubuntu land with Ivy BridgeRecently I got a Intel Ivy Bridge based laptop. Generally I'm quite satisfied with it. Of course installed latest Ubuntu on it. First problem was EFI boot and BIOS had no other options. Best way to work around it was to use EFI aware grub2. I wanted to keep the preinstalled Windows 7 there for couple of things, so needed dual boot.<br />
<br />
After digging around this German links was most relevant and helpful:
<a href="http://thinkpad-forum.de/threads/123262-EFI-Grub2-Multiboot-HowTo">http://thinkpad-forum.de/threads/123262-EFI-Grub2-Multiboot-HowTo</a>.
<br /><br />
In the end all I needed to do was to install Grub2 to EFI boot parition (/dev/sda1 on my case) and create the grub.efi binary under that. Then just copy /boot/grub/grub.cfg under it as well. On BIOS set up new boot label to boot \EFI\grub\grub.efi
<br /><br />
After using the system couple of days found out random crashes. The system totally hanged. Finally traced the problem to HD4000 graphics driver:
<a href="http://partiallysanedeveloper.blogspot.fi/2012/05/ivy-bridge-hd4000-linux-freeze.html">http://partiallysanedeveloper.blogspot.fi/2012/05/ivy-bridge-hd4000-linux-freeze.html</a>
<br />
<br />
Needed to update Kernel. But which one? After multiple tries, I took the "latest" and "shiniest" one:
<a href="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.4-precise/">http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.4-precise/</a>.
With that kernel I got almost all the functionality and stability I needed.
<br />
<br />
However one BIG problem: headphones. I got sound normally from the speakers but after plugging in the headphones I got nothing. This problem seems to be on almost all the kernels I tried. Then I somehow figured out a important thing related to this. When I boot with headphone plugged in I got no sound from them. When I boot WITHOUT headphones plugged then they work just fine. Of course I debugged this problem all the time with the headphones plugged in and newer noticed this could be some weird detection problem. Since I kind of found solution for this I didn't bother to google it down. And of course Canonical does not provide support for unsupported kernels. If I remember correctly with the original Ubuntu 12.04 kernel this worked, but the HD4000 problem is on my scale bigger one than remember to boot without plugging anything to the 3.5" jack....
<br /><br />
Of course my hopes are on 12.10 and don't want to dig it deeper, just wanted to inform you about this one.Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com1tag:blogger.com,1999:blog-31063096.post-78940393769733184832011-03-21T11:24:00.002+02:002011-03-21T11:42:11.468+02:00WaylandRecently Wayland have become a hot topic. Canonical has announced that <a href="http://www.markshuttleworth.com/archives/551">Ubuntu will go to Wayland</a>. Also <a href="http://meego.com/">MeeGo</a> has <a href="http://permalink.gmane.org/gmane.comp.handhelds.meego.devel/6643">great interest</a> on it.<br /><br />Qt has had (experimental) <a href="http://qt.gitorious.org/qt/qt/trees/master/src/plugins/platforms/wayland">Wayland client</a> support for some time now.<br /><br />A very new thing is support for Qt as <a href="http://labs.qt.nokia.com/2011/03/18/multi-process-lighthouse/">Wayland server</a>. With that one can easily make own Qt based Wayland compositor. This is huge. Since this the only working Wayland compositor has been under wayland-demos. Using Qt for this opens many opportunities.<br /><br />My vision is that Wayland is the future. And the future might be there sooner than you think...Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-75400609111568277642011-02-24T13:06:00.003+02:002011-02-24T13:10:21.395+02:00MeeGo statusOur CEO started a blog: <a href="http://cannedbypasi.blogspot.com/">http://cannedbypasi.blogspot.com/</a><br /><br />He wrote first entry about <a href="http://cannedbypasi.blogspot.com/2011/02/meego-qt-alive-and-kicking.html">MeeGo and Qt status</a>.<br /><br />Shortly: <a href="http://meego.com">MeeGo</a> is alive and kicking.Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-78301151844771383932010-11-26T23:21:00.004+02:002010-11-29T14:48:07.870+02:00Encrypted rootfs on MeeGo 1.1 netbookI promised my scripts to encrypt the rootfs on my Lenovo Ideapad running MeeGo 1.1. It's currently just a dirty hack but thought it could be nice to share it with you.<br /><br />My scripts uses cryptoloop. Unfortunately MeeGo 1.1 netbook stock kernel didn't support md_crypt so that was a no go. Of course I could compile the module myself but I wanted out-of-the box solution.<br /><br />Basic idea is to create custom initrd and use it. My solution needs Live USB stick to boot and do the magic. Also another USB drive is needed to get the current root filesystem in safe while encrypting the partition. I don't know if it's possible to encrypt "in place" meaning to use two loopback devices. However this is the safe solution.<br /><br />For the busy ones, just boot the MeeGo 1.1 Live USB and grab these files:<br /><pre><a href="http://kaaos.huutonauru.net/meego/netbook_rootfs_crypt/crypt_hd.sh">http://kaaos.huutonauru.net/meego/netbook_rootfs_crypt/crypt_hd.sh</a><br /><a href="http://kaaos.huutonauru.net/meego/netbook_rootfs_crypt/mkcryptrd.sh">http://kaaos.huutonauru.net/meego/netbook_rootfs_crypt/mkcryptrd.sh</a></pre><br />Then: <pre>chmod a+x crypt_hd.sh mkcryptrd.sh<br />su<br />./crypt_hd.sh</pre><br />And follow the instructions.<br /><br />The ones who have more time and want to double check everything, please follow instructions at: <a href="http://kaaos.huutonauru.net/meego/netbook_rootfs_crypt/README">http://kaaos.huutonauru.net/meego/netbook_rootfs_crypt/README</a><br /><br />This solution has at least one drawback. Once the kernel updates you have to recreate the initrd. For that purposes I created a tiny script than can be run after kernel update:<pre><a href="http://kaaos.huutonauru.net/meego/netbook_rootfs_crypt/update_initrd.sh">http://kaaos.huutonauru.net/meego/netbook_rootfs_crypt/update_initrd.sh</a></pre><br />That script also needs the mkcryptrd.sh script above.<br /><br />Of course that may break your system at any time, so be warned.<br /><br />For my Lenovo Ideapad S10-3t and MeeGo 1.1 netbook it worked fine. My test case was to make very fresh installation first from the Live/installation USB. Boot again and setup the cryptoloop from Live USB. After that I could easily boot my crypted MeeGo 1.1. It asks password in very early phase of boot process. After it's written correctly the MeeGo 1.1 system should boot up normally.<br /><br />This worked for me, and I give no guarantee that this works for you. However you're welcome to send patches and improvements.<br /><br />UPDATE 29.11.2010:<br />Some people have reported problems when they have different kernel version than on Live USB. The're unable to boot back to their system. I try to figure out solution for this issue.Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com2tag:blogger.com,1999:blog-31063096.post-43407521919740466132010-11-25T14:58:00.001+02:002010-11-25T15:00:46.019+02:00My presentation at MeeGo Conference 2010Finally they uploaded videos of MeeGo Conference 2010 presentations. Here's my presentation, enjoy:<br /><a href="http://conference2010.meego.com/session/meego-system-integration-hardware">http://conference2010.meego.com/session/meego-system-integration-hardware</a><br /><br />Also please note the <a href="http://conference2010.meego.com/sites/all/files/sessions/jouni_roivas_meego_system_integration_to_hw.pdf">slides as PDF</a>.Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-74148145279158593472010-11-24T19:36:00.005+02:002010-11-24T22:41:37.341+02:00MeeGo on Lenovo Ideapad S10-3tI was one of the lucky people that received Lenovo Ideapad S10-3t in <a href="http://conference2010.meego.com/">MeeGo Conference 2010</a> at Dublin. Of course I'm using MeeGo on that and now I have been playing with it a while.<br /><br />Unfortunately I needed to reinstall the MeeGo 1.1 and I used the image available at <a href="http://meego.com/downloads/releases/1.1/meego-v1.1-netbooks">http://meego.com/downloads/releases/1.1/meego-v1.1-netbooks</a><br /><br />After some time and multiple reboots the WLAN and Bluetooth stopped working. Little googling revealed that there's something wrong with BIOS/settings. This helped a lot: <a href="http://forum.meego.com/showthread.php?t=2011">http://forum.meego.com/showthread.php?t=2011</a><br /><br />So just go to BIOS (F2 at boot), reset factory default and save.<br /><br /><br />Thought that this could be nice machine to take with me when traveling. So In order to use it more productive way I installed <a href="http://www.documentfoundation.org/">LibreOffice</a>.<br /><br />Actually I downloaded the GNU/Linux 32 bit tar.gz and found RPM:s under that. I was a bit adventurous and created a repository for them.<br />So did:<br /><pre>tar xzvf LibO_3.3.0_Linux_x86-64_install-rpm_en-US.tar.gz<br />sudo mkdir -p /usr/local/repos/libreoffice<br />sudo cp -r LibO_3.3.0beta3_20101115_Linux_x86_install-rpm_en-US/RPMS/* /usr/local/repos/libreoffice<br />cd /usr/local/repos/libreoffice<br />sudo zypper install createrepo<br />sudo createrepo .</pre><br />After that set up zypper repository for that. Created file /etc/zypp/repos.d/libreoffice.repo:<br /><pre>[libreoffice]<br />name=libreoffice<br />enabled=1<br />autorefresh=0<br />baseurl=file:///usr/local/repos/libreoffice<br />type=rpm-md<br />gpgcheck=0</pre><br />After that just:<br /><pre>sudo zypper refresh<br />sudo zypper install libreoffice3-* libreoffice3.3-freedesktop-menus</pre><br />So this far it has been quite nice to play around with this Ideapad and MeeGo. Another idea was to have the whole rootfs encrypted to protect my data in case I lost the machine. I actually accomplished that and will post scripts and instructions soon!Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com1tag:blogger.com,1999:blog-31063096.post-82158706324198188992010-03-24T11:38:00.002+02:002010-03-24T12:28:41.432+02:00Inner QtLately I have played a lot with <a href="http://qt.nokia.com">Qt</a>. Generally it's nice and I think it's easy to adapt and get things done. Also the development of Qt have been blazingly fast, new features are implemented and it's going into good direction.<br /><br />I have taken a closer look to the inner design of Qt. First note was that Qt is just one big collection of code. Of course it's divided into modules like QtCore, QtGui, QtNetwork, QtOpenGL, etc. But when you look the sources you'll see one big drawback: you really can't compile one module without compiling first almost all other modules. Also compiling only few classes or widgets is not possible.<br /><br />The main reason for Qt being just a big pile of code is heavy usage of private members. In generally private members and classes are good. But somebody has led this into very wrong direction. Totally separated Qt classes uses each others private members/classes directly. That achieved by making the private members protected and listing other classes as friend classes. This leads to degeneration of the code. An extreme example is that QWidget, the very basic class in Qt. Let's see it's sources: <a href="http://qt.gitorious.org/qt/qt/blobs/master/src/gui/kernel/qwidget.h">qwidget.h</a>. Total number of friend statements in qwidget.h is about 50. However not all of them are really used, but 50? Are you kidding? Then it hits me, what the heck does implementation of QPixmap::fill in <a href="http://qt.gitorious.org/qt/qt/blobs/raw/6dcdab8d9ee66f420a525400d873cfccf78c7003/src/gui/kernel/qwidget.cpp">qwidget.cpp</a> ?<br /><br />Another thing that does not fit in my mind is use of QApplicationPrivate. There's lot of use of it in qwidget.cpp. And I really don't get the point why? Why are these not public functions and members in QApplication or QCoreApplication? Of course there's some aspects which supports this kind of approach, but this was just an example. Such usages of private classes and members can be found all over the Qt. For example there's clean cases where private is used even if there's public member which does the same thing.<br /><br />My point was that Qt is great, but could be even better if the inner design is reviewed and proper modifications made. I mean: using public members, avoiding usage of privates and friend classes and cleaning off all the stupidity. A good test could be: if you take a source files of a widget and compile it outside Qt source tree (compile with public API), does it compile without modifications? For most widgets and classes this should be true. Currently most of the classes fails this test. Of course using privates is ok when it's really needed. But I see no reason using privates so heavily as Qt currently uses.Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com1tag:blogger.com,1999:blog-31063096.post-50689760702399655832008-09-22T15:55:00.002+03:002008-09-22T16:24:50.703+03:00Drafting a browserAfter my latest post about Google Chrome, I was pondering how to use the process separating system on other projects or making a own browser with the same idea. Fortunately I found that there's <a href="http://library.gnome.org/devel/gtk/unstable/GtkSocket.html">GtkSocket</a> and <a href="http://library.gnome.org/devel/gtk/unstable/GtkPlug.html">GtkPlug</a>. With them you can easily embed other processes on a main process.<br /><br />So we need a main application, which creates tabs and takes care of handling them. Quite easy job to do. When creating a new tab showing a new GtkSocket inside it. Socket id is passed to a new process, for example by launching a new process with exec and passing socket id (numeric value) as a command line agument. That's about the minimal required functionality for the main process. It just handles tabs and launches other processes.<br /><br />The client application reads the numeric socket id from it's command line arguments, creates a new GtkPlug with gtk_plug_new (socket id as a parameter). Now it can just draw any Gtk+ widgets on that GtkPlug widget and show them. So now we can draw, let's say, a URL bar and for example <a href="http://live.gnome.org/WebKitGtk">WebKit/Gtk</a> on that GtkPlug widget. And let's define some signals that when typing URL on the URL bar the URL will be opened on the WebKit/GTK. Now the client app is ready.<br /><br />And what do we have now? A main app, which opens tabs, launches a client app and passes GtkSocket id for it. Client shows URL bar and WebKit. The contents of client app is shown inside the main app's tab view. Isn't that now a simple web browser, where every tab is running it's own, separate process? Somebody could now catch the idea and continue working on this kind of approach. And that's not just browsers. The GtkSocket is normat Gtk+ widget, which can be used like any other widget. One could make very interesting apps where one main app embeds other processes inside it and showing their content. Now anybody got some ideas? At least I do...Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com2tag:blogger.com,1999:blog-31063096.post-72821770355663401422008-09-03T13:40:00.002+03:002008-09-03T13:54:58.483+03:00Google ChromeRecently Google announced their web browser project called <a href="http://www.google.com/chrome">Chrome</a>. They also released beta version for Windows. It seems to be a interesting project. Especially when they say that it's released as open source.<br /><br />The main renderer of Chrome is based on <a href="http://webkit.org">Webkit</a>. Webkit is quite good browser engine used for example by Apple Safari, Nokia S60 web browser and Google Android. On top of that Google has made it's own JavaScript engine, which seems to be faster than any other JavaScript engine on the market.<br /><br />One good idea on Chrome is that every tab is it's own process. Also JavaScript runs on it's own thread making the web experience more better. Since traditional browser runs all tasks in queue it means that when one task is taking a long time, others must wait for it.<br /><br />My first impressions about Google Chrome is that it includes great innovations and ideas, but I have also my doubts. There been also criticism about the <a href="http://tapthehive.com/discuss/This_Post_Not_Made_In_Chrome_Google_s_EULA_Sucks">EULA</a>. What I'm waiting is that other browsers adapts ideas from Google Chrome and so everybody would benefit even if they don't want to use the Google's browser. I'm sure that Mozilla Firefox project will react soon. Better browsing times are about to come...Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-5724658725083594172008-08-22T09:58:00.003+03:002008-08-22T10:22:34.951+03:00Ubuntu on Asus EeePCI installed <a href="http://www.ubuntu-eee.com">Ubuntu Eee</a> on my Asus EeePC 900 some time ago and have been using it since then. I really like it. Screen resolution is ok, all my favourite apps are working and I can perform all the task I usually do.<br /><br />The install process itself was painless, I made a bootable live USB stick from the Ubuntu Eee image, booted from it and installed it. After reboot Ubuntu started, and for example WLAN was working out of the box. First thing I noticed was that the touchpad was unconfigurable. I was unable to run gsynaptics. So I installed <a href="http://array.org/ubuntu/"> array.org</a> kernel and enabled the <a href="http://array.org/ubuntu/news-archive.html#2008-07-21T12:43:57-06:00">elantech synaptics</a> driver. Also xorg.conf needed some tweak in order to make gsynaptics to run. Shutdown had also a problem but unloading <code>snd-hda-intel</code> module on halt fix this problem.<br /><br />Another thing was the sound volume buttons but fortunately there was good instructions on <a href="http://wiki.eeeuser.com/getting_ubuntu_8.04_to_work_perfectly">Eee User wiki</a>. Another annoying problem was evolution launching every time when power cord was plugged in. Resolution was to remove <code>/etc/acpi/events/asus-mail</code>. After that there was one more problem: webcam. Resolution was to use <a href="http://www.unicap-imaging.org/download.htm">ucview</a> and to make some module tweaking.<br /><br />Now I'm quite satisfied with my configuration. This is way more better than the default distibution. The performance is quite good, and there's enough memory for my use. I didn't even set up a swap partition, however it could be useful in for more powerful use. For light net surfing and desktop use I'll be just fine without swap. I doubt if I'll try another system since I'm too happy now for the Ubuntu.Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-43269684884370614802008-07-25T14:10:00.004+03:002008-07-26T11:45:26.582+03:00Asus Eee PCRecently I visited London. The trip was nice and I enjoyed the atmosphere, nice people and the feel of a big city. However I was lucky enough to get one <a href="http://eeepc.asus.com/global/">Asus Eee PC</a> 900 with 8.9" display, 900 MHz CPU, 1 GB memory and 20 GB SSD hard drive. It didn't cost too much, and got even extra warranty. It's UK version so no finnish key layout, and the power plug is also UK so got to purchase also a converter to make it work on european standard outlet.<br /><br />Now I'm using the default Xandros distribution, got terminal (ctrl+alt+t) and I'm able to use apt-get. Nice system but I think I want more. Next thing is to try <a href="http://www.eeebuntu.org/">Eeebuntu</a> and see if I like it better.<br /><br />But I'll report more when I know better. Have a great summer...Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-72428827499334040402008-07-07T21:04:00.002+03:002008-07-07T21:19:19.206+03:00Some tricks with N810Recently I got Nokia N810. Of course I installed <a href="http://mojo.handhelds.org/">Handhelds Mojo</a> "<a href="http://mojo.handhelds.org/grumpy-armv5el">grumpy</a>" on it. The installation process was not painless. Some struggling around and it booted to the login prompt. I was wise enought to set up a normal user and a password for it so I was able to login (N810 includes a keyboard, nice).<br /><br />But that was just not enough. I wanted X. Easiest way seemed to be to compile <a href="http://repository.maemo.org/pool/chinook/free/x/xorg-server/">Xomap</a> package for the grumpy system. For my surprise it was quite easy job, some tweaking of course, but I got X running quite easily.<br /><br />I got even touchscreen working, but HW keys just didn't want to work. There is quite a <a href="http://lists.maemo.org/pipermail/maemo-developers/2008-February/032207.html">same situation</a>, but unfortunately didn't find solution for that. Also mailed a question to the author of the post but got no reply from him.<br /><br />However I'm quite glad to get this all working (grumpy + Xomap) on N810. It just proves that the Handhelds Mojo project is a piece of great workJouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-46347284088971201102008-05-07T19:11:00.003+03:002008-05-08T10:41:27.885+03:00Mojo on N800Recently a port of Ubuntu for ARM processors was released. The project is named <a href="http://mojo.handhelds.org/">Mojo</a>, and currently they've released distributions called Frisky (Feisty based) and Grumpy (Gutsy based). The first thought I had was to make it work on a real hardware. This time I chose my Nokia N800 tablet.<br /><br />At the beginning I made a simple system with debootstrap. I was using a qemu based ARM system to install debootstrap to create the system for a specific directory. For simplicity I put resulted contents from the directory to a MMC card. I just made one EXT3 partition and copied (or really I used tar) everything there. I put the MMC card inside my N800 and used flasher to select boot from MMC. Booted and nothing seems to happen. Weird.<br /><br />First I thought there's some problem with my system. After a thought find out that my system might boot but it won't show anything on the screen. The solution was to follow instructions how to <a href="http://www.internettablettalk.com/forums/showthread.php?t=18948">disable boot splash screen and enable console on framebuffer</a>. Now I was able to boot the device, startup messages from kernel begun to run, and finally the system from the MMC booted and show it's login prompt. Fortunately there was no keyboard available so I was just pressing the enter key to see that system really reacts for something.<br /><br />Next I'd like to try to make real system working on the device. Meaning X and some apps running. Also want to try this process on my FIC Neo1973. But the greatest thing is that now I can use Ubuntu as my system on the ARM. Previously I was using Debian, but Ubuntu brings some benefit. I will certainly continue to play with these repositories and probably get something nice working...<br /><br /><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/E2gp0BXCa5Y&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/E2gp0BXCa5Y&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com1tag:blogger.com,1999:blog-31063096.post-41167513632606759372008-03-09T17:16:00.004+02:002008-03-09T17:42:01.059+02:00Uptime weirdnessGot unusual situation today. I was checking my server uptime because it was going to break 500 days and wanted to celebrate it. One day it was just fine saying:<br /><br /><code>10:05:53 up 487 days, 23:55, 5 users, load average: 0.08, 0.02, 0.01</code><br /><br />I just remembered that the box should have been breaked the record and checked the uptime again and it was saying:<br /><br /><code>17:02:24 up 10 days, 4:24, 5 users, load average: 0.16, 0.03, 0.01</code><br /><br />So what happened? The box have not certainly been rebooted or anything. I've been happily running processes on it daily.<br /><br />I'm still running old 2.4 kernel series on a faithful Debian sarge installation. A closer investigation showed that those old kernels have a bug which <a href="https://bugzilla.redhat.com/show_bug.cgi?id=97373">resets uptime after 497 days</a>. It has been luckily fixed on 2.6 series kernels but it won't help me.<br /><br /><br />P.S. Luckily a couple days ago I got a new computer for development and test purposes. It's not the newest and shiniest one, nor cutting edge, but certainly faster and better than any of my laptops or other computers. It got a fairly ok graphics card (nVidia, and it's proprietary drivers sucks but it's still ok). Mainly I needed support for OpenGL shaders and framebuffer object extension and the nVidia card supports both of them. For now the box is running Ubuntu 7.10 because it's just the best choise at the moment, but will certainly test other distros when I get some time and I don't need it any more as a stable development environment. But I'm again excited to get a new toy, I have been using only laptops for quite a while and a desktop machine is really refreshing extra!Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-23641054797860418352008-02-29T22:19:00.004+02:002008-03-01T11:19:40.962+02:00Rooting my NASI purchased a <a href="http://www.buffalotech.com/products/network-storage/linkstation/linkstation-live/">Buffalo Linkstation Live</a> NAS. It was at first a nice toy. Then I figured it was running Linux. The adventure begins.<br /><br />Little search at Google showed that it's possible to gain telnet and <a href="http://buffalo.nas-central.org/index.php/Open_Stock_Firmware">root access to the box</a>. I was totally excited to get the root shell prompt on my terminal. This seems to be too good to be true, but suprisingly it was. I was able to get uname and statistics via procfs. Setuped the SSH and was able to login to the box.<br /><br />Next I installed ipkg system on it using <a href="http://buffalo.nas-central.org/forums/viewtopic.php?f=19&t=4075&p=39162#p39162">these instructions</a>. I was able to install packages! Installed <a href="http://en.wikipedia.org/wiki/GNU_Screen">screen</a> and <a href="http://irssi.org">irssi</a> and in several minutes I was using IRC on the box.<br /><br />There's a lot of packages available to the device and just can't even imagine what to do next. I have a NAS box, which can be extended to a real server with any applications I want to run. It has a quite a big amount of disc space (500 GB), and it didn't even cost a much. I'm impressed. For people looking a quiet, small and handy server, I can recommend purchasing one of these. I will continue playing with this and will report if there will be some more findings.Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-58902614603271859162008-02-27T19:42:00.007+02:002008-02-27T21:43:11.420+02:00FOSDEM 2008So the <a href="http://fosdem.org/2008">FOSDEM 2008</a> is now over. Writing down some experiences about it. First of all, there seemed to be a lot of people in there. Their broschyr said there will be 4000+ geeks at the place. But nobody was counting, so the number is just an estimation. However the place was crowded, some lectures was too full, people was just standing like sardines in can. There was space in some places too, but the most popular events was just nightmare.<br /><br /><img src="http://roivas.org/fosdem2008/janson.jpg" width="400px" /><br /><span style="font-weight:bold;">Janson lecture room</span><br /><br />Picked some interesting lectures, such as <a href="http://clutter-project.org/">Clutter</a>, integrating the Web into GTK+ with WebKit, Mozilla Mobile, <a href="http://www.tangogps.org/">tangoGPS</a> lighting talk, among other full lectures and lightning talks (15 minutes time limit) which I was watching.<br /><br />Also spent some time watching the stands. There was many <a href="http://eeepc.asus.com/">Asus Eee PC</a>'s and <a href="http://olpc.com/">OLPC</a> (One Laptop Per Child) computers, as well as different embedded devices running free software, for example <a href="http://www.openembedded.org">OpenEmbedded</a> stand was interesting.<br /><br /><img src="http://roivas.org/fosdem2008/eeepc.jpg" width="400px" /><br /><span style="font-weight:bold;">Eee PC</span><br /><br /><img src="http://roivas.org/fosdem2008/olpc.jpg" width="400px" /><br /><span style="font-weight:bold;">OLPC</span><br /><br />It was not only strict business but also fun time, spending nice time at Friday Beer Event at Delirium cafe and GNOME Beer Party on Saturday. Had a change to talk to people in a relaxed environment. Somebody said that the real conference starts when people gets some beer.<br /><br />But after all met some good people and changed thoughts, talked about different open source related stuff. And I was able to show my demo with FIC Neo1973. The demo itself was not impressive, it was just a Debian etch booting with working X, touch screen and <a href="http://matchbox-project.org/">Matchbox window manager</a>. But what makes it great, is the time spent on that: only a single day. I'd probably talk more closely about it and about the progress in this blog.<br /><br />But I was nice to be there! Thanks to the organizers, all speakers and people I met.Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-57541000328432181002008-02-06T17:40:00.000+02:002008-02-11T13:50:39.310+02:00Going to Fosdem 2008<a href="http://www.fosdem.org"><img src="http://www.fosdem.org/promo/going-to" alt="I'm going to FOSDEM, the Free and Open Source Software Developers' European Meeting" /></a><br /><br />As said I will be at <a href="http://www.fosdem.org/2008/">FOSDEM 2008</a> in Brussels, Belgium. I'm going there with a co-worker, and our employer, <a href="http://nomovok.com/">Nomovok</a>, is kindly paying the trip.<br /><br />I'm quite excited to see other people working on open source projects and talk to them about all kind of open source related things. If you're going to FOSDEM as well and are intrested to talk with me, please contact me beforehand with a email (you're able to see the email in my profile) and let see if we can arrange a meeting.<br /><br />I probably have my FIC Neo1973 with me so that I can show it for curious people. Also my Nokia N800 will be there. I can also tell about some personal intrests of mine in area of open source. So don't hesitate to contact me. See you at the FOSDEM.Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-81609075403479378422008-01-24T20:03:00.000+02:002008-01-24T20:41:17.120+02:00Running ARM Debian in qemuI wanted a whole running ARM Linux system, but considered my real ARM devices (for example FIC Neo 1973) too slow and limited for the most tasks I wanted to perform. So had an idea of fully emulated ARM system, running on <a href="http://fabrice.bellard.free.fr/qemu/">qemu</a>. Best option for the installable system seemed to be <a href="http://debian.org">Debian</a> since it had a prebuilt packages and quite easy install system. And of course, I like Debian.<br /><br />Fortunately I found a good guide for my adventure: <a href="http://www.aurel32.net/info/debian_arm_qemu.php">http://www.aurel32.net/info/debian_arm_qemu.php</a>. First started by getting the latest qemu, and built it for my system. Fine, then installed it and everything seemed good. So continued with the next step: installing Debian to the qemu system. Installer started fine. The installation went fine. Then the first boot and the first problem. For some reason the boot process hanged every time when the system was checking the disc image. The check was forced in first place because the clock of the qemu system was reseted to zero on every boot (back to 1970's) and the system thought that we have been too long without performing the check. Just spent a day trying to solve the issue and googled for solution. The main problem seemed to be qemu but even the newest CVS version didn't help. Finally made a dirty but a working solution: changed disc image parameters with tune2fs so that the image won't be checked any more. Success.<br /><br />Finally logged to the Debian system and was able to operate as in any other system. I was able to install new packages, build packages and perform other operations. Then I downloaded a third party ARM Linux application which just didn't work. I was unable to execute it. Then figured out something. The kernel which was provided by the tutorial didn't support EABI. I wanted EABI. So I thought that building a own kernel would be nice and easy. Thought wrong.<br /><br />First I needed cross compiling toolchain for ARM EABI, it was fortunately found from <a href="http://www.codesourcery.com/gnu_toolchains/arm/download.html">http://www.codesourcery.com/gnu_toolchains/arm/download.html</a>. Then I downloaded newest kernel, set up cross compiling and chosen the default versatile kernel configure. And changed it to support EABI. Then built it. Success. Try to boot - and fail. The default versatile configure was not the right one. Since the tutorial didn't bother to provide kernel configuration to build the kernel, I was forced to figure it out myself. Gone through hundreds of different configuration and finally found one which worked almost. It just didn't found my hard disk or the disk image where my Debian installation was. I thought I had everything: PCI (took also some time to figure out that I need support for it) and SCSI disc support, but something just was missing. Hit my head against the wall until figured it out: SCSI low level driver. I had to check it from qemu home page, selected it from the configure and built. Finally a success!<br /><br />Now everything was working again on my qemu ARM system. The lesson learned: you should always know the platform for which you're building the kernel for. To know all the devices, chips and drivers possibly needed. And the kernel configuration seems to hide some options, making unable to select or even see them, if they depend on other configuration option. Next time I will double check all the device drivers that I really need and study the platform better. No guesses any more. Only cold facts.Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com1tag:blogger.com,1999:blog-31063096.post-5292554367658565062007-11-19T10:53:00.000+02:002007-11-19T11:01:17.822+02:00Some recent FIC Neo 1973 experiencesI have been playing with my Neo 1973 phone for some time. I tested Qtopia and it looked nice and got phone calls working for the first time. However it's not designed mainly for Neo 1973 and the experience was not too nice. It lacks something.<br /><br />Recently there was a new OpenMoko image released, and of course I had to flash it to my device. The look was upgraded and the phone calls was finally working! Had some bugs, but it was working. I was able to make and receive calls.<br /><br /><object height="355" width="425"><param name="movie" value="http://www.youtube.com/v/zYY48vyLVVc&rel=1"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/zYY48vyLVVc&rel=1" type="application/x-shockwave-flash" wmode="transparent" height="355" width="425"></embed></object><br /><br />Also tried to compile my own test application, and had some success. I was able to get "Hello world" on the console. Waiting to get something more working, for example a GTK+ app would be nice to get running. But until that I keep on playing with this thing and will report as soon I get some results...Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-39742201014900067552007-10-15T12:37:00.000+03:002007-10-15T13:06:35.113+03:00Got my FIC Neo1973Today I finally got my <a href="http://openmoko.com/products-neo-base-00-stdkit.html">FIC Neo1973</a>, a <a href="http://openmoko.com/">OpenMoko</a> based mobile phone. Man from the packet service called and woke me up telling that he'll bring the packet in five minutes. I was ready in a minute and counting seconds until the doorbell rang.<br /><br />It was like a Christmas when I opened the package revealing it's contents:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://roivas.org/pub/openmoko/moko5.jpg"><img style="cursor: pointer; width: 423px; height: 220px;" src="http://roivas.org/pub/openmoko/moko5.jpg" alt="" border="0" /></a><br /><br />The phone on the left, stylus package, battery, wires and all other stuff on the right side of the package.<br /><br />Finally I took the phone on my hand:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://roivas.org/pub/openmoko/moko4.jpg"><img style="margin: 0px auto 10px; display: block; cursor: pointer; width: 320px;" src="http://roivas.org/pub/openmoko/moko4.jpg" alt="" border="0" /></a><br /><br />Great. It's a little bit bigger than I thought. But it fits to my hand and isn't too heavy. There's a handy pouch included in which you can carry the stylus and Neo1973 with you without a fear to scratch the screen. Memory card slot is under SIM slot and both of them are under the battery so changing a memory card is not a easy task. Here's picture about the interiors:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://roivas.org/pub/openmoko/moko3.jpg"><img style="cursor: pointer; width: 385px; height: 287px;" src="http://roivas.org/pub/openmoko/moko3.jpg" alt="" border="0" /></a><br /><br />The phone was shipped without rootfs installed, only uboot and kernel. As a first thing I flashed new kernel and newest devlopment rootfs. Got the device booting:<br /><br /><object height="350" width="425"><param name="movie" value="http://www.youtube.com/v/owExkOxHsIY"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/owExkOxHsIY" type="application/x-shockwave-flash" wmode="transparent" height="350" width="425"></embed></object><br /><br />And here's finally the UI up and running:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://roivas.org/pub/openmoko/moko1.jpg"><img style="cursor: pointer; width: 320px;" src="http://roivas.org/pub/openmoko/moko1.jpg" alt="" border="0" /></a><br /><br /><br />First impressions is that the boot process takes quite a long time. It's not like forever, but have to be patient. The software is not quite ready yet and they have a lot to do, some apps simply does not work or works only partially. I faced also problems with GSM calls, the GSM just doesn't seem to work. Find out that this <a href="http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=256">bug</a> might cause the problems since doing things on the command line as they told in the comments made it power up the GSM and to make it able to call (with AT commands).<br /><br />However I keep on testing the device and will definately report more impressions about the device and the software.Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-30610141532847551762007-09-28T10:15:00.000+03:002007-09-28T10:38:48.727+03:00About ClutterI've been playing around with <a href="http://www.clutter-project.org/">Clutter</a> lately and find it intresting project. So shortly it's a library to create fast, visually rich and animated graphical user interfaces. It uses <a href="http://opengl.org/">OpenGL</a> or <a href="http://www.khronos.org/opengles/">OpenGL ES</a> for rendering, but hides their complex API.<br /><br />It uses GObject as base of it's classes and people who has been coding with GTK or glib are very home with Clutter. Additional libraries provides features like GStreamer playback support, Cairo rendering and embedding into GTK.<br /><br />Building an simple application seems to be easy following the documentation. There seems to be lot of features, and basic operations works nicely. I made a test app utilizing clutter-gtk for GTK embedding, an it run smoothly on my desktop. However when I tried same application using OpenGL ES backend I faced problems. Clutter was missing <a href="http://standards.freedesktop.org/xembed-spec/xembed-spec-0.5.html">XEMBED</a> support for ES backed. I found this support in normal OpenGL version and find out making support for ES was quite easy job. I made a patch and posted it into Clutter's <a href="http://bugzilla.openedhand.com/show_bug.cgi?id=518">Bugzilla</a>. Now I got a response and they seems to be excited about this patch.<br /><br />It seems that Clutter is a nice project and the project team members are doign a good work. The library could be used more widely to make some nice, smooth UI's. However I'm not a graphic so didn't manage to create too smooth UI, but maybe somebody else success more better than me.Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-87356737350128763032007-09-03T18:59:00.000+03:002007-09-25T13:34:41.220+03:00A word about Ubuntu Mobile and EmbeddedThe most popular Linux distribution (according <a href="http://distrowatch.com/">DistroWatch.com</a>) on desktop, Ubuntu, is aiming on the <a href="https://wiki.ubuntu.com/MobileAndEmbedded">embedded</a> market. They aim their embedded distribution mainly on devices which are called "Internet tablets" or "mobile Internet devices".<br /><br />Currently the target is on Intel platform called MID (Mobile Internet Device) and available devices such as <a href="http://www.samsung.com/uk/products/mobilecomputing/ultramobile/np_q1_v000suk.asp">Samsung Q1 Ultra</a>, <a href="http://www.america.htc.com/products/shift/default.html">HTC Shift</a> and <a href="http://www.elektrobit.com/index.php?599">Elektrobit EB MIMD</a>. The distro will aim on Intel based system leaving for example ARM based devices like Nokia N800 out of the scope.<br /><br />About the project itself. It tries to use existing software as it's base, but is not afraid to implement it's own applications when suitable one not available. It's intresting that the project took <a href="http://live.gnome.org/Hildon">Hildon</a> as it's UI framework. Hildon is originally developed by Nokia for it's maemo platform. However, Hildon is open source and such thing is possible to do and kind of open source spirit, and in the line with the policy to use existing components if availble.<br /><br />They're targeting to release first version with Ubuntu 7.10, meaning very soon from now. As I see these Intel based devices are yet to come to the markets and we'll not see this in use in this year but in a year or two those devices with Ubuntu's embedded version might be a everyday. Only the time will show...Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-48456530402508863692007-08-11T10:15:00.000+03:002007-08-11T10:27:36.164+03:00Poky LinuxRecently <a href="http://o-hand.com/">Opened Hand</a> announced <a href="http://pokylinux.org/">Poky Linux</a> for embedded devices. Currently the system runs on various Sharp Zaurus devices and there is also experimental support for Nokia N800 and OpenMoko Neo1973 devices. I tried the Poky system on <a href="http://fabrice.bellard.free.fr/qemu/">qemu</a> and also installed it on my Nokia N800.<br /><br />The system contains UI component called Sato, which is corresponding component to the Hildon widget set. The system is fully open, and contains currently basic applications such as web browser and video player, a PIM suite called <a href="http://pimlico-project.org/">pimlico</a> and some games.<br /><br />Here's a capture of Poky Linux running in qemu:<br /><br /><object height="350" width="425"><param name="movie" value="http://www.youtube.com/v/H6BWf0_I-0U"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/H6BWf0_I-0U" type="application/x-shockwave-flash" wmode="transparent" height="350" width="425"></embed></object><br /><br />And the system running on Nokia N800:<br /><br /><object height="350" width="425"><param name="movie" value="http://www.youtube.com/v/uob6NOwkFY0"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/uob6NOwkFY0" type="application/x-shockwave-flash" wmode="transparent" height="350" width="425"></embed></object><br /><br />Seems that network is not supported yet on N800 so I was not able to test the browser any better. But currently the Poky Linux seems a promising option.Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0tag:blogger.com,1999:blog-31063096.post-4680155397872787162007-08-06T19:21:00.001+03:002007-08-06T19:33:56.640+03:00Lost in BerlinOn last week I was visiting Berlin. I took my Nokia N800 and a GPS receiver with me. I have installed Maemo Mapper on the device and loaded Berlin maps beforehand on it. Navigating was working nice, but I still had to buy a paper map. There's something that a digital map can't replace.<br /><br />Another reason for taking the N800 with me was the WLAN connection. I succesfully connected to the hotel's WLAN. Also it was handy on the airport where I had to spend several hours. However the WLAN spots were not free so it cost some money but I can manage a few euro's cost.<br /><br />I also finally ordered the Neo1973 (OpenMoko) device. I'll be waiting for it, and I will surely report first impressions on this blog. But until that I'm testing the development tools and tell more about them later...Jouni Roivashttp://www.blogger.com/profile/13876356219049430284noreply@blogger.com0