Control Amarok with Bluetooth

Ever since I’ve received my new phone, bluetooth has excited me. To be honest, the notion of being able to control my pc from the phone was the exciting aspect. Ever wondered how to do this? Let me elaborate. (Note: I assume you are strong in the source)

Step 1: Get the hardware
Make sure your telephone has a bluetooth connection and check that your computer has bluetooth support. This howto covers most Java enabled mobile phones. Most laptops have it inbuilt, but if your pc is lacking, grab a cheap dongle from ebay.

Step 2: Install bluetooth and applications
Install the bluetooth libraries and applications for your system. Many linux distributions such as kubuntu come with bluetooth enabled by default. However, you’ll need to remove the KDE bluetooth applications, such as kbluetoothd and kmobiletools. We’ll need to compile from source in order to apply a patch for the bemused server which will be interfacing with the mobile phone.

Download the source code of kdebluetooth. It is important to use beta2, as beta3 seems to be missing the bemused server which we will be needing. Extract the source, then download and apply this patch in the kdebluetooth directory. Compile and install the modified source.

Download JamSE, a mobile Java bemused client. Just leave it somewhere for now.

Step 3: Configure bluetooth
Edit your hcid.conf (mine lives in /etc/bluetooth) and set your configuration as follows:
options {
autoinit yes;
security auto;
pairing multi;
pin_helper /usr/lib/kdebluetooth/kbluepin;
}

Make sure your kbluepin application exists and is working – it is used to negotiate a pin when pairing with a bluetooth device.
Restart bluetooth. (eg: sudo /etc/init.d/bluetooth restart)
Start kbluetoothd.

Step 3: Tie the knots
Start konqueror and navigate to the bluetooth:/ io-slave. Assuming that your bluetooth adapter is recognised and the connection is working, you should see any devices in range pop up shortly. Select your device and you should see a list of services.

Bluetooth IO Slave

Choose the OBEX File Transfer service in order to transfer the Jamse jar file to the phone. In order to use the file transfer a bluetooth pairing will be required. Pay attention to your phone and choose a simple password like 1234. Once committed, the bluetooth pin helper which we set up earlier in hcid.conf will be run and ask for the pin which was entered into the phone. If you enter the same password, then a successful pairing will have been made and the obex file transfer should show a file listing of the contents of your mobile device. Just for the record, Amarok should be already configured for automatic use with kbluetoothd. If not, trawl through the configuration options which can be accessed via the kdebluetooth system tray icon.

Once jamse.{jar,jad} have been transferred to the phone, you should start them, using your mobile. Navigate to the location and start the application. With jamse, search for your computer and connect to it. Connect to the pc and allow application connectivity. If you have had some pretty good amount of luck, then you should see a Amarok popup and a bemused notification. Your mobile phone should now be displaying the currently playing song, and you will be able to change tracks and perform all your other simple/standard music player controls.

bemused-notify
Jamse-screenshot

Conclusions
There is no better way to finish the day by lying in bed listening to Amarok. But who wants to get up to turn off the music, or switch tracks! Not I! Now you can use your bluetooth enabled mobile phone to reach that extra height of laziness!

I tried a few other bemused (and generic bluetooth remote) clients for my phone, and they didn’t work very reliably.

9 Comments

  1. chrisli
    Posted September 3, 2007 at 11:02 pm | Permalink

    Hi,

    you can control Media with Bluetooth with the linuxMCE project that will be integrated in KDE!

    http://dot.kde.org/1187201437/

  2. Bill
    Posted December 28, 2007 at 5:12 am | Permalink

    HI, I am having trouble installing the patch above… there are also three files on my system for KDEbluetooth. To which one should the patch be installed?

    Forgive my ignorance… I am new to Linux.

    Thanks for what looks to be a great application to use with Amarok!

  3. laurens
    Posted December 31, 2007 at 1:25 am | Permalink

    Good afternoon,
    I’m having a short problem with installing this great app.

    Where in hcid.conf do I have to past the code :
    [begin of code] pin_helper /usr/lib/kdebluetooth/kbluepin; [end of code]?

    Please forgive me if I’m asking a silly question, because I have linux for about a month and used most of the time synaptic.

    Kind regards:
    Laurens

  4. Posted January 7, 2008 at 2:34 am | Permalink

    Hi, is possible to remotely control Amarok without KDE? I use Xfce and for Bluetooth connection I use bluez-utils, bluez-gnome and gnome-bluetooth… It would be great to control my Amarok.

  5. Posted January 14, 2008 at 6:12 am | Permalink

    bump

  6. Posted January 14, 2008 at 7:55 pm | Permalink

    Yes, of course you can still control Amarok without KDE. You need the same underlying libraries and either the same or different software. There is no problem using the kbluetooth libs without KDE, as the kdelibs will be already loaded if you are running Amarok.

    I can’t give more precise information since I have not looked into it, and I am currently travelling through Borneo.

  7. Posted January 16, 2008 at 2:14 am | Permalink

    I mean using bemused with bluez-utils. Normally I can remote XMMS. I just don’t know how to say bemused to control Amarok.

  8. William
    Posted February 23, 2008 at 11:13 am | Permalink

    hi seb
    i have a XDA Terra (HTC Herald 100), and i have tried several versions, but none of those work in my phone. any ideas? it seems like a resolution problem, but im not sure.

  9. Benny learsI
    Posted March 16, 2008 at 3:39 am | Permalink

    search for anyRemote – works with GENIME and KDE…

5 Trackbacks

  1. By Bluetooth music remote « 0ddn1x: tricks with *nix on September 11, 2007 at 8:14 am

    [...] Bluetooth music remote Filed under: Linux — 0ddn1x @ 2007-09-10 21:58:52 +0000 http://www.sebruiz.net/267 [...]

  2. By Amarok Weekly Newsletter #10 at amarok.org.pl on September 19, 2007 at 9:44 pm

    [...] Ruiz napisał instrukcję jak kontrolować Amaroka z telefonu komórkowego używając połączenia [...]

  3. [...] Read more… Related posts:Video conference between Linux and Windows usersMobile phone contacts, calendar and messages online backupGoogle phone (GPhone) rumorsKeep contacts and calendar/datebook of Motorola Razr V3 saved [...]

  4. [...] read more | digg story [...]

  5. By links for 2007-12-15 « linkchaos on December 15, 2007 at 5:32 pm

    [...] Control Amarok with Bluetooth at sebruiz.net (tags: amarok roverbar bluetooth) [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>