LWN.net Logo

Development

Introducing the XMMS2 Media Player

May 25, 2005

This article was contributed by Anders Gustafsson and Sham Chukoury.

"Developer Release 1" of XMMS2, the next generation of the X Multimedia System (XMMS), has been released. This article describes what is new in XMMS2.

Why bother working on a next generation XMMS while there are various existing and possibly more advanced projects already in progress, some which are ready for production use? Because XMMS is just too damn popular to be allowed to die, of course! But seriously, while the field of 'audio playback' in general is something of an old beaten path, there is still much room for improvement.

Constant progress is happening in the field of digital audio playback, including: new compression/encoding schemes, better and more flexible encapsulation and container formats, more efficient encoders and decoders, better ways of managing collections of music files, new ways of letting users interact with their music and so on. XMMS2 jumps into the mix with the goal of trying to provide an improved music listening experience for users.

The XMMS2 project started in late 2002 as an idea to make a "kick-ass music player", and has eventually evolved into the next generation XMMS. The need for an XMMS replacement had been evident for years: the XMMS codebase and framework weren't exactly well-designed from the beginning. Lately, active development of XMMS has mostly stopped, this can be attributed to the lack of active developers, and a broken codebase. Adding new features to XMMS is difficult. Some of the most-wanted features would be nearly impossible to add. Some parts of XMMS are beyond patching, a re-design of the framework is needed.

Developers of another fork of XMMS, BMP, the "Beep media player", comment on XMMS:

The XMMS code we inherited is old and messy. In more specific terms, it is poorly structured, poorly documented and littered with duplications. It is difficult to modify or extend one component of XMMS without breaking another. We spent most of our time fixing problems that were introduced after seemingly innocent modifications.

The XMMS2 team is committed to producing a better music player, while diligently maintaining a robust and flexible design. The goal is to make the system easy for developers to maintain and integrate with. In terms of the listening experience, XMMS2 makes it possible for anyone to easily manage their music collection and to interact with it in a flexible manner.

A Client/Server Model

XMMS2 runs the core player and user interface(s) as separate processes. The core player acts as a server to which user interfaces can connect. The interprocess communication is carried out over a Unix socket or a tcp connection, but all of the details are hidden from the client in a high-level client library.

The library also has bindings for Python and Ruby, simplifying the creation of clients. Putting the user interface in a separate process provides the opportunity to offer some very nice features. It allows any number of clients (user interfaces) to be connected simultaneously.

When you are sitting on your sofa with your laptop, you can just ssh to your desktop where XMMS2 is playing, and use the text interface to change songs, much like using xmms-shell for XMMS, but XMMS2 is designed for this from the ground up, and all clients are first-class citizens having full access to all of the available features.

Support for multiple clients also means that you don't have to keep a client connected - you may start the player, load a nice playlist and start playing it, and disconnect your client without killing the core player. This flexibility makes XMMS2 well suited for a headless system, and allows it to be controlled from a web browser.

The client-server model allows XMMS2 to be completely desktop environment agnostic. It is possible for one user to run the core player with a client that integrates tightly with a KDE-desktop, while another user runs it a with client that just sits in his/her Gnome panel. At the moment, there are no finished and stable GUI clients, but the plan is to write a small skinnable client that isn't bound to either KDE or Gnome. This will be shipped with XMMS2 as the default GUI client. The XMMS2 team also hopes that third-party clients which are more tightly integrated with individual desktop environments will be independently developed.

If you are familiar with XMMS, you know that its plugin system allows plugins of type "General", which are used to provide functions such as controlling the player using an IR remote control (xmms-lirc), running specific commands when a new song is played (song_change) and starting playback at a specific time (xmms-alarm). In XMMS2 all of these functions can be implemented as special clients.

This increases the stability of the core player, as the core player will continue to work fine even if one of the clients crashes. This design also speeds the development of such functions up in two ways, the client doesn't need to be unloaded and loaded from the server to test each change, and the server will keep running even if the client has crashed.

More importantly, the client functions can be written in a scripting language such as Python or Ruby. Visualization works exactly the same way - a visualization client requests visualization data, and processes it to produce fancy real-time visual graphics. Currently, only frequency information is available, wave data will probably be added in next release.

The Medialib

