keskiviikko 20. tammikuuta 2010

Spotify on N900

While I had my brief fling with the Htc Hero, the Android-based phone, I enjoyed being able to get to my Spotify playlists and search for music online while commuting. When I got my N900, I didn't renew my Spotify Premium, since I had no use for it anymore. Recently, some solutions have been popping up for the N900. All of them rely on (require) the libdespotify -library (also known as Despotify). The solutions I mention here are merely frontends for Despotify, that does the heavy lifting.

There are three ways, as of writing this, to get Spotify working on the N900.
  • Despotify Command line version
  • Qtify
  • Yaspot
I've tested Yaspot, since it appeared to get the best reviews on the forums. Here are my findings.

First run, I was faced with the login screen for the first time:



It's easy and intuitive enough. The only thing that leaves a question mark is the choice of bitrate. What bitrate is it? Do I have enough bandwidth for high? I suppose I could google it, but what would that really tell me, that I wouldn't still have to test out in real life? So, let's leave it checked and see what happens.

My first test run is during my morning commute in Helsinki, Finland. I know the 3G connection is shaky at best at some points. All my previous phones have had trouble staying connected to the internet, especially at one point in a suburb called Tammisto. The N900 is no exception, so what will happen? My HTC Hero played right through this Bermuda Triangle of 3G. It will be interesting to see how Yaspot and Despotify does.

My first test run is flawless. I have NO problems what so ever during the whole 30 min trip. I can easily swap songs, get to my playlists, do searches etc. Everything works. I get a very good feeling about this.

My second test run is not as glamorous. I get constant skipping and I'm wondering how it is that my 3g connection is worse on the way back. Is it that the bus is full of people? Is the weather worse? Does my N900 require a reboot? Do I not have enough bandwidth for high bitrate, even though it worked perfectly for 30 minutes this morning? I reboot, log on again with low bitrate and am again able to enjoy my music with nary a skip.

So, time for the third test. Morning commute the next day. I go with hight bandwidth again, just for the heck of it and it works. However, in the Bermuda triangle (Tammisto), I get skips. I'm not too concerned, since this was more or less expected even during the first run. I decide to see what happens if I don't start fiddling with my N900 and let it sort out the connection issue by itself. Sure enough, 10 seconds beyond the Bermuda triangle, Prodigy comes back to life and works beautifully for the rest of the trip.

Bottom line: Yaspot is VERY usable for me. It doesn't cache music ahead of time like the official Android client, it seems. My Android never skipped in Tammisto, because it had time to cache so much music that I always med it through - unless the song ended in the middle of the Bermuda Triangle. Then it too, took a break.

Yaspot is significantly better in terms of user interface when it comes to searching. The official Android client is a huge clusterfuck when you try to search for something. The N900 is all business and may not look as good, but boy does it deliver.

It's not perfect though. Here are the bad parts:
  • Yaspot always skips when the N900 does something else. When the screen dims, when you lock the device, when you enter the dashboard, when the device comes back to life etc. There's half a second of silence. Best to just leave it alone while you're listening to music. Probably a Despotify issue and not Yaspot.
  • Yaspot did crash a couple of times. Especially when I got impatient and clicked stuff when it was already processing.
  • Not that beautiful to look at.
  • No music caching (or very little, it seems)
  • It does appear to suck a LOT of battery. Beware of that. I am seeing a full battery when I start my commute and something like 75% left when I get to work. It's to be expected, I suppose.

Here are some screenshots:



This is the view you get when you have logged in



Search results look like this



This is what happens when you click the rightmost column
in the search results. You are taken to Album view.



If you want a "now playing" view, you need to back three steps from 
album view and press "playing queue" on the first screen or select it 
from  the status bar menu. Notice how there is no indication 
of what track we are actually listening to :)




Maps

I've been looking for the ideal map-software for N900 for quite some time. They all have their strong and weak points. I'm not really that into getting navigation: I just want an app for easy map browsing, that more or less duplicates my desktop experience of Google maps. Here are my requirements:
  • Panning of maps
  • Easy zooming
  • Address search that works
  • Easy to read
  • GPS -support
I've started out with Ovi maps and like so many others, I found it to be slightly less than optimal. People have been bashing it right and left on the forums, so I might have been slightly influenced by that.

So I set out on a quest to find something better. Here are the apps I tried:
For my requirements, all of these above are valiant efforts, but for me, none of them could replace the built in Ovi maps. Say what you will, but I think Ovi maps is the best we have right now.

Here are some letdowns from the above programs:

Maemo-mapper doesn't zoom in for me, when I search for an address. Searching is hit and miss: I can't find the street number for my place of work (but I can find the street). It's one of the big streets in Helsinki and then again, my buddy found his street number "Middleofnowhere street 238" that is significantly smaller and peripheral. Maemo-mapper also has a very cumbersome map respository system that is so far from being user friendly it's ridiculous. The downloadable sample repositories didn't work, becuase the Google links were wrong. Plus it crashed on numerous occasions, due to not being stable.

Map buddy does search. Just not addresses, it appears. Instead, you can look for pizza, but it's US centered, so apparently there isn't a single place to go out for pizza in all of Helsinki. Sigh.

Maep is very good looking, but it lacks search.

The HTML-based alternatives are numerous, including Google's own mobile version (at http://m.google.com/maps). Only, you can't zoom out with it. Any way at all! So much for that. The others are pretty much equally limited, most lacking panning and decent zooming. Here's one of the first efforts: http://tomch.com/maemaps.html

So after this long journey, I came full circle and went back to Ovi Maps. It does all the things I want, except for giving me the same map look I've grown accustomed to in Google maps.

Today I downloaded all of Finland as a map package (from this address) and installed it. It's the easiest thing in the world. If you know what you are doing, installation-instructions are one row:

Unzip the map pack you downloaded to MyDocs/cities/diskcache.

Here are the reasons why Ovi maps kicks everyone's ass right now:
  • Searchable with "ajax", meaning it gives me a list of hits as I'm writing the address or place I'm looking for
  • Downloadable maps
  • 3d-view that is rotatable
  • GPS tracking
  • Fast zoom alternatives to street, city, country level (etc).
Here's a screenshot as my final try to convince you. I challenge you to make any of the above apps as good looking or readable.


keskiviikko 2. joulukuuta 2009

New tweaks

I've been testing out the N900 for 10 days now and have ran into some interesting situations and found some interesting solutions. Here is a fresh batch of "tweaks":

Tweak 1:
I've stopped using the Facebook widget. It sucked my battery dry at a substantially faster rate. The very first day I closed it, I had more than 50% battery left halfway through the day. Normally it would hang at around 35% by then. Try it, you may find it has a huge impact!

Tweak 2:
I've put my mailbox on a diet. I used to have 5600 messages in my IMAP inbox and now I have only 700 (a month's worth). Due to a bug in the mail client Modest, it appears the IMAP folders are completely refreshed every time you open them. With 5600 messages I waited around 20 seconds to actually see my messages each time I opened the inbox. Now I wait only 3 seconds. You can always file your old mail under different folders (I have 2006, 2007, 2008 and 2009 plus a separate folder for each client). It's not like the N900 can search mailboxes anyway.

Tweak 3:

I bought a cheapish bluetooth headset (at 59€), the Nokia BH-214. It's pretty nice, because you can connect your own headphones to it. I use it mostly for music, but since I've had the microphone bug, where the microphone is suddenly and inexplicably muted and requires a reboot, I can still talk to people over the headset if my mic fails.

The microphone is in the dongle, which has four different buttons: Phone, play/pause, next, previous, so that means I can use any headphones and still am able to talk to people.

Tweak 4:
I yearned for a numerical battery level and now I have one. Just issue this command in the x-terminal:


lshal | grep battery.charge_level.percentage | awk '{print $3}'

It performs the lshal command, which lists HAL devices, looks for the row that contains "battery.charge_level.percentage" and then extracts the third column from that row.

I put this in an executable shellscript /usr/bin/bat, so that I can just write "bat" anywhere to see this output. I'll try to make a desktop widget or status bar module of it some day.

There are some limitations: It doesn't appear to update when the phone is sleeping (unconfirmed) and it goes to zero when the device is charging.

Issue 1:
I've installed Fennec (Mozilla Firefox for mobile devices) and later on learned that it messes with the FM Tuner software (or rather, some libraries they have in common?), which is why I was never able to make the tuner work. It should be fixed in the next version of tuner, but right now, I can't even fix it by uninstalling Fennec and Tuner and then reinstalling only tuner. It's dead and would require a reflash of the N900 to fix. So don't mess with Fennec if the tuner is important to you.

Issue 2: 
When i relaunch the camera, it doesn't remember that I told it to never use flash and always flashes anyway. I've made it a habit to always go into flash settings, turn on flash and then turn it off again, when I launch the Camera app, to ensure that it won't flash. So far it has worked.

That's all for today, folks. I will return with more stories as I keep on testing the N900. Today a lot more people received theirs (at least here in Finland), so we will be seeing new reports and rants shortly.

sunnuntai 29. marraskuuta 2009

