Mi blog lah! Το ιστολόγιό μου


From new user to kernel compilation to upstream fix

It is quite exciting when helping new users solve issues while migrating to the Linux operating system, and Ubuntu Linux in this case.

A couple of weeks ago, a new member at the Ubuntu-gr forum posted a question about a sound problem in an Ubuntu Linux installation.

Alsa Mixer

Alsa Mixer

Here is the timeline

  1. An initial post was made with the relevant hardware information.
  2. More information was gathered that led to the PCI ID and subsystem ID of the sound card, which further led to the source of a patch for a quirk.
  3. The advice to recompile the full kernel (with the patch) was given. This process required over 10GB, which caused the distribution to crash. The user was fine to reinstall.
  4. A subsequent route was taken to simply compile Alsa (not the full kernel) and add the patch.
  5. This route was successful and the sound was now working.
  6. We want to post this patch upstream so that newer versions of the kernel contain the fix. In addition, all distributions will benefit as well.
  7. A bug report was submitted to the Alsa bugtracking #0004561. We now wait.
  8. Days are passing with no progress. A question at #alsa (Freenode) shows that the Alsa bugtracking is probably not used, so there is need to contact the developers through the mailing list.
  9. An e-mail is sent to the Alsa mailing list with the patch. The Alsa developer takes the patch and applies to his tree. We missed by several days the release of Linux 2.6.30; the patch should appear in 2.6.31.

The whole process took ten days. It is amazing how rewarding it is to follow the open-source processes and contribute the personal time to help make open-source better.

The patch was evidently elemental, however it required new testing to make sure it works, and that it applies to the current state of Alsa. There are many areas that you can contribute some of your time to make open-source better.

I would like to thank Theodora for going through the process, locating and verifying the patch, so that now it is pending inclusion in Linux 2.6.31.

Update 22Apr 2010: The change has been added to the Linux kernel :-). It's a tiny small change that anyone can do.


Playing with Git

Git is a version control system (VCS) software that is used for source code management (SCM). There are several examples of VCS software, such as CVS and SVN. What makes Git different is that it is a distributed VCS, that is, a DVCS.

Being a DVCS, when you use Git you create fully capable local repositories that can be used for offline work. When you get the files of a repository, you actually grab the full information (this makes the initial creation of local repositories out of a remote repository slower, and the repositories are bigger).

You can install git by installing the git package. You can test it by opening a terminal window, and running

git clone git://github.com/schacon/whygitisbetter.git

The files appear in a directory called whygitisbetter. In a subdirectory called .git/,git stores all the controlling information it requires to manage the local repository. When you enter the repository directory (whygitisbetter in our case), you can issue commands that will figure out what's going on because of the info in .git/.

With git, we create local copies of repositories by cloning. If you have used CVS or SVN, this is somewhat equivalent to the checkout command. By cloning, you create a full local repository. When you checkout with CVS or SVN, you get the latest snapshot only of the source code.

What you downloaded above is the source code for the http://www.whygitisbetterthanx.com/ website. It describes the relative advantages of git compared to other VCS and DVCS systems.

Among the different sources of documentation for git, I think one of the easiest to read is the Git Community Book. It is consise and easy to follow, and it comes with video casting (videos that show different tasks, with audio guidance).

You can create local repositories on your system. If you want to have a remote repository, you can create an account at GitHub, an attractive start-up that offers 100MB free space for your git repository. Therefore, you can host your pet project on github quite easily.

GitHub combines source code management with social networking, no matter how strange that may look like. It comes with tools that allows to maintain your own copies of repositories (for example, from other github users), and helps with the communication. For example, if I create my own copy of the whygitisbetter repository and add something nice to the book, I can send a pull request (with the click of a button) to the maintainer to grab my changes!

If you have already used another SCM tool (non-distributed), it takes some time to get used to the new way of git. It is a good skill to have, and the effort should pay off quickly. There is a SVN to Git crash course available.

If you have never used an SCM, it is cool to go for git. There is nothing to unlearn, and you will get a new skill.

Git is used for the developement of the Linux kernel, the Perl language, Ruby On Rails, and others.


Droid fonts from Google (Android SDK)

Update 10Feb2009: The Droid fonts are now available from android.git.kernel.org (Download tar.gz archive), under the Apache License, Version 2.0. Ascender (the company who created Droid), has now a dedicated website at http://www.droidfonts.com/ (thanks Rex!). At this dedicated website, Ascender presents the Droid Pro family which has several additions to Droid. For the open-source crowd, it is important to have the initial Droid font family dual-licensed under the “OpenFont License”, which would enable the best use with the rest of the OFL licensed fonts.

