Thursday, September 17, 2009

Race to do nothing!

In the early days there was prelink as part of maemo. It disappeared in the n810 distribution ranges. I noticed that there is no armel deb in debian for prelink, but there were murmurs of folks hacking it to work. Push finally came to shove, and as I like C++ many of my apps on maemo have quite a few symbols that need to be resolved before the app can run.

The long story short, prelink_0.0.20090311 is up at my repo. Use at your own risk, if your device breaks you get to keep both pieces etc etc.

Initial benchmarking: for an app that uses a few libraries, is C++, and has quite a few symbols that the dynamic linker has to attend to. For a complete run before it was 5.2 seconds on a warm start, with prelink of the binary it is 2.5 seconds. Considering that in that 2.5 the app itself has to completely run, there was a huge amount of time spent, err wasted, in the dynamic linker.

Of course, if I can get hidden symbols to work too then that 2.5 might drop back to 1.5-2 seconds. But for hidden symbols you have to either wrap things in pragmas or declare each function and class as exposed or not, so for a large library its quite intrusive. But the prelink is a huge gain for no code changes, so far at least. YMMV.

It's a touch ironic that Nokia recommends using prelink for embedded devices. But that is for qtopia... maybe for the next distro prelink will reappear in the default installation.

Saturday, September 5, 2009

geotagged image files and libferris

Tip of the day, if you have a geotagged image file such as those produced using Location Tracker on Symbian phones, then you can use libferris to start Google Earth showing you that image on a map. Just run
ferris-open-google-earth-for-context.pl
with the image(s) you want to see. Its a fairly quick way to show the movements of the day on a map. I should also add timeline support there I guess, so you can retrace a trip in the order it occurred using just waypoint image files.

This also works with any type of file that is location tagged with libferris. If you have a digital long/lat then you can view it on a map (TM).

Tuesday, September 1, 2009

n810 and gphoto

After noticing that gphoto is not packaged for maemo I did a bit of digging, seeing sad news from those who tried getting it going. But I thought I'd try with 2.4.6 to see if things are better now.


For those who want to tinker, see my packages. The library came across OK but gphoto itself uses a newer debhelper, so I just plucked the binary itself into the repo. If you want to use this with libferris, then expand the additional libraries into /usr/local/lib/ferris/plugins/context on the device.

I found that once USB mode was set to host, I could see the camera with gphoto but as reported in the past, there were frequent crashes. This is really unfortunate as all the blocks where in place for the command I was chasing:


# ferriscp -av \
gphoto://Canon.../DCIM/102CANON/IMG_2442.JPG \
flickr://me/upload


Most of the time using gphoto locks everything and about 5-10 seconds later the device restarts. I might have to hunt for a newer kernel for diablo... or wait until I have gphoto support on an n9 (nn?), a P+S wifi camera, and a decent data plan...

Sunday, August 30, 2009

Images from n810 to the Web

New debs allowing you to copy to flickr, 23hq, vimeo, youtube etc from the n810 are available. The next step is closer integration, tapping into the "send to" menu to let you send any image file to these places. Hey, its just a filesystem now ;)

One interesting possibility is using the n810 to shuttle images from a digital camera to the net. This gets around the vendor lock-in that might be present on your camera because the n810 just grabs the images from the cam and then shuttles them onward to wherever.

I also updated libferris to allow you to authenticate from the console, just the ticket to let you set things up over ssh with your desktop browser.

OK, for maemo, check the repository and you'll want ferris, libferris, and libferrisui at least. Version 1.3.6.
If you get into dependency trouble, see the build order to get an idea of the tree. Sorry its a bit hard to get on the device, hopefully stuff will move into extras in time.

Anyone who has used desktop flickr tools, you'll know about the whole authenticate before you buy thing. The below commands setup 23hq and copy an image over to it.


$ ferris-capplet-auth --list-auth-sites
...
flickr
23hq
...
$ ferris-capplet-auth --auth-with-site 23hq
...
Grant Auth following URL...

http://www.23hq.com/services/auth/?api_key=...

Then press return to continue...
<Open above link in browser, grant auth, hit return>

Done...

$ ferriscp -av 26082009071.jpg 23hq://me/upload


Hopefully things will become easier in the future: installation, setup etc. Of course, streaming from the webcam to youtube will rock, but baby steps as they say.

Friday, August 7, 2009

Them pesky web serviceses...

It always stuck me as a little odd that you have specific applications to upload to flickr, another little app with a cute interface for throwing video files at webserviceY etc. I should also mention that all of this is coming to the maemo build shortly... what better place to unlock web services than a tablet or phone, neh?

