Weekend Project: Take a Look at Wine 1.4

107

The Wine project has released stable version 1.4 of its Windows-compatibility service for Linux (and other non-Microsoft OSes), the culmination of 20 months’ worth of development. The new release adds a host of new features, including new graphics, video, and audio subsystems, tighter integration with existing Linux, and improvements to 3D, font support, and scripting languages.

In the old days, WINE was capitalized as an homage to its ultimate goal: Wine Is Not an Emulator. Rather, it is an application framework that provides the Windows APIs on other OSes — primarily Linux and Mac OS X, but others, too (including, if you so desire, other versions of Windows). The point is that you can run applications compiled for Windows directly in another OS. Unlike virtual machine solutions, you do not also have to purchase a copy of Windows to do so, and the lower overhead of a VM-free environment gives better performance, too.

Version 1.4 was released on March 7, about two years since the previous major update, Wine 1.2. Microsoft did not roll out a new version of Windows in the interim, so understandably the Wine project has had time to undertake plenty of changes of its own.

New: Multimedia, Input, and System Integration

The biggest change is a true “device independent bitmaps” (DIB) graphics engine. This engine performs software graphics rendering for the Windows Graphics Device Interface (GDI) API, which Wine has never supported before. Note, however, that Windows offers lots of different graphics APIs. Wine already had support for the better-known Direct3D and DirectDraw APIs, which also received a speedup. Still, the result of the new engine is considerably faster rendering for a variety of applications. The DIB code was actually developed by Transgaming, one of the commercial vendors that makes use of Wine in its own product line.

Windows also offers multiple audio APIs, the newest of which is MMDevAPI, which was introduced in Windows Vista. Wine 1.4 sports a rewritten audio architecture that implements this new API, and supports several audio back-ends: ALSA, CoreAudio, and OSS 4. Support for older back-ends like OSS 3 was dropped, as was support for AudioIO and JACK. PulseAudio, which is now the default in many desktop Linux systems, is supported through its existing ALSA compatibility. The project would like to restore JACK functionality, but it needs developers to help do so; similarly there is a side project to write direct support for PulseAudio, but it has yet to make it into the mainline code base.

Wine also uses the GStreamer multimedia engine for audio and video decoding, which gives Wine apps automatic support for every file format known to GStreamer. There are X improvements in 1.4 as well, most importantly support for XInput 2. XI2 should fix cursor-movement problems with full-screen Windows programs, as well as support animated cursors and mapping joystick actions. Finally, the new release uses XRender to speed up rendering gradients.

The new release also better integrates the Windows “system tray” (which many applications running under Wine will expect to exist) with Linux system trays, and even supports pop-up notifications. Wine also has support for applications that use several additional programming languages (including VBScript and JavaScript bytcodes), plus support for both reading and creating .CAB “cabinet” archives and .MSI installers. There is also a built-in Gecko-based HTML rendering engine (which should make HTML-and-CSS-based programs more reliable than the Internet Explorer-based renderer found in Windows…).

Enhanced: 3D, Text, Printing, and Installing

As mentioned above, Wine’s support for Direct3D and DirectDraw both received enhancement for 1.4. OpenGL is used as the back-end for both; a more detailed look at the capabilities and benchmarks can be found on Phoronix.

The font subsystem received a substantial make-over for 1.4, too. The big news is full support for bi-directional text (including shifting the location of menus, dialog box contents, and other UI elements when using right-to-left text), and full support for vertical text (such as Japanese). Rotated text is also supported, and the rendering engine is improved.

The project claims full support for Unicode 6.0’s writing systems, although that definitely does not mean that every language in Unicode can be used in Wine. However, there have been significant improvements to the localization effort — more locales are supported, and every UI resource (from strings to dialogs to menu entries) is now in a gettext .po file. So if your language is not supported yet, now is the time to get busy translating!

Printing improvements include directly accessing CUPS as the printing system (previous versions of Wine piped print jobs through lpr) and a revamped PostScript interpreter. The software installer has also been beefed up; it can now install patch-sets (which are very important for applying security updates) and roll-back previous installations. Considering that most Wine users deploy the framework for a smallish set of specific applications, this installer functionality is very handy.

Finally, the new release adds some “experimental” features that not everyone will find to be their cup of tea, but show promise in the long run. First, there is support for some new C++ classes from Microsoft, as well as expanded XML support, and Wine’s first implementation of OpenCL (which allows developers to write code that runs on both CPUs and GPUs). Wine also compiles on the ARM architecture for the first time. Windows is not a major player on ARM, but the tablet version of Windows 8 is poised to make a push on ARM this year, so having Wine ready is an important step for the project.

Application Support, Caveats, and Where We Go Next

Naturally enough, Wine for ARM is not as thoroughly tested as Wine on x86. But the new release does still support many more applications than did Wine 1.2. You can find the complete list on the Wine app database — just be aware that individual user reports are the source of most of the compatibility information. It is not as simple as running a static test to see whether or not application X is supported. That said, one of the major bullet points of Wine 1.4 is robust support for Microsoft Office 2010, so if you run Wine to ensure document compatibility with Windows-based friends, you are in good hands.

There are two caveats to be noted with this release. First, although ALSA-over-PulseAudio is a supported audio back-end (and indeed is probably the most common configuration), you should check your version numbers. Some users have reported iffy sound behavior when running pre-1.0 PulseAudio and pre-1.0.25 alsa-plugins.

Second, although standard hardware devices like keyboards, mice, and external peripherals work fine, Wine still does not have support for installing and using Windows USB drivers. This only applies to unusual hardware that requires a separately-installed Windows driver, so it probably does not affect you, but be forewarned. On the other hand, if you have a weird barcode scanner or infrared USB laser that you must use with Windows drivers, there is an external patch set available.

On the same front, if the application you need Wine support for is causing problems, there are some external tools available that help you locate and install add-ons to round out the experience. Many of these add-on options are not free software, so they cannot be shipped with Wine itself, but if you are in dire straits, you might want to check out PlayOnLinux and WineTricks.

Interestingly enough, openSUSE community manager Jos Poortvliet just published a detailed report on using Wine for gaming, in which he discusses both add-on tools. Primarily, however, the emphasis is on how well Wine works on a modern Linux distribution, and the verdict is pretty good. Considering that 27 of the top 30 entries in the Wine compatibility matrix are games, providing a good experience is critical. Although there are probably some people who use Windows for other tasks, too, if you know where to look.