Making your own wallpapers

I made my first wallpaper the other day. Normally, wallpapers are a walk in the park, but with the N900 you have four desktops and most people want continuity (the wallpapers should flow from one desktop to the next).


This whole ordeal is facilitated by the .desktop -files that you can find on your N900. You put the filenames of four separate image files (I've used only JPG:s, but I guess PNG:s would work too) into one wallpaper control file (with the file extension .desktop).

The easiest (?) way to put a wallpaper on your N900 would then be the following:

Step 1
Copy a .desktop file from your N900 to your computer (by connecting the N900 with a USB cable or by SFTP:ing in to it, if you have openssh installed). You can find the .desktop file in the .images folder. Just choose any of them, let's say .abstract1.desktop.

Note that with a Mac computer, you won't be able to see the .desktop files in finder, unless you tell your mac to show hidden files, which is not that easy. You're almost better off going the SFTP way and using Fugu or such to connect to your N900.

Step 2
Get the photos (you could take the four photos from my link or any other photos from n900wallpapers.com). You could also make your own 4-part-wallpaper by starting out with one 3200x480 panorama image and cutting it down to 4 separate photos that are exactly 800x480 pixels or you could just pick out four different images at exactly 800x480. Your choice.

Step 3
Edit the .desktop file to reflect your images. Let's say you downloaded my forest girl -photos and renamed them forest1.jpg, forest2.jpg, forest3.jpg and forest4.jpg. Start by renaming the .desktop file so it reflects the contents of the wallpaper, for instance .forest.desktop.

Then open up the .forest.desktop -file in your favorite text only editor (Notepad, for instance). Mine looks like this:

[Desktop Entry]
Type=Background Image
Name=Forest
Hidden=true
X-File1=/home/user/MyDocs/.images/Wallpapers/forest1.jpg
X-File2=/home/user/MyDocs/.images/Wallpapers/forest2.jpg
X-File3=/home/user/MyDocs/.images/Wallpapers/forest3.jpg
X-File4=/home/user/MyDocs/.images/Wallpapers/forest4.jpg
X-Order=01

You should change five things: the Name -row to reflect the name you want for the wallpaper and the four rows containing the reference to the JPG-picture.

Notice how my file names (paths) have "Wallpapers/" in them. That's because I don't want all my files in the root of the Images -folder. I want to organise stuff and put all my wallpaper items in a folder called Wallpapers. So you can leave it or change it to /home/user/MyDocs/.images/forest1.jpg. Your call.

Step 4:
Save the .desktop file and copy it to the Image-folder (named .images) on your N900. You should now be able to click the desktop on you N900, choose the blue "gears" -icon, click Desktop menu -> Change background and find the wallpaper you just uploaded. Remember to unmount your N900 from your desktop before doing this.

If you left Wallpapers/ in the file name path of the four images, you should create a folder called "Wallpapers" under .images and upload forest1.jpg - forest4.jpg to that folder. Otherwise just upload the images to the root of .images. The most important thing is, of course, that the paths in the .forest.desktop -file point to where the images actually are.

Using top

I have installed a cpu monitor status module from the extras repository, that at first seemed grossly inaccurate or at least hard to read any meaningful information from.



I take back what I said. Over the past few days I've noticed that CPU-monitor peaking (the left bar has gone into the red with five squares). Whenever that has happened, like the true linux-aficionado that I am, I've launched a terminal to see what's drawing resources. Each time it has been the same process: /usr/sbin/browserd. If you want the CPU-monitor, you can get it by installing load-applet.

Using top

To find out what process is sucking away cpu cycles, you can use top. On the N900, you start top, the diagnostic tool of choice for many unix administrators this way:
  • Start the terminal (easiest by just pressing ctrl-shift-x)
  • Write top at the prompt and press enter.
  • Exit top by pressing "q" on the keyboard.
  • Sort by CPU usage by pressing capital "P" (for processor)
  • Sort by memory usage by pressing capital "M"
  • The terminal can be exited by writing exit and pressing enter at the prompt. Or by closing the window from the X.



This is my view of top when I have started exactly two web sites: Facebook and the Finnish news service Ampparit. (Note the cpu monitor at four squares and the memory monitor at two). As you can see, browserd is using over 80% (81.5) of the CPU's capacity. This is of course not a static value that never changes: you need to keep monitoring the readings to see if it goes down to a more normal level over time.

In my case cpu usage jumps between 40% and 80%, but never goes down to a low level. Whether this is an error somewhere or not is hard to tell. We have to remember that this is a truly multitasking device, so CPU usage should be the same whether we are looking at the page or not. For Android this is not the case, on Android the background processes are going into a hibernate-kind-of-state and stop wasting CPU cycles when a window is thrown into the background.

On the N900 you, the user, are responsible for hibernating stuff you don't need. This means it might be a bad idea to leave a website open for a whole day in a backgrounded window. I was going to do just that for Facebook and always have the most up to date feed visible when I activate the window. Now I'm going to close web browser windows I don't need, because cpu usage is proportional to battery usage. Not in a linear fashion, but you can be sure that an N900 with a cpu usage of (average) 50% throughout the day is going to suck more juice out of your batteries than one that is hanging steady at 1%.

I've also confirmed that hibernating putting the N900 to sleep (by double pressing the power button so the screen goes black) has no effect on browserd cpu usage.

It is interesting to note, that we shouldn't assume the name browserd automatically implicates the web browser, but I googled it and came up with several web sites that confirmed that browserd is linked to the web browser and if I have no web sites open, it shouldn't be doing anything at all. Another typical way of confirming that the web browser is indeed responsible for the higher cpu usage is to close all browser windows and monitor the effect it has on browserd and system cpu usage. If it goes down, you can be pretty sure you caught the right program.

Different websites put a different strain on the CPU. One of the biggest culprits is naturally flash - we all know that. The site "Ampparit" is running some flash ads and so I tried closing down just Ampparit and leaving Facebook. The result was interesting. Cpu usage went down from 40-80% to around 2-5%. So leaving a website open with any kind of flash component is a big no-no. I might still not want facebook hanging in its own window throughout the day. Event 4% cpu usage that wouldn't have to be expended, might be too steep.

lauantai 28. marraskuuta 2009

The FM transmitter

I'll be brief. I went to a baby store with my wife today (big disappointment, they didn't sell any babies) and it was a 30 min drive each way. I wanted to give the FM-transmitter a test, so I started looking for it.

