Python-purple presentation at FISL10

June 26th, 2009

The presentation about Cython develpment and python-purple was very good. Bruno Abinader talked about how INdT used Cython to develop a python binding for Libpurple (which is used by Pidgin, Adium and Meebo).

I demonstrated a very basic demo using python-tk as UI toolkit. The presentation and demo can be found on the project website under “Documentation” section.

briglia News, Python

Fisl 10

June 1st, 2009

Yeah. The presentation submitted by Bruno Abinader and I was approved for Fisl 10. :) We will talk about libpurple python bindings and Cython. Basically, python-purple development. :)

See you there.

briglia News

USB to Serial adapter on Mac OSX

May 26th, 2009

I just tried to use minicom + usb-serial adapter on Mac OS (Tiger 10.5.x) and nothing happened. Looking at driver’s CD which came with USB serial adapter I discovered that it was made by Prolific.

photo-serial

Google-is-my-friend and I found the driver that really works. Download and install it. After this, a /dev/tty.usbserial device node will appear. Now you just have to configure Minicom and everything works.

briglia Macbook

Abil demo

May 23rd, 2009

Abil demo: using Qt Animation Framework, Itemviews-ng and libpurple.

… and the code is here.

briglia Qt

Using MVC Design Pattern and Qt Animation Framework

May 21st, 2009

We have been studying Qt and decided to develop a small chat client project for Maemo. One of the mandatory requirements was the Qt Animation Framework usage. Just for test, or to learn, we designed our application as a big state machine.

Another design decision was to use MVC. But, how integrate model-view-controller and state machine? Well, as you know, views should handle all canvas and animations (if exist). Given this scenario, we splitted states into two types: macro-states and sub-states. Macro-states are the controllers and sub-states are contained by views. Views are responsible by their sub-states processing. Each view have a state called “doneState” which is used to inform respective controller that view is ok to be deleted.

The picture below tries to make it more clear to understand:

abil-statemachine

The transitions inside views are not early defined. If a view has an animation, it is probably that will exist a transition from “static state” to “animation state” inside view state.

Today, Abil (this is the name for the project), has a splash screen, login screen and buddy list screen. The picture above just shows the interaction between splash and login but all components have the same composition: a controller which contains a view. The controller itself is a state and the view has sub-states for static and animation.

The state machine is used to control the screen transitions and to de/allocate controllers. Transitions from splash to login, from login to buddy list screens were defined. But, how implement these transitions without instatiate each controller?

We used Qt Meta Objects to do this job. See code snipped below:

<code>

QtStateMachine machine;
QtFinalState *doneState = new QtFinalState(machine.rootState());
AbilState mainState(MainCtrl::staticMetaObject, &scene, machine.rootState());
AbilState splashState(SplashCtrl::staticMetaObject, &scene, &mainState);
AbilState loginState(LoginCtrl::staticMetaObject, &scene, &mainState);
AbilState buddyState(BuddyCtrl::staticMetaObject, &scene, &mainState);

splashState.addFinishedTransition(&loginState);
loginState.addFinishedTransition(&buddyState);
buddyState.addFinishedTransition(&loginState);

mainState.setInitialAbilState(&splashState);
mainState.addFinishedTransition(doneState);
QObject::connect(&machine, SIGNAL(finished()), QApplication::instance(), SLOT(quit()));

machine.setInitialState(&mainState);
machine.start();QtStateMachine machine;
QtFinalState *doneState = new QtFinalState(machine.rootState());
AbilState mainState(MainCtrl::staticMetaObject, &scene, machine.rootState());
AbilState splashState(SplashCtrl::staticMetaObject, &scene, &mainState);
AbilState loginState(LoginCtrl::staticMetaObject, &scene, &mainState);
AbilState buddyState(BuddyCtrl::staticMetaObject, &scene, &mainState);

splashState.addFinishedTransition(&loginState);
loginState.addFinishedTransition(&buddyState);
buddyState.addFinishedTransition(&loginState);

mainState.setInitialAbilState(&splashState);
mainState.addFinishedTransition(doneState);
QObject::connect(&machine, SIGNAL(finished()), QApplication::instance(), SLOT(quit()));

machine.setInitialState(&mainState);
machine.start();

</code>