What ever happened to the unix philosophy, "everything is a file". Then you could just "cp" to flickr, write your facebook status in bash or C-x C-s your mood to facebook://status.

I added some support for the flickr API to ferris last year, and the recent 1.3.5 release expands that and adds more web service goodness. But, which of these nasty, closed source services should be supported? The answer: it doesn't matter, there just filesystems! Of course, I'd prefer to mount a FOSS, GNU, Free, Privacy respecting server, and who wouldn't.. but for some things you want to just cp to youtube and forget about it.

For facebook I have three objects at facebook:// level. A status file which is read/write, a recent directory which shows the feed of stuff your chums are up to, and a contacts directory with virtual vcard files for your pals. I even added in the profile picture of each friend into their v-vcard. Unfortunately facebook doesn't allow you to get phone number info through the web API, which is strange because you can just simulate a login and swipe it by screen scraping, but that's nasty T&C violating thinking neh?

The flickr API mounting should work, to some extent with any service offering that API. For example, 23hq offers free hosting which might appeal. The extensions in libferris 1.3.5 let you see your contacts in a directory, find images by photo ID, browse your photosets and images not yet in a photoset. If you look in your contacts directory, you'll see their photostream and favs as directories.

Note that the thumbnail image is available from flickr through libferris as 32bit RGBA decoded data, so a libferris client can graphically browse a flickr API photoset just as it can a digital camera mounted with libferris. The thumbail EA is the same. Of course, if you copy an image from flickr:// or 23hq:// libferris grabs the largest (or original) image from the site and supplies it to you. Feel the unlocking of captive data. Oh, and upload works as it did last year...

Finally, the mounting of Google docs and spreadsheets. This also has support for appending to plain text files, so you can redirect stdout to append to a google docs text file just as you can >> /tmp/foo.txt.

Spreadsheet mounting goes right down to the cell. So you can use google as a calculator from the command line if it tickles you...


$ export SPREAD=google://spreadsheets/smalltest1/Sheet1
$ echo 5 | ferris-redirect --ea b $SPREAD/9
$ echo 23 | ferris-redirect --ea c $SPREAD/9
$ echo -n "=sum(B9,C9)" | ferris-redirect --ea d $SPREAD/9
$ fcat -a d $SPREAD/9
28


And there are vimeo, youtube and others still needing mounting... but thats what 1.3.6 exists for right? Feel free to send in patches for your fav service! See plugins/context/facebook et al in the source.

Wednesday, July 29, 2009

select...group by artist

So I finally updated my Amarok mounting to work with 2.x. I'm still having a few issues with the 2.x of 'rok but that's another story.

One of the cool things about being able to mount things with libferris is that everything above ferris can also see them, XQuery, SQLite etc. For example, the amarok://playlist URL shows, as you would imagine, the playlist as it currently appears in the running amarok application.

The following little SQLite is fairly self explanatory:
.load libferrissqlitevtable.so
create virtual table fs using libferris(
'amarok://playlist',
'',
name text,
title text,
size int,
length int,
playtime text,
link-target text,
ferris-delegate-url text
);

select name, playtime, title from fs
order by name desc;

select avg(length) from fs;


And for a particular album, the playlist and average track time.

9|352|Absolutely Curtains
8|246|Stay
7|255|Free Four
6|274|Childhood's End
5|260|Mudmen
4|309|Wots ... Uh The Deal
3|187|The Gold It's In The ...
2|209|Burning Bridges
1|147|When You're In
0|185|Obscured By Clouds

242.4

Of course, a litttle group by artist, album... would make the SQL more generic:
select avg(length),max(artist),max(album)
from fs
group by artist, album;

285.777777777778|Pink Floyd|Dark Side of the Moon
242.4|Pink Floyd|Obscured By Clouds

Wednesday, July 22, 2009

Done bought me a new calculator...

So, the next release of libferris will include support for mounting google spreadsheets. This works right through to the file manager now. You can mount a spreadsheet as a filesystem and edit it with ego. Changes to cell a written to google, any formulas that are updated appear in the file manager right away, and of course if you are viewing the worksheet in a web browser its updated too.

I'm looking forward to compiling the latest ferris for maemo so that you can edit stuff on the tablet and have it change on your desktop automatically ;)

export SPREAD=google://docs/spreadsheets/smalltest1/Sheet1
$ echo 5 | ferris-redirect --ea b $SPREAD/9
$ echo 23 | ferris-redirect --ea c $SPREAD/9

$ echo -n "=sum(B9,C9)" | ferris-redirect --ea d $SPREAD/9
$ fcat -a d $SPREAD/9
28

And of course, if you use the first row for headings...

$ echo -n result | ferris-redirect --ea d $SPREAD/1
$ fcat -a result $SPREAD/9
28