Displaying just the filename or URL of an audio stream in the playlist isn't very attractive, metadata such as the artist's name and the song title should also be shown. This media information is generally available inside the file (or stream) itself, like the ID3 tag in an mp3 file, and must be parsed. This parsing takes some time, and if it had to be done every time a song was added to the playlist, it would take a noticeable amount of time to add an album to the playlist. To solve this problem, the media info is cached in a database, named the 'medialib'. When a song is added to the playlist, the medialib is first queried, if the song has been seen before, the media info will instantly be available and the operation of adding songs to the playlist will be much faster.

This also has a very nice side effect: all of the mediainfo from the songs seen by XMMS2 will be stored in a database. This makes it possible to perform queries to find songs that have certain properties. For example, finding all songs by a certain artist or of a particular genre. This is so useful that a command was added to import music metadata straight into the medialib. The medialib is implemented as a standard SQL database using SQLite.

The medialib can be queried using SQL, and the possibilities are only limited by one's imagination. Examples are: "list all unique artists", "all artists with more than one hour total playtime", "10 random songs from artists beginning with 'a'", "100 random songs which are longer than 2 minutes and have the genre 'electronic'", and "select one song from each year between 1980 and 2003".

If logging is enabled, which it is by default, an entry is written to a log-table in the database every time a song is played. By using this table, even more complex queries can be made: "10 random songs that weren't played last week", "20 hangover-songs (that have been played Saturdays 10:00-14:00)". The power of querying the medialib would be apparent when XMMS2 is coupled with a client that abstracts away the SQL queries in a simple, but effective manner. No such client exists today, but the potential is great.

Transport Plugins

One of the problems with XMMS is that each input plugin is responsible for reading data from files or streams. This means that every input plugin wanting to be able to load a file over HTTP must implement its own HTTP code.

In XMMS2 the "input" plugins are split into "transport" and "decoder". Thus, if an HTTP transport plugin is installed, all supported file types can be loaded over HTTP.

Summary

While it is far from being able to replace XMMS as the de-facto standard music player on linux desktops, "Developer Release 1" of XMMS2 shows that the potential is there. Hopefully, the development of interfaces will be accelerated now that a public release has been made. All developers are encouraged to take a look at it, and take a plunge into the code to help make it the music player.

For more information have a look at the XMMS2 Wiki and join #xmms2 on freenode.

Comments (12 posted)

System Applications

Database Software

PostgreSQL Weekly News

The May 22, 2005 edition of the PostgreSQL Weekly News is out with the weeks' PostgreSQL database articles and resources.

Full Story (comments: none)

DBD::Pg 1.42 released

Version 1.42 of DBD::Pg, a Perl database interface, has been announced. "DBD::Pg version 1.42 is mainly a bug fix for version 1.41." The code is available on CPAN.

Comments (none posted)

Druid 3.6 released

Version 3.6 of Druid, a cross-platform GUI database manager, is out. "Druid is a GUI tool for database build and management. Users can add/change/delete DB objects (tables, fields, etc). Druid generates for you: SQL scripts, docs in XHTML, PDF, DocBook, etc; code in C, C++ & Java Beans even for JDO and support Castor & OJB".

Comments (none posted)

Networking Tools

LAT v0.5.3 released

Version 0.5.3 of LAT, the LDAP Administration Tool is available. "The tool allows you to browse LDAP-based directories and add/edit/delete entries contained within. It can store profiles for quick access to different servers. There are also different views available such as Users, Groups and Hosts which allow you to easily manage objects without having to deal with the intricacies of LDAP." Bug fixes and some new features are included in this release.

Full Story (comments: none)

Build a RADIUS server on Linux (IBM developerWorks)

Wei Zhang uses Linux as the base for a RADIUS server on IBM developerWorks. "As a network administrator, you need to keep administrative user information for each network device you need to manage. But network devices usually support only limited functions for user management. Learn how to use an external RADIUS server on Linux™ to authenticate users, particularly against an LDAP server, allowing you to centralize user information stored in the LDAP server and authenticated by the RADIUS server, thereby both reducing administrative overhead on user management and making the remote login process more secure."

Comments (none posted)

Printing

More New CUPS Tutorials

