Pages

Sunday, 16 October 2011

The Open Source community and patents – the way forward


In a post at "the H" HTC and Samsung where criticized for paying patents to Microsoft for its Android devices. The author argued that this is a problem for the open source community and questioned if Android is open source then.

From my perspective there is a common mix up of rights; the right to the solution and the right to the implementation.

Lets start with the basics. In general, a patent protects a solution to a problem. The solution and problem comes in pairs ans is equal as important. For example, Apple have patented the usage of glass stairs for promotional purposes, which does not imply that Apple have the sole right to glass stairs – I am allowed to build on at home if I like.

This opens for tweaks; Motorola patented answering the phone when the hatch as opened (first generation Motorola GSM phones with credit card sized SIMs) while Ericsson patented that the hatch was opened when the phone was answered, almost the same from use perspective – opening the hatch and answer the phone is one move.

So, what all this thing about Android and patents. How can we develop and manufacture a GSM, 3G, or LTE phone using Android or Linux completely free from patents? The answer is simple – you cant.

Patents in Telecommunication
Telecommunication is a complex world of technologies where we (the users) are spoiled with features and availability. The Erlang Language developed for Telecommunication systems has been developed with 99.999999999 % availability in mind, which leaves only a fraction of a second per year of downtime. We, the users, have a ever growing expectation of the data transfer rate in our systems and those does not come for free. A hand full of telecommunication companies have developed the standards and put a lot of effort in them – and they need to get payback or there will be no money to develop the next version or generation of communication. And to be honest, we, the users, are very greedy of the data transfer rate and many of us are prepared to pay moderate Euros to get it, takes it for granted and whines when we travels on the country side where the coverage are low or we have to manage without 3G.
To generate payback, the companies developing the standards also patents the technology solutions needed to comply with the standards to generate revenue and founding for next generation communication systems. This way license fees for the patents boils down to us end users to pay and, which I think is reasonable, the ones using the telecommunication networks are paying for the development of the same. This does not only applies to network equipment, it also applies to the cell phones. Nokia and Ericsson knows that Apple needs to use patented technology if Apple claims to have a 3G cell phone. Either Apple purchases technology from a manufacturer that in turn pays the license fee, or Apple develops own hardware and needs to pay themselves.

The smart phone
A modern smart phone commonly consist of two parts; the modem side and the application side. The modem side is perhaps not widely known but is where the telecommunication takes place. This is where the aerial is connected, and where transmission over the air is managed. This is also where telecommunication have protected the technology, hidden from the every day user (trust me, this is pretty advanced signal analysis, the only course I never understood) .

The other part of the smart phone is the application side. Once the application side was the home of menu systems; the user got accustomed to the menu system from Nokia or Sony Ericsson and when it was time to chose next phone this was an argument to stick with a phone from same same vendor. This was true until iPhone was released and Android started to compete.

With the iPhone and Android the application side was suddenly not a simple menu system but a windows manager adjusted to touch usage (i.e. no keyboard or mouse). This was a step closer to the ordinary world of desk top computing, a step also bringing the patents from the desktop world. Also in the world of desktop software and computing there are people putting Euros into research that they expect to get revenue from, and solution to problems are protected by patents. Sometimes we got accustomed to inventions in the user interface as well. There must have been someone that invented the mouse, or the touch screen. Someone invented the usage of graphical user interface and was in the right to protect those inventions by patents.

The problem that arises with Android phones is that mainly Microsoft, Nokia and later also Apple put a lot of effort in developing smart phones before Android hit the market, or even the lab. I have an early Ericsson PDA with Windows CE 3 or so lying in a drawer. There where at least 2 generation of Symbian released before Android and naturally the effort put in by Microsoft, Nokia, Ericsson et.al was protected where feasible. Protected not only for a future revenue but for trading of patents related to the communication standard. An example (totally made up by me): if Nokia, Ericsson and Samsung develops LTE and have a round 5000 patents each they can trade; if I use 5000 of your patents tat I need, you can use 5000 patents from me that you need. And Acme Phones that never bothered to put a dime in the research has to pay all three companies for using the 15000 patents in LTE. And the Acme phones will be €5 more expensive for the customer and this is why the customer shall rejects those phones and prefer the other three.

