Senin, 17 Agustus 2009

Kernel Mode-Setting (KMS) on Neo FreeRunner + Debian

Edit Aug 18th: video available (ogv, also on youtube)

Forget AMD, Intel, NVIDIA! Thomas White's incredible work with Neo FreeRunner's puny graphics dec...accelerator, Smedia Glamo 3362 is starting to bear fruits. Not listening to such comments as �the chip will never be used anywhere else� and �why not spend your time doing something more relevant�, he has chosen to actually do what he likes and sees as an interesting challenge. And that's often the spirit of free software, so I don't really agree with the naysayers.

The camera shot on the right, running KMS-enabled X.org driver for the glamo chip on my Debian installation (visible software matchbox-window-manager, fbpanel, zhone), is a bit optimistic looking since Zhone happens to draw correctly. A lot of the drawing is not yet synced correctly, which shows as all text and images in eg. GTK applications being garbled. But as little as two days ago one couldn't yet much launch applications without X crashing, so the newest commits by Thomas were a big step forwards. I'm using Debian, and he's not, so I try to find time to help in debugging even though I really can't much help with the driver code.

The driver is not just one piece of code, but consists of a kernel drm driver (direct rendering manager) using GEM, libdrm support for the kernel driver and finally the X.org driver supporting these other components and offering buzz-words like DRI2. There is also a beginning of a Mesa 3D driver, though it is so far just a skeleton driver since the 2D/KMS/EXA/DRM parts are what should be done first before dwelling into the OpenGL realm.

Openmoko the company is basically nowadays just producing new Neo FreeRunners to resellers, but the community of the so far only Free phone is thriving. The final (Openmoko produced, from where gta02-core continues) version of the phone, with the famous buzzing problem fixed, appeared on store shelves some time ago, offering better out-of-the-box phone functionality in addition to all the �mini computer� features. It was also offered to Debconf visitors on discount.

It's not only cool to have kernel mode-setting, though it is indeed very cool as well. The reason for much sorrow in the whole OM project has been the graphics chip, and some of the problems with the chip are only finally solvable with the kernel doing the mode-setting. So it's both a very modern thing to use KMS, but there are also clear potential benefits of having accurate control over this very �sensitive� piece of silicon. The current non-KMS X.org driver for example busy loops in order to try to feed the chip at a correct pace, causing CPU usage every time there is any drawing going on.

This is somehow reminding me about getting the best out of 8-bit computers and other hardware with some specific limitations. The glamo chip is very limited in some ways, but also capable in some other ways like theoretically offering MPEG-4 decoding, OpenGL ES 3D support. It's a mixed bag of things, and I can very well imagine it's indeed an interesting challenge to work on it, if you just have the skills (I don't) and nerves (proper debugging tools help).

It's so nerdy to drool over lines in the X.org log, but I just can help it:
X.Org X Server 1.6.3
Release Date: 2009-7-31
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.28 armv5tel Debian
Current Operating System: Linux neo 2.6.29-GTA02_mydrm #2 PREEMPT Mon Aug 17 18:24:39 EEST 2009 armv4tl
...
II) Using KMS!
...
(WW) Glamo(0): EXA hardware acceleration initialising
(II) EXA(0): Driver allocated offscreen pixmaps
(II) EXA(0): Driver registered support for the following operations:
(II) Solid
(II) Copy
(II) Glamo(0): Initialized EXA acceleration
...
(II) Glamo(0): RandR 1.2 enabled, ignore the following RandR disabled message.
...
(II) Glamo(0): [glamo-dri] Name of DRM device is '/dev/dri/card0'
(WW) Glamo(0): [DRI2] Version 1 API (broken front buffer rendering)
(II) Glamo(0): [DRI2] Setup complete
...
(II) AIGLX: enabled GLX_MESA_copy_sub_buffer
(II) AIGLX: Loaded and initialized /usr/lib/dri/glamo_dri.so
(II) GLX: Initialized DRI2 GL provider for screen 0
(II) Glamo(0): Adding framebuffer....!
(II) Glamo(0): 8 480 640 16 16 960
(II) Glamo(0): rootPixmap = 0x1d0a00
(II) Glamo(0): Done

Kamis, 13 Agustus 2009

Four questions about the Microsoft-Nokia alliance

The Microsoft-Nokia alliance turned out to be a lot more interesting than the pre-announcement rumors made it out to be. Rather than just a bundling deal for mobile Office, the press release says they'll also be co-developing "a range of new user experiences" for Nokia phones, aimed at enterprises. Those will include mobile Office, enterprise IM and conferencing, access to portals built on SharePoint, and device management.

Of those items, the IM and conferencing ideas sound the most promising to me. Office, as I explained in my last post, is not much of a purchase-driver on mobile phones. And I think Microsoft would have needed to provide Nokia compatibility in its mobile portal and device management products anyway.

