Channel9 works with Moonlight!

by Miguel de Icaza

I just got back from Mix, updates my Moonlight from SVN and the videos at channel9 are now working with Mono.

Inside Silverlight 2 Beta 1, an overview with Scott Guthrie

This is one of the important pieces of our media pipeline that was missing (support for the HTTP streaming protocol). The implementation is based on the work that Fernando and Rolf did using the recently released specifications that Microsoft published.

Sadly, I was not able to show that at Mix. Its also the first take, so more testing and exercising will be required.

Posted on 08 Mar 2008

Pre-Mix 08: Moonlight Updates

by Miguel de Icaza

We have been hard at work in Moonlight and I keep postponing when to blog some updates about our work every few days hoping to cram some new feature in the blog post.

And every few days turn into every few weeks and the next thing you know what should have been published a month ago ends up being my pre-Mix post.

Some of the most important changes in the last two months have been:

Moonlight Media Pipeline: So far we had been using ffmpeg's pipeline to process media. This means that ffmpeg was in charge of detecting the media formats, locating the codecs, demultiplexing the data, and decoding the data into video and audio frames.

The ffmpeg pipeline was fine as a sample pipeline, but we needed a few more things. We needed more control over the pipeline to implement things like media streaming and supporting seek operations over HTTP; We want to be able to relicense the code under non-LGPL terms (for people that can not use the LGPL or some commercial uses) and we need to plug Microsoft's Media Pack media decoders.

Rolf rewrote our multimedia pipeline so that the code on SVN no longer depends on ffmpeg's pipeline and only uses ffmpeg's decoders for video and audio:

The end goal is to plug Microsoft's Media Pack (this contains the codecs video and audio) into Moonlight:

The installers that we currently distribute for Linux do not contain the ffmpeg media codecs. If you need to test media you will need to compile the code from source.

Streaming: With our new pipeline we are now able to stream media. In the past Moonlight downloaded the media file into the local file system, and only when the entire file was downloaded we would start the playback.

Moonlight can now start playback as soon as there is enough buffered data. This works for media that is only available over HTTP. Fernando has been working on the support for media that supports the MMS-over-HTTP (controlling seeking for example). Luckily, the specs for HTTP-based streaming to Windows Media servers were released last week (also the specs for the ASF container format, which should help validate our implementation).

Test Tools: As part of our collaboration with Microsoft we received various tools that are used to test Silverlight. We could not reuse the tools directly for Moonlight (too many Win32-isms, too hard to plug into Mozilla/Linux) so Jackson rewrote all of that code for Linux.

The test tools include plugins that expose Javascript APIs to control Silverlight and the browser, simulate user events and take snapshots of the screen. Microsoft has given us permission to open source our implementation of these tools.

This should help us in creating our own tests, and in checking our own code for regressions beyond the test suites that we will have received from them.

The code should hit SVN soon.

Mozilla Installers: We created some installers for Mozilla that should offer a one-click install experience for users on Linux.

Verifier: Rodrigo continues to work on Mono's CIL verifier and on strengthening the image loader, work that will not be used immediately for our Silverlight 1.0 support, but that will be important for 2.0 (when Mono is required).

Historically Mono had not been used to execute untrusted code as we mostly were a runtime for desktop and server applications and errors in the images fell directly in the "doctor it hurts when I do this" category.

But with Silverlight 2.0 the story changes, Mono will be executing potentially hostile code so this work is mandatory. Additionally, Sebastien has been improving Gendarme and his Monoxide tool to help in the audit process and we have created a security audit plan for the runtime. This work, like the verifier work is a work in progress.

In addition to using it for Silverlight, the verifier work will enable the SecondLife folks to allow the execution of binary code in their simulators instead of being limiting SecondLife to use LSL-based scripts.

Windowless Support: As it turns out Windowless rendering is used by many Silverlight applications. This is where Silverlight content seamlessly blends with the HTMl content. This is a must-have for things like Tafiti, the XamlPad, and the Vista simulator and nice-to-have for some other sites.