As end user I put a lot of trust in every day technology. This text is written in the autumn sun outdoor on my laptop running Linux. And despite the open source operating system, Libre Office, XFCE windows manager the core is from Intel and is protected by patents.

Interesting as it might be, lets get to the open source point.

Solution versus Implementation
My point is that the patented solution to a problem is in general a conceptual solution to a problem, not the implementation of the solution. In order to enter the telecommunication market with open source technology we must first understand the role of patents on the business area, and we must understand the difference between solution and implementation.

Take the patent of answering the phone when the hatch is opened. This implies that the user opens the hatch, that the phone detects that the hatch is being opened and answers the call. However it does NOT make any assumptions on the design of the hatch, nor about the hatch sensor, not even that there shall be any sensor. The patent protection concerns the solution not the implementation.

The distinction is important. Most of the software developed by the open source community solves problem that is also solved by the closed source business actors. I have a mouse-menu in XFCE and there is a start menu in MS Windows. I have a save as dialog in KDE and there is a Save As dialog in Mac OS. The similarities cannot be ignored and is not a result of open or closed source code, it is a result of the current usage culture. If someone had the patent to use a imput dialog for user interaction when a file name is required it would be of no importance if the implementation was in open or close source code. It would, how ever, be of importance if the solution was distributed or if only the source code (i.e. source code not yet compiled into a working solution) was distributed; we as individuals are free to break patents on a personal base. This is why some Linux distros does not contain MP3 decoders until after the installation. This is why I am happy running Gentoo as my main Linux distribution.


Way Forward: Appreciate the Solution
The question remains, what can the open source community do?
The answer is as simple to pronounce as it is difficult to achieve; focus on open source solutions instead of open source implementation, and protect the solutions like patents.

The community must start to appreciate bare solutions submitted to the community. Finding new solutions is what can compete with patents. For each and every one of us we must search to find the joy of develop code that is part of a solution developed by someone else, and allow that someone to be a inventor not necessary a code writer. To be honest, what I see of the community is that code matters and solutions mostly matters not (unless implemented). Until we accept that the implementation does not affect whether a solution is patentable or not we will suffer from the commercial world and their habit of patents.

When I read about the patent rages between Google and Apple I must admit that Apple have put efforts in inventing solution of user interaction sing a small display and touch screen. The community must then make own competitive solutions within the same area. The same problem must be solved using another solution. If Apple have patent on dragging a symbol over the screen to unlock the phone, we must come up with another solution for unlocking the phone. Or we must tweak the problem; do we really lock the phone or shall we do something else to prevent it from unexpected input?

One world
Our open source community exists in the same world as the closed source and we all live by the same set of laws. Those are the laws that regulates the car industry to produce cars we can trust, and ensures that medical equipment does not harm us when we need them. And it allows and encourage companies to make money on developing new technology. I hope you paid salary thus making use of the economical system. We cannot stand outside those regulations but we can be smarter and we can invent solutions that is now owned by greedy companies. 

I believe that we can do this if we learn to appreciate the value of good inventions and solutions.






Friday, 15 July 2011

Setting up a home file server

We have been using a central file server for a while when I realized that a disk failure might be very costly. The server have two major roles; a central file server and a backend myth-tv server where things are recorded. By combining those two roles we only need this one online 24/7 and can close all other computers.

What hit me was that as I am using LVM spawning over several disks, the failure of one disk will drag the others along and the entire LVM volume will be lost, a particular unpleasant alternative, especially as the myth-tv recordings are not regulrarly backed up (mostly Simpsons, Star Gate and Alias). I decided to dig into the world of RAID.

I started to analyse the disk usage to get a full picture of our needs. 


            Size   Used   Free
            [GB]    [GB]  [GB] 

Volume Group lvm_video           
          
video        931    867     65
           
Volume Group opus_main           
           
lvm_users    200    24     177
lvm_audio    300    227     74
lvm_lager    500    359    142
lvm_video    900    570    331
opus_home     30     19     12
           
            1930   1199    736
           
Totals      2861   2066    801



The suprise was that by using different file systems for different purposes (video, music, etc) we have a slack of 800GB, unused space just there in case it should be needed. On the other hand, making one big file system shall be well though through, on disturbance and everything might be lost – we wouldn't want that do we. And when the file systems are in the size of Tera Bytes, the file systems starts behave strange and slow – the choice of file system becomes important.

