Linux Desktop Latency
posted on January 20, 2011It seems there are is a lot of activity at the moment in the Linux community to make the desktop as responsive as possible.
In mid-November Mike Galbraith wrote the now-famous 200 line patch that groups processes together to make the desktop experience more interactive. This was accepted by Linus Torvalds and should be in the 2.6.38 kernel when it’s released next month.
Lennart Poettering wrote an alternative shell script soon after that performs a similar operation. I followed the instructions on my Ubuntu machine, as it was easier than recompiling my kernel, and noticed significant improvements on slower machines.
Linus prefers having these improvements in the kernel to make it simpler for users but I’m sure we’ll continue to see the original patch improved for quite a bit longer.
The latest development in desktop scheduling takes a different angle in the form of ulatencyd. The application runs in the background as a daemon, monitors what applications are in use and creates cgroups dynamically. There are several included filters and custom ones can be written in the Lua language.
It is still at an early stage but you can build and run the application right now or download a pre-build Ubuntu package from a PPA. Here’s how you do that:
sudo add-apt-repository ppa:poelzi/ulatencyd-stable
sudo apt-get update
sudo apt-get install ulatencyd
I’ve often thought there could be more intelligent ways of assigning processes priority when my systems are under heavy load. I’ve made several attempts at tweaking memory usage and other schedulers but finally it seems like we may soon have the most responsive desktop as a default. I’ll be excited to see how it progresses over the coming months.
Ubuntu Opportunistic Developers Week
posted on March 3, 2010I’ve been following along with the latest community program from Ubuntu this week – Ubuntu Opportunistic Developers Week. There are a number of talks, each one hour long, which aim to stir up some action in the minds of would-be developers.
The talks are carried out through a tool called Lernid from community manager Jono Bacon. I feel this has been very successful in bringing down the perceived barriers between the well known developers and those of us who wish to get an application going.
Listeners were encouraged at the beginning of the week to think of an app and, hopefully by the end of the week, make it happen. Almost all levels of programmer could benefit from the talks and the leaders were very willing to answer in depth questioning throughout.
The format has worked really well in that you can choose which parts to listen in on and somehow feel less intimidated to ask questions than in a real-life conference.
The week has definitely inspired me so far to start putting some of the ideas I’ve had in to practise. A few of the projects I had tried before such as Quickly and Ground Control, but I was good to hear from the humans behind them. Talks that engaged me especially were CouchDB/DesktopCouch with Stuart Langridge, GStreamer with Laszlo Pandy and GooCanvas with Rick Spencer.
I look forward to the rest of the week and hope it inspires many more developers like me to create some really cool open-source apps. Thanks to everyone who has taken the time to make it possible.
All change
posted on June 12, 2008OK, so I’ve neglected the blog a bit recently but hopefully I can be excused. I had three weeks of exams for my final year at University of Essex and dissertation presentation before that. The exams were over almost two weeks ago now and since then I have catching up with other work and starting a few of my own projects I have been thinking about lately.
I have been gennerally been working on the way I integrate websites for customers in future, and making my source code for web applications more structured and re-usable. There are several useful segments of code I have written over the years and I feel it would be beneficial to make them more generic so they can be added to new projects more easily and extended.
The management system I developed a few years ago for the family business website http://courchevel-1650.com has proven to be successfull and new features have been developed regularly. The system handles all the areas associated with renting out property to holiday makers, such as storing customer details, managing availability, updating the website and printing letters. With a proven system like this that does so much, I’m sure other businesses could make use of it so am making it more generic.
Aside from these I have several other ideas in the pipeline inspired from courses I took in ‘Image Processing’ and ‘Further Concepts in Databases’ but you’ll have to wait for further details at a later date. I also feel the urge to contribute source code to a few open source projects so expect to see developments in this area in future.
Sony Ericsson phones reading ID3 tags
posted on February 16, 2008I’ve been having trouble transferring/playing music on the SE W610i and K800i phones. Copying the MP3 files to the phone is easy–when you plug it in with the USB cable you can select ‘File Transfer’ on the phone and it will reboot as a mass storage device so Linux can mount it. However, after transferring albums and safely unmounting the disks, they appeared to have strange names in the music player. When viewing by artist, album and track in the Walkman and standard music player sometimes the ends of names would be cut off even if they weren’t particularly long. For example, after transferring Mark Ronson’s album ‘Version’ and viewing by artist, the album would be split apparently between three artists:
Mark Ro Mark Ron Mark Ronso
Initially I assumed the files were becoming corrupt somehow, even though I made sure I was unmounting properly from Ubuntu and even tried the same files from a Windows machine. After a bit of searching I found a forum thread about the same problem. The problem is due to ID3 tags–specifically version 2.4. The way the Sony Ericssons (at least these phones) display artist and track names has nothing to do with directories or file names but ID3 tag embedded in your MP3 files. Many of my albums had information stored in v2.4 of ID3 (Amarok uses 2.4 by default), but the phones can’t handle this properly and much prefer the 2.3 version. Problem identified! Now for a solution.
Warning: There is a possibility you will loose some ID3 data when converting from v2.4 back to v2.3, However the stuff that does get removed can’t be that great as I haven’t noticed anything missing. V2.4 is supposedly a bit controversial anyway, so v2.3 should make your files more widely supported.
There are two open source tools I can see as being helpful–id3v2 (command line) and Kid3 (graphical GUI KDE application). id3v2 has the argument -c (–convert) which is supposed to convert from id3v1 to id3v2. This will allow you to convert all MP3s in a directory with one command as follows:
id3v2 -C Music/MarkRonson/*
Kid3 has a reasonable user interface and may in fact do a better job at conversion as it has a specific v2.4 to v2.3 conversion tool. You select the files you wish to convert by opening them, Ctrl-A then from the main menu select ‘Tools’ -> ‘Convert ID3v2.4 to ID3v2.3′.
Hope this has helped someone out. This fix works but hopefully a more elegant solution will come at a later date (e.g. ID3 tags get converted automatically when being copied or SE release a firmware update to support v2.4)
Packard Bell Syntek webcam success
posted on February 5, 2008Approximately 18 months ago, my girlfriend was looking for a small and light laptop to replace her broken iBook. The replacement laptop is a Packard Bell Easynote BU45-U-045 (I think that’s the model number–product details). Most of the hardware is well supported by Ubuntu Linux–Intel graphics chip runs Compiz-Fusion well, SD card reader, and wireless–although with ‘Restricted Drivers Manager’. There is also a webcam integrated above the screen, but I didn’t get this working until today. The camera chip comes from Syntek Semiconductor Ltd but is usually assembled under the name D-Max.
The command ‘lsusb‘ was an obvious starting point, but no manufacturer/device name is given so you have to look carefully at the ID numbers. This is the output I have (174f:a821) but apparently there are other devices by Syntek that are supported (174f:6a31, 174f:6a33, 174f:6a51, 174f:6a54 and 174f:a311).
jayne@jayne-laptop:~$ lsusb Bus 004 Device 001: ID 0000:0000 Bus 005 Device 001: ID 0000:0000 Bus 003 Device 001: ID 0000:0000 Bus 003 Device 002: ID 08ff:1600 AuthenTec, Inc. Bus 002 Device 001: ID 0000:0000 Bus 001 Device 002: ID 174f:a821 Bus 001 Device 001: ID 0000:0000
I found the Syntek DC-1125 Camera Driver Project hosted on SourceForge, still in development (in face the latest version was released today!) but it worked OK for me. These instructions are how I managed to get it to work on Ubuntu. If you decide to carry out these yourself, you do so at you own risk and I accept no responsibility.
Download the drivers from the project page–you want the file stk11xx-*.tar.gz–and extract them. From the extracted directory, make the Loadable Kernel Module with the command sudo make -f Makefile.standalone. I got the following error about ctags, but this didn’t matter as the module had been compiled by this point (.ko file).
make: ctags: Command not found make: *** [driver] Error 127
If compilation goes OK you should see a file called ‘stk11xx.ko’ in the directory which you should copy to your kernel’s module directory, sudo cp stk11xx.ko /lib/modules/`uname -r`/kernel/drivers.
Run the following commands to load you camera’s kernel module. The light next to it flashes if you have one.
sudo depmod -a sudo modprobe stk11xx
If all has gone well up to this point, test it with an application like Camorama or Ekiga. Install Camorama through Synaptic or by typing the following command.
sudo apt-get install camorama
For me the image shown was upside down, which was annoying at first. However there is an argument you can pass when you load the module which counteracts this. If you need the image flipped, use these commands to unload the module and re-load it with the argument ‘vflip=1′.
sudo rmmod stk11xx sudo modprobe stk11xx vflip=1
Open Camorama again and you will hopefully now be the right way up. Now we have to make sure that this argument gets added automatically or you will be the wrong way up next time you start the computer. You want to create a new file in the directory ‘/etc/modprobe.d’ for the module with the line ‘options stk11xx vflip=1′ in it.
sudo touch /etc/modprobe.d/stk11xx sudo gedit /etc/modprobe.d/stk11xx
If you have a similar webcam, I hope this post is useful to you. If you have tried this for yourself, please leave a comment.