The good news is that Chris has implemented the support for it:

The bad news is that this is limited to Firefox 3.0, the 2.0 edition does not have support for Windowless rendering.

See Chris' blog entry for the details about the challenges and limitations of Moonlight/Windowless in Firefox/Linux.

Bug weeks: With the test suite running on Linux we have been focusing on passing all the Microsoft tests that we can and implementing the major features missing (like Windowless support).

Silverlight 2.0 Other than the JIT support for Silvelright 2.0 at this point we have not done any work on it (well there are 3 classes stubbed privately).

There are two reasons for this: the updated 2.0 API is not public and although we have access to it, it is a bit of a mess to try to keep two separate trees (public and private) to support this and since Mix is just around the corner, we will just wait until next week.

The second reason is that we want to focus on shipping 1.0, completing the media pack integration and working on the configuration aspects of Moonlight (auto-update configuration for instance).

Our Priorities

Everyone on the team has been working very hard to get all the pieces in place, and we are getting closer to completion. Every time we fix a bug, it has a nice ripple effect of fixing various other issues that we had seen in some sites at once.

Our priority currently is to ship Moonlight 1.0, and this means more or less:

  • Integrate the Microsoft Media Pack.
  • Complete our media pipeline.
  • Fix all the bugs exposed by the test suites.
  • Investigate some of the problems with some video card/driver configurations that seem to burn a lot of cycles.
  • Improve the performance for heavily animated scenes.

Am excited about the Mix conference, looking forward to see the demos and what gets announced. And obviously very excited about my own session on Thursday to talk about Moonlight and Mono.

Time to go to sleep. Marek and myself are on a 7am flight and it will be hard to make it.

Posted on 03 Mar 2008

Wooohooo! Am on Channel9!

by Miguel de Icaza

The interview that I had when I visited Microsoft for the Lang.NET 2008 has been posted to Channel9. Its a conversation between Charles, Dragos (from the Volta team) and myself on open source, .NET, Mono, Moonlight and other fun topics.

Posted on 29 Feb 2008

Mono and the Game Developers Conference

by Miguel de Icaza

Last week some of us from the Mono team at Novell went to San Francisco for the Game Developers Conference. As some of my dear readers know, I was not much of a gamer a year ago, and I do not claim to understand this industry.

Mono is currently being used by a major publisher [1] to script a new version of a popular franchise (the new edition) and Mono is also the engine that drives Unity3D for scripting and SecondLife is beta testing Mono now on their beta grid.

Other than being fascinated by Unity3D and SecondLife, we had not really paid much attention to games. But in the last nine months we started to get a constant stream of requests to license the Mono runtime to power more and more games.

When Joseph Hill joined Novell in January as Mono's product manager we started to revisit some of these request. People wanted to get a proprietary license for Mono to use on the PlayStation, the XBox and the Wii and some folks also wanted Mono under non-LGPL terms (as it turns out, important to prevent cheating).

Three weeks before the GDC conference, our in-house expert on the game industry Michael Hutchinson told us that this conference existed. In a couple of days we booked some space on the show and we got things in place, we were going to promote Mono as an accelerated scripting engine.

Mono in Games

As it turns out, .NET-based tools and .NET-based scripting of tools are pervasive in the game industry.

As for the games themselves, engines are typically written in a combination of C++, C and assembly language and the high-level code is written with scripting languages. Lua is the most popular language to embed in a game (a procedural C-like language) and Python, variations on Lisp and a never ending stream of evolved batch languages.