When I found some “green” 2T har disks for a campaign price I decided to make the plans happened. I purchased 4 * 2TB disk for the array.


Solaris

Back in the 90:th I was very found of Sun-OS and Solaris and my first assumption was to setup the server using OpenSolaris and ZFS. Sorry to say I found that OpenSolaris seems no longer supported by Oracle so I decided to go for Open Indiana – the community driven Solaris.

To solve my problems I planned the following setup:


I made some initial testing and I really liked the ZFS. It just felt good. So did Solaris, felt like a since lost home. I decided to go for the Solaris solution.

First I installed Open Indiana build 148 and tried to make a system update. It failed; “System is a LiveCD” or similar. Had to find a walk around for that (sorry no link, google on the error messange to find solution).

Seting up the ZFS was easy. First step is to create zpools. I made one pool of the 4 disks using RAID-Z, simply RAID-5 but where the write-hole is close. The write-hole is a moment where a power-loss will cause damage to the array in any RAID-5 and, by the sound of it, is closed by integrating RAD and file system as in ZFS.

Second I created some ZFS directories. Those are kind of mount points that can be shared using NFS. Ordinary directories and data resides in the ZFS directory.

Third step was to start moving data from my Linux disks (ReiserFS and LVM) to the Solaris-disks. This turned out to be more problematic than I expected. First Solaris cannot mount a NFS3 share from Linux as Sun have decided to go for a non standard security model. I did some feeble tries to enable NFS4 on the Linux server but gave up and instead I used a Linux workstation to rsync data onto a NFS-mounted ZFS-partition. This was a very sloooow way of transfer 1.7TB data. The storage rate was ridiculous slow, it took like seconds to store a simple small HTML-file. I never got to the huge files like movies but I did the music.

I also found that even though the NFS share had no-root-squash (or root=IP-of-client as it is called in Solaris) it affected the files but not the directories. This results in a load of error during a rsync which I do NOT want as I use rsync for backing up to the server and really need to know the real errors.
Beside this I set-up an mysql server on the Solaris machine which as well turned out to be very slow. Just displaying the tables in a database gave a noticeable response time (even second and third time).

It also turned out to need pretty much more memory than Linux and I only have 2GB in the machine. This was not enough for the Virtual MythBackend server. I started the virtual server on another host (Linux) but with the virtual disk on the original ZFS file system via NFS. Once again things where very slow. This set-up however is not new to me. I do regularly run virtual machines where the virtual disks are mounted using NFS.

At this point I decided to reconsider the Solaris alternative. The drawbacks started to queue up:
  • It seems to be very slow on the file system   
  • It seems to be slow on MySql
  • It cannot mount Linux file systems

Linux

So I did reconsider and decided to go for a Linux setup instead. This way I can use the old installation of Gentoo. I went for the following setup:
  • The root partition is on the old 160GB disk.
  • The 4 new 2TB disks are installed as an RAID-5 array.
  • The raid-array results in a 5.5 TiB disk, about 6TB (Ti 1024-based and TB 1000-based)
  • The array is divided into 28 partitions each 200GiB
  • A reasonable amount of partitions is added to a LVM volume (lvm_nas)
  • Logical volumes are created for my needs and exported
  • All logical volumes are using EXT4 as file system.
There where some issues with the move though.

The first and most scary issue was with the disks. There where something like a GTP partition that fdisk cannot manage, and the GTP was corrupt. Trying out several disk utilities I stumbled on the gdisk utility (GTP fdisk) and learned that you will need a GTP partition table for disks this big.I managed to clear out the Solaris partition information and create the one full-disk partition that is to be included in the RAID.

Creating the RAID array was pretty easy but I discovered that the array is actually built in the background. For my setup it was estimated to take 18h to finish. It did not take that long time. In Gentoo it seems that mdadm is used while the official Raid guide refer to RaidTools.
 
Once the raid-array in place I created a GTP file table using gdisk. I also created 28 partitions รก 200GB to be used as physical volumes in LVM.

To the LVM volume I added space as I need now. There is a lot if unallocated space to use when I need more.

Ext4 takes longer time to create than ReiserFS. How long time file check will take is yet to be discovered. I did however try to grow a mounted EXT4 file system and it worked well but to some extra time. Next time I will probably work on offline file systems.