The Common UNIX Printing System (CUPS) site has several new tutorials online. Topics include: How Do I Fix The Error: "client-error-request-value-too-long" and How Do I Give My Windows Client Adminstrative Capabilities in CUPS?

Comments (1 posted)

Security

Sussen v0.11 released

Version 0.11 of Sussena, a tool for testing the security posture of computers and network devices, is out. "Since the last release we have moved away from porting security tests to focusing on running existing ones. To that end we've been working on NASL and OVAL interpreters for Sussen."

Full Story (comments: none)

Web Site Development

Business Directory module for phpWebsite released (SourceForge)

The phpwsBusinesses Business Directory module for phpWebsite has been announced. "phpwsBusinesses is a module for phpWebsite. It is intended to serve as a contact directory for businesses, and is suitable for websites such as a local Chamber of Commerce might have."

Comments (none posted)

Documentation

KnowledgeTree 2.0.4 released (SourceForge)

Version 2.0.4 of KnowledgeTree has been announced. "KnowledgeTree is an Open Source Document Management System, and version 2.0.4 has focussed mostly on minor bugfixes, improvements in flexibility, and preliminary support for PHP5."

Comments (none posted)

Desktop Applications

Audio Applications

Realtime Extension documentation for SND, and snd-ls V0.9.3.0

Version 0.9.3.0 of snd-ls, a distribution of the sound editor Snd, is out with support for SND 7.13 and bug fixes. Also, new documentation for the SND Realtime Extension is available.

Full Story (comments: none)

Business Applications

Tina POS 0.0.7 released! (SourceForge)

Version 0.0.7 of Tina POS, a cross-platform point of sales application that has been designed for touch screens, has been announced. Changes include new translations, a new ant build file, bug fixes, and other improvements.

Comments (none posted)

Data Visualization

wxMaxima 0.6.1 released (SourceForge)

Version 0.6.1 of wxMaxima, a cross-platform graphical front-end for the Maxima computer algebra system, is available. "New in version 0.6.1: support for greek characters in console window; export console window to HTML; save selection to image (selection to clipboard as image on windows); toolbar; other small changes/enhancements and bug fixes."

Comments (none posted)

Desktop Environments

GNOME Software Announcements

The following new GNOME software has been announced this week:

Comments (none posted)

KDE Software Announcements

The following new KDE software has been announced this week:

Comments (none posted)

KDE Commit Digest (KDE.News)

The May 20, 2005 edition of the KDE Commit Digest is online, here's the content summary: "KNode rewrites article viewer. KViewShell adds basic printing support. Juk adds a cover manager. KDE4 porting continues apace."

Comments (none posted)

Interoperability

Wine 20050524 Released

Release 20050524 of Wine has been announced. Changes include MSI improvements, new file manager features, better Winelib import library compatibilities, code cleanup, bug fixes, and more.

Comments (none posted)

Music Applications

LinuxSampler 0.3.1 announced

Version 0.3.1 of LinuxSampler, a modular streaming-capable sampler, has been announced. "Focus of this first release was an adequate support of the Gigasampler format, including experimental support for the new Gigasampler v3 format."

Full Story (comments: none)

Q-Faust project announced

Albert Graef has announced his Q-Faust project. "I thought that some of you might be interested in a Faust interface I created for my functional programming language Q. The interface allows you to load and run Faust DSPs in Q. Those of you who attended Yann Olarey's Faust workshop and my talk about Q at LAC05 should have an idea of what I'm talking about. ;-) I think that Faust and Q really make a great combo, which allows you to do all your multimedia/DSP stuff using nothing but modern FP tools."

Full Story (comments: none)

QSynth 0.2.3 released

Version 0.2.3 of QSynth, a Qt GUI front-end application to the fluidsynth soundfont2 engine, is available. "The fine print goes like there's no really big new features on this. After all its only a minor dot-realease."

Full Story (comments: none)

Office Suites

OO.o build 1.9.104 released

Version 1.9.104 of OO.o build is out. "This package contains Desktop integration work for OpenOffice.org, several back-ported features & speedups, and a much simplified build wrapper, making an OO.o build / install possible for the common man." Lots of bug fixes have been implemented.

Full Story (comments: none)

Web Browsers

Deer Park Alpha 1 Release Candidates Available (MozillaZine)

