Search This Blog

Sunday, June 2, 2013

Ubuntu 13.04, GNOME 3 and Bumblebee

I just upgraded my Ubuntu from 12.10 to 13.04 (now that I have a good internet connection) and I did find the desktop to be more responsive than before. The file browser seemed to be working faster, applications seemed to be launching faster and even my laptop seemed to be running a tad cooler !
I thought I'd push my luck a little and try installing the nVidia proprietary driver for my GT 630M that I had been trying to install since the December of last year. Bad move. I was left with a terminal screen and no GUI. The nVidia install script had altered my current display manager config in ways I did not know how to repair (I couldn't find all the files that had been altered).



I don't know much about hardware but from what I could understand of what was written online, the way laptops with nVidia Optimus technology work is that they direct all traffic through the in-built Intel graphics card (in my case the Intel HD 3000). If this load is detected (somehow) to be too much for the Intel card to handle, it calls upon the dedicated graphics card (enter nVidia) by redirecting the data to be processed to it. Now the major problem with this setup is that operating systems like my dear Ubuntu-Linux refused to detect the dedicated graphics card all together and hence all my attempts to install the nVidia drivers failed miserably. Let me pause for a second - I wanted a GUI before experimenting any further and so I thought I would sort out the Unity issue first before proceeding with the graphics card issue.

Taking my brother's advice I decided to scrap Unity in favour of GNOME 3.8 and lightdm in favour of gdm. So I removed Unity and installed GNOME 3.8 by getting the packages from their repository.
sudo add-apt-repository ppa:gnome3-team/gnome3
sudo apt-get update
sudo apt-get install gnome-shell ubuntu-gnome-desktop

Done ! GNOME 3.8 installed and running. It was the bare minimum with no addons but it would do for now. The only remaining task was to get my nVidia card to work.

My Ubuntu running GNOME 3

After searching around for a while I found a project called Bumblebee which aims to provide an Optimus-like solution for users running Linux distros on laptops with i3 / i5 / i7 processors and nVidia graphics cards. The main aim of the project is to help with discrete nVidia graphics power management on Linux the way Optimus works on Windows.
You can find out more about the Bumblebee project here : http://bumblebee-project.org/
I followed the installation instructions provided for Ubuntu here - http://bumblebee-project.org/install.html and hurray ! My nVidia card now works on Ubuntu ! Plus my battery life while running Linux has improved tremendously. I am now getting over 4.5 hours on full charge (as opposed to the short 1.5 - 2 hours that I used to get before Bumblebee & GNOME 3).

Using my nVidia card to run a test
I am just hoping that I don't end up with a terminal screen and no GUI anytime soon !

Tuesday, May 28, 2013

Google Summer of Code (GSoC) 2013 !

Received a letter of acceptance for GSoC 2013 last night ! This is going to be one hell of a summer !

I'd like to thank my mentor Tiziana Refice and others at Measurement Lab, Dominic Hamon and Eric Gavaletz for their valuable input while I was understanding the project and preparing my proposal. Ofcourse a big thanks to my college seniors and my brother who encouraged me to take up a project and use my summer productively !

I will be working with Measurement Lab developing a Flash client for their Network Diagnostic Tool (NDT). You can find out more about the organization here : Measurement Lab. The design document for the project is available here : NDT Client Design Doc.

I will be posting project updates and useful findings here.
Can't wait to get started !

Monday, May 27, 2013

Re-united with my Canon 550D !

Some pics from a night walk around Buheira corniche : 

Dhow Restaurant near Crystal Plaza

A bench on the sidewalk

The night Souq

The winding path
The Corniche

Reflections

Thursday, May 2, 2013

ActionScript 3.0 - Natural vs. Event-based Delays

As the title of this blog hints there are going to be quite a few technical posts here. So here's the first one : It's about something I came across recently in Flash ActionScript 3.0.

The problem I faced was that I had to accurately measure time intervals in my SWF. As this was related to network diagnosis, small inaccuracies in the measurement would result in very large differences in the final result.

I wanted to see if the accuracy of measurement in Flash was comparable to the one in Java where we take the difference between the returned values of the System.currentTimeMillis() function at two different times. To do this I set up a Timer with a delay of 500ms that would run 10 times, calling a function on the completion of each run. This function would calculate the difference of the current getTimer() value and the one stored in startt (below).The results are added to a TextField "recordTimer" on the screen. This was the code for the above :

var records:Vector.<String> = new Vector.<String>();
var count:uint = 0;
var startt:Number = getTimer();
var q:Timer = new Timer(500, 10);


q.addEventListener(TimerEvent.TIMER, updq);
q.addEventListener(TimerEvent.TIMER_COMPLETE, compq);

q.start();

function updq(e:TimerEvent):void {
 temp = getTimer();
records[count] = String(temp - startt);
count++;
}


function compq(e:TimerEvent):void {
for(var j:uint = 0; j < 10; j++)
recordTimer.appendText(records[j] + "\n");

}  


However there was a problem with this code. Since events are related to the frame rate, there was a granularity of ~33ms in my result (I was running my SWF at 30fps) : 



So I decided to produce a natural delay instead and ran an empty for-loop 30 million times instead of using a Timer. This was the code I wrote :

var starttime:uint = getTimer();
var endtime:uint;
var j:uint = 0;
var i:uint = 0;

begin();

function begin():void {
    for(i = 0; i < 10; i++) {
    starttime = getTimer();
    for(j = 0; j < 30000000; j++);
    endtime = getTimer();
    results1.appendText(String(endtime - starttime) + "\n");
    }
}

This time the result was more to my liking :





As there were no events involved, there was no granularity in the results. Also, the values seemed to be accurate within ~1ms, which I think should be good enough for my cause !

I end this post with two key points :
1. Measuring time intervals in ActionScript 3.0 seems to be quite accurate
2. When using events, always keep the framerate you are using in mind

Tuesday, April 23, 2013

Why not ?

I never understood why people maintained blogs. Today, right now to be precise, I found myself wondering "Why not ?". It seems like a decent idea to me now. I think it may be a nice place for me to keep a record of things I'd like to remember or things that I may discover.

When I was in school my teachers, parents and classmates told me that I had a knack for writing. I had even begun writing a novel once ! It was actually a collective effort by our whole class. Our English teacher in the 6th grade did an amazing job of inspiring all of us and so we began writing a novel. We took turns to add content to it, I began writing it and passed it on to the next person who added his own twist to the tale then passed it to the next guy and so on. It had become really weird in the middle when characters in the novel began dying left, right and center according to the whims and fancies of the various authors but it sure was a lot of fun to write. I don't know where it is now, I probably threw it out with a pile of old papers sometime...

Now 5 years later (or more, who's counting ?) I feel bad that I did not pay enough attention to this side of me. Maybe this blog would have been far more interesting had I capitalized on that skill earlier. Maybe this is just me desperately trying to make amends. Better late than never right ?