The MythBacken and MySql works the same as before - it is the same Linux installation. This time MySql have its own logical volume. Backups are mainly made using LVM snapshots; I make a snapshot of the volume that is copied out using rsync. 

Conclusion

Until the integration between Linux and Solaris works well you will avoid some troubles by sticking to one or the other. I am pretty satisfied with the Linux solution but it would been nice to have the Solaris server in place and working well but I had to admit the battle lost at one point. A heterogeneous environment is likely to be easier to keep up to date in the long run.  


If I need to play dare devil again I will tryout some of the BSD-clones. I am particular interested in the Hammer file system on DragonFly BSD. Sorry to say it is very difficult to get an up to date indication of the maturity. Same goes for ZFS on Linux, which would be an alternative. But while the "stable" version of Linux ZFS  is read only support it feels like a bit immature for me. Write capabilities is kind of important on a file server ;) 

 

 

Monday, 13 June 2011

Building QEmu on Cygwin; the magic trick!

I have just spent some hours to fund out why me and my colleague was unable to build qemu-0.14 on Cygwin. We did everything right and still we was stuck with the magic error from configure:


$./configure
ERROR: "gcc" either does not exist or does not work


Searching for problems with configure and gcc as keywords gives a lot of noise but eventually we found a solution. During installation we installed both gcc-3 and gcc-4 with gcc-4 as default. Switching over to gcc-3 made the trick. It can easily be done using options to configure:


$./configure --cc="gcc-3 -mno-cygwin" --host-cc=gcc-3

Br
Erik



Sunday, 15 May 2011

Archimate Symbols

There are many ways to do design and there are a huge lot of tools that can be used for UML modeling. Most of my experience is that UML design and code generation works pretty well if set up properly, but I still think that the transform from abstract architecture into UML design models is still hard to manage. Perhaps because abstract architecture does not really result in code, but in systems and rules and process descriptions.This leads back to the tooling issue. I have been using Enterprise Architect from Sparx Systems for a while and like it but what to do if the customer does not have an established tooling for Architecture.

This might sound like one of those vi versus vim questions, or Linux versus Windows, but it is not. The tooling is important. Not in the sens that it must be a certain software from a certain vendor but working with enterprise architecture mostly results in a evolutionary step that is expected to live for a long time and that is expected to take even further evolutionary steps.

In this sens the tooling is important  as my work will be base for further development by someone else for the upcoming say 10 years. I cannot do the tooling on my this-is-the-software-I-like but must ensure that the tools is selected with long term aspects as well.

It is at this point I start evaluating the word processor as UML tool using clipart one way or another. This is what we got when I started 1992; we did all design in Fram Maker on Sun OS 4 and OpenLook. Those where the days ;)
Archimate Symbols
And I still can fell pretty comfortable working in the word processor as long there is a decent set of symbols. Currently I have had hard to find a decent set of Archimate Symbols so I decided to build my own. This did not only result in the symbols but I did them in Google Docs Drawing as well and can now do Archimate Design in the cloud. For my this makes the same value of Google Draw as MS Visio Professional used to do but for anyone with a google mail account it is gratis. I am very pleased.So pleased I decided to allow You to use the Archimate Symbols licenced under Creative Commons - CC0 1.0.


// Erik

Friday, 4 February 2011

The Djunge of Licencing

I ran across this article by the H today. It covers some of the issues around Open Source Licences and the problems in combining them.

There are lot of stuff that are not clearly covered by any license. Take for example the Qt library, one of my favourites. It has a lot of smart functions. The development is open and freely accessible for each and every one.

So, what if I surf around the bug tracker or more precisely the feature requests and when I find a nice one for my own stuff I steal it.

Take for example the idea of "advanced rubber band", the suggestion that the square used to change size of an object is rotated together with the object.

The question is then: who owns the idea and the feature request, and under what license is it made available to the public?

The same goes the other way around, what it the idea is stolen and then presented as a suggestion and implemented. Who is then responsible for stealing the idea?

I have had the favour of working with mixed closed and open source on an earlier assignment. The conclusion is that this is an area where one shall take  particular care. One is actually playing with the risk of having the entire application suite forcedly licensed as open source with the requirement to supply full source code to any one that asks. We had each and every usage of open source licensed software reviewed by lawyers and signed by someone high in the hierarchy. Thinking of it I this was an reasonable procedure.

