Planet maemo: category "feed:b45a8ddcf3f2f1452044ac0e6a02e711"

Martin Grimme

Mer plays videos with MediaBox

2009-05-19 13:06 UTC  by  Martin Grimme

Another milestone has been reached in the Mer project on its way to eventually replace Maemo on the N8x0 devices. It will be possible to play videos with Mer 0.13. The current SVN version of MediaBox supports Mer and uses the libxine backend for video playback.

After installing libxine and MediaBox SVN version on Mer, you will need to install the D-Bus-Xine service. D-Bus-Xine is a simple D-Bus service for embedding libxine in applications. It was originally written for enabling DVD playback
with MediaBox on PCs.

A version compiled for Mer-ARMEL can be found here. If you want to compile D-Bus-Xine yourself, you can also download its source code.

I haven't built deb packages for D-Bus-Xine yet, so you'll have to manually extract the tarball in the root directory (/) on Mer.

After having started MediaBox, you should enter its preferences view
and set the media backends to Xine for all filetypes that you want to be able play.
However, there is no sound support yet in Mer 0.13, so don't expect too much.

EDIT: see the comments for how to get sound
Categories: mediabox
Martin Grimme

MediaBox Media Center 0.96.4 released

2009-03-06 13:46 UTC  by  Martin Grimme
Hilights of the new MediaBox release:

The overall performance of the user interface has been improved again and the lists now feature transition effects and remember the position where you where standing in the parent folder when you go back. This is especially handy when browsing UPnP/DLNA servers.

The mplayer backend has been optimized and mplayer now plays videos generally a lot smoother than before. Playback of higher resolution videos (e.g. 640 x 480) is now also smoother by automatic downscaling.

Media indexing has been improved and runs faster. And if you don't like indexing of ID tags, you can always browse the filesystem to play your media, of course.

Music can now also be browsed by genre, additional to browsing by artist, by album, and by folder.

MediaBox can now be told to keep the display lit while playing media. Stop playing, and the device may enter powersaving mode again.

If you use the Nokia headset that came with the device, you can now use the headset button to pause/play and skip to the next or previous track. Do this by pushing the button once, twice, or three times, respectively. Do not press the button to quickly because the headset is bad at detecting consecutive actions, though. Half a second between clicks is just right.
Categories: maemo
Martin Grimme
Note: If you're reading this article in a feed aggregator like, it might be truncated. Please click the link to the original feed to read the full article.

Get your text editor ready because this time I'm showing you the basics of plugin development for MediaBox.

Last time, I have explained the component system of MediaBox. If you haven't read this article yet, please do so as it will help you understand what's going on.
Now we're going to write a simple plugin that displays a short notification when the application has started.

As I have told you before, a plugin is a directory with some components in it. MediaBox looks for the plugin directories in its components directory. So we put a new directory in there with two empty files and in it:

+-- components
+-- my_first_plugin

Every plugin needs the file. This is the place where components are loaded and messages are defined. In this example, we will only load our StartupNotifier component, though.

Put the following code into

def get_classes():

from StartupNotifier import StartupNotifier
return [StartupNotifier]

The function get_classes is called by MediaBox to load the components. This function must return a list of the classes (not instantiated objects) of your components.

Now we are going to fill with life. It is a simple component, so we derive StartupNotifier from the Component baseclass:

from com import Component, msgs

class StartupNotifier(Component):

def __init__(self):


def handle_message(self, msg, *args):

if (msg == msgs.CORE_EV_APP_STARTED):
"Application Startup Complete")

That's all. This simple form of a component is called a mediator component, because it just listens for and emits messages. When a component wants to listen to the message bus, it simply overrides the method handle_message and checks for the message types it's interested in. The call_service method on the other hand sends a service call to the message bus.

When you now start MediaBox, you will be greeted by your new plugin.

Next time will be a bit more theoretical again. Then I'll talk about the different types of components and what they do in MediaBox.
Categories: maemo
Martin Grimme
I am going to write a bit about extending MediaBox with new plugins. Let's start with the basics of the component system first. I will show you some code examples in a later article.