MozillaZine has announced the availability of release candidate builds of Mozilla Firefox 1.1. "Asa Dotzler has announced that release candidate builds of Deer Park Alpha 1 are now available. Deer Park is the codename for Mozilla Firefox 1.1 and Deer Park Alpha 1 is a preview of 1.1 aimed at developers. The builds available today are Deer Park Alpha 1 release candidates. Deer Park Alpha 1 intentionally uses a codename rather than the Mozilla Firefox branding to dissuade end-users from downloading the preview (an end-user beta will be available closer to the final 1.1 release)."

Comments (none posted)

Languages and Tools

C

GCC 3.4.4 released

The GNU project and the GCC developers have announced the release of GCC 3.4.4. This release is a bug-fix release, containing fixes for regressions in GCC 3.4.3 relative to previous releases of GCC.

Comments (none posted)

Caml

Caml Weekly News

The May 17-24, 2005 edition of the Caml Weekly News is online with the weekly roundup of Caml language news.

Full Story (comments: none)

Groovy

Stir some Groovy into your Java apps (IBM developerWorks)

Andrew Glover mixes Groovy and Java on IBM developerWorks. "Ever thought about embedding Groovy's simple, easy-to-write scripts in your more complex Java™ programs? In this installment of Practically Groovy, Andrew Glover shows you the many ways to incorporate Groovy into your Java code and explains where and when it's appropriate to do so."

Comments (none posted)

Lisp

ECL 0.9f released

Version 0.9f of ECL, Embeddable Common-Lisp, is out. "This version adds two new contributed modules, improves ANSI compliance, and fixes several bugs."

Full Story (comments: none)

Perl

Parrot 0.2.0 'NLnet' Released! (use Perl)

Version 0.2.0 of Parrot, a virtual machine for Perl 6 and other languages, has been announced. Changes include a change to the subversion RCS, Lisp support, a reworked Parrot Grammar Engine, bug fixes, and lots more.

Comments (none posted)

Perl 5.8.7 RC1 is out (use Perl)

Version 5.8.7 RC1 of Perl has been announced. "This is a regular maintenance release for perl 5.8.x, providing bug fixes and integrating module updates from CPAN."

Comments (none posted)

This Week in Perl 6 (O'Reilly)

O'Reilly's This Week in Perl 6 for May 3-17, 2005 is online with the latest Perl 6 news.

Comments (none posted)

Python

PyPy 0.6 released

The initial release of PyPy, a reimplementation of Python written in Python, has been announced. "The PyPy Development Team is happy to announce the first public release of PyPy after two years of spare-time and half a year of EU funded development. The 0.6 release is eminently a preview release.*"

Comments (none posted)

Dr. Dobb's Python-URL!

The May 24, 2005 edition of Dr. Dobb's Python-URL! is online with a new collection of Python language articles.

Full Story (comments: none)

Tcl/Tk

Dr. Dobb's Tcl-URL!

The May 23, 2005 edition of Dr. Dobb's Tcl-URL! is online with the weekly roundup of Tcl/Tk articles.

Full Story (comments: none)

XML

Unicode Secrets (O'Reilly)

Uche Ogbuji writes about the Unicode character set on O'Reilly. "Poor understanding of Unicode is probably the biggest obstacle users face when trying to learn how to process XML, and Python users are no exception. In my experience, Unicode matters are the most common component in users' cries for help with Python XML tools. In this article and the next I'll present a variety of tips, tricks, and best practices in order to help users minimize Unicode problems."

Comments (none posted)

Emulators

dosemu-devel 1.3.2 released

After a long period of inactivity, a new development version of dosemu, a DOS emulator, is out. Changes include updates to the video library code, documentation updates, and more.

Comments (1 posted)

Miscellaneous

OpenRelease 0.1.2 announced

Version 0.1.2. of OpenRelease is available with bug fixes and other improvements. "OpenRelease is a Python module which automates the packaging, release, and announcement of open source software. The pack class creates packages, which are defined by packer classes, manages versioning, and brings up your notes and changelog in an editor. The release class uploads the package to SourceForge, releases it through QRS, announces it on freshmeat and (if appropriate) on pypi."

Comments (none posted)

Page editor: Forrest Cook
Next page: Linux in the news>>

Copyright © 2005, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds
Powered by Rackspace Managed Hosting.