Tuesday, October 13, 2009

We Can Receive FM Radio On The N900 Now !

Posted on 08:00 by SlipKoRnSaad

Controlling the FM radio in the N900 is tricky stuff. At first, the hardware is disabled for power saving reasons. Bluetooth has to be powered up, the I2C communication bus has to be powered up, and only then, the FM radio driver will actually load.

Martin have created a package n900-fmrx-enabler for this task. The FMRX-Enabler is a D-Bus service that takes care about enabling the FM radio hardware on request and powering it down again when no application are using it.

After the driver has been loaded by the FMRX-Enabler, the FM radio provides two interfaces for controlling. A classic Video4Linux2 interface featuring only the basic stuff such as setting the frequency and muting/unmuting it, and a sysfs interface where you can read and write into file-like objects to control the radio.

Another tricky part is getting to hear sound from the radio. Unlike the N800, the FM radio doesn't output to the speakers directly. You have to capture the sound from the PGA line and play it back. A simple GStreamer pipeline such as gst-launch pulsesrc ! pulsesink does the job, after enabling PGA line2 and PGA capturing in the mixer.

Martin have uploaded an application package fmradio for the FM radio to extras-testing. Testers are encouraged to test this, too.

One drawback with the FM radio is that due to constant capturing and replaying, the FM radio is kinda demanding on the battery. There's no safe way around that. The unsafe way around that can damage your speakers, so capturing/replaying is a must.

He's gonna put up some developer documentation for the FM radio stuff.

No Response to "We Can Receive FM Radio On The N900 Now !"