I understand the logic behind the alliance. Nokia has never been able to get much traction for its e-series business phones, and Microsoft hasn't been able to kick RIM out of enterprise. So if they get together, maybe they can make progress. But it's easy to make a sweeping corporate alliance announcement, and very hard to make it actually work, especially when the partners are as big and high-ego as Microsoft and Nokia. This alliance will live or die based on execution, and on a lot of details that we don't know about yet.

Here are four questions I'd love to see answered:


What specifically are those "new user experiences"?

If Nokia and Microsoft can come up with some truly useful functionality that RIM can't copy, they might be able to win share. But the emphasis in the press release on enterprise mobility worries me. The core users for RIM are communication-hungry professionals. If you want to eat away at RIM's base, you need to excite those communicator users, and I'm not sure if either company has the right ideas to do that. As Microsoft has already proven, pleasing IT managers won't drive a ton of mobile phone purchases.


Will Microsoft really follow through?

Microsoft has been hinting for the last decade that it was were willing to decouple mobile Office from the operating system, but they never had the courage to follow through. Now they have announced something that sounds pretty definitive, but the real test will be whether they put their best engineers on the Nokia products. If Microsoft assigns its C players to the alliance, or tries to make its Nokia products inferior to their Windows Mobile versions, the alliance won't go anywhere interesting.


What does this do to Microsoft's relationships with other handset companies?

Imagine for a moment that you are the CEO of Samsung. Actually, imagine that for several moments. You aren't exclusive with Microsoft, but you've done a lot of phones with Windows Mobile on them. Now all of a sudden Microsoft makes a deal with a company that you think of as the Antichrist.

How do you feel about that?

I can tell you that Samsung is not the most trusting and nurturing company to do business with even in the best of times. So I think you make two phone calls. The first is to Steve Ballmer, asking very pointedly if you can get the same software as Nokia, on the same terms, at the same time. If you don't like the answer to that question, your next call is to Google, regarding increasing your range of Android phones.

Maybe the reality is that Microsoft has given up on Windows Mobile and doesn't care what Samsung does. But that itself would be interesting news.

I would love to know how those phone calls went today.


What does RIM do about this?

It has been putting a lot of effort into Apple-competitive features like multimedia and a software store. Does it have enough bandwidth to also fight Nokia-Microsoft? What happens to its core business if Microsoft and Nokia do come up with some cool functions that RIM doesn't have? Are there any partners that could be a counterweight to Microsoft and Nokia? If I'm working at RIM, I start to think about alliances with companies like Oracle and SAP. And I wonder if Google is interested in doing some enterprise work together.

Selasa, 11 Agustus 2009

Nokia and Microsoft, sittin' in a tree...

Multiple sources are reporting that Nokia is hedging its bets on mobile phone software:

-- The New York Times says Microsoft and Nokia will announce Wednesday that Microsoft is porting Office to Nokia's Symbian S60 phones (link).
--TechCrunch, quoting the Financial Times in Germany, claims Nokia is planning to dump Symbian in favor of its Maemo Linux operating system (link).
--Om Malik says he asked Nokia about it, and the company denied plans to dump Symbian. But the company also said, "recognizing that the value we bring to the consumer is increasingly represented through software, there is logically not just one software environment that fits all consumer and market needs." In other words, we have an open marriage with Symbian (link).


In one sense, this is absolutely not news for Nokia. It has been playing the field for years, trying to prevent any single company from gaining control over mobile software (and thereby imposing a standard on Nokia). The change is that in the past, most of that energy was aimed against Microsoft.

Microsoft too seems to be bending its standards. With the exception of the Mac, Microsoft has been extremely reluctant to license Office for other operating systems. In the past, if Nokia wanted Office, it would have been expected to license Windows Mobile.

But now both companies feel threatened by Apple and Google, and all of a sudden that ugly person across the dance floor looks a lot cuter.


The real question that no one seems to be asking is whether most customers will care about any of this stuff. Most Nokia smartphone users are blissfully unaware that their phones have an operating system, let alone whether it's Symbian or Maemo. They just want the phone to work well.

And speaking as a former Palm guy who dealt with the mobile market for years, putting Microsoft Office on a smartphone is like putting wings on a giraffe -- it may get you some attention, but it's not very practical.

Don't get me wrong, I like and admire QuickOffice, which is probably the leading Office-equivalent app in the mobile space today. It's a cool product, but for most people the screens of smartphones are too small for serious spreadsheet and word processing activity. It works, but it's awkward and produces eyestrain. Most people who have a serious need for Office on the go will just carry a netbook.

So Nokia and Microsoft will both get some nice publicity, but the announcements mean very little to the average user. What both Microsoft and Nokia need to do is create compelling new mobile functionality that's better than the stuff being produced by Apple and RIM. Until they do that, all the strategic alliances in the world won't make a significant difference.

=====

Update: The announcement this morning was more subtle and perhaps far-reaching than what was reported yesterday. I think the strategic situation is still the same as what I described above, but there might be more value for users than I expected. More thoughts after I have a chance to digest the announcement.