Since version 0.96 MediaBox uses a component system for extensions. It is essential to understand this system when implementing plugins.

Components in MediaBox are independent objects connected to a message bus, where they can send messages or listen to messages from other components. Every component gets connected to the bus automatically when created. You don't have to take care about this step.

A plugin is a collection of one or more components grouped into a directory. The YouTube plugin, for instance, consists of a YouTube device component and a component for the preferences dialog.

Plugins can also add new messages to the vocabulary of messages that can be sent across the message bus.

Here's a little ASCII-art to summarize this all.

consist of connect to
Plugins -------------> Components ---------------> Message Bus
| | | |
| emit | | listen for |
| | | |
| | | |
| define v v transports |
+------------------> Messages
Categories: maemo
Martin Grimme

Making Themes for MediaBox

2009-01-10 06:43 UTC  by  Martin Grimme
Today I'm showing you how to make new themes for MediaBox.
Click to read 1224 more words
Categories: maemo
Martin Grimme

A New Version of MediaBox Media Center

2008-12-28 06:23 UTC  by  Martin Grimme
Finally, after several months of work I have now released MediaBox 0.96, which was really overdue... ;)

A lot of people were very helpful and regularly tried out the code fresh from SVN during the last few months and provided lots of feedback. Thanks to you all!
Special thanks also go to Hugo Baldasano for his work on asynchronous networking and for good help with UPnP event handling!

The long wait is now over and MediaBox 0.96 is available in the maemo-extras repository for Chinook and Diablo. The .deb packages for users of OS 2006 (yes, that's Nokia 770) and OS 2007 will be made available soon on the MediaBox homepage.

UPnP Streaming

UPnP/DLNA is a great technology for streaming music, videos, and photos to your
tablet. Simply put an UPnP media server in your home network and MediaBox
will discover it automatically for browsing and streaming its contents.

Playlists and media bookmarks

Playlists can be created and edited and are saved automatically. You can reorder the items at any time, and you can mix audio, videos, and images in a playlist.

You can now also set media bookmarks in any (seekable) file to mark the best spots and to find the place where you stopped listening to your audio book or podcast the last time. Simply click on the star-button to set a media bookmark for the current position.

Shuffle and Repeat

I don't think I need to say much about these features anymore, except that MediaBox can do it now, too.


Car-mode is what I call the fullscreen mode of the music player because it's very handy to use while driving a car. Big buttons for previous, next, and play/pause, along with big cover-art and a big title label make MediaBox perfect for this situation. I use this mode frequently with a shuffled playlist when driving.


It seems like every media center these days needs to be themable. MediaBox follows this fad so you can give it a new skin by downloading themes from the maemo-extras repository.
The first extra theme available is called "DarkBox", and hopefully others and betters will follow. I'm going to give more details on theming and building theme packages later. It's really easy, so get your GIMP or Photoshop ready! :)


MediaBox can be extended with plugins, and I'm going to cover plugin development later. Some plugins are already available for download:

  • a FM radio (for the N800),

  • a YouTube browser

  • and internet radio with SHOUTcast directory.

Categories: maemo
Martin Grimme

Bluetooth-PAN fixed for Diablo

2008-08-18 23:03 UTC  by  Martin Grimme
Yesterday I uploaded version 1.0.1 of maemo-pan to the Diablo extras repository. This new version finally fixes Bluetooth-PAN on Diablo.

Nokia recently uploaded a fix for handling DUMMY network connections in Diablo, which is needed for getting Bluetooth-PAN integrated into the connection dialog. If you install maemo-pan 1.0.1, the dummy-network package from Nokia will be installed as a dependency automatically.

Nokia's networking fix uses a hardcoded name for dummy connections, so you'll have to connect to "Dummy network" instead of "Bluetooth-PAN" (as it was on Chinook).