People want to reuse Mono on games for a few different tasks. These are some of the reasons that we know about:

  • Speed: as games become more complex, and people spend more money on software that takes advantage of GPUs, optimizing compilers and even special hardware for physics the weakest performance spot on a game has typically been the language that has been used to implement the high-level portions of the game.
    In a world that is increasingly green, it is a waste of perfectly healthy computer cycles to interpret your code when you can use an optimizing JIT compiler to run your code.
  • Mainstream Language Support: In some cases, game companies have created their own languages, evolved or modified existing languages (modified versions of Lua are common). Some people would like to get access to more mainstream languages to develop their game logic.
    In the short term, jumping from procedural languages to object oriented languages is a first jump.
    Hopefully they will drink the functional kool-aid and use some of the C# functional features, or even F# to write their games.
  • Code Sharing: C# or .NET code that is today written to run on servers, or as part of the tools being used to create games can now be easily be reused on the game itself.
  • Mainstream Tool Support: Many games engines are already being developed with Visual Studio. Game developers can use the same tools to develop and debug the high-level game play scripts that they use to develop and debug the game engine.

Luckily, developers that have been writing Lua code for years will be happy to know that they can compile their Lua code to run on Mono (and get the performance boost they need) by using the Lua2IL compiler.

Update: The always great Lua developers have pointed out that the new thing is not Lua2IL but LuaCLR.

Mono and XNA

Mono does not really attempt to compete with Microsoft XNA

Microsoft's XNA is an end-to-end solution for game developers that want to create games for Windows, the XBox and the Zune, the XNA approach is to write manage code on *top* of XNA.

This works for certain kinds of games, but in the game developer space, some developers need to support more than one console and the high-end games (am sure there is a technical terms for these) end up licensing game engines, audio engines, graphics and physics from all kinds of middleware vendors.

In those cases (even when targeting the XBox) C# and .NET would not be available to the game developer.

So we basically think of the Mono runtime merely as a fast scripting engine with all of the ECMA/ISO CLI benefits and not really as providers of gaming APIs.

There has been some discussion in the #mono channel recently about whether we would create or endorse a gaming API developed by a third party. Like blessing Tao or OpenTK as the standard way of building games for Mono.

Although there is some value in having a blessed set of libraries for Mono, and I have no problem if people want to call their libraries Mono.Gaming, at this point the team at Novell is not able to dedicate any cycles to this effort (we can provide spiritual support, along the lines of yelling "Go team! Go" from the sidelines).

Intrinsics and Parallel Code

Am personally fascinated by running computational code on the GPU or taking advantage of special CPU instructions at the runtime level. Last year I wrote a bit about how we could implement this in Mono (Microsoft has already an implementation) and later we even made it part of our interviewing process.

Gratuitous Cell Processor imageAt the conference some people asked as to whether it would be possible to take advantage of the PlayStation3 six SPE processors. During the conference I had no idea that there was already a project using Mono on the PS3 with Linux that already does this, but the idea sounded fascinating.

It is particularly fascinating because the SPEs on the PS3 do not have the same limitations than GPU computations have, these are full blown CPUs (with some memory limitations) but still general purpose computation devices.

