<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Felipe Contreras &#187; MeeGo</title>
	<atom:link href="http://felipec.wordpress.com/category/meego/feed/" rel="self" type="application/rss+xml" />
	<link>http://felipec.wordpress.com</link>
	<description>Personal blog of Felipe Contreras</description>
	<lastBuildDate>Tue, 21 May 2013 00:10:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='felipec.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Felipe Contreras &#187; MeeGo</title>
		<link>http://felipec.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://felipec.wordpress.com/osd.xml" title="Felipe Contreras" />
	<atom:link rel='hub' href='http://felipec.wordpress.com/?pushpress=hub'/>
		<item>
		<title>gst-av 0.6 released; more reliable</title>
		<link>http://felipec.wordpress.com/2012/02/11/gst-av-0-6-released-more-reliable/</link>
		<comments>http://felipec.wordpress.com/2012/02/11/gst-av-0-6-released-more-reliable/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 00:16:48 +0000</pubDate>
		<dc:creator>FelipeC</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Planet]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[gst-av]]></category>
		<category><![CDATA[libav]]></category>

		<guid isPermaLink="false">http://felipec.wordpress.com/?p=1139</guid>
		<description><![CDATA[gst-av is a GStreamer plug-in to provide support for libav (fork of FFmpeg), it is similar to gst-ffmpeg, but without GStreamer politics, which means all libav plugins are supported, even if there are native GStreamer alternatives; VP8, MP3, Ogg, Vorbis, &#8230; <a href="http://felipec.wordpress.com/2012/02/11/gst-av-0-6-released-more-reliable/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=1139&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>gst-av is a GStreamer plug-in to provide support for libav (fork of FFmpeg), it is similar to gst-ffmpeg, but without GStreamer politics, which means all libav plugins are supported, even if there are native GStreamer alternatives; VP8, MP3, Ogg, Vorbis, AAC, etc.</p>
<p>This release takes care of a few corner-cases, and has support for more versions of FFmpeg.</p>
<p>Here are the goods:<br />
<a href="http://code.google.com/p/gst-av/downloads/list">http://code.google.com/p/gst-av/downloads/list</a></p>
<p>And here&#8217;s the short-log:</p>
<pre>Felipe Contreras (19):
      adec: flush buffer on EOS
      adec: improve timestamp reset
      adec: avoid deprecated av_get_bits_per_sample_fmt()
      adec: avoid FF_API_GET_BITS_PER_SAMPLE_FMT
      vdec: properly initialize input buffer
      parse: add more H.264 parsing checks
      parse: fix H.264 parsing for bitstream format
      get_bits: add show_bits function
      build: set runpath for libav
      vdec: fix potential leaks
      vdec: use libav pts stuff
      vdec: get delayed pictures on eos
      build: trivial improvements
      parse: trivial fix
      h264enc: fix static function
      vdec: add support for old reordered_opaque
      adec: add support for old sample_fmt
      adec: add support for really old bps()
      adec: add support for all MPEG-1 audio

Mark Nauwelaerts (1):
      parse: be less picky regarding some reserved value</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/felipec.wordpress.com/1139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/felipec.wordpress.com/1139/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=1139&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://felipec.wordpress.com/2012/02/11/gst-av-0-6-released-more-reliable/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1bb1c1a41b92d9f18e2890c3f6d33970?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">FelipeC</media:title>
		</media:content>
	</item>
		<item>
		<title>Android vs. Maemo power management: static vs. dynamic</title>
		<link>http://felipec.wordpress.com/2012/01/04/android-vs-maemo-power-managment-static-vs-dynamic/</link>
		<comments>http://felipec.wordpress.com/2012/01/04/android-vs-maemo-power-managment-static-vs-dynamic/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 23:10:26 +0000</pubDate>
		<dc:creator>FelipeC</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Embedded]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Planet]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[power management]]></category>

		<guid isPermaLink="false">http://felipec.wordpress.com/?p=1099</guid>
		<description><![CDATA[Some of you might have heard about Google&#8217;s Android team proposal to introduce wakelocks (aka suspend-blockers) to the Linux kernel. While there was a real issue being solved in the kernel side, the benefits on the user-space side were dubious &#8230; <a href="http://felipec.wordpress.com/2012/01/04/android-vs-maemo-power-managment-static-vs-dynamic/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=1099&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Some of you might have heard about Google&#8217;s Android team proposal to introduce wakelocks (aka suspend-blockers) to the Linux kernel. While there was a real issue being solved in the kernel side, the benefits on the user-space side were dubious at best, and after a <b>huge</b> discussion, they finally didn&#8217;t get in.</p>
<p>During this discussions the dynamic and static power management were described and discussed at length, and there was a bit of talk about Maemo(MeeGo) vs Android approaches to power management, but there was so much more than that.</p>
<p>Some people have problems with the battery on Android devices, for some people it&#8217;s just fine, some people have problems with the Maemo, other don&#8217;t, so in general; your mileage might vary. But given the extremely different approaches, it&#8217;s easy to see in which cases you would have better luck with Maemo, and in which with Android&#8211;Although I do think it&#8217;s obvious which approach is superior, but I am biased.</p>
<p>An interesting achievement was shared by Thiago Maciera, who managed to get &#8216;<a href="https://plus.google.com/108138837678270193032/posts/Apd28fCRQCz">5 days and a couple of minutes</a>&#8216; out of the Nokia N9 while traveling, and actually using it&#8211;and let&#8217;s remember this is a 1450 mAh battery. Some Android users might have trouble believing this, but hopefully this blog post would explain what&#8217;s going on.</p>
<p>So lets go ahead and explore the two approaches.</p>
<h2>Dynamic Power Management</h2>
<p>Perhaps the simplest way to imagine dynamic power management, is the gears of a manual transmission car. You go up and down depending on how much power does the system actually needs.</p>
<p>In some hardware, such as OMAP chips, it&#8217;s possible to have quite a lot of fine control on the power states of quite a lot of devices, plus different operating power points on the different cores. For example, it might be possible to have some devices, such as the display on, and active, some other devices partially off, like speaker, and other completely off, like USB. And based on the status of the whole system, whole blocks can be powered off, other with low voltage levels, etc.</p>
<p>Linux has a framework to deal properly with this kind of hardware, the <a href="http://lwn.net/Articles/347573/">runtime power management</a>, that originally came from the embedded world, and a lot from OMAP development, but is now available to everyone.</p>
<p>The idea is very simple; devices should sleep as much as possible. This means that if you have a sound device that needs chunks of 100ms, and the system is not doing anything else but playing sound, then most of the devices go to sleep, even the CPU, and the CPU is only waken up when it needs to write data for the audio device. Even better is to configure the sound device for chunks of 1 second, so the system can sleep even more.</p>
<p>Obviously, some co-operation between kernel and user-space is needed. Say, if you have an instant messenger program that needs to do work every minute, and a mail program that is configured to check mail every 10 minutes, you would want them to do work at the same time when they align at every 10 minutes. This is sometimes called <b>IP heartbeat</b>; the system wakes up for a beat, and then immediately goes back to sleep. And there are kernel facilities as well, such as range timers.</p>
<p>All this is possible thanks to very small latencies required for devices to go to sleep and wakeup, and have intermediary modes (e.g. on, inactive, retention, off), so, for example a device might be able to go to inactive mode in 1ms, retention in 2ms, and off in 5ms (totally invented numbers). Again, the more sleep, the better. Obviously, this is <b>impossible</b> on x86 chips, which have huge latencies&#8211;at least right now, and it&#8217;s something Intel is probably trying to improve effusively. All these latencies are known by the runtime pm framework in the kernel, and based on that it and the usage, it figures out what is the lowest power state possible without breaking things.</p>
<p>Note I&#8217;m not a power management expert, but you cant watch a colleague of mine explain the OMAP 3 power-managment on this video:</p>
<p><a href='http://free-electrons.com/pub/video/2009/fosdem/fosdem2009-schrijver-advanced-pm-omap3.ogv'>Advanced Power Management for OMAP3</a></p>
<p>And there&#8217;s plenty of <del datetime="2012-01-12T18:29:44+00:00"><a href="http://lwn.net/Articles/347573/">more resources</a></del>.</p>
<p><b>Update</b>: That was the wrong link, here are the <a href="http://elinux.org/Power_Management">resources</a>.</p>
<h2>Static Power Management</h2>
<p>Static power management has two modes: on and off. That&#8217;s it.</p>
<p>OK, that&#8217;s not exactly the case in general, but it is in the Android context; the system is either suspended, or active, and it&#8217;s easy to know in which mode you are; if the screen is on, it&#8217;s active, and if it&#8217;s off; it&#8217; is suspended (ideally).</p>
<p>There&#8217;s really not much more than that. The complexity comes from the problem of <b>when</b> to suspend; you might have turned off the display, but there might be a system service that still needs to do work, so this service grabs a <b>suspend blocker</b> which, as the name suggests, prevents the system from suspending (until the lock is released). This introduces a problem; a rouge program might grab a &#8216;suspend blocker&#8217; and never release it, which means your phone will never suspend, and thus the battery would drain rather quickly. So, some security mechanisms are introduced to grant permissions selectively to use suspend blockers.</p>
<p>And moreover, Android developers found race conditions in the suspend sequences in certain situations that were rather nasty (e.g. the system tries to suspend at the same time the user clicks a button, and the system never wakes up again), and these were acknowledged as real issues that would happen on all systems (including PC&#8217;s and servers, albeit rarely, because they don&#8217;t suspend so often), and got fixed (or at least they tried).</p>
<h2>Versus</h2>
<p>First of all, it&#8217;s important to know that if you have dynamic pm working perfectly, you reach exactly the same voltage usage than static pm, so in ideal cases they both behave <b>exactly</b> the same.</p>
<p>The problem is that it&#8217;s really hard for dynamic pm to reach that ideal case, in reality systems are able to sleep for certain periods of time, after which they are woken up, often times unnecessarily, and as I already explained; that&#8217;s not good. So the goal of a dynamic pm system is to increase those periods of time as much as possible, thus maximizing battery life. But there&#8217;s a point of diminished returns (read <a href="http://article.gmane.org/gmane.linux.kernel/995525">this</a> or <a href="http://article.gmane.org/gmane.linux.ports.arm.omap/37982">this</a> for expert explanations), so, if the system manages to sleep 1s in average, there&#8217;s really not much more to gain if it sleeps 2s, or even 10s. These goals were quite difficult to achieve in the past (not these, I invented those numbers), but not so much any more thanks to several mechanisms that have been introduced and implemented through the years. So it&#8217;s fair to say that the <i>sweet spot</i> of dynamic pm has been achieved.</p>
<p>This means that <b>today</b> a system that has been fine-tuned for dynamic pm can reach reach a decent battery life compared to one that uses static pm in most circumstances. But for some use-cases, say, you leave your phone on your desk and you don&#8217;t use it at all, static pm would allow it to stay alive for <b>weeks</b>, or even <b>months</b>, while dynamic pm can&#8217;t possibly achieve that any time soon. Hopefully you would agree, that nobody cares about those use-cases were you are not actually using the device.</p>
<p>And of course, you only need <b>one</b> application behaving badly and waking up the system constantly, and the battery life is screwed. So in essence, dynamic pm is hard to achieve.</p>
<p>Android developers argued that was one of the main reasons to go for static pm; it&#8217;s easier to achieve, specially if you want to support a lot of third party applications (Android Market) without compromising battery life. While this makes sense, I wasn&#8217;t convinced by this argument; you still can have one application that is behaving badly (grabbing suspend blockers the whole time), and while permissions should help, the application might still request the permission, and the user grant it (who reads incomprehensible warnings before clicking &#8216;Yes&#8217; anyway?).</p>
<p>So, both can get screwed by bad apps (although it&#8217;s likely that it&#8217;s harder in the static pm case, albeit not that much).</p>
<p>But actually, you can have <b>both</b> static and dynamic power management, and in fact, Android does. But that doesn&#8217;t mean Android automatically wins, as I explained, the system needs to be fine-tuned for dynamic pm, and that has never been a focus of Android (there&#8217;s no API&#8217;s or frameworks for that, etc.). So, for example, a Nokia N9 phone might be able to sleep 1s in average, while an Android phone 100ms (when not suspended). This means when you are <b>actually using the device</b> (the screen is on), chances are, a system fine-tuned for dynamic pm (Nokia N9) would consume less battery, than an Android device.</p>
<p><b>That</b> is the main difference between the two. <b>tl;dr:</b> dynamic pm is better for active usage.</p>
<p>So, if Android developers want to improve the battery usage while on <b>active usage</b> (which I assume is what the users want), they need to fine-tune the system for dynamic pm, and thus sleep as much as possible, hopefully reaching the <i>sweet spot</i>. But wait a second&#8230; If Android is using dynamic pm anyway, and they tune the system to the point of diminishing returns; <b>there is not need for static pm</b>. Right? Well, that&#8217;s my thinking, but I didn&#8217;t manage to make Android developers realize that in the discussion.</p>
<p>Plus, there&#8217;s a bunch of other reasons while static pm is not palatable for non-Android systems (aka. typical Linux systems), but I won&#8217;t go into those details.</p>
<p>Nokia&#8217;s bet was on dynamic, Google&#8217;s bet was on static, and in the end we agreed to disagree, but I think it&#8217;s clear from the outcome in real-world situations who was right&#8211;N9 users experiencing more than one day of normal usage, and even more than two. Sadly, only Nokia N9 users would manage to experience dynamic pm in full glory (at the moment).</p>
<h2>Upstream</h2>
<p>But not all is lost, and this in my opinion is the most important aspect. Dynamic pm lives on the Linux kernel <b>mainline</b> through the runtime power management API. This is <b>not</b> a Nokia invention that will die with the Nokia N9; it&#8217;s a collaborative effort where Nokia, TI, and other companies worked together, and now not only benefits OMAP, but other embedded chips, and even non-embedded ones. Being upstream means it&#8217;s good, and it has been blessed by many parties, and has gone through many iterations, and finally it probably doesn&#8217;t look like the original OMAP SRF code <b>at all</b>. Sooner or later your phone (if you don&#8217;t have an N9) will benefit from this effort, and it might even be an Android phone, your netbook (if not already benefiting in some way), and even your PC.</p>
<p>Android&#8217;s suspend blockers are not upstream, and it&#8217;s quite unlikely that they will ever be, or that you would see them used in any system other than Android, and there&#8217;s good reasons for that. Matthew Garrett did an excellent job of summarizing what went wrong with the story of suspend blockers on his presentation &#8216;Android/Linux kernel: Lessons learned&#8217;, but unfortunately the Linux foundation seems to be doing a poor job of providing those videos (I cannot watch them any more, even though I registered<del datetime="2012-01-12T00:48:17+00:00">, and they haven&#8217;t been helpful through email conversations</del>).</p>
<p><b>Update</b>: I managed to get the video from the Linux Foundation and pushed it to YouTube:<br />
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='660' height='402' src='http://www.youtube.com/embed/A4psPP67YMU?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>Here is <a href="http://thread.gmane.org/gmane.linux.kernel/1016861/focus=1020374">part of the discussion</a> on LKML, if you want to read it for some strange reason. WARNING; it&#8217;s <b>huge</b>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/felipec.wordpress.com/1099/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/felipec.wordpress.com/1099/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=1099&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://felipec.wordpress.com/2012/01/04/android-vs-maemo-power-managment-static-vs-dynamic/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
<enclosure url="http://free-electrons.com/pub/video/2009/fosdem/fosdem2009-schrijver-advanced-pm-omap3.ogv" length="176442026" type="video/ogg" />
	
		<media:content url="http://1.gravatar.com/avatar/1bb1c1a41b92d9f18e2890c3f6d33970?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">FelipeC</media:title>
		</media:content>
	</item>
		<item>
		<title>A tale of just another Linux kernel bug</title>
		<link>http://felipec.wordpress.com/2011/12/13/a-tale-of-just-another-linux-kernel-bug/</link>
		<comments>http://felipec.wordpress.com/2011/12/13/a-tale-of-just-another-linux-kernel-bug/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 16:00:06 +0000</pubDate>
		<dc:creator>FelipeC</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Embedded]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Planet]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://felipec.wordpress.com/?p=1066</guid>
		<description><![CDATA[As part of a bigger effort to get my Nokia N900 in good shape for development, I decided to track down an issue with the keyboard; I could type &#8216;a&#8217;, but not &#8216;A&#8217; or any special characters, so no &#8216;shift&#8217; &#8230; <a href="http://felipec.wordpress.com/2011/12/13/a-tale-of-just-another-linux-kernel-bug/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=1066&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>As part of a bigger effort to get my <a href="http://en.wikipedia.org/wiki/Nokia_N900">Nokia N900</a> in good shape for development, I decided to track down an issue with the keyboard; I could type &#8216;a&#8217;, but not &#8216;A&#8217; or any special characters, so no &#8216;shift&#8217; or &#8216;ctrl&#8217; or anything special. Trying to figure out what was going on took me through an unexpected journey, which is not remarkable, but I think it&#8217;s a good example of what many kernel developers (and low level developers) constantly go through, and as such, might be interesting for some people to read.</p>
<h2>Keycodes</h2>
<p>So, first things first. I recently had an issue with a PS/2 keyboard on my PC, so I had an idea how to debug this, and the first thing I did was to run <code>keycode</code>, which shows messages like these:</p>
<pre>keycode  30 press
keycode  30 release
keycode  30 press
keycode  30 release
keycode  29 press</pre>
<p>Then these keys are supposed to be converted to real characters somehow through a key map, and apparently X has a map of its own.</p>
<p>However, I saw keycodes being pressed when I clicked &#8216;shift&#8217;, so I concluded that neither hardware, nor input driver was the problem, could it be the mapping? The MeeGo project provided a <a href="https://meego.gitorious.org/meego-device-adaptation/n900_nokia-n900-configs/blobs/master/nokia-n900-keys.map">mapping file</a> that I have been using for some time, and it clearly shows &#8220;keycode 42 = Shift&#8221;, and I was getting keycode 42, so the mapping seemed correct, but was it being applied properly? I found out this can be checked by using <code>dumpkeys</code>, and indeed, the mapping was correct.</p>
<p>Everything was fine up to this level. Next.</p>
<p>Note: all these tools (showkey, loadkeys, and dumpkeys) are provided by the &#8216;kbd&#8217; package.</p>
<h2>Virtual terminal</h2>
<p>Now I stumbled into a problem; I&#8217;ve no idea what it is that I am interacting with on the framebuffer console (I&#8217;m not using X). So, I try fill that gap in my knowledge by going to the <code>##linux</code> IRC channel in freenode.net, and ask the question: what is it that converts they keycodes to characters in a framebuffer console? As it&#8217;s typical when I ask these sorts of tricky questions, I get useless responses, like, &#8216;what distribution are you using?&#8217; I <i>knew</i> that didn&#8217;t matter, so I set out to investigate myself.</p>
<p>I thought, well, what is this thing that I have to add in my inittab to get the console working? <code>1:2345:respawn:/sbin/getty 9600 tty1</code>. I tried to read documentation about getty and try different options, like try to specify vt100 as an argument, but to no avail.</p>
<p>Maybe it&#8217;s done in the kernel? I thought. So I quickly went through my kernel config, and I find this gem:</p>
<pre>CONFIG_VT

If you say Y here, you will get support for terminal devices with
display and keyboard devices. These are called "virtual" because you
can run several virtual terminals (also called virtual consoles) on
one physical terminal. This is rather useful, for example one
virtual terminal can collect system messages and warnings, another
one can be used for a text-mode user session, and a third could run
an X session, all in parallel. Switching between virtual terminals
is done with certain key combinations, usually Alt-.

The setterm command ("man setterm") can be used to change the
properties (such as colors or beeping) of a virtual terminal. The
man page console_codes(4) ("man console_codes") contains the special
character sequences that can be used to change those properties
directly. The fonts used on virtual terminals can be changed with
the setfont ("man setfont") command and the key bindings are defined
with the loadkeys ("man loadkeys") command.

You need at least one virtual terminal device in order to make use
of your keyboard and monitor. Therefore, only people configuring an
embedded system would want to say N here in order to save some
memory; the only way to log into such a system is then via a serial
or network connection.

If unsure, say Y, or else you won't be able to do much with your new
shiny Linux system <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </pre>
<p>That makes sense, now we are getting somewhere. So, in the past, there was this notion of &#8216;terminals&#8217;, which are specialized pieces of hardware that send and receive ASCII (or some codes), so they are the ones that have all the needed stuff to control they keyboard, screen, and so on. I never had the need to use one of these terminals, therefore I never really knew what a &#8220;virtual&#8221; terminal was. So a virtual terminal does the job of a real terminal; it needs an input driver, and a display driver, and really puts them to do something useful.</p>
<p>Interesting theory, but is it true? I quickly looked at the code inside drivers/tty/vt, and I found code to control the keyboard, screen, and also that contains the keyboard mappings. Excellent! So we found the thing that uses these keyboard mappings. Now what?</p>
<p>Before moving on, the fact that this code resides in tty is also helpful, basically, serial console, virtual terminals (framebuffer console), and real terminals all operate through tty&#8217;s (teleprinter), which are means of communication between hosts and these &#8220;devices&#8221;. So, getty really gets a tty to be used by any of these.</p>
<p>All right, so now the knowledge gap seems to be filled, what next? Well, clearly there&#8217;s something wrong with this virtual terminal, but what? I immediately started looking at the code at drivers/tty/vt/keyboard.c, and I noticed something interesting: <b>kbdmode</b> can have different values, like RAW, and this mode, certain things are not handled, like &#8216;shift&#8217;. That looked promising, but how to change that mode?</p>
<p>I looked for tools to control the virtual terminal, I found an interesting one, setterm, which was not available in my minimal system, I couldn&#8217;t find how to get it, and anyway didn&#8217;t have any option that I wanted. terminfo and such looked interesting, but it didn&#8217;t seem like anything relevant to the issue at hand. Then I found <code>kbd_mode</code>, which obviously did what I wanted, and I already had it <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . I couldn&#8217;t even type mbd_mode on my keyboard, so I had to write shortcuts on my PC (kbda, kbdb, etc.). Unfortunately, I found out that initially the mode was set to &#8216;unicode&#8217;, which seemed Ok, and changing to &#8216;ascii&#8217; didn&#8217;t change anything.</p>
<p>So, it didn&#8217;t seem to be a user-space configuration of any sort. Next.</p>
<h2>Getting our hands dirty</h2>
<p>Time to actually type some code. I modified the code in &#8216;drivers/tty/vt/keyboard.c&#8217;, specially in kbd_keycode() to find out the true kbdmode, the keycodes coming down, and how they were being interpreted.</p>
<p>I quickly found out that they keycodes and mode were indeed correct, but each and every key press was immediately followed by a key release, so shift+a was interpreted as shift, a. Now we are getting somewhere; the problem <b>has to be</b> on the input driver.</p>
<p>Maybe I chose the wrong one, or maybe I&#8217;m missing some configurations. I see some CONFIG_KEYBOARD_GPIO, and CONFIG_KEYBOARD_TWL4030, and it looks like I should be using TWL4030, as that&#8217;s the chip the Nokia N900 has, but I&#8217;m not sure, so time to look at the <a href="http://wiki.maemo.org/N900_Hardware_Schematic">N900 schematics</a>. Well, it seemed like TWL4030 is indeed the right one, and there&#8217;s nothing to it; either you have it or not.</p>
<p>Maybe some recent change broke it&#8230; But there&#8217;s nothing recent that I can see that could do that. So it&#8217;s time to take a look at the actual code: drivers/input/keyboard/twl4030_keypad.c. After adding a few prints here and there I realize the problem starts with this code <code>ret = twl4030_kpread(kp, &amp;reg, KEYP_ISR1, 1)</code> which returns 0 after a key press (that returns 1). So, time to read the <a href="http://www.ti.com/litv/pdf/swcu050g">TRM</a>.</p>
<p>It took me some time to find the right document, and then understand what all the configuration options were actually doing (more or less), and then play around with them. After making a lot of more or less random changes I notice no difference in this particular problem of getting an extra &#8217;0&#8242;. So I think to myself; maybe the problem is the interrupt.</p>
<p>So I abandon the configuration of the keyboard, and look at the code to request the interrupt:<br />
<code>request_threaded_irq(kp-&gt;irq, NULL, do_kp_irq, 0, pdev-&gt;name, kp);</code></p>
<p>I had some interrupt issues before (in fact on this very keyboard), so I knew a few hacks I could try, like specifying the IRQF_ONESHOT flag. That didn&#8217;t help, so I tried to do that in the parent interrupt on &#8216;drivers/mfd/twl4030-irq.c&#8217;, because I saw a patch from Neil Brown on the linux-omap mailing list that fixed another issue, but that didn&#8217;t help either. Then I realized I saw one patch that affected this interrupt request (<a href="http://article.gmane.org/gmane.linux.kernel/932255">see here</a>). So I revert the patch, and <b>voilà</b>, no more 0&#8242;s afterwards, and the keyboard works properly.</p>
<p>However, there&#8217;s a nasty warning about interrupts being enabled, which is probably the reason why the original patch happened, so I try a few random things to get rid of it, but nothing helps. So then I wonder, maybe the reason the keyboard driver worked before that patch is just pure luck, and these extra interrupts were not being detected properly.</p>
<h2>Enough fooling around</h2>
<p>Since I really want to fix this issue properly, I push myself to really understand what&#8217;s going on in the driver. So I slowly read all the documentation, and all the registers, and try to set different values to see what&#8217;s going on. While doing that, I noticed one function was calculating the times wrongly, and was telling the driver to use values twice as big as originally intended. It took me some time to figure out why the author chose 31 &lt;&lt; (x + 1) instead of 2 &lt;&lt; (x + 1) * 31, which is what a direct function conversion would return, until I realized that a shift basically means multiplying by two, and x &lt;&lt; 1 is basically the same as (2 &lt;&lt; 0) * x, but the author missed that x = ptv + 1, and so it should be 31 &lt;&lt; (ptv + 2). Anyway, after being confident of these timeout values, I could set big timeouts on the range of seconds without overflowing the registers and see exactly what they were doing in timescales I could notice.</p>
<p>So yeah, these registers were doing what I thought they should be doing. Nice try.</p>
<p>Time to go back to the interrupt handling. After reading the code of the twl4030-irq, which is supposed to fire the irqs that the keyboard driver eventually gets, and then reading some kernel core code as well, it was not really clear to me how these were all weaved together, so I added some printfs.</p>
<p>Before going forward I&#8217;ll briefly explain a bit what TWL4030 is. To my understanding it&#8217;s basically an integrated circuit that has many functions, one of them is having a keyboard controller. So there is no dedicated IRQ for the keyboard interrupt, but TWL4030 has a level interrupt, and then the right module IRQ is demultiplexed. OK.</p>
<p>I was hoping there was a chain of actions like pih -&gt; sih (from twl-core) -&gt; keyboard, but no, there was only one action in the chain. Fortunately when I reverted the patch I got a warning with a backtrace where I could see something like twl4030_irq_thread-&gt;generic_handle_irq-&gt;handle_simple_irq. It was really straight-forward, but I couldn&#8217;t see why. There was a lot of code in twl403o-irq for a &#8220;secondary interrupt handler&#8221; but it didn&#8217;t seem to be called at all, and I didn&#8217;t see how generic_handle_irq was calling handle_simple_irq.</p>
<p>Time to step back for a second. I remembered a patch from Neil Brown trying to fix something regarding how this sih stuff was called (<a href="http://article.gmane.org/gmane.linux.kernel/1220708">here</a>) because it was not called at all, but these patches are supposed to be fixes for other patches that are not applied at this point, so they really wouldn&#8217;t help.</p>
<p>At this point I&#8217;m pretty much stuck, as I&#8217;ve no idea how all this code is connected, you might think that all this is way over my head, and it might be, even if just a little, but that has never deterred me. I know that as long as I have the code, and I have a way to run it, I can figure out how it works, so I just keep trying.</p>
<p>After reading the code more carefully, I noticed that only some twl &#8220;modules&#8221; had a sih setup, and the keyboard was not one of them, so that explained the sih part. And then I noticed a part of the irq handling that dealt with &#8220;chips&#8221;, and one interesting function that setup the chip&#8217;s &#8220;handler&#8221;. Wait a second&#8230; So there&#8217;s a chip handler, and a client handler, a few keystrokes after and I find this gem <code>irq_set_chip_and_handler(i, &amp;twl4030_irq_chip, handle_simple_irq)</code>. Finally! So I can now see the whole chain of events, but alas, I still have no idea why things are failing.</p>
<p>I thought maybe some states where miscalculated, so I find a function that is used to print everything related to an irq, but it was hidden in some internal code, so I had to do a few tricks to use it in the keyboard driver. All the states seemed to be OK, except one&#8230; the irq count, which showed something like 0, 0, 0, 1, 2, 2, 3 where it should have shown 0, 0, 1, 1, 2, 2. I looked at all the places where this counter is modified, and I found an interesting function: handle_nested_irq, so I replaced handle_simple_irq just for fun, and&#8230;</p>
<p><b>BAM!</b></p>
<p>Everything worked perfectly.</p>
<h2>Why, Why, Why</h2>
<p>So, now I found a fix, but why does it work? If I want to fix this in a way that other people will not get bitten, I have to find the proper fix, so &#8220;This seems to make things work here&#8221; usually doesn&#8217;t convince many kernel hackers.</p>
<p>Using handle_nested_irq makes the compiler throw a warning right away, because the number of arguments is different, so I looked at how other people use this function, and it&#8217;s indeed very different, it looks like people are calling handle_nested_irq directly, instead of generic_handle_irq, which would eventually handle handle_simple_irq, because that&#8217;s the chip&#8217;s configured handler. It all boils down to the difference between handle_nested_irq and handle_simple_irq, and looking at them it&#8217;s clear that handle_nested_irq does much less, specifically, it calls directly the action-&gt;thread_fn() callback, which is the keyboard interrupt handler, rather than waking up the thread, which is the same function (but in a specialized thread).</p>
<p>And this finally shines some light; the reason why the interrupt counter is wrong, is that the thread is waked <b>after</b> the irq has been processed, so the code that is supposed to clear the interrupt hasn&#8217;t been called yet, and a second interrupt is generated which is spurious. The relevant code is supposed to read a register, and the hardware clear the interrupt on a read (or write) operation. The reason handle_nested_irq works is because it doesn&#8217;t bother with the interrupt thread at all, it calls the function right away on the same thread, and thus the interrupt is marked as handled at the right time (after it has been really handled).</p>
<p>And this also explains why other people call handle_nested_irq instead of generic_handle_irq; you are supposed to call it inside an interrupt thread (which is configured with request_threaded_irq), but there&#8217;s a thread lying around that nobody uses. Indeed, Neil Brown noticed the same (<a href="http://article.gmane.org/gmane.linux.kernel/1220707">here</a>), so irq_set_nested_thread() will make sure that no extra thread is created.</p>
<p>So both irq handlers must be threaded, the one for the twl-core, and the one for the keyboard, not just the one for the keyboard like right now. Fortunately Felipe Balbi already fixed that (see this <a href="http://article.gmane.org/gmane.linux.ports.arm.omap/59958">patch series</a>), but that broke things badly, and then Neil Brown fixed them (see <a href="http://article.gmane.org/gmane.linux.ports.arm.omap/67333">this</a>). Interestingly enough, I had already tested those patches for other reasons, but at this point I wasn&#8217;t sure if they would fix the keyboard problems, I just assumed the would anyway.</p>
<p>Good good, it looks like we finally have the whole picture, but the job&#8217;s not done yet.</p>
<h2>Getting it &#8220;done&#8221;</h2>
<p>Now the question is: how to fix this? One limitation of the &#8216;stable&#8217; kernel trees (at least AFAIK), is that the patches should be in the latest Linus&#8217;s tree, so whatever solution is found, should be in the main tree.</p>
<p>Ideally, all the stack of irq&#8217;s should be reorganized to use the nested/threaded API, or none at all. So <a href="http://article.gmane.org/gmane.linux.kernel/932255">this</a> patch, should have been applied only after <a href="http://article.gmane.org/gmane.linux.ports.arm.omap/59958">this patch series</a>, and not two years beforehand. I pondered for quite some time whether a middle-ground could be found, either by workarounds in the core irq handler, or in the keyboard one, eventually I came to the conclusion that since the core is supposed to set irq_set_nested_thread() anyway (just trust me), the keyboard one is the one that should check if it&#8217;s nested or not, and either set the thread handler, or a normal one, and this code should work before and after the patches applied for 3.2. Unfortunately, the &#8216;nested&#8217; flag is supposed to be internal to the kernel&#8217;s thread handling code.</p>
<p>So there&#8217;s really no way around it, either the original patch is reverted (and other possible similar ones for other twl modules), or all the twl core irq handler gets the new code for 3.2 backported, and that code isn&#8217;t even fixed yet (as of v3.2-rc5) (and maybe it will not be the way things are progressing).</p>
<p>Then the question arises; is all that new code on v3.2 working properly? I went ahead and tried it, and lo and behold; the keyboard works as expected. I then backported all those patches to v3.1, and they all worked too.</p>
<p>But does it really make sense to apply all those patches to all the kernels after v2.6.33? Or does it make sense to revert a few of them? That&#8217;s not for me to decide, so I ask the community, after I did all that work on <a href="http://article.gmane.org/gmane.linux.kernel.input/22899">this mail</a>.</p>
<p>Sometimes the result of a week&#8217;s work ends up being a one line patch, sometimes it&#8217;s just one character, and in this case, there was no patch (at least from me), but at least the issue is clearly identified, as well as the fixes. And that means nobody has to do this work again.</p>
<p>Well, the fun is not over&#8230; We still need to synchronize the maintainers, so the right patches land on Linus&#8217; tree for v3.2, and they are back-ported to the relevant linux-stable trees.</p>
<h2>Kernel development is hard, let&#8217;s go shopping</h2>
<p>What are you talking about? This isn&#8217;t even kernel development, it&#8217;s just some legwork <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  I&#8217;m going to be <a href="http://search.dilbert.com/comic/Topper">Topper</a> for a second and say &#8220;That&#8217;s nothing!&#8221;, there&#8217;s way more complicated and challenging issues kernel developers confront all the time. I thought this was interesting because of all the steps I had to do, and because it involved things I had no idea about.</p>
<p>Was this worth my time? Well, I learned what is actually a virtual terminal for real, and not some vague notion, like when common people say &#8220;My browser? Yeah, I use Google&#8230; No?&#8221;. I also learned a bit more about the IRQ handling API in the Linux kernel, and BTW, all this threaded interrupt API started because of real issues, and the removal of IRQF_DISABLED (nice LWN article about it <a href="http://lwn.net/Articles/380931/">here</a>), and that thread was fun to read years ago, even when I didn&#8217;t understand most of it, maybe it&#8217;s time to read it again <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>For me, the best is the satisfaction of knowing that I really &#8220;got it&#8221;. I mean, I really understand what causes the problem, many of the possible solutions, including hacky and proper ones, and exactly what to do if I get bitten by a similar problem regarding threaded IRQ&#8217;s.</p>
<p>And now that the keyboard is fixed, on with the next problem on the N900 (which I stopped working on, because I though a functional keyboard would help to debug it, as opposed to shut down, remove the MMC, plug it into a PC, write a script with the commands I want to run, unmount, plug it back, and boot [I can't use USB networking for this issue to appear]).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/felipec.wordpress.com/1066/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/felipec.wordpress.com/1066/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=1066&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://felipec.wordpress.com/2011/12/13/a-tale-of-just-another-linux-kernel-bug/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1bb1c1a41b92d9f18e2890c3f6d33970?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">FelipeC</media:title>
		</media:content>
	</item>
		<item>
		<title>Scrobbler for Maemo, now both on N900, and N9</title>
		<link>http://felipec.wordpress.com/2011/08/18/scrobbler-for-maemo-now-both-on-n900-and-n9/</link>
		<comments>http://felipec.wordpress.com/2011/08/18/scrobbler-for-maemo-now-both-on-n900-and-n9/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 20:02:13 +0000</pubDate>
		<dc:creator>FelipeC</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Planet]]></category>
		<category><![CDATA[last.fm]]></category>
		<category><![CDATA[maemo-scrobberl]]></category>
		<category><![CDATA[scrobbler]]></category>

		<guid isPermaLink="false">http://felipec.wordpress.com/?p=968</guid>
		<description><![CDATA[Version 2.0 finally moved to Fremantle stable, so everybody can start using it If you are not familiar with it, this package will see what music you are listening on Maemo devices, and scrobble to your favorite service, either last.fm, &#8230; <a href="http://felipec.wordpress.com/2011/08/18/scrobbler-for-maemo-now-both-on-n900-and-n9/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=968&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Version 2.0 finally moved to Fremantle stable, so everybody can <a href="http://maemo.org/downloads/product/Maemo5/maemo-scrobbler/">start using it</a> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you are not familiar with it, this package will see what music you are listening on Maemo devices, and scrobble to your favorite service, either last.fm, libre.fm, or both.</p>
<p>I already explained the features in an <a href="http://felipec.wordpress.com/2010/07/11/scrobbler-for-maemo-2-0-released-now-with-love-support/">earlier blog entry</a>, along with an explanation of how to make use of the &#8220;love&#8221; feature.</p>
<p>But now I also managed to port this to Harmattan, and it works perfectly on my Nokia N9. Interestingly enough, the new UI has a &#8220;favorite&#8221; feature directly integrated, it took me some time, as it&#8217;s not publicly documented, but I finally managed to hook into it, so everything works seamlessly <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='660' height='402' src='http://www.youtube.com/embed/66KJCavcC2o?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<p>I was rather impressed by how easy it was to port it, I was able to leave all the GLib bits intact, even libsoup is still supported, and libconio, so I only had to make changes regarding the new qmafw. Thanks to the Qt guys for using the GLib&#8217;s mainloop by default, it certainly made things easier for me <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><b>Update</b></p>
<p>You can find a debian package here: <a href="http://people.freedesktop.org/~felipec/maemo-scrobbler_2.0-2_armel.deb">maemo-scrobbler 2.0-2</a>.</p>
<p>Then, you would need to create a file <code>~/.config/scrobbler</code> like this:</p>
<pre>[lastfm]
username=foo
password=bar
            
[librefm]
username=foo
password=bar</pre>
<p>That&#8217;s it <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/felipec.wordpress.com/968/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/felipec.wordpress.com/968/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=968&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://felipec.wordpress.com/2011/08/18/scrobbler-for-maemo-now-both-on-n900-and-n9/feed/</wfw:commentRss>
		<slash:comments>74</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1bb1c1a41b92d9f18e2890c3f6d33970?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">FelipeC</media:title>
		</media:content>
	</item>
		<item>
		<title>N9 Swipe undocumented feature; activate sane behavior</title>
		<link>http://felipec.wordpress.com/2011/08/14/n9-swipe-undocumented-feature-activate-sane-behavior/</link>
		<comments>http://felipec.wordpress.com/2011/08/14/n9-swipe-undocumented-feature-activate-sane-behavior/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 11:30:20 +0000</pubDate>
		<dc:creator>FelipeC</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Planet]]></category>

		<guid isPermaLink="false">http://felipec.wordpress.com/?p=956</guid>
		<description><![CDATA[Ed Page recently blogged about his idea to improve the Swipe UI. Fortunately for him, a bunch of people and I had the same idea inside Nokia Update: apparently this is not present in the images distributed with the Nokia &#8230; <a href="http://felipec.wordpress.com/2011/08/14/n9-swipe-undocumented-feature-activate-sane-behavior/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=956&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Ed Page recently <a href="http://eopage.blogspot.com/2011/08/swipe-ux-idea.html">blogged about</a> his idea to improve the Swipe UI. Fortunately for him, a bunch of people and I had the same idea inside Nokia <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><b>Update</b>: apparently this is not present in the images distributed with the Nokia N950&#8242;s, it was introduced after 25-3.</p>
<p>If you open <code>~/.config/mcompositor/mcompsitor.conf</code>, you&#8217;ll see a bunch of swipe-action-foo configs, all of them set to &#8220;away&#8221; (by default).</p>
<p>You can, however, change them to something like:<br />
<code>swipe-action-up: switcher<br />
swipe-action-down: close<br />
swipe-action-left: events<br />
swipe-action-right: launcher</code></p>
<p>And voilà! Now depending on which direction you swipe, is the action that would happen. You need to kill mcompositor for them to become active (or send SIGTERM/SIGINT, I don&#8217;t remember which one).</p>
<p>This was possible because I got fed up arguing about the benefits of swiping down to close applications, and decided to implement the thing by myself. While doing that, I also decided to implement an idea that was flying around, which was to do something different depending on the direction of the swipe. It took me about two days to do, including making it configurable, mostly trying to familiarize myself with the code that was split into multiple packages, and wrapping myself around C++, which I have avoided as much as possible. That was much less time than the time spent discussing before and after I implemented the patches. Fortunately, after seeing the thing in action, many people jumped into the wagon, and at least swipe down to close is available to the masses, which people <a href="http://mynokiablog.com/2011/07/17/video-swipe-down-to-close-app-in-nokia-n9-australia-first-to-launch-n9/">seem to like</a>. Guerrilla design <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>However, after a lot of though, I realized the configuration I mentioned above is ideal. And this is my rationale:</p>
<h2>Rationale</h2>
<p>The current design is inconsistent; when you swipe away, you never know in which desktop view you are going to end up, specially if you just unlocked the device. You might end up in &#8216;switcher&#8217;, or &#8216;launcher&#8217;, or &#8216;events&#8217;. Same action, different behaviour equals inconsistency.</p>
<p>There&#8217;s a simple solution; utilize the simple mental model required to navigate the desktop views.</p>
<p><a href="http://felipec.files.wordpress.com/2011/08/swipe.png"><img src="http://felipec.files.wordpress.com/2011/08/swipe.png?w=660" alt="Swipe mental model" title="Swipe"   class="aligncenter size-full wp-image-958" /></a></p>
<p>In this way, it&#8217;s easy to know exactly what would happen when swiping on each direction, decreasing the amount of actions needed from the user. The same action always produces the same behavior.</p>
<p>It is unclear if this mode is ever going to be officially supported on the device, despite the fact that I think it&#8217;s <b>obviously</b> superior (and Ed Page seems to agree, as he came with the exact same idea by himself), maybe some people are worried about updating manuals and what not, but at least it&#8217;s trivial to activate, and anybody can create a 3rd party app for that <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>BTW. This is yet another reason why I distrust people telling me I&#8217;m a &#8220;geek&#8221;, and &#8220;designers&#8221; know better when it comes to design. In the words of Elaine Morgan; yes, they can all be wrong, history is strung with occasions when they all got it wrong.</p>
<p>Enjoy <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/felipec.wordpress.com/956/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/felipec.wordpress.com/956/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=956&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://felipec.wordpress.com/2011/08/14/n9-swipe-undocumented-feature-activate-sane-behavior/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1bb1c1a41b92d9f18e2890c3f6d33970?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">FelipeC</media:title>
		</media:content>

		<media:content url="http://felipec.files.wordpress.com/2011/08/swipe.png" medium="image">
			<media:title type="html">Swipe</media:title>
		</media:content>
	</item>
		<item>
		<title>My disagreement with Elop on MeeGo</title>
		<link>http://felipec.wordpress.com/2011/06/21/my-disagreement-with-elop-on-meego/</link>
		<comments>http://felipec.wordpress.com/2011/06/21/my-disagreement-with-elop-on-meego/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 09:36:31 +0000</pubDate>
		<dc:creator>FelipeC</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Planet]]></category>
		<category><![CDATA[nokia]]></category>

		<guid isPermaLink="false">http://felipec.wordpress.com/?p=922</guid>
		<description><![CDATA[Some time ago I received a private email directly from Elop (just me, nobody else in CC, I am not going to go into details as to why), in which he explained that the biggest problem was the small amount &#8230; <a href="http://felipec.wordpress.com/2011/06/21/my-disagreement-with-elop-on-meego/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=922&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Some time ago I received a private email directly from Elop (just me, nobody else in CC, I am not going to go into details as to why), in which he explained that the biggest problem was the small amount of MeeGo devices in the years immediately ahead.</p>
<p>This is simply not true.<span id="more-922"></span></p>
<p>Before explaining why, I&#8217;ll quickly say that I actually work on hardware adaptation, so if somebody knows the amount of effort needed to adapt MeeGo to different hardware platforms, it&#8217;s us. Plus, I closely follow Linux related mailing lists (linux-arm, linux-omap, linux-media, etc.), and know a lot of people in different companies that work precisely in this area. I have quite a few years of experience doing this, so I know what I&#8217;m talking about.</p>
<p><b>Update</b>: To avoid confusion, I am a mere software engineer. And when I say &#8220;us&#8221; I&#8217;m talking about the bigger team I am part of.</p>
<p><b>Nobody</b> I know believes what Elop said, and let&#8217;s keep in mind that Elop is not an expert in this area, we are. So my guess is that he got his information from some upper management guy who didn&#8217;t know what he was talking about <del datetime="2011-06-22T14:07:54+00:00">either</del>.</p>
<p>As I explained Elop, if we wanted to ship 10 devices with OMAP 3 (the same platform of the Nokia N9) <b>today</b>, there is absolutely no problem from the software point of view: all the UI software remains the same, and the hardware adaptation would probably require few modifications, if any.</p>
<p>The problem is when porting to an entirely new hardware platform, say Snapdragon. Suppose only 3 devices are planned on the &#8220;years immediately ahead&#8221;, well, then it makes sense to have 3 different hardware platforms, and each one of those requires work from the hardware adaptation team, not from the upper layers, though. However, that&#8217;s not a technical limitation, it could very well be 30 devices instead of 3, it&#8217;s basically the same amount of work for us. IOW; what matters is the hardware platform, not the number of different devices.</p>
<p><b>Note</b>: all these are merely examples, not actual plans</p>
<p>Funnily enough, Windows Phone only supports <b>one</b> hardware platform: Snapdragon (and in fact only certain chips). So MeeGo <b>already</b> has an advantage over Windows Phone; you could ship more devices on more hardware platforms. All we need is the word.</p>
<p>Not to mention the fact that most of the hardware adaptation is <b>already</b> done by hardware vendors. They do it because it&#8217;s the easiest way to demo their hardware (it&#8217;s Linux). I tried to explain that on an earlier post where I show many examples of people porting MeeGo to a <a href="http://felipec.wordpress.com/2011/02/22/meego-scales-because-linux-scales/">plethora of devices</a> (it&#8217;s easy and fun).</p>
<p>Another advantage of course is that MeeGo is <b>already</b> here (<a href="http://conversations.nokia.com/2011/06/21/introducing-the-nokia-n9-all-it-takes-is-a-swipe/">Nokia N9</a>).</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='660' height='402' src='http://www.youtube.com/embed/gfE3B6L-Otw?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<p>Not to mention the fact that MeeGo is open source, and Linux is a synergetic endeavor; there&#8217;s many more than one company (Microsoft) working on it, in fact, almost everybody else is.</p>
<p>Elop&#8217;s answer? &#8220;I am simply going to choose to respectfully disagree on multiple fronts&#8221;. He didn&#8217;t even bothered to mention exactly what was the disagreement.</p>
<p>So there you have it, if there&#8217;s a reason for ditching MeeGo, it&#8217;s certainly not a technical one, and most likely not a good one either. I hope the people out there like what we did with the Nokia N9 and ask the though question &#8220;Why exactly did you leave MeeGo, again?&#8221;, specially when there are no signs of any Windows Phone device.</p>
<p><b>Note</b>: as usual, this is my own personal opinion, and it&#8217;s based on publicly available information</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/felipec.wordpress.com/922/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/felipec.wordpress.com/922/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=922&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://felipec.wordpress.com/2011/06/21/my-disagreement-with-elop-on-meego/feed/</wfw:commentRss>
		<slash:comments>335</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1bb1c1a41b92d9f18e2890c3f6d33970?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">FelipeC</media:title>
		</media:content>
	</item>
		<item>
		<title>gst-av 0.5 released; now with video encoding and decoding support</title>
		<link>http://felipec.wordpress.com/2011/05/19/gst-av-0-5-released-now-with-video-encoding-and-decoding-support/</link>
		<comments>http://felipec.wordpress.com/2011/05/19/gst-av-0-5-released-now-with-video-encoding-and-decoding-support/#comments</comments>
		<pubDate>Thu, 19 May 2011 17:13:55 +0000</pubDate>
		<dc:creator>FelipeC</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Planet]]></category>

		<guid isPermaLink="false">http://felipec.wordpress.com/?p=861</guid>
		<description><![CDATA[gst-av is a GStreamer plug-in to provide support for libav (formerly FFmpeg), it is similar to gst-ffmpeg, but without GStreamer politics, which means all libav plugins are supported, even if there are native GStreamer alternatives; VP8, MP3, Ogg, Vorbis, AAC, &#8230; <a href="http://felipec.wordpress.com/2011/05/19/gst-av-0-5-released-now-with-video-encoding-and-decoding-support/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=861&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>gst-av is a GStreamer plug-in to provide support for libav (formerly FFmpeg), it is similar to gst-ffmpeg, but without GStreamer politics, which means all libav plugins are supported, even if there are native GStreamer alternatives; VP8, MP3, Ogg, Vorbis, AAC, etc.</p>
<p>In addition, it is much simpler (2654 vs 16575 LOC), has better performance, and has a bit of extra features (such as less latency), and doesn&#8217;t use deprecated API&#8217;s. In a <a href="http://felipec.wordpress.com/2010/09/14/gst-av-0-3-better-performance-for-vorbis-and-mp3/">previous post</a> I measured exactly how much improvement compared to gst-ffmpeg there is; it&#8217;s not much, but it&#8217;s some.</p>
<p>IOW; it&#8217;s possible that gst-av is the only GStreamer codec plug-in you would ever need <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<span id="more-861"></span></p>
<p>Compared to the previous version, now there&#8217;s video decoding (H.263, H.264, MPEG-4, WMV and VP8), and video encoding (H.263 and H.264), plus a fix for audio decoding with playbin, and better integration with the official FLAC parser.</p>
<p>For Nokia N900 users, ogg-support is going to use gst-av for 1.0.7, which you can test <del datetime="2011-05-23T15:49:39+00:00"><a href="http://maemo.org/packages/package_instance/view/fremantle_extras-devel_free_armel/ogg-support/1.0.7~rc1/">now</a></del>, <a href="http://maemo.org/packages/package_instance/view/fremantle_extras-devel_free_armel/ogg-support/1.0.7/">now</a>.</p>
<p>BTW. It works both for libav and FFmpeg.</p>
<p>There&#8217;s now a <a href="http://code.google.com/p/gst-av/">project page</a> hosted in Google Code where you can find all the juicy stuff.</p>
<p>Enjoy <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/felipec.wordpress.com/861/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/felipec.wordpress.com/861/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=861&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://felipec.wordpress.com/2011/05/19/gst-av-0-5-released-now-with-video-encoding-and-decoding-support/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1bb1c1a41b92d9f18e2890c3f6d33970?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">FelipeC</media:title>
		</media:content>
	</item>
		<item>
		<title>Why Linux is the most important software project in history</title>
		<link>http://felipec.wordpress.com/2011/03/06/why-linux-is-the-most-important-software-project-in-history/</link>
		<comments>http://felipec.wordpress.com/2011/03/06/why-linux-is-the-most-important-software-project-in-history/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 20:42:40 +0000</pubDate>
		<dc:creator>FelipeC</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Planet]]></category>
		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://felipec.wordpress.com/?p=745</guid>
		<description><![CDATA[Here&#8217;s another post that for some people is obvious, but there are other (e.g. high level managers) that might not necessarily see the importance of Linux, in fact, I have been surprised by many open source developers who don&#8217;t seem &#8230; <a href="http://felipec.wordpress.com/2011/03/06/why-linux-is-the-most-important-software-project-in-history/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=745&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s another post that for some people is obvious, but there are other (e.g. high level managers) that might not necessarily see the importance of Linux, in fact, I have been surprised by many open source developers who don&#8217;t seem to be familiar with how Linux works (they think it&#8217;s just something that works?). The fact of the matter is that Linux is light years ahead of any other software project, open or closed, I&#8217;ll try to explain why.</p>
<p>BTW. By &#8220;Linux&#8221;, I mean the kernel, not the ecosystem. Which is the name of the project.</p>
<h2>Everywhere</h2>
<p>First of all, Linux runs everywhere; desktops, <a href="http://www.android.com/">smartphones</a>, <a href="http://www.linuxplanet.com/linuxplanet/reviews/7054/1/">routers</a>, web servers, supercomputers, <a href="http://lugm.org/2009/06/23/the-sony-bravia-lcd-tvs-run-linux/">TVs</a>, <a href="http://www.engadget.com/2010/11/30/infinity-i-kitchen-sports-linux-based-touch-screen-computer-kit/">refrigerators</a>, <a href="http://www.youtube.com/watch?v=M-80QD5Zjyc">tablets</a>, even on the stock market (<a href="http://www.linuxtoday.com/high_performance/2011021801635NWHE">London</a>, NY, Johannesburg, etc.).</p>
<p>Not only it runs anywhere, but in many areas it&#8217;s the undisputed #1. In smartphones, Android already has the most market share, and grabbing more and more. In supercomputers, Linux has 92% of the TOP500. On servers, it&#8217;s 64%.</p>
<p>There&#8217;s <strong>a lot</strong> of benefits to having a single kernel that runs on all kinds of hardware, I&#8217;ll mention two examples.</p>
<p>One is the improvements in power consumption that all the embedded people have been pushing for not only benefit laptops and desktops, but even servers. Also, features like dynamic power management that works really well on embedded influence the desktop and server hardware.</p>
<p>Another one is the <a href="http://lwn.net/Articles/360199/">VFS scalability</a> patches. Nick Piggin found some issues with 64 CPUs machines that require some reorganization of VFS. The problem is that it&#8217;s tricky to test issues with these patches, however, since also have a <a href="https://rt.wiki.kernel.org/">real-time community</a> (they have their own patches, but eventually will get merged), they could find issues on these patches more easily.</p>
<p>Here&#8217;s a nice interview with Jim Zemlin from Linux Foundation that explains where Linux comes from, where it is, how it might very well become the building block of all devices in the future.</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='660' height='402' src='http://www.youtube.com/embed/VVUHaC1somA?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<h2>Collaboration</h2>
<p>There&#8217;s many open projects, but not many where <b>everyone</b> is involved and working together. The Linux Foundation issues a yearly report of <a href="http://www.linuxfoundation.org/news-media/blogs/browse/2010/12/our-annual-kernel-development-report-new-and-old-faces">how the kernel is being developed</a>, and you can see competing companies working together, such as Red Hat (<em>12.4%</em>), Novell (<em>7.0%</em>), IBM (<em>6.9%</em>), Intel (<em>5.8%</em>), Oracle (<em>2.3%</em>), Renesas (<em>1.4.%</em>), SGI (<em>1.3%</em>), Fujitsu (<em>1.2%</em>), Nokia (<em>1.0%</em>), HP (<em>1.0%</em>), Google (<em>0.8%</em>), AMD (<em>0.8%</em>), etc.</p>
<p>This is true synergy, not the management bullshit kind; nobody alone (Microsoft) can compete with what everyone together can produce (Linux).</p>
<h2>Communication</h2>
<p>The traffic of the main mailing list (<a href="http://dir.gmane.org/gmane.linux.kernel">LKML</a>) is astronomical; 250 messages per day, but that&#8217;s only <b>one</b> mailing list, there are around 200 <a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=MAINTAINERS">subsystem lists</a>. Many of these lists have a lot of traffic as well, one I&#8217;m subscribed to is <a href="http://dir.gmane.org/gmane.linux.drivers.video-input-infrastructure">linux-media</a>, which has around 30 messages per day.</p>
<p>And there&#8217;s a reason why so many people can follow so much traffic without it becoming a total mess. All kernel mailing lists follow common guidelines; you don&#8217;t have to be subscribed!, don&#8217;t do <a href="http://felipec.wordpress.com/2010/08/03/avoid-reply-to-munging-mail-as-mail-was-meant-to-be/">reply-to munging</a>, encourage cross-posting, cc the right people, trim unnecessary context, and don&#8217;t top post.</p>
<p>Also very important is to send patches through the mailing list. You don&#8217;t even have to think about it, just type &#8216;git send-email&#8217; with a proper &#8211;cc-cmd, and Linux&#8217;s get_maintainer.pl script would find the right maintainers and contributors to cc, and the proper mailing lists to send the patch to. Again, no need to be subscribed. More next.</p>
<h2>Patches</h2>
<p>I have explained before why sending patches through the mailing list is <a href="http://felipec.wordpress.com/2010/01/19/why-bugzilla-sucks-for-handling-patches/">superior to bugzilla</a>. But it can be summarized as; you don&#8217;t need to be subscribed, you don&#8217;t need to login anywhere, you don&#8217;t need to search for the right component, etc.</p>
<p>As an example I put myself. I am paid by Nokia to work on GStreamer stuff, yet, even though I have a bugzilla account and everything, it&#8217;s easier for me to submit (and get merged) patches to Linux (mostly on my free time); it&#8217;s just one command. It&#8217;s not only easier for me to submit patches, but also to review them; just click <em>reply</em>. I&#8217;m not even going to mention closed source, which is horrible in this area.</p>
<p>It is also rewarding that usually that the response to patches is immediate, however, sometimes there are so many comments that patch series have 3, 5, 10, even 30 revisions before they are accepted. This is great for quality reasons, not only for for the project, the developers involved also learn a lot.</p>
<p>Using a mailing list also means that it&#8217;s easy to switch from reviewing a patch to a new discussion, based on the patch, thus helping communication.</p>
<h2>Speed</h2>
<p>It is not surprising that such a fine tuned process the results of producing stable releases each three months like clockwork, introducing major features, and from 5 to 6 patches <b>per hour</b>.</p>
<p>I can&#8217;t really explain how many things are going on in Linux, but Jonathan Corbet does in his Kernel Report.</p>
<div class='embed-vimeo' style='text-align:center;'><iframe src='http://player.vimeo.com/video/20710613' width='400' height='300' frameborder='0'></iframe></div>
<h2>Conclusion</h2>
<p>So, Linux is an incredibly massive endeavor, easy and fun to work with, an unstoppable behemoth in the software industry, and IMO companies trying to stand in its way are going to realize their mistake in a painful way.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/felipec.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/felipec.wordpress.com/745/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=745&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://felipec.wordpress.com/2011/03/06/why-linux-is-the-most-important-software-project-in-history/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1bb1c1a41b92d9f18e2890c3f6d33970?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">FelipeC</media:title>
		</media:content>
	</item>
		<item>
		<title>MeeGo scales, because Linux scales</title>
		<link>http://felipec.wordpress.com/2011/02/22/meego-scales-because-linux-scales/</link>
		<comments>http://felipec.wordpress.com/2011/02/22/meego-scales-because-linux-scales/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 10:44:45 +0000</pubDate>
		<dc:creator>FelipeC</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Embedded]]></category>
		<category><![CDATA[Future]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Planet]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[meego]]></category>
		<category><![CDATA[qt]]></category>

		<guid isPermaLink="false">http://felipec.wordpress.com/?p=734</guid>
		<description><![CDATA[To me, and a lot of people, it&#8217;s obvious why MeeGo scales to a wide variety of devices, but apparently that&#8217;s not clear to other people, so I&#8217;ll try to explain why that&#8217;s the case. First, let&#8217;s divide the operating &#8230; <a href="http://felipec.wordpress.com/2011/02/22/meego-scales-because-linux-scales/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=734&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>To me, and a lot of people, it&#8217;s obvious why MeeGo scales to a wide variety of devices, but apparently that&#8217;s not clear to other people, so I&#8217;ll try to explain why that&#8217;s the case.</p>
<p>First, let&#8217;s divide the operating system:</p>
<ol>
<li>Kernel</li>
<li>Drivers</li>
<li>Adaptation</li>
<li>System Frameworks</li>
<li>Application Framework</li>
<li>Applications</li>
</ol>
<p>&#8220;Linux&#8221; can mean many things, in the case of Android, Linux means mostly the <strong>Kernel</strong> (which is heavily modified), and in some cases the <strong>Drivers</strong> (although sometimes they have to be written from scratch), but all the layers above are specific to Android.</p>
<p>On Maemo, MeeGo, Moblin, and LiMo, &#8220;Linux&#8221; means an upstream <strong>Kernel</strong> (no drastic changes), upstream <strong>Drivers</strong> (which means they can be shared with other upstream players as they are), but also means &#8220;Linux ecosystem&#8221;; D-Bus, X.org, GStreamer, GTK+/Qt/EFL, etc. Which means they take advantage of already existing <strong>System</strong> and <strong>Application Frameworks</strong>. And all they have to do, is build the <strong>Applications</strong>, which is not an easy task, but certainly easier than having to do all the previous ones.</p>
<p>Now, the problem when creating MeeGo, is that for reasons I won&#8217;t (can&#8217;t?) explain here, Maemo and Moblin were forced to switch from GTK+ to Qt. This might have been the right move in the long term, but it means rewriting two very big layers of the operating system, in fact, the two layers that differentiate the various mobile platforms for the most part. And this of course means letting go of a lot of talent that helped build both Maemo and Moblin.</p>
<p>For better or worse, the decision was made, and all we could do is ride along with it. And maturizing MeeGo, essentially means maturizing these two new layers being written not entirely from scratch (as Qt was already there), but pretty much (as you have to add new features to it, and build on top).</p>
<p>Now, did MeeGo fail? Well, I don&#8217;t know when this UI can be considered mature enough, but sooner or later, it will be (I do think it will be soon). The timeframe depends also on your definition of &#8220;mature&#8221;, but regardless of that, it will happen. After that, MeeGo will be ready to ship on all kinds of devices. All the hardware platform vendors have to do, is write the drivers, and the adaptation, and they already do anyway for other sw platforms.</p>
<p>Needless to say, the UI is irrelevant to the hardware platform.</p>
<p>So, here&#8217;s the proof that the lower layers are more than ready:</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='660' height='402' src='http://www.youtube.com/embed/XJhLah_u_4U?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<p>Just after a few months of announcing MeeGo IVI, these guys were able to write a very impressive application thanks to QML, and ignore the official UI.</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='660' height='402' src='http://www.youtube.com/embed/S20k1mvL8d0?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<p>The OMAP4 guys went for the full MeeGO UI. No problems.</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='660' height='402' src='http://www.youtube.com/embed/TkEj6h3pW6Q?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<p>Even though Freescale is probably not that committed to MeeGo, it&#8217;s easier to create demo using it (Qt; Nomovok) rather than other platforms. It&#8217;s even hardware accelerated.</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='660' height='402' src='http://www.youtube.com/embed/xuNOweDXh3Q?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<p>Renesas also chose the Nomovok demo to show their hardware capabilities.</p>
<p><a href="http://blog.steventroughtonsmith.com/2010/12/meego-11-running-on-htcs-hd2.html">MeeGo 1.1 running on HTC&#8217;s HD2</a></p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='660' height='402' src='http://www.youtube.com/embed/9uCxsqhggho?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<p><strong>One</strong> guy; yes, one guy. Decides to run MeeGo on his HTC, and succeeds. Of course, he uses the work already done by <a href="http://forum.xda-developers.com/showthread.php?t=889433">Ubuntu for HD2</a>, but since MeeGo is close to upstream, the same kernel can be used. Sure, it&#8217;s slow (no hardware acceleration), and there&#8217;s many things missing, but for a short amount of time spent by hobbyists, that&#8217;s pretty great already.</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='660' height='402' src='http://www.youtube.com/embed/Q0OMdJDjUA4?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<p>This is one is not so impressive, but also shows the work of one guy porting MeeGo to Nexus S</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='660' height='402' src='http://www.youtube.com/embed/H9_UJbhollc?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<p>And running on Archos 9. Not very impressive UI, but the point is that it runs on this hw.</p>
<h2>Conclusion</h2>
<p>So, as you can see MeeGo is <strong>already</strong> supported in many hardware platforms; not because the relevant companies made a deal with Nokia or Intel; they don&#8217;t have to. The only thing they have to do is support Linux; Linux is what allows them to run MeeGo, and Linux is what allows MeeGo to run on any hardware platform.</p>
<p>This is <strong>impossible</strong> with WP7 for numerous reasons; it&#8217;s closed source, it&#8217;s proprietary, it&#8217;s Microsoft, etc. It&#8217;s not so impossible to do the same with Android, but it&#8217;s more difficult than with MeeGo because they don&#8217;t share anything with a typical linux ecosystem; they are on a far away island on their own.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/felipec.wordpress.com/734/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/felipec.wordpress.com/734/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=734&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://felipec.wordpress.com/2011/02/22/meego-scales-because-linux-scales/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1bb1c1a41b92d9f18e2890c3f6d33970?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">FelipeC</media:title>
		</media:content>
	</item>
		<item>
		<title>Nokia; from a burning platform, to a sinking platform</title>
		<link>http://felipec.wordpress.com/2011/02/17/nokia-from-a-burning-platform-to-a-sinking-platform/</link>
		<comments>http://felipec.wordpress.com/2011/02/17/nokia-from-a-burning-platform-to-a-sinking-platform/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 22:56:55 +0000</pubDate>
		<dc:creator>FelipeC</dc:creator>
				<category><![CDATA[Embedded]]></category>
		<category><![CDATA[Future]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Planet]]></category>
		<category><![CDATA[elop]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[nokia]]></category>

		<guid isPermaLink="false">http://felipec.wordpress.com/?p=716</guid>
		<description><![CDATA[I&#8217;ve been thinking a lot about this decision to use WP7 from Nokia, as I&#8217;m sure many people have, but I&#8217;ve wanted to wait for the dust to settle down before blogging, so here&#8217;s what I think; it doesn&#8217;t make &#8230; <a href="http://felipec.wordpress.com/2011/02/17/nokia-from-a-burning-platform-to-a-sinking-platform/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=716&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been thinking a lot about this decision to use WP7 from Nokia, as I&#8217;m sure many people have, but I&#8217;ve wanted to wait for the dust to settle down before blogging, so here&#8217;s what I think; it doesn&#8217;t make any sense from any point of view.</p>
<p>Technically, there is nothing that can compare to the linux kernel, which works on everything; supercomputers, mobile phones, TVs, routers, web servers, desktops, refrigerators, etc. Not only does it work, but it works well, much better than everything else. As an example, the work that has been done to scale linux&#8217;s vfs to many processors (64) does benefit embedded, because some operations are more granular. Or the work on power management lead by embedded helps web servers, where decreasing power consumption is also very much wanted. This creates a environment of synergy never seen before, where even competitors work together. Linux won the kernel race, and its use would only increase; the ones that try to fight against it would only fail miserably.<br />
<span id="more-716"></span></p>
<h2>Sinking</h2>
<p>WP7 is only the last iteration in Microsoft&#8217;s attempts to come up with something that has any market in the mobile arena; all the previous attempts have failed. What makes anyone think that this time it would work? And how many companies have successfully partnered with Microsoft? There&#8217;s no reason to think that WP7 has any future.</p>
<p>If you look at the <a href="http://en.wikipedia.org/wiki/List_of_Windows_Phone_devices">list of mobile phones running WP7</a>, you would see that it&#8217;s very small, and you would also see that there&#8217;s only one hardware platform supported: <a href="http://en.wikipedia.org/wiki/Snapdragon_(System_on_Chip)">Snapdragon</a>. To make WP7 work on a wide variety of platforms, even Intel, on a relatively short amount of time, is simply impossible. It can only be done with linux.</p>
<p>And why would phone manufacturers, such as Samsung, find this platform appealing? Before, it was marginal, and now it&#8217;s hijacked by Nokia with the &#8220;exclusive deal&#8221; with Microsoft. Phone manufacturers should know by now how difficult is to work with Microsoft and its technologies, and how exhausting must be to try to differentiate. As Nokia colleague puts it: &#8220;Where is Nokia&#8217;s brand in &#8216;Windows Phone&#8217;&#8221;.</p>
<p>It&#8217;s a sinking platform, and most likely others would jump away from it soon. But Nokia is now stuck to the death. Thanks to Stephen Elop, there&#8217;s no plan b.</p>
<h2>Balance</h2>
<p>Android is not perfect, manufacturers are finding it increasingly difficult to differentiate, but Google has the last word. Now, Android is the #1 platform, and the market share would surely keep increasing if nothing drastic happens. That&#8217;s not good.</p>
<p>Other phone manufacturers have to look into alternatives to Android, if only to increase competition and thus make Android continually improve itself, and not left unchecked. So what are the options? WP7, MeeGo, or a new platform from scratch.</p>
<p>I already listed some of the disadvantages of WP7, and starting a new platform from scratch never looks too appealing, so, ironically, MeeGo might seem now a viable option. It wasn&#8217;t previously, because the fight for balance was against Nokia, now it&#8217;s against Android.</p>
<p>Intel is going to continue to work on MeeGo, and there&#8217;s already many other companies and people working actively on it; that&#8217;s not changing. Moreover, Nokia will continue working on it, in fact, nothing changes before the first MeeGo product is released. So MeeGo is still pretty much alive.</p>
<h2>What if</h2>
<p>What if other phone manufacturers join MeeGo, and continue without Nokia? What if Nokia&#8217;s first MeeGo product becomes a bomb (as is the plan)? What if WP7 fails?</p>
<p>It&#8217;s hard to guess the future, but I&#8217;ve had good luck in my previous guesses, so here&#8217;s my foretale; Windows Phone 7 is going to be significantly delayed, and then fail, <strong>badly</strong>. But that would be too late for Nokia to do anything else; all the confidence in the company would be lost, from consumers, share holders, developers, parters, etc. Elop would probably blame it on Nokia&#8217;s execution, some managers would get fired, and Microsoft would buy Nokia for cheap.</p>
<p>That&#8217;s a lot of guessing, but what is clear is that linux will dominate the market one way or the other.</p>
<p>Personally I&#8217;m still committed to Nokia&#8217;s first MeeGo product, which I firmly believe is going to be remarkable in many aspects. After that nothing is clear, but unless Elop and the Board of Directors gets fired, I&#8217;d say the future of MeeGo in Nokia is very dim, as well as the future of Nokia itself.</p>
<p><strong>Update</strong>: Motorola is <a href="http://www.informationweek.com/news/mobility/smart_phones/showArticle.jhtml?articleID=229218777&amp;cid=RSSfeed_IWK_All">confirming my thoughts</a> so far; can&#8217;t &#8216;envision&#8217; using WP7, and hopes for more competing platforms.</p>
<p><strong>Update</strong>: Intel is officially <a href="http://timesofindia.indiatimes.com/tech/news/telecom/Meego-Now-Intel-to-dump-Nokia/articleshow/7516479.cms#">looking for phone manufacturers as partners</a>,</p>
<p><strong>Update</strong>: <a href="http://www.informationweek.com/news/development/mobility/showArticle.jhtml?articleID=229400097">Motorola is not satisfied with Google&#8217;s Android</a></p>
<p><strong>Note</strong>: Everything written here is my <strong>personal</strong> opinion and has nothing to do with my employer. Also, I have not used any internal information to form my opinions; everything is available publicly.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/felipec.wordpress.com/716/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/felipec.wordpress.com/716/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=felipec.wordpress.com&#038;blog=62686&#038;post=716&#038;subd=felipec&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://felipec.wordpress.com/2011/02/17/nokia-from-a-burning-platform-to-a-sinking-platform/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1bb1c1a41b92d9f18e2890c3f6d33970?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">FelipeC</media:title>
		</media:content>
	</item>
	</channel>
</rss>
