Hack 10. Control XMMS with Bluetooth

Use your Bluetooth phone to control your music remotely under Linux.

If you have a mobile Bluetooth device that you'd like to use to control the XMMS media player in Linux, you might be in luck. There are actually a couple of applications out there that use a WAP-like serial interface to Sony Ericsson's T-series phones (including the T68i and the T39m) to configure them for use as XMMS remote controls.

The first of the two is a standalone Ruby-based application called bluexmms, which is available from http://linuxbrit.co.uk/bluexmms. Make sure your phone is paired [Hack #4] with the Bluetooth interface on your computer. Install bluexmms, and then use rfcomm to bind an RFCOMM device to channel 2 on the T68i, which is the T68's generic telephony service.

Next, run bluexmms /dev/rfcomm1 on your device, substituting the name of the RFCOMM device you just created. You should now be able to go to Accessories XMMS Remote on your phones menu, and voilà! You can now control XMMS directly from your phone.

A second, but similar approach, involves an XMMS plug-in called BTE (a.k.a.btexmms), which can be downloaded from http://www.lyola.com/bte. Build and install the plug-in, and create an RFCOMM device on channel 2, as just described. Then, go into the XMMS preferences menu and, under Effects images/U2192.jpg border=0> General Plugins, enable and configure the BTE Control plug-in. Set the device to whatever RFCOMM device you created for this purpose, and save your changes. Now you should be able to access the remote control from Accessories images/U2192.jpg border=0> XMMS Remote, as described previously.

If you don't have a Sony Ericsson T-series phone, you might try Bemused, which runs on SymbianOS devices, such as the Nokia 3650/7650 and the Sony Ericsson P800. Unlike the T68 apps just listed, which rely on the computer to establish a connection to the phone, Bemused instead uses a client that initiates the connection from your phone to a server running on your computer.

You can get the Bemused server and client from http://www.compsoc.man.ac.uk/~ashley/bemused. First, unpack bemused.zip and upload and install the .sis file on your phone. Then, download bemusedlinuxserver.tar.gz, and build and install it on your computer. You'll need to advertise Bluetooth serial port services on your laptop by running sdptool add --channel=10 SP, and then edit and configure /etc/bemused.conf appropriately. The Bemused README suggests using Bluetooth channel 10 on your computer, but any unused channel will do. Start your X11 window manager of choice, if you haven't already. Run bemusedserverlinux from the command line. At this point, you should be able to fire up the Bemused application on your phone and have the full power of XMMS at your fingertips, from clear across the room.

If you don't have one of these devices, don't fret; nearly every Bluetooth device these days implements some kind of serial communications layer. Using examples from the projects just listed, you can probably create an XMMS remote control for your own phone or PDA. The hackability quotient of Bluetooth for this particular kind of application is pretty high.

Clearly, if you've made it this far, you're probably thinking that, with a wireless remote control for XMMS, you could plug a dedicated MP3 server running Linux into the hi-fi amplifier in your living room and never need a monitor or a keyboard for it. Or maybe you're considering plugging a low-power FM transmitter into your sound card, so you can listen to your music collection from any radio in the house.

You're absolutely right. Bluetooth can do this and much more. Read on for more hacks that show you just what you can do with a Bluetooth device and various computer operating systems.

Schuyler Erle

Категории