With the recent introduction of Ubuntu Touch a very interesting change of strategy is emerging for Canonical.
As Phoronix and others have discovered, Ubuntu Phone and Touch are using SurfaceFlinger as their compositor. SurfaceFlinger uses OpenGL ES to render applications screens/windows in a hardware accelerated way using the OpenGL driver of the GPU directly.
Now, Canonical is promising a completely integrated experience for Ubuntu 14.04 which will run Phone, Touch, TV and Desktop applications in one common GUI environment. How will they be able to fulfill their promise for Linux desktop applications currently running on Xorg?
So far, everyone has believed that the Ubuntu desktop is migrating from Xorg to Wayland. This migration has been going so slow that there is actually no visible sign of happening any time soon. It seems that Canonical has slightly changed the “to” part of their migration plans. They are not moving to Wayland, they are moving to SurfaceFlinger.
I, for one, think that this is a brilliant idea.
Compared to Android’s SurfaceFlinger, Wayland has not much appeal from the “possible benefits” point of view. SurfaceFlinger is developed by Google and is already deployed on countless Android devices. It has a sizable amount of developers working on it and its future is certain as long as Android is with us (which is pretty likely given its current market share and trends). Migration to Wayland hasn’t started in earnest so there would not be much effort thrown out of the window.
With the recent merging of the Android and the mainline Linux kernels, porting Linux desktops to Android hardware has already become somewhat easier. Wifi, Bluetooth and other hardware components can be accessed through the Android kernel released by the producer of the SOC/board. The biggest remaining problems are making Xorg and audio working. Xorg is used by all desktop applications while audio is used by only some (media players, screen-capture apps…etc). Xorg seems to be a fairly big problem because Android hw producers usually don’t provide X drivers at all and that makes the porting effort a show-stopper for hardware which otherwise run Android very well.
An Ubuntu desktop running on SurfaceFlinger would be a much easier subject for porting to common Android hardware compared to the current situation (as the quickly growing number of devices supporting Ubuntu Touch demonstrates this spectacularly). OpenGL ES driver comes with the Android kernel, released by the hw manufacturer, so SurfaceFlinger works right-away.
The most important part of the migration to Wayland has been the GTK and Qt backend implementations. These can also be created relatively quickly for SurfaceFlinger so 90% of the standard Linux apps would display on it right away (Qt may already has Android/SurfaceFlinger support based on their Git repository)
OK, but SurfaceFlinger is only one part of the problem, what about the rest?
It is very much possible that Canonical/Ubuntu is planning to migrate heavily to Android backend services (not only SurfaceFlinger) in order to take advantage of the huge popularity of Android among the hardware manufacturers.
Possibly, a wrapper may be created for the PulseAudio API to execute sound services with AudioFlinger. The opposite was deemed possible by one of the developers of PulseAudio, so it is certainly an option. This would make the typical audio-using Linux desktop application work on top of Android’s AudioFlinger on a stock Android kernel released by the SOC/board manufacturer.
Other Android services may also be targeted in a similar way. Hardware accelerated video playing would be a notable example but acceleration sensor, camera and GPS services would also become easy accessible for traditional Linux applications.
With such a services-migration completed, one could do a mostly complete Ubuntu port in a matter of days to Android hardware and the required skills would be way-fewer than they are now. As a result, Ubuntu would be available for almost every hardware which supports Android. Some of the ports would be done by Canonical (Nexus devices) and most of them by the community (with the Cyanogen community doing the heavy lifting in many cases).
I think this is a good strategy since it brings Linux desktop applications to commodity Android hardware. Personally, I don’t care what backend services allow my applications to run as long as they do it efficiently and without (many) bugs.
Closing the gap between Android technologies and the Linux desktop would allow the latter to stay competitive and make an integrated experience possible. Linux desktops would eventually become capable of running Android applications (Dalvik would be just another Java-like VM, next to OpenJDK and Snoracle Java) Also, Linux desktop applications may become able to run on Android as first-class citizens (by packaging the necessary wrapper libraries to SurfaceFlinger and others).
Why do I think this is a necessity?
It is widely rumored that the next major version of Android will introduce some kind of desktop environment for keyboard/mouse work. This would allow Android to start shipping on desktop PCs. Given the weight of Google, I imagine that PC vendors would immediately start selling x86/PC hardware with Android. They already do it with ChromeOS which is much more limited than Android, so a desktop-toting Android version would easily beat that in functionality (huge number of apps and an ecosystem rapidly growing up to the weight that of Windows).
In an environment like that, desktop Linux would rapidly loose its remaining competitive advantage and very soon the desktop would be dominated by Android alone (only in the Linux camp, not meaning Windows, although I think that it would eventually become a strong Windows-competitor). If desktop Linux is as easy to port to any hardware as Android and runs Android apps next to traditional Linux apps, the competitive advantage remains.
It is way too early to tell if the above is the plan of Canonical but using SurfaceFlinger points to this direction. I would definitely like to see Ubuntu and other desktop Linuxes on every possible Android devices.
Soon after the article had been published, Canonical announced the development of their own compositor (Mir) and declared SurfaceFlinger as a component to be removed from the Ubuntu phablet stack. This mostly invalidates the assumption on their strategy. If Mir will be able to work with binary OpenGL ES drivers of GPU producers, that will probably make Ubuntu easier to port but definitely not as easy as an OS heavily based on Android technologies.
I believe that the current market trends make Canonical’s Ubuntu for Android project the most important development in the recent history of Linux.
Desktop Linux is slowly gaining market share but its advancement is excruciatingly slow. The desktop itself is loosing market share to mobile operating systems like Android and iOS primarily because Internet usage is shifting towards mobile devices. A lot of people use their mobile phone as their primary computing device and mobile phone hw is developing leaps and bounds to serve these use-cases (bigger screens, quad-core processors…etc).
Due to its touch-oriented, mobile-centric features + Google’s strong push, Android is rapidly expanding its market share among the mobile operating systems and is the most successful Linux distribution ever.
Ubuntu for Android (UfA)
Ubuntu for Android blends Android and Ubuntu in the perfect manner. Ubuntu and Android share the same Linux kernel instance so there is no dual-booting, they run in parallel. When the need arises, the user can switch to the desktop interface of Ubuntu for productive work, typically when a mouse and keyboard gets attached to the device (via a docking station, a lapdock or simply a bluetooth keyboard/mouse)
The two operating systems are completely synergistic. Some examples:
- Ubuntu is capable of using the databases of Android (e.g. uses Android’s contact database in the email software)
- Ubuntu uses Android’s network management
- You keep all of your touch applications and use them on the Android interface but you also have the full desktop arsenal when you switch to Desktop Mode
- Android’s touch applications can also be displayed on Ubuntu’s desktop interface (in windows) and you can use them with keyboard and mouse
Why Android needs Ubuntu and the Linux desktop:
Android is heavily touch oriented and cannot very well serve desktop-oriented productive use-cases (like editing a spreadsheet) even though ARM hardware is now absolutely capable to make a phone or a smartbook a primary computer.
Desktop Mode is important in order to make a mobile device a no-compromise, primary computing solution. Today’s touch-interfaces alone can only serve content consumption.
Current Android office suites are no match for LibreOffice and the touch interface in general is no match for the Desktop when productive work is to be done. Ubuntu includes a lot of other powerful desktop productivity software in their repositories. It provides the full spectrum of sophisticated software like GIMP, Open/LibreOffice, Dia, full-blown Java applications like MindCraft, SweetHome3D, TimeslotTracker, JED, Azureus…etc. Full-featured browsing with Firefox (including plugins like AdBlock), proper, full-blown email client like Thunderbird…etc.
Desktop Mode is a weapon in the mobile OS wars and it would be a key feature against WinRT and iOS. WinRT will have no meaningful Desktop Mode but Apple may decide to migrate desktop features to iOS (from OS X). Since Apple’s new strategy of keeping older iOS devices on the market is very successful, Android needs further innovation and distinguishing features. This is a very good article which has similar arguments as my own.
Why Linux/Ubuntu/Canonical need Android?
Android is still spreading at an impressive rate. Apart from mobile phones, tablets and tablet/smartbook hybrids like the Transformer Prime, it gets into smart-TVs, set-top-boxes (Mele A1000) and other devices.
Android is a well-known consumer brand now, much-much stronger than Ubuntu or Linux in general. A lot of hardware manufacturers are now releasing their devices with Android because that immediately gives market recognition and a huge selection of readily available apps.
UfA has the potential for bringing a lot of users to Ubuntu/Linux and this may be the best way to achieve a much higher market penetration. Canonical may as well stop developing the standalone desktop and still have a growing penetration if UfA becomes successful.
There is a set of problems ahead for UfA and Canonical.
Canonical is currently focusing to dockable mobile phones as the sole target for UfA. Although it is true that mobile phones are the highest-volume Android devices at the moment, they are not necessarily the best devices for expressing the synergy between the two operating systems. Tablet/smartbook hybrids like the Transformer Prime are a more natural target since they already have a sufficiently big screen attached and keyboard/mouse built-in the docking station part of the device. For using UfA with a mobile phone (with acceptable performance) you would need a state-of-the art mobile phone and extra accessories (like a docking station). Docking stations are not widespread at all, you practically cannot buy them with the exception of some phone models like the Atrix. With the Transformer Prime+its dock, you immediately have everything you need to use UfA, no extra expenses.
Ubuntu for Android is practically a closed-source product at the moment and it is not available for the general public. The reasoning behind this is somewhat understandable since installing UfA into an Android instance is a technically complex task and requires rooting the device + a lot of hw-specific settings and configurations (e.g. the X Server). It is really not like selecting an app from Google Play and pushing the Install button. For this reason, Canonical decided that it will try to market UfA exclusively through OEM partnerships so UfA will arrive pre-installed with your device or not at all.
The biggest problem with the above is that it limits UfA adoption severely. Since UfA was announced and presented at the beginning of this year, we should have already heard about a lot of announcements by Canonical and device manufacturers. With the obvious lack of those announcements, we have to assume that there are not enough OEMs which recognize the importance and distinguishing features of UfA. I believe this may be the problem of chicken & egg. First, users must see UfA in action in order to recognize that they need this feature in their next phone/tablet/smartbook/set-top-box and demand it from the manufacturers. The closed-source nature of UfA also makes it impossible for the Linux community to contribute.
I strongly suggest that Canonical select some successful, high-volume mobile devices which are already on the market and release UfA for them as after-market mods. My first target would be the Transformer Prime but the HTC One X and the Samsung Galaxy S3 may also be good targets.
Partnering with the Cyanogen Mod team may be a good way to do this since they already support a wide range of devices (they are especially strong with HTC models) and established themselves as the prime producers of after-market ROMs. The cooperation may give birth to a special Cyanogen edition (let’s call it Cyanobuntu) in order to distinguish the base Cyanogen ROMs from the Ubuntu-extended editions.
Once Cyanobuntu gets sufficiently well known on a set of devices, OEMs may be much more easier to persuade about the advantages of Ubuntu for Android.
Time is of the essence
Ubuntu for Android started off at a very good time but the competition is not standing in one place either. WinRT and Windows8 (for x86) tablets are coming this fall and may prove strong contenders in the mobile computing segment. Windows8 will have both an unlimited Desktop Mode and the Metro touch interface. WinRT will have no meaningful Desktop Mode but it will ship with MS Office so it will have appeal for a set of users.
There is no time to loose, Android and Ubuntu must be ready when Windows 8 makes it début.