Tuesday 10 July 2007

Bemused support in Totem

Should have been a one-day quick hack, ended up taking 2 or 3 if I include the research into the (poor) alternatives.

Behold! Totem now includes a plugin allowing it to run as a Bemused server. This means you can connect your phone/PDA/Palm to Totem, and use it to control playback.

First you'll need Totem SVN trunk, and compile with the Bluetooth library headers installed. More importantly, you'll need a client:
Install the application (left as an exercise to the reader), connect to Totem, and voila! Ready to control.

Now, a comment on the protocol and the code of the different implementations:
  • The protocol disagrees with the native Linux implementation (INFOACK, or INF2ACK for INF2 requests? Null-terminated strings, where?)
  • Doesn't handle Unicode properly, all over the place, the protocol uses NULL characters strings as end of strings, which breaks UTF-8
  • More protocol problems, what happens with empty playlists is a mystery
  • bemused.java has problems handling empty playlists, and truncates movie titles when not.
  • JAMSE isn't open source, and seems hell-bent on using skins, and different clients for different mobile phones ("skin" size)
  • The Totem code is horrible, doesn't handle directory listings (the protocol for directory listings is utter shite, and unworkable), leaks all over the place, and is a security risk (seriously).
That said, the competition isn't that great either, as it doesn't even run (although I just notice that my e-mail was actually answered, but didn't get to my inbox). I guess I'll be looking into Remuco soon.

5 comments:

ओंकार (Onkar) said...

Not sure how much you are interested or know about this already. Many recent Sony Ericsson phones ship with software which sends HID key codes over Bluetooth. Operating system has to support HID profile of Bluetooth standard. Using this you can emulate keyboard/mouse key presses and control any damn application.

All one needs to do is create a key configuration profile. For long I have been using this technique for controlling playback in totem with the profile that I created through my K700i. What I am looking for is to get this profile included in official distribution of totem so that one can directly transfer it to his phone and start using it. Details at https://help.ubuntu.com/community/BluetoothRemoteControl

Please contact me via email if you need any more details.

Note: The keymap image will need to be improved and modified for various screen resolutions. I am exploring the possibility of including an SVG image instead of JPEG but my PC is packed in box in the process of home shifting and I am staying with a friend so it will take long time. :-D

Bastien Nocera said...

Thanks Onkar. I knew about this (although some readers might not have), but the problem is that not everyone uses Sony Ericsson phones, but there's J2ME VMs in nearly every phone (and other devices).

Anonymous said...

Please note that JamSE doesn't run on every midp phone (at least it doesn't run on most nokia s40 2nd edition because the file access api (jsr-75?) is missing).
So the only one choice is bemused.java..
Remuco supports a larger group of phones with "legacy" and "simple client" (and it's opensource).

Дамјан said...

Doesn't handle Unicode properly, all over the place, the protocol uses NULL characters strings as end of strings, which breaks UTF-8

How is that?
UTF-8 is doesn't use NULL characters.

http://en.wikipedia.org/wiki/UTF-8

ओंकार (Onkar) said...

I know that not everyone owns a Sony Ericsson phone. Even those who own a phone with this feature, most may not have tried using it with GNU/Linux because they don't know they can create custom profile or don't have time to do it. So for them including the profile will make life a little bit easier. of course final decision is yours. :-)

I hope other phone manufacturers will pick up this idea soon. :-)