Apart from fixing the networking issue on Diablo, maemo-pan 1.0.1 is the same as maemo-pan 1.0. New features will be added in a later release.

maemo-pan 1.0.1 is only interesting to Diablo users. If you're running Chinook, maemo-pan 1.0 is fine. There is no version 1.0.1 in the Chinook extras repository because of that.
Categories: maemo
Martin Grimme

Tablet Python #4 - Sources of Memory Leaks

2008-06-12 07:32 UTC  by  Martin Grimme
Marius Gedminas blogged an interesting article about memory leaks in Python. On the tablet you don't have much memory available, so memory leaks will annoy the users very quickly.

Python is a garbage-collected language (like Java or C#), so memory leaking is normally not an issue, but there are situations where you should be careful.

Bindings to C libraries

Many modules are bindings to C or C++ libraries, and memory leaking is unfortunately quite common in those languages, esp. in complex libraries. A hot candidate for memory leaking on the maemo platform are the GdkPixbuf operations.

GdkPixbufs get not automatically garbage collected by Python. Always use del on a GdkPixbuf explicitly when you don't need it any longer.

The __del__ destructor method

Classes can have some sort of destructor method in Python.

def __del__(self):


This is called when you use del on the last reference you are holding. But be very careful! Classes overriding this destructor method are not eligible for breaking reference cycles by the garbage collector anymore! They have to be released manually. It's normally not necessary to override the __del__ method, so you better stay away from it.

Always take special care when dealing with classes overriding the __del__ method. Cyclic references involving such classes cannot be resolved by the garbage collector automatically.
Categories: python
Martin Grimme

MediaBox 0.95 released

2008-05-09 12:06 UTC  by  Martin Grimme
The new version 0.95 of the MediaBox Media Center is finally available. Thanks to all users who reported bugs and made suggestions for new features. Thanks to lot of feedback, many things have improved since the last release.

With the new MediaBox you can finally compose playlists and rearrange them on the fly. If your internet tablet has a keyboard connected, you can also search for tracks in long playlists or albums by just typing a few letters of the title.

The new version has an improved easy and finger-friendly user interface and reduces memory consumption, especially when dealing with large collections of media.

You can view the release notes at

MediaBox 0.95 is available in the Maemo Extras repository. Click the arrow below for quick install.

Have fun!
Categories: maemo
Martin Grimme

MediaBox Walkthrough: Search as You Type

2008-05-02 13:10 UTC  by  Martin Grimme
Today I'm showing you another new feature of the upcoming version 0.95 of the MediaBox Media Center. Search-as-You-Type works on any internet tablet with a keyboard, either built-in or connected via Bluetooth or USB.

Find a track
If you have many tracks in an album or the playlist and want to quickly scroll to a particular track, just type some letters from its title.

While typing, MediaBox searches your tracks for a match and scrolls the list to bring the track into view. You can see your search term displayed in the title bar while typing.

You don't have to type the full title as it's sufficient to type just a few subsequent letters from anywhere in the title.

Make a new search
The search text field clears automatically after a few seconds.

In order to make a new search, wait for the search text to disappear in the title bar, and enter your new search term.
Categories: maemo
Martin Grimme

Mediabox Walkthrough: Playlist Editing

2008-05-01 09:07 UTC  by  Martin Grimme
In a few days the new version 0.95 of the MediaBox Media Center will be released for the Nokia internet tablets. Let me introduce a few of the new features until then. Today I'm showing you a bit about the new playlist feature.

Enter the music viewer

You can edit the playlist in the music viewer. To get there, press on the tiny arrow button in the bottom left corner once.

The screen will slide up to reveal the viewer menu where you can switch between the different viewers of MediaBox.

Tap on the music viewer icon to select it. You're in the music viewer now.

Choose an album

On the left-hand side of the screen you can see a strip of images representing your album folders which MediaBox has found on your device.

You can drag the strip with your thumb to scroll through it.

When you've found the album you're looking for, press on the little arrow button on the album image to open it.

Add tracks to the playlist
After opening an album, you can see all its tracks on the screen. Again, you can use your thumb to scroll through this list.

The top item of this list represents the album itself and shows you the album cover (if available) and the number of tracks in the album. The other items represent the tracks in the album.

On each track there is a menu button to the right. Tap on it to reveal the track menu, where you can choose between [play] and [add to playlist]. The album item does not (yet) have a menu button. Instead it has the [add to playlist] button there.

That way you can either add particular tracks or complete albums at once to the playlist.

Switch to the playlist view

There is a button in the toolbar where you can switch between album view and playlist view. Press it once to get to the playlist view.

The playlist view shows all your playlist items in a list. Use your thumb to scroll through this list.

The album cover on the left side of each playlist item shows you where this particular track comes from.

Play or remove tracks

Each playlist item has a menu item on the right-hand side.
Press it once to reveal the item menu, where you will find buttons for [play], [remove from playlist], [remove succeeding], and [remove preceeding].

The [remove succeeding] and [remove preceeding] buttons are special because they do not only remove the selected item, but also all items preceeding or succeeding it.
That way you can quickly clean up large portions of the playlist.

Reorder the playlist

You can use your thumb to drag playlist items in order to reorder them.

Use the tiny dragging area at the left of an item to drag it around.
Categories: maemo
Martin Grimme
I have just upgraded to Ubuntu Gutsy (I know I'm very very late) on my laptop. The installation went fine but when I connected an external monitor with a higher resolution than my laptop has, gdm and GNOME were not able to detect this, and instead displayed the picture in the upper left corner of the screen.

This was especially funny with GNOME, because the desktop actually used the full resolution, and I could move windows over the whole screen. Only the panels were stuck in the middle of the screen.

Apparently I'm not the only one with this problem, so let me tell you what I found out and how to fix this.

Everything was fine with Ubuntu Feisty. When I connected an external monitor, the laptop screen switched off and the higher resolution was used. But now when I connect an external monitor, the laptop screen doesn't switch off automatically.

Because the laptop screen is still on, the system now has two screens and GNOME will automatically adapt to the screen with the lower resolution.

The moment I manually switched off the laptop screen with the tool xrandr

$ xrandr --output LVDS --off

the GNOME panels jumped to their correct position. So let's investigate this xrandr a bit more.

xrandr is a powerful tool for managing multiple video outputs, rotating the screen, and setting up multihead displays.

You can get a list of what the graphics driver thinks it has connected by invoking

$ xrandr -q

This will give you something like this:

Screen 0: minimum 320 x 200, current 1680 x 1050, maximum 1680 x 1200
VGA-0 connected 1680x1050+0+0 (normal left inverted right) 433mm x 271mm
1680x1050 60.0*+ 60.0
1280x1024 75.0 59.9
1440x900 75.0 59.9
1280x960 59.9
1152x864 74.8
1280x720 59.9
1024x768 75.1 60.0
800x600 75.0 60.3
640x480 75.0 60.0
720x400 70.1
LVDS connected (normal left inverted right)
1024x768 60.0 + 60.0
800x600 60.3
640x480 59.9
S-video disconnected (normal left inverted right)

The interesting entries are LVDS (the laptop screen) and VGA-0 (the external monitor). Both are connected. VGA-0 might be called VGA or similar on your system, as this name is driver-dependent.

If I wanted to check if an external monitor was connected, I'd just run

$ xrandr -q | grep "^VGA.* connected"

VGA-0 connected 1280x1024+0+0 (normal left inverted right) 338mm x 270mm

I want the system to switch off the laptop screen whenever an external monitor is connected, so that GNOME will use the higher resolution. This easily can be done by adding the following lines to /etc/gdm/Init/Default just before the

exit 0


xrandr -q | grep "^VGA.* connected" >/dev/null
if [ $RC = 0 ]; then
xrandr --output LVDS --off

It will also make gdm use the full resolution.
Categories: Laptop