Just a disclaimer; I do favour open source software in general and Linux in particular. Meanwhile I do software engineering for living which implies the usage of paid software which in most cases means closed source software.

Sunday, 23 January 2011

The music player I'd like along the running trail..

I do it in periods. Sometimes several times a week, sometimes just once in a while. I am thinking of running. Mostly the procedure is the same. I start the phone tracker software and the music player with Rockbox, tries to remember to start with some easy warm up, do the exercise and if I can I will make some spurting at the end. I started running as exercise when I realized I can listen to music along the way. No music - no running. No can do.

Along the trail when the endorphins start coming to me I usually becomes very creative, after shower I have forgotten most of it :(
 
Any how I have had this idea of a runners music player or perhaps exercisers music player. Music is an important part of my exercise and I can really feel how the musical power helps me give that little extra. There is nothing so good as the perfect song during the end spurt. During the trail I like to have mixed music, some powerful and some a little bit softer making me slow down.

The obvious solution for my needs would be a music player where the music follows the characteristics of the exercise. Say I compile several play-lists, one for warm up, one for the trail, one for the spurting, one for the calm down and stretching. I will then need a mechanism to switch play list as the characteristics of the exercise is changed or about to change. To further support the situation, the switch will be instant, and the play-list will be allowed to have a starting position and a end position for each song so that my spurting is not started in an long soft intro to an otherwise heavy tune.

Naturally the player keeps the position in the play lists as I switch between them and when I switch back it continues where I left it.

If tracking is enabled the music, switching the play lists, pause music, receiving phone calls, and other important events is tracked as well.

As usual I have made a UML model for the system over view; the main use cases, the domain objects and a requirements. The requirements symbol is not a UML symbol I seen elsewhere but it is used in Enterprise Architect  from Sparx Systems which is the design tool I am using. 


The user may listen to music during exercise and may track the path. If enabled, when passing a given way-point with certain conditions (e.g. second time, passing in south direction) the system (here modeled as an actor) will switch play-list for you. 


Tracking of songs, path, play list switching may or may not be used. 


Naturally the music may be normalized - it is very annoying to break the focus to adjust the volume.



Saturday, 15 January 2011

Exploring Andoid

Now when I have two droids, a phone and a MP3 player, I spent some effort to play with Android development the other day. I am in deep need of a audio book player that will not mix my huge amount of audio books with the music, and that will not have easily accessible functions like next track as I only use them unintentionally (frustration!). Android comes with some nice design features that I think have been "concepts in mind" or "slideware" since the 90:s but Google have implemented just nice.

I am talking about the Intents and Activities.

From my point of view (mainly Qt development in C++ when it comes to end user applications) I compare the Activity with a full screen dialog with a special purpose. This is not really the same as an ordinary main window; activities is expected to come with an intention - the Intents. The intents describes the intention of an Activity.

So far nothing special. I design my main window as an activity and next thing is to open an audio file from the book. Now I need to start another activity where I can browse files. At the first glans I though this to be an easy task. Then I stumbled on the Intent and things got complicated. After some reading everything turned impressed instead.

Here goes:
The framework is built so when I need to have something done I find the corresponding Intent (i.e. PickFile in my case) and ask for an activity that will provide me with that intended function. The system will try to match this and if there are alternatives, the user will be asked to chose. The proposed way to make sure I have my own Activity started is to create an unique Intent identifier and fire it of.

So, why is this really cool?
Take a look at http://www.openintents.org/. There you have a database of intents and can download or purchase the module supplying the activity. This means that using Intents you can use and resue, not only open source code by copying it into you application, but you can use closed source modules as well.

Experimenting with Intents
and Activities as Use Cases
I like to express my self using UML or other graphical notations. I started to experiment how to model my Audiobook player (named Narrator and have a yet empty project page at http://gitorious.org/narrator ) using intents. The figure shows how I ended up modelling the Intents as existing and reusable Use Cases. This is the point when I really start liking the concept; it really enables software reuse rather than code reuse. Use Case reuse is on a higher level than code reuse and I think that it is on this level reuse must be made if to make sense. This way I will be reasonable flexible with the requirements around the use case Open File thus allow for alternative solutions.