Controllers are not instantiated until the last moment. :) But, we are able to add transitions for macro-states. I’ll explain better this solution in another post.

briglia Qt

Python and XAutomation to test UI

April 28th, 2009

It’s common sense that SW testing is necessary but (there is always a “but”), developers hate to do it.

Facing this problem, I developed a python script to test Carman users interaction, or, to test the UI from user point-of-view. Using XAutomation is possible to test Maemo applications running in Nokia devices natively.

Since I have to do a lot of measurements (for my Master’s tests), collecting data from graphical applications execution, I developed two python scripts to test Canola and Browser. They are open source, feel free to use it and/or suggest something.

- Canola test script

- Browser test script

I’ve used this xautomation Debian package compiled for ARM.

briglia Master's

Ubuntu Jaunty on Mactel

April 21st, 2009

Since three weeks ago, I’m using a Macbook Pro, version 5. First, I tried to develop native Linux applications using VMWare Fusion, even the performance and speed are good, I wanted more and installed Ubuntu Jaunty using Bootcamp to make the partitioning.

There are a lot of tutorials and howto’s that explain how to install ubuntu on a macbook (intel, or just mactel). I followed this one.

After Jaunty installation, I noticed that screen was not well adjusted: the brightness was different from OSX setting. Another difference is the keyboard backlight. Screen brightness and keyboard backlight can be configured, after the nvidia driver installation (see this link). To summarize, I just used these two commands:

Screen brightness:

echo &lt;VALUE&gt; | sudo tee -a /sys/class/backlight/mbp_backlight/brightness

where

&lt;VALUE&gt;

can be 0 – 15.

Keyboard backlight:

echo &lt;VALUE&gt; | sudo tee -a /sys/class/leds/smc::kbd_backlight/brightness

where

&lt;VALUE&gt;

can be 0 – 300.

briglia Macbook

Cache Compression x MiBench

March 25th, 2009

I just did some tests using newest Compressed Cache, and MiBench (paper here). These tests are part of my Master’s work and were done to evaluate if MiBench benchmarks are suitable for Compressed Cache usage. Since MiBench is largely used in Embedded Systems studies, is important to see if they have memory consumption and/or if the bencharmks are ok to test swap consumption.

MiBench benchmarks are divided in six modules: Automotive, Consumer Devices, Network, Office Automation, Security and Telecommunication. Each module groups programs those act as benchmarks to evaluate common characteristics. What I did was pick one program from each module and execute it in a N810 with Maemo Diablo system. See figures below:

Automotive benchmark

Automotive benchmark

Consumer Devices benchmark

Consumer Devices benchmark

Network benchmark

Network benchmark

Office Automation benchmark

Office Automation benchmark

Security benchmark

Security benchmark

Telecommunication benchmark

Telecommunication benchmark

As we can notice, graphs presented itself quite similar. It happened due to the memory consumption behaviour applied by each benchmark. Conclusion: MiBench does not do usage of swap area and/or memory. It indicates that we need a better benchmark if we want to evaluate Compressed Cache.

Actually, this is just a small part of my Master’s. Tests are more “real-world” oriented, involving applications like browser, media player and PDF reader.

briglia Master's

Carman-0.7 beta2-7 out

March 19th, 2009

I’m proud to announce a new Carman release. Carman-0.7-beta2-7 is now available on Maemo Extras repository and can be installed for DIABLO and CHINOOK Maemo versions.

briglia News

Using latest linux-omap kernel in N810

February 28th, 2009

This post describes my experience to get N810 working with latest linux-omap kernel.

1. Get latest codesourcery arm-eabi toolkit. (here) And install it.

2. Clone linux-omap kernel from git repository.

3. Compile it using cross compiler from step 1. You just need to put in your PATH the bin/ directory from cross compiler installation.

4. Get flasher utility for your machine.

5. Following this tutorial, you should put your device in R&D mode with RD flags = no-omap-wd,no-retu-wd,no-lifeguard-reset, but when I put “no-retu-wd” the device had some unstability and I put RD flags = no-omap-wd, no-lifeguard-reset.

6. For Wlan driver, just follow this tutorial and you’re ready to use latest linux-omap kernel in N810.

briglia Hacks, Kernel, Linux-omap