Two years ago, Google bought a start-up called Android in order to deliver an open platform for mobile applications. A few days ago the Android SDK has been released and you can develop now Android applications that can run in the emulator. Android handsets are expected at some point next year.

Even if you do not plan to develop applications for Android, you can still run the emulator which is functional, includes quite a few samples, and comes with a browser shown above. To get it, download the Android SDK for your system, uncompress it and run


An interesting aspect of Android is that it comes with a set of fonts that have been specially designed for mobile devices, the Droid fonts. The fonts are embedded in the Android image, in android_sdk_linux_m3-rc20a/tools/lib/images/system.img, a clever guy managed to extract them and a modest guy corrected me (Damien's blog to download).

The fonts are probably licensed under the same license as the SDK (Apache License), however it is better to hear from Google first.

In the meantime, here is a screenshot of Ubuntu 7.10 with Droid.

Update: To extract the fonts from the SDK, run the emulator with the -console parameter. The emulator starts and at the same time you get a shell to the filesystem of the running emulator. You can locate the fonts in system/fonts/. Once located the full path of a file, you can extract with ./adb pull system/fonts/DroidSans.ttf /tmp/DroidSans.ttf (thanks cosmix for the tip).


One-line hardware support (USB Wireless Adapter)

I got recently a USB Wireless Adaptor, produced by Aztech. It was a good buy for several reasons:

  • It advertised Linux support
  • It was affordable
  • It had good quality casing; you can step on it and it won't break
  • It had the Penguin on the box and was really really cheap

When I plugged it in on my Linux system, it did not work out of the box. The kernel acknowledged that a USB device was inserted (two lines in /var/log/messages) but no driver claimed the device.

With the package came a CD which had drivers for several operating systems, including Linux. Apparently one would need to install the specific driver. I think the driver was available in both source code and as a binary package (for some kernel version).

The kernel module on the CD was called zd1211, so I checked whether my kernel had such a module installed. To my surprise, there was such a kernel module, called zd1211rw. I hope you have better chance with the URL because now the website appears to be down (Error 500).

Therefore, what was wrong with my zd1211rw kernel module? Reading the documentation of project website, I figured out that you have to report the ID (called the USB ID) of your adapter  so that it is included in the kernel module, and when you plug in your device, it will be automatically detected.

You can find the USB ID by running the command lsusb. Then, it is a one-line patch for the zd1211rw driver to add support for the device,

--- zd1211rw.linux2.6.20/zd_usb.c      2007-09-25 14:48:06.000000000
+++ zd1211rw/zd_usb.c    2007-09-28 11:35:51.000000000 +0300
@@ -64,6 +64,7 @@
{ USB_DEVICE(0x13b1, 0x0024), .driver_info = DEVICE_ZD1211B },
{ USB_DEVICE(0x0586, 0x340f), .driver_info = DEVICE_ZD1211B },
{ USB_DEVICE(0x0baf, 0x0121), .driver_info = DEVICE_ZD1211B },
+       { USB_DEVICE(0x0cde, 0x001a), .driver_info = DEVICE_ZD1211B },
/* "Driverless" devices that need ejecting */
{ USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER },
{ USB_DEVICE(0x0ace, 0x20ff), .driver_info = DEVICE_INSTALLER },

What Aztech should have done is to submit the USB ID to the developers of the zd1211rw driver. In this way, any Linux distribution that comes out with the updated kernel will have support for the device.

It is very important to get the manufacturers to change mentality. From offering a CD with "drivers", for free and open-source software they should also work upstream with the device driver developers of the Linux kernel. The effort is small and the customer benefits huge.



(see http://www.guadec.org/schedule/warmup)

At the first presentation, Quim Gil talked about GNOME marketing, what have been done, what is the goal of marketing. He showed a focused mind on important marketing tasks; it is easy to get carried away and not be effective, a mistake that happens in several projects.

The next session was by Tomas Frydrych (Open Hand - I have their sticker on my laptop!) on memory use in GNOME applications. Many people complain that XYZ is bloated. However, this does not convey what exactly happens; pretty useless. In addition, the common tools that show memory use do not show the proper picture because of the memory management techniques. That is, due to shared libraries, the total memory occupied by an application appears very big. A tool examined is exmap. This tool uses a kernel module that shows memory use of applications by reading in /proc. It takes a snapshot of memory use; it's not real-time info. It comes with a GTK+ front-end (gexmap) that requires a big screen (oops, PDAs). However, it is not suitable for internet tablets and other low-spec devices. Therefore, they came up with exmap-console which addresses the shortcommings. It has a console interface based on the readline library.

Here are the rest of my notes. Hope they make sense to you.

. exmap --interactive
. ?: help
. Head: quite useful (dynamic allocation)
. Mapped:
. Sole use: memory that app is using on its own (rss?)
. "sort vm"
. "print" or "p"
. "add nautilus"
. "clear"
. "detail file" (what executables/libs loaded and how much consume)
. "detail none"

Sole use
. valgrind, to analyse Sole Use memory?
. "detail ????"

Lots of small libraries: overhead

Looking ahead
. Pagemap: by Matt Macall
. http://projects.o-hand.com/exmap-console/

. Sole use: ~18MB ;-(

Tomas was apparently running Ubuntu with the English UK locale. The English UK translation team is doing an amazing job at the translation stats. Actually, most messages are copied, however with a script one can pick up words such as organization and change to organisation. The problem here is that, for example, the GAIM mo file is 215KB (?), however for the British English translation the actual changes should be less than 2-3KB. Messages that are missing from a translation mean that the original US English messages will be used. I'll have to find how to use msgfilter to make messages untranslated if msgid == msgstr. Where is Danilo?

After lunch time (did not go for lunch), I went to the Accerciser session. Pretty cool tool, something I have been look for. Accerciser uses the accessibility framework of GNOME in order to inspect the windows of running applications and see into the properties. A good use is to identify if elements such as text boxes come with description labels; they are important to be there for accessibility purposes (screen reader), as a person that depends on software to read (text to speech) the contents of windows.

The next session was GNOME accessibility for blind people. Jan Buchal gave an excellent presentation.

My notes,

. is from Chech republic, is blind himself. has been using computers for 20+ years

. from user perspective
. users, regular and irregular ;-)
. software
. firefox 3.0beta - ok for accessibility other versions no
. gaim messenger ok
. openoffice.org ok but did not try
. orca screenreader ^^^ works ok.
. generally ready for prime time
. ubuntu guy for accessibility was there
. made joke about not having/needing display slides ;-]
. synthesizer: festival, espeak, etc - can choose
. availability of voices
. javascript: not good for accessibility
. links/w3m: just fine!
. firefox3 makes accessibility now possible.
. web designer education, things like title="", alt="" for images.
. OOo, not installed but should work, ooo-gnome
. "braillcom" company name
. "speech dispatcher"
. logical events
. have short sound event instead of "button", "input form"
. another special sound for emacs prompt, etc.
. uses emacs
. have all events spoken, such as application crashing.
. problems of accessibility
. not money main factor, but still exists.
. standard developers do not use accessibility functions
. "accessor" talk, can help
. small developer group on accessiblity, may not cooperate well
. non-regular users (such as blind musician)
. musicians
. project "singing computer"
. gtk, did not have good infrastructure
. used lilypond (music typesetter, good but not simple to use)
. singing mode in festival
. use emacs with special mode to write music scores (?)
. write music score and have the computer sing it (this is not "caruso")
. gnome interface for lilypond would be interesting
. chemistry for blind
. gtk+
. considering it
. must also work, unfortunately, on windows
. gtk+ for windows, not so good for accessibility
. conclusion: free accessibility
. need users so that applications can be improved
. have festival synthesizer, not perfect but usable
. many languages, hindi, finnish, afrikaans
. endinburgh project, to reimplement festival better
. proprietary software is a disadvantage
. q: how do you learn to use new software?
. a: has been a computer user for 20+ years, is not good candidate to say
. a: if you are dedicated, you can bypass hardles, old lady emacs/festival/lilypond
. brrlcom, not for end-users(?)
. developer problem?
. generally there is lack of documentation; easy to teach what a developer needs to know
. so that the application is accessible
. HIG Human Interface Guidelines, accessible to the developers
. "speakup" project
. Willy, from Sun microsystems, working on accessibility for +20 years, Lead of Orca.
. developers: feel accessibility is a hindrance to development
. in practice the gap is not huge
. get tools (glade) and gtk+ to come with accessibility on by default
. accessibility
. is not only for people with disabilities
. can do amazing things like 3d interfaces something

These summaries are an important example of the rule that during presentation, participants tend to remember only about 8% of the material. In some examples, even less is being recollected.


Διανομή Linux για μικρά συστήματα

Puppy OS screenshot

Προέρχεται από τον simosx.

Υπάρχουν μια σειρά από διανομές Linux που δεν έχουν μεγάλες απαιτήσεις σε χώρο στο σκληρό δίσκο ή επιδόσεις από τον επεξεργαστή. Ακόμα, είναι εύκολο να γίνει η εγκατάστασή τους σε USB stick/CDROM/Προσομοιωτή/ZIP Disk/Σκληρό δίσκο/κτλ με αποτέλεσμα να είναι αρκετά φορητά.

Τέτοιες διανομές είναι

  • Feather Linux, που συνδυάζει όλα τα αρχεία σε λιγότερο από 128ΜΒ (βασίζεται σε Knoppix remaster),
  • Damn Small Linux (DSL), που συνδυάζει όλα τα αρχεία σε λιγότερο από 50ΜΒ.
  • Puppy Linux (PuppyOS), που συνδυάζει όλα τα αρχεία σε λιγότερο από 70ΜΒ.

Για το Damn Small Linux (DSL), τα χαρακτηριστικά είναι

  • Boot from a business card CD as a live linux distribution (LiveCD)
  • Boot from a USB pen drive
  • Boot from within a host operating system (that's right, it can run *inside* Windows)
  • Run very nicely from an IDE Compact Flash drive via a method we call "frugal install"
  • Transform into a Debian OS with a traditional hard drive install
  • Run light enough to power a 486DX with 16MB of Ram
  • Run fully in RAM with as little as 128MB (you will be amazed at how fast your computer can be!)
  • Modularly grow -- DSL is highly extendable without the need to customize

Για το Puppy Linux (PuppyOS), τα χαρακτηριστικά είναι

  • Puppy will easily install to USB, Zip or hard drive media.
  • Booting from CD, Puppy will load totally into RAM so that the CD drive is then free for other purposes.
  • Booting from CD, Puppy can save everything back to the CD, no need for a hard drive.
  • Booting from USB, Puppy will greatly minimise writes, to extend the life of Flash devices indefinitely.
  • Puppy will be extremely friendly for Linux newbies.
  • Puppy will boot up and run extraordinarily fast.
  • Puppy will have all the applications needed for daily use.
  • Puppy will just work, no hassles.
  • Puppy will breathe new life into old PCs

Τέτοιες διανομές είναι πολύ σημαντικές διότι προσεγγίζουν τη λειτουργικότητα του OLPC.
Χρησιμοποίησα το Puppy OS σε USB stick και παρακάτω είναι μια σειρά από σχόλια

  • Σε τυπικό φορητό υπολογιστή Pentium M, η διανομή είναι πολύ διαδραστική. Κάθε λειτουργία ξεκινά πολύ γρήγορα και δεν ακούς καθόλου το ανεμιστηράκι (ίσως πρέπει να ενεργοποιήσετε το powersave kernel module για το φορητό σας :)).
  • Οι διανομές αυτές χρησιμοποιούν τον πυρήνα 2.4.x. Είδα ότι υπήρχαν χρήστες που έκαναν αναβάθμιση σε 2.6.x, δεν ξέρω αν αλλάζει κάτι σημαντικό στη διαδραστικότητα ή στη χρήση της μνήμης.
  • Υπάρχει Firefox και δουλεύει αρκετά καλά. Ωστόσο, ο υπολογιστής έχει 512ΜΒ RAM και μπορείτε να δείτε στο στιγμιότυπο ότι γίνεται χρήση ενός σεβαστού ποσού της μνήμης.
  • Το Abiword ξεκινά πολύ γρήγορα, είναι διαδραστικό. Πολύ όμορφα.
  • Δεν κατάφερα να γράψω ελληνικά διότι η έκδοση αυτή του XFree86 δεν είχε τα απαραίτητα αρχεία με τις διατάξεις πληκτρολογίου. Γενικά θα είναι προβληματική η κατάσταση αυτή αν δεν υπάρχει μικροεφαρμογή που να δείχνει την τρέχουσα ενεργή διάταξη πληκτρολογίου.
  • Η βασική γραμματοσειρά δεν έχει ποιοτικά ελληνικά, μπορεί κάποιος να εγκαταστήσει DejaVu ρίχνοντας τα αρχεία στο ~/.fonts/
  • Υπάρχει διαχειριστής πακέτων και μπορείτε να εγκαταστήσετε νέες εφαρμογές σχετικά εύκολα.
  • Ο διαχειριστής παραθύρων νομίζω ότι είναι ο fvwm. Η βασική εγκατάσταση είναι αρκετά βασική. Ωστόσο, άλλοι χρήστες κατάφεραν και είχαν πολύ καλύτερο αποτέλεσμα.
  • Κατά την εκκίνηση γίνεται αντιγραφή του περιεχομένου του USB stick στο σκληρό δίσκο. Δεν ξέρω αν αυτό είναι απαίτηση ή γίνεται για λόγους ταχύτητας. Μετά το κλείσιμο του υπολογιστή, το αρχείο αυτό αντιγράφεται πίσω στο USB stick.

Ενημέρωση: Υλοποίηση proof-of-concept με τη χρήση του Puppy Linux για το OLPC.


Switch to our mobile site