Tuesday, November 27, 2007

MediaBox 0.90.1 addresses the gconf issue

It seems that the gconf Python bindings are not available on every installation of pymaemo. Thus many users (mainly OS 2008) were not able to run the MediaBox media center. This release is for you!

MediaBox 0.90.1 falls back to using gconftool-2, if no gconf bindings are available. As a side-result, version 0.90.1 will now also start on the Nokia 770 with OS 2006 and sorta works (kinetic scrolling looks incredibly smooth on the 770, actually smoother than on the N800, but the 770 will choke on too many thumbnails for now).

Thanks to all those who reported problems and helped me locate the gconf bug.

Monday, November 26, 2007

MediaBox Enters the Stage


Finally, the first version of MediaBox has been released. This is an
extremely finger-friendly media center for the N800 and N810 internet tablets.
The Nokia 770 should be supported with a later release.




Let the screenshots speak:












Monday, November 19, 2007

N800's FM radio now works in Japan

My kernel patch for FM band selection on the N800 was confirmed to work in Japan. Now I'm going to clean it up a little and improve support for it in pyFMRadio. Thanks to Kenroy Harrison for testing it!

Sunday, November 18, 2007

Enabling FM band selection on the N800

The Nokia N800 has a built-in FM radio which can't currently be used in Japan since Japan uses a different FM band (76 MHz to 90 MHz) than Europe and the US (87.5 MHz to 108 MHz).
Thanks to Kenroy Harrison for pointing this out.

The TEA5761 FM chip on the N800 supports the Japanese band by setting the BLIM bit but this is not supported by Nokia's driver code (Nokia doesn't sell the N800 in Japan anyway). So I have built a patched kernel enabling setting the BLIM bit.
The new release of pyFMRadio adds support for this kernel and allows switching the FM band.


If you have a N800 and are currently in Japan, please test this Python code and report if it's actually working:


from FMRadio import FMRadio
import time

r = FMRadio()
r.set_fm_band(r.FM_BAND_JPN)
for freq in r.scan():
r.set_frequency(freq)
r.set_volume(50)
time.sleep(3)
r.close()

Monday, November 12, 2007

pyFMRadio and auto-scanning

PyFMRadio, the N800 FM radio module for Python now supports automatic scanning for radio stations in the new release 0.20. The new version now also powers down the radio chip on close(), so it won't drain battery when the radio is not used.

Here's some example code for callback-based station scanning:


# import radio stuff
from FMRadio import FMRadio, FMRadioUnavailableError


stations = []


def scan_cb(freq, is_station):
"""
Callback for scanning for stations. This callback is called for every
frequency and tells you if a radio station was found.
"""

print "scanning @ %0.2f MHz" % (freq / 1000.0),
if (is_station):
print "STATION FOUND"
stations.append(freq)
else:
print ""



# open the radio
try:
radio = FMRadio()
except FMRadioUnavailableError:
# radio not available
print "Your device doesn't seem to have a FM radio..."
import sys; sys.exit(1)

# get frequency range; currently only the US/Europe frequency band is supported
# by the driver
low, high = radio.get_frequency_range()
print "Frequency range: %0.2f - %0.2f MHz" % (low / 1000.0, high / 1000.0)

# scan for radio stations
radio.scan(scan_cb)

# if we have found some stations, start playing
if (stations):
radio.set_volume(50)

print "Now listen to the radio."
for freq in stations:
print "Tuning in %0.2f MHz." % (freq / 1000.0)
radio.set_frequency(freq)
import time; time.sleep(3)

else:
print "No radio stations found. The signal is too weak."

# don't forget to shutdown the radio; this will also power down the radio chip
print "Switching off the radio."
radio.close()

Saturday, November 10, 2007

N810 maemo submission accepted

Here I am to join the lucky posts on planet.maemo.org about getting an N810 discount. Thanks to Nokia for choosing me again! :)

My new media center will soon be ready for the first release. It's already working great, only some rough edges to fix and some performance boosts to apply. When dealing with lots of thumbnail images in an resource-restricted environment such as the N800, you'll have to take special care about clean and efficient programming. And when I say "lots of thumbnail images", I mean that every video, every music ablum, and every image gets a thumbnail preview.

Another big challenge will be to get the app running fine on the Nokia 770. No, this device isn't dead for me yet. Since the video bus of the 770 is actually faster than that of the N800, kinetic scrolling works great there as well. But I'm still struggling with memory limitations and some mplayer issues on the 770.

Wednesday, November 7, 2007

My Work on MediaBox

MediaBox Media Center

Let me introduce MediaBox, a finger-friendly media center
for Nokia internet tablets, to be released in a few days.

This basically started some months ago as an experimental frontend to
mplayer
with physically correct kinetic scrolling for browsing the collection of
video files. But soon it was clear to me that this user interface could do a
lot more, so I added music playback and integrated the image viewer from my
Obscura project.

MediaBox can play video, audio, display images, features a desk clock with
large letters, and is open for new extensions. It will soon be able to use the
FM radio in the N800 with the pyFMRadio project.



Since the media player backend of MediaBox is mplayer, it will be able to play
almost anything you throw at it, including Ogg Vorbis.




PyFMRadio

The Nokia N800 has a built-in FM tuner and I wanted to be able to use this with
MediaBox. So far, the only FM radio application for the N800 seems to be the
closed-source fmradio applet by Nokia. It's good but it's not finger-friendly.

So I started diving into the kernel code and eventually came up with
a way to control the FM tuner chip with pure Python. This might
be useful to other projects as well, so I set up the offspring project
pyFMRadio.