2007-12-03

I’ve updated the maemo port of Exaile to version 0.2.11. There are not many visible changes, apart from alphabetic separators in the collection list. I now include the bytecode-compiled pyc files, so startup time should be reduced slightly. It still takes a bit long to start up though. I’ve been using this for about a month now and it seems to be stable enough.

This will probably be the last release for OS2007. I’ll make a release for OS2008 once I have that installed and working on my N800.

2007-11-30

A few weekends ago I updated my system from Fedora 6 to Fedora 8. I did a fresh install, as opposed to doing an upgrade. Here are a few of the problems I encountered, along with solutions:

Wireless networking wasn’t working

Fedora 8 detected my Atheros-based wifi card, since it now includes the new freedomware ath5k driver. However I couldn’t get it to associate with my access point. The workaround was to install the proprietary madwifi package from livna: On a machine with Internet access, go to livna.org and download madwifi and the kmod-madwifi package corresponding to the installed kernel (do uname -r to find out). Then do:su -
rpm -ihv madwiki kmod-wifi
modprobe -r ath5k
modprobe ath_pci

Go to Administration->Services and start/turn on NetworkManager and NetworkManagerDispatcher services. The NetworkManager applet should appear in the system tray. Click on this to configure a wireless connection.

Setting up the livna repository

The livna.org repository is a separate repo containing packages that aren’t included in the main Fedora repo for various legal, technical and ethical reasons. I need it for the madwifi driver and the gspca webcam driver among other things. Set it up like so:su -
rpm -ihv http://rpm.livna.org/livna-release-8.rpm

Installing the webcam driver

The driver for my Logitech Quickcam IM webcam is freedomware, however apparently it does yucky things like JPEG decoding inside the kernel, so is not included in the mainline kernel. It can be installed from livna like so:su -
yum install gspca
modprobe gspca
Alternatively, you can install it from the GUI by going to System->Add/Remove Software and searching for gspca.
You can test that the webcam is working by running Ekiga (strangely filed under Internet->IP Telephony blah blah) and setting up video.

Using a home directory on a separate partition

I have my home directory stored on a separate ‘data’ partition. I was not able to log in when I configured my account to use this as my home directory. To fix this, I had to change the SELinux context on the root directory of the file-system on the data partition like so:chcon system_u:object_r:home_root_t:s0 /data

Fixing broken icons in Evolution

It appears that the necessary dependency isn’t installed by default for a KDE install. Fix the icons like so:su -c 'yum install nodoka-theme-gnome'

Installing Adobe Flash Player

Note that a freedomware flash player, gnash, is in the works, but it only supports a subset of Flash v7 functionality.

Other issues

I’ve had problems with sound not being available upon booting from time to time. This seems to be due to the coexistence of the webcam’s internal microphone sound device, and my main soundcard sound device. I also get ‘artsd’ crash messages upon logging into KDE from time to time.

I hope to cover my impressions of the various Fedora 8 components in subquent posts, but we’ll see how we go.

2007-08-12

The officially recommended way to create .deb packages for the maemo platform is to use dpkg-buildpackage within Scratchbox. For me, Scratchbox is a pain to install for two main reasons. First, there is no RPM package of the scratchbox environment, so apparently I need to run some scripts as root, let my system get a little messier, which I am not willing to do. Second, the docs advise to turn off SELinux in order to get the Scratchbox environment to work, which again I am not keen to do.

If you are using Debian or Ubuntu, there is probably a cleaner approach, but I am currently using Fedora, so I just rolled my own method using the command line. Copy the following files to your project directory:

Then rename deb_hand_example.mak to Makefile, and adjust the variables in this file to match your project.

Setup the required files (referenced in these makefiles) for packaging. There some pointers on this in the Python Maemo howto in the packaging section.

Note the ${PACKAGE_DIR}/data: ${SOURCE_DIR} target in the makefile. This must be modified to layout all files as you wish them to be installed on the target system. The example makefile rule should be a reasonable guide.

Then once you are ready, do ‘make PACKAGE_DIR= deb’ and if all goes well a shiny new deb package should be sitting in release_dir. If not, fix your settings in the Makefile, run ‘make clobber’ and then try again.

Next, I’ll probably work on making the interface a bit prettier, starting with hildon-izing the menus. I’d also like to add Replay Gain support to Exaile at some stage. And of course there are still a few bugs to iron out. There is a TODO file tucked away somewhere in the package with more details on things that need to be done.

BTW, make sure you change the foreground color in the preferences for the OSD notifications. There is some problem setting the background color at the moment which results in the notifications appearing blank. I’ll fix this (at least the default setting) soon.

There’s lots of work still to be done, but if your desperate for a nicer sound player on the N800 then this should do the job. If there are any features that you would like to be fixed/added sooner rather than later then leave a comment and I’ll push it higher on my todo list.

After much gnashing of teeth I have managed to manually make a .deb package that installs on the N800. I wanted to make the .deb by hand since I use Fedora on the desktop, for which the dpkg tools are not available. (I haven’t installed Scratchbox, because there are no rpms available for it at the moment, and I’d like to install it cleanly.)

A .deb package is quite simple, at least in theory. It consists of a control.tar.gz archive with package control files, data.tar.gz archive of all files that will be installed and debian-binary file that indicates the deb version to use. These files are then placed within an ar archive.

I cobbled together the archive contents using a hacky make file and sed. The final ar archive was the main sticking point. The ar format used in .deb packages is different to that generated by GNU ar. By looking at an existing deb package (the one for maemo-wordpy as it happens) with the emacs hexl-mode and consulting the wikipedia entry on the ar format and a fewotherpeople who shared my pain, I was able to come up with a sed script to fix the internal headers:

sed -e 's|^\([^/]\+\)/ \(.*\)|\1 \2|g' temp.ar > output.deb

This still didn’t cut the mustard. It turns out that the order of the files within the ar archive is important:

2007-07-03

I shamefully forgot to include a screenshot in the last post, so here you go:

As you can see, the GUI needs a bit of polishing (‘hildonisation’).

I fixed end-of-track detection for the nokia-mode pipeline. This means that the player will actually start playing the next track in the playlist when a song finishes! The problem was that I neglected to add the playbin bus setup for the nokia pipeline. Also, I had to ensure that the on_message handler was reconnected whenever a new track is played in nokia-mode, since the pipeline gets rebuilt if the file format is different.

The first fix had the pleasant side-effect of making m4a files play correctly from Exaile (previously they were really stuttery).

I fixed the about dialog. The version of libglade on the N800 appears to be a bit behind the times and doesn’t support GtkAboutDialog. I just create it in the program directly using gtk.AboutDialog and it works fine. I’m not a big fan of the libglade approach of reading in the widgets at runtime from an XML file. I prefer the way that it is done in Qt Designer/PyQt where the language-independent XML widget description is converted into Python code in a separate step. This code can be imported and extended by the main application code. It feels like such a waste to add an extra parsing step, for no gain.

I’ve encountered a bit of instability now and then during testing, especially when doing lots of seeking. Sometimes this results in a total lack of responsiveness and I have to kill the process manually. I’m willing to live this for now.

There are plenty of todo items, but I think I’ll work on making a .deb package to enable people to try this out more easily. Also, I plan to start a hildonisation branch, and keep another branch for functionality fixes. I’m using Mercurial for revision control, and this will be a good opportunity to play with branching and merging. Hopefully I will get round to setting up an online repository at some stage.

2007-07-01

The default media player on the Nokia N800, creatively titled Media Player, sucks in many ways. There is no Ogg Vorbis support, no way to create a playlist from the GUI, seeking support is hit and miss, lacklustre graphic design, minimal metadata support, etc. Its shortcomings are compounded by the fact that is closed source, so it’s not just a matter of fixing the warts. This led me to port an existing media player, Exaile, to the N800.

Exaile is a cross-platform player written in Python. It uses the Gtk GUI framework and GStreamer for the audio backend. It attempts to be a clone of the magnificent Amarok, but in Python (fun to hack and easily portable) and Gtk (handy if that’s what you prefer or is all you have, as on the N800). It has nice collection and playlist management in the the style of Amarok, and some degree of last.fm support.

Porting involved taking out some newer Gtk features (e.g. SVG icons), adding support for the SQLite that comes with Python 2.5 (the version available for Maemo), adding support for modified gstreamer audio codec pipelines, and modifying the GUI to suit the constraints of a handheld platform.

I grabbed the basis for the gstreamer audio pipeline support from the Coherence project; a UPnP platform written in Python, with recently added N800 support. This had support for the built-in MP3 dsp codec as well as the third-party Ogg Vorbis software codec. The parse_launch function is used to create a gstreamer pipeline like so:

I added support for a couple of other codecs; m4a (MPEG4 audio, so I can play iTunes Plus songs without transcoding degradation) and AAC (advanced audio coding, similar to m4a, used by Nokia). These work in my isolated test cases, but have some problems at the moment when integrated with my Exaile port. It took quite a bit of poking around and trial and error to get m4a playback happening; there’s not a lot of Maemo documentation for this at the moment. For the interested, here are the pipelines:

I’m still not quite sure of the meaning of the ‘sync=false’ setting, but without that playback is grossly stilted. When used within Exaile playback is still problematic, so there is work to be done there.

The user interface is a bit rough at the moment. It needs to be hildon-ised, to fit in with the look and feel fo the N800 software. I’d also like to integrate some of the pretty aspects of the Listen audio player (another Python/Gtk/Gstreamer audio player) into the interface, and adapt it to suit the style of the N800.

At this point I now have a media player that is better (for me) than the ones that I have used up to this point (Osso Media Player, Kilikali, UKMP, and some other player I removed on account of it trashing some of my setup). There is still a lot of work to be done. Here is my current todo list:

Fix the ‘about’ dialog

Get .m4a files to play properly

Fix displaying of notification bubbles

Fix getting available plugins

Make left column hidable in main view

Improve layout of song info in main view

Fix opening of directories in Files browser

Fix searching for .aac files

Test audio scrobbling

Add offline queueing for audio scrobbling

Get last.fm streaming working

Improve startup time

Hildon-ise the GUI

Make .deb packages for the exaile port and the mutagen library

This should keep me busy for a while! It is a bit of a nuisance to use at the moment, since it must be started from the command line, and the Mutagen library must be installed by hand. Things will be much nicer once I make .deb pacakges for this. Here is a tarball alpha release for those desperate have a play: exaile_maemo/release/exaile_0.2.9_maemo_5.tar.gz