Paolo pointed me to CellDotNet: A project to make it possible to run .NET code on the Cell architecture.. CellDotNet is basically a JIT compiler (written in entirely in C#) that can compile CIL bytecodes into native code for the PS3 SPE processors (this is a project from Klaus Hansen and Rasmus Halland).

They have ported the SciMark benchmark to use some vector operations in the SPE. Currently I am unable to report the numbers as I do not have a PS3 running Linux, but I am expensing a PS3 as we speak to be able to report these back to you dear readers.

What makes CellDotNet all the more interesting is combining C# new functional features with the the Parallel Extensions to .NET.

Two good articles to get a grasp on what this offers are: Optimize Managed Code For Multi-Core Machines and Parallel LINQ: Running Queries On Multi-Core Processors.

PLINQ is built on top of the Language Integrated Query (LINQ), and although it has been promoted mostly as a technology to do database queries, the Parallel LINQ extensions basically supports map/reduce inside C#.

These libraries are only available as a technology preview currently for .NET and they do not exist yet for Mono. Hopefully we will get these implemented at some point.

[1] Our contract with said major publisher does not allow me to disclose who they are or the the game they develop on my blog. But it allows Novell to publish the information on the Novell site. After a year of asking Novell people to put this information on the web site, the information has not yet been posted. So the mystery as to what this is will sadly continue.

Posted on 26 Feb 2008

Lang.NET talks available

by Miguel de Icaza

The Lang.NET 2008 talks have been published.

They require Silverlight 1.0, but Moonlight compiled from source with ffmpeg support is able to play those presentations back.

If you are in a rush, see the following post for details on downloading the WMV file (so you do not need to install Moonlight from source on Linux).

Posted on 24 Feb 2008

Mono Hackweek Summary

by Miguel de Icaza

Some of the Mono folks have blogged about their work for last week hack-week:

Paolo and Zoltan rearchitected the Regular expression library in Mono and got a 9x performance improvement in regular expression matching. The work had two components: redesign of the opcodes in the regular expression engine, and generating native code using Reflection.Emit. At least for the Language Shootout case, the new regular expression code is the second best (Tcl is faster, but apparently Tcl does not cope with Unicode regexes).

Wade worked on MythTV under XGL and making Tomboy Scale.

Andrew added Zeroconf/Bonjour support to Giver (a tool used to easily share files with friends or nearby users). And he also worked on Tasky a simple task management tool that integrates with Remember the Milk. He also wrote a command line tool to remotely control Tomboy. screencast.

Mike added support to importing data to his Exert Project (fitness/workout log software) that he started last Hack Week.

Sebastien revamped and added various new rules to Gendarme, our analyzer for CLI assemblies to spot errors and common programming mistakes.

He also improved its APIs and performance. He also started to fix some bugs in our class libraries based on the analysis done by Gendarme.

Jonathan ported his XMPP/VB.NET client to Mono:

And also got MonoDevelop running natively on Windows:

Jonathan Pryor spent the week polishing various loose ends. Including the release of his fantastic NDesk.GetOptions command-line parsing library and providing documentation to various components in Mono.

Atsushi worked on the implementation of WebHttpBinding (part of 3.5 WCF) and various other parts. See his blog for details.

Mark polished his MathMap composer tool.

Marek did some work towards replacing System.Reflection.Emit with Cecil. After some discussion we believe we can keep both backends, one to keep things as usual, and another to be used with MonoDevelop (so MCS provides the actual parsing for the editor intellisense and compile-as-you-type support).

Jackson worked on a couple of interesting demonstrations with Aaron, which hopefully they will be able to demo soon.

Carlos spent his time improving System.IO.Serial, there were a handful of events not implemented that he worked on.

Andreia and Marek worked on a Gtk# native client for Bugzilla.

Stephane created a new Gtk.Print/Cairo dialog for F-Spot and worked on support for TimeZones in F-Spot (code has not been commited yet).

Everaldo worked on packaging Mono for Maemo4. He has promised a number of blog posts detailing the work on GarMono, and the new packages that will be included on it.

Rolf continued to replace SRE with Cecil in the VB.NET compiler.

Lluis worked on improving Mono.Addins and creating an add-in for authoring add-ins in MonoDevelop.

Paolo early on also extended C# to allow inline-IL assembly language code (similar to __asm__ in C or C++ in some compilers). See the blog post for the various samples of C# with embedded IL.

Chris worked on a scheme compiler.

Jeff learned more about Regular Expressions than he wanted to. Update: Jeff wrote an add-in for MonoDevelop to do Evolution plugins in C#.

Update: I had not finished reading all the status reports on the mailing list. Dick Porter wrote bluetooth support for F-Spot. There is a bug in the system underlying bluetooth C libraries that prevents it from working correctly out of the box, but hopefully that will get fixed.

Update: Mike Krueger improved extensively the search functionality in MonoDevelop, it now implements Emacs/Mozilla-like searching and he also wrote an assembly browser/decompiler that is plugged right into the solution browser.

As for me, I spent the week going insane over the incredibly frustrating T61p problems with performance. Inspired by Marek's encouragement to learn LINQ and functional-style programming, I started a project that I abandoned quickly to implement a managed spreadsheet.

At least I learned two lessons: am more comfortable writing tokenizers using the regular call-back system than the automatically generated state machine from generators. I also learned that OOXML is very easy to parse, but it would be nice for PDF files to have hyperlinks in the spec.

I am probably missing a few things, but I did not catch all the blog posts this week.

Posted on 23 Feb 2008

Game Developer's Conference

by Miguel de Icaza

Some of us in the Mono team are in San Francisco for the Game Developers Conference at the Moscone Center.

For more details see Joseph's post Mono at the Game Developers Conference.

Posted on 20 Feb 2008

Politics as Theater

by Miguel de Icaza

My friend Jon Perr (he was Ximian's Marketing VP) did a fun presentation at Ignite Portland.

The presentation uses an unusual format: you talk for 5 minutes, and 20 slides are displayed, each for 15 seconds (they advance automatically).

Watch his presentation here. The slides contain more data than the 15 seconds allowed, so you can read that here (also check the notes).

Posted on 18 Feb 2008

ThinkPad T61P Speed Problems

by Miguel de Icaza

I recently upgraded to a ThinkPad T61p. I did not reinstally my OS, but instead just moved the old hard drive into the new machine.

The new machine is supposed to run at 2.4Ghz when plugged to the AC power, but it keeps going down to 1.2Ghz when am trying to get some work done (start a build: cpu speed goes down; Start firefox, cpu speed goes down). When am idling, the CPU speed will happily go back to 2.4Ghz. It can get as bad as 800Mhz, and in fact, it tends to boot in that mode at 800Mhz so booting takes forever.

The machine is cool, unlike the last laptop it does not feel warm at all (perhaps because it never performs better than a PC/XT).

I have Googled and Googled and various people seem to be having this problem across some other machines and Linux distributions, but there does not seem to be any solution posted. This is also not a new problem.

gnome-power-manager shows that the speed policy is "Always Maximum Speed":

This is what cpufreq-info shows:

I have tried:

  • powersave -f, it sometimes makes the machine go to 2.4Ghz, but it will happily go back to 1.2 a few seconds later.
  • Setting the minimal frequency in /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq by writing 2401000 to it. This sometimes works, but sometimes I get:
    		root# echo 2401000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 
    		sh: echo: write error: Invalid argument
  • Calling: cpufreq-set -c 0 -d 2401000 -u 2401000 -g userspace this again works sometimes but when the CPU insists on sticking to 1.2Ghz it will just produce an error.
  • Variants on cpufreq-set's governor: I tried userspace, and performance. They both seem to fail sometimes, and work sometimes. When they work, the processor speeds only stays for a few seconds before it goes back to slow speed.
  • Tried disabling the speed stepping support in the BIOS. Although /proc/cpuinfo then reports that the CPU is running at 2.4Ghz, regular benchmark programs show that the machine is actually running at 1.2Ghz (building mcs goes from 2.7 seconds to 4.7).
  • Tried killing powesaved, gnome-power-manager to make sure they wre not interfering, they still do not work.

If you got some ideas, drop me an email, I will post any solutions

Posted on 13 Feb 2008

MonoDevelop goes to MacOS X

by Miguel de Icaza

We have released an updated Mono 1.2.6 package for MacOS X that contains Imendio's Native Gtk+ for OSX, Gtk# and MonoDevelop with Mac support. It is now available from our downloads page.

MonoDevelop on OSX.

MonoDevelop has pretty much the same feature parity than Linux does. There are a few missing features that we hope to resolve in the future, and there is plenty of room to improve.

Our recent efforts to better support the OSX stem from our belief that some Windows expats will want to continue building .NET applications using the Mac. And once they have updated their applications to run on the Mac, the code will run just as well on Linux.

Also, we believe that Unity3D developers will find auto-complete a useful tool when writing extension scripts for Unity. No templates or integration yet, but hopefully we will have those in the future.

This is only our first step.

MonoDevelop for Windows

Eventually, we would also like to bring MonoDevelop to Windows. Not to compete with SharpDevelop as they are focused on being a great IDE for Window developers. Our focus will be in bringing Stetic (our Gtk# GUI designer) to developers building cross platform applications.

Posted on 07 Feb 2008

« Newer entries | Older entries »