At first I expected to find a "turn FM transmitter on" -button in the Media Player app, but there was none. I then realized the FM transmitter probably affects all system sounds, so the logical place for it would be in the settings app. Bingo! Right there under settings was a menu item called "FM transmitter". I clicked it and only the absolutely necessary controls were available: Turn FM transmitter on and channel frequency. I set mine to 107.9, because that is what I had a preconfigured channel for from my iPhone FM-transmitter device.

After that it was smooth sailing. Everything worked as expected from start to finish and I don't feel it sucked a lot of battery either. I could actually hear all system sounds in the car speakers, but I didn't test whether callers' voices could be heard too...

The only hiccup was that our Audi "concert" system played a very audible beep every 20 seconds. It was because we had traffic announcements turned on in the car radio and turning it off required a little research in the manual.

I tried listening for noise in the signal, but could hear none. I guess with the sound of winter tires against bare asphalt, possible noise was at a much much lower level. I've always been sort of condescending towards car audiophiles anyway: show me a car with zero ambient noise inside while driving. Until we start running purely on electricity, the sound of traffic, engine and tires will probably far outweigh any noise from the audio system. And switching to electricity will probably not cancel out tire-noise. We would need to be flying or hovering (on electricity) for that ;)

torstai 26. marraskuuta 2009

On 3G coverage and quality

Today I rode the bus home from work with my N900 for the first time ever. I listened to music the entire trip and surfed the web. I also engaged in a Skype-chat session with a buddy.

The positive thing was that I staid on the 3G network during the entire trip. There were certain places during the trip, when my Hero would always jump back to 2G or lose connectivity altogether. Not the N900 - it plowed through like a champ in all the difficult places and never missed a beat. I could cautiously come to the conclusion that the N900 has a much better 3G implementation than the Hero (or the iPhone). Let's see how it goes.

The negative thing during my trip was that my dashboard started stuttering. I received notification of a mail and went to the dashboard. Suddenly, I could no longer choose any of the windows in the dashboard view. The N900 froze completely. I could click an empty area to go back to the desktop, but the dashboard was dead.

A minute later, it came back to life and worked normally again. I have no idea what made it freeze, but I know I wasn't deliberately running any resource hogging apps (with the possible exception of the media player). This would've been fine(ish) otherwise, but the same thing happened again a moment later on. 1 minute freeze and then everything was ok again. I didn't want to reboot, since a good song was blaring in my ears.

I have a funny story that's slightly relevant to this case too: During the day, the dashboard acted up as well. No matter how many times I pressed the dashboard button, the N900 threw me straight to the application list. I was getting furious: Isn't anything working right on this phone? ... Until I realized I couldn't access the dashboard, since I had no programs running! ;)