iPhone works for me

A year ago, I was comparing mobile phones, I bought a Touch Diamond and regretted it and then I bought an iPhone 3G which I used for a year and now I even upgraded to the 3GS. Now that I just got yet another comment to my post about the Touch Diamond, I thought I should recycle that comparison table from a year ago, but this time I’ll compare my assumptions about the iPhone back then with how it actually turned out.

So, here’s the table:

assumed actually
Phone usage
Quick dialing of arbitrary numbers actually, using the favorites list, and even using the touch keypad with its very large buttons, I never had a problem dialing a number.
Acceptable battery life (more than two days) ? meh – two to three days, but as I’m syncing podcasts every day, I get to charge the phone every day as well, so this doesn’t matter as much
usable as modem probably not it is now (using a little help for my Swisscom contract). As I was bound to my old contract with sunrise until may, I would have been able to use my old phone in an emergency, but that thankfully didn’t happen.
usable while not looking at the device I got really dependent upon the small button on my headset plus the volume hardware buttons on the side of the device, both allowing me to do 90% of the stuff I was able to do on the old phone without looking at it.
quick writing of SMS messages actually, I’m nearly as fast as with the T9 – having all keys at my disposal eliminates the need to select the right word in the menus, but not having the physical keys lets me wrestle with typos or auto correction which removes a bit of the advantage. It’s not nearly as bad as I have imagined though.
Sending and receiving of MMS messages works now. I missed the feature about once or twice in the 2.0 days, but usually sending a picture via email worked just as well (and was cheaper).
PIM usage
synchronizes with google calendar/contacts maybe yes. Since the beginning of the year, this works really well because Google just pretends to be Exchange
synchronizes with Outlook maybe yes, directly via ActiveSync – but since February, our company went the Google Apps route, so this has become irrelevant.
usable calendar yes yes
usable todo list
media player usage
integrates into current iTunes based podcast workflow yes yes
straight forward audio playing interface yes yes (see my note about the button on the headset above)
straight forward video playing interface actually, the interface is perfectly fine
acceptable video player limited kinda yes. Using my 8 core Mac Pro, it’s quick and easy to convert a video, but lately I’m using my home cinema equipment for the real movies/tv series and the iPhone for video podcasts which already come in the native format. Still, it’s no generic video player capable of playing video in the most common formats and it doesn’t really support playing from any server in my home network.
hackability
ssh client maybe yes. TouchTerm works very well – much better than any of the mobile Putty variants (Symbian an Winmob)
skype client maybe note quite. Actually usable with the speakerphone or headset, but not as useful in general use due to the inability to run in the background
OperaMini (browser usable on GSM) not needed any more due to UMTS and near-flat rates.
WLAN-Browser yes yes

Nearly all my gripes about the iPhone have either become irrelevant or turned out not to be a problem after all.

Combine the very acceptable performance as a phone with the perfect performance as a podcast player, music player, acceptable gaming platform and perfect mobile internet device, then it becomes clear that the iPhone has become the perfect phone for me.

I upgraded to the 3GS mainly because of the larger capacity, but now that I have it, the speed improvement actually matters much more than the capacity increase as 32 GB still is not enough to fit all my audio books, so I’m still limited to all my music, all unlistened podcasts and a selection of audio books.

But the speed improvement from the 3G to the 3GS is so incredible, that I’m still very happy I made the purchase. All the other features are either not quite ready for prime time (voice control) or not really interesting to me (video recording, compass).

Still. After looking for the perfect phone for 8 years now, I finally found the hardware in the iPhone.

802.11n, Powerline and Sonos

I decided to have a look into the networking setup for my bedroom as lately, I was getting really bad bandwidth.

Earlier, while unable to stream 1080p into my bedrom, I was able to watch 720p, but lately even that has become choppy at best.

In my bedroom, I was using a Sonos Zone Player 100 connected via Ethernet to a Devolo A/V 200MBit power line adapter.

I have been using the switch integrated into the zone player to connect the bedrom MacMini media center and the PS3 to the network. The idea was that powerline will provide better bandwidth than WiFi, which it initially seemed to do, but as I said, lately, this system became really painful to use.

Naturally I had enough and wanted to look into other options.

Here’s a quick list of my findings:

  • The Sonos ZonePlayer actually acts as a bridge. If one player is connected via Ethernet, it’ll use its mesh network to wirelessly bridge that Ethernet connection to the switch inside the Sonos. I’m actually deeply astonished that I even got working networking with my configuration.
  • Either my Devolo adaptor is defective or something strange is going on in my power line network – a test using FTP never yielded more than 1 MB/s throughput which explains why 720p didn’t work.
  • While still not a ratified standard, 802.11n, at least as implemented by Apple works really well and delivers constant 4 MB/s throughput in my configuration.
  • Not wanting to risk cross-vendor incompatibilities (802.11n is not ratified after all), I went the Apple Airport route, even though there probably would have been cheaper solutions.
  • Knowing that bandwidth rapidly decreases with range, I bought one AirPort Extreme Base Station and three AirPort Expresses which I’m using to do nothing but extend the 5Ghz n network.
  • All the AirPort products have a nasty constantly lit LED which I had to cover up – this is my bedroom after all, but I still wanted line of sight to optimize bandwidth. There is a configuration option for the LED, but it only provides two options: Constantly on (annoying) and blinking on traffic (very annoying).
  • While the large AirPort Extreme can create both a 2.4 GHz and a 5 GHz network, the Express ones can only extend either one of them!

This involved a lot of trying out, changing around configurations and a bit of research, but going from 0.7 MB/s to 4 MB/s in throughput certainly was worth the time spent.

Also, yes, these numbers are in Megabytes unless I’m writing MBits in which case it’s Megabits.

No more hard drives for me!

Last week I noticed that the hardware store of my choice had these fancy new (and fast) Intel SSDs in stock – reason enough for me to go ahead and buy two to try them out in my two MacPro desktop machines. Kos-Mos, my home mac was the first to be converted.

But before that, there was this hardware problem to overcome. See: The SSDs are 2.5 inch drives whereas the MacPro has 3.5 inch slots. While the connectors (SATA) are compatible, the smaller form factor of the Intel drives prevents the usual drive sliders of the MacPro from working.

The solution was to buy one of these adapters for the SSDs. Before doing that, I read about other solutions, some of them involving duct tape, but this felt like it was the cleanest way and it was: The kits fit perfectly, so installing the drive was a real piece of cake.

The next problem was about logistics:

pilif@kosmos /Volumes/Macintosh HD
 % df -h | grep Macintosh
/dev/disk2s2   365Gi  319Gi   46Gi    88%    /Volumes/Macintosh HD

Whereas the largest Intel SSD available to date has just 160GB of capacity (149 “really usable”), so at least some kind of reorganization had to be done.

Seeing that the installation running on the traditional drive was ages old anyways (dating back to the last quarter of 2006), I decided that the sanest way to proceed was to just install another copy of Leopard to the new drive and use that as the boot device, coping over the applications and parts of the user profile I really needed.

Been there, done that.

I didn’t do any real benchmark, but boot-time is now sub 10 seconds. Eclipse starts up in sub 5 seconds. The installation of all the updates since the pristine 10.5.1 that was on the DVDs that came with the machine took less than three minutes – including the reboots (I’ve installed the 10.5.7 update this morning and it took around 10 minutes on the same machine).

And to make things even better: The machine is significantly quieter than before – at least once the old hard drive powers down.

I will never, ever, again use non-SSD drives in any machine I’m working at from now on.

The perceived speedup was as significant as going from 8MB or RAM to 32MB back in the days. The machine basically feels like a new computer.

Of course I ran into one really bad issue:

The idea was to symlink  ~/Music to my old drive because my iTunes Library (mostly due to Podcasts and audio books) was too large to conveniently copy to the SSD. I renamed ~/Music to ~/Music.old, created the symlink and started iTunes for the first time, only to get screwed with an empty library.

According to the preferences though, iTunes did correctly follow the symlink and was pointing to the right path (WTF?). I tried to manually re-add the library folder which did kind of work, but screwed over all my podcasts – completely.

This is where I noticed that somehow iTunes still found ~/Music.old and used that one. A quick ps turned out my best friend, the iTunes helper was running, so I shut that one down and moved ~/Music.old away to /, just to be sure.

Restarted iTunes just to run into the very same problems again (now, this is a serious WTF).

The only way to get this to work was to quit iTunes (that includes killing the helper) and to completely remove all traces of that Music folder.

Now iTunes is finally using the Music folder on my traditional hard drive. This kind of work should not be needed and I seriously wonder what kind of magic was going on behind the scenes there – after killing the helper and renaming the folder, it should not have used it any more.

Still: SSDs are fun. And I would never again want to miss the kind of speed I’m now enjoying.

celes in the office is next :-)

This month’s find: jna and applet-launcher

Way way back, I was talking about java applets and native libraries and the things you need to consider when writing applets that need access to native libraries (mostly for hardware access). And let’s be honest – considering how far HTML and JavaScript have come, native hardware access is probably the only thing you still needs applets for.

Java is slow and bloated and users generally don’t seem to like it very much, but the moment you need access to specific hardware – or even just to specific files on the users filesystem, Java becomes an interesting option as it is the only technology readily available on multiple platforms and browsers.

Flash only works for hardware Adobe has put an API in (cameras and microphones) and doesn’t allow access to arbitrary files. .NET doesn’t work on browsers (it works on IE, but the solution at hand should work on browsers too) and ActiveX is generally horrible, doesn’t work in browsers and additionally only works under windows (.NET works in theory on Unixes and Macs as well).

Which leaves us with Java.

Because applets are scriptable, you get away with hiding the awful user interface that is Swing (or, god forbid, AWT) and writing a nice integrated GUI using web technologies.

But there’s still the issue with native libraries.

First, your applet needs to be signed – no way around that. Then, you need to manually transfer all the native libraries and extension libraries. Also, you’ll need to put them in certain predefined places – some of which require administration privileges to be written into.

And don’t get me started about JNI. Contrary to .NET, you can’t just call into native libraries. You’ll have to write your own glue layer between the native OS and the JRE. That glue layer is platform specific of course, so you better have your C compiler ready – and the plattforms you intend to run on, of course.

So even if Java is the only way, it still sucks.

Complex deployment, administrative privileges and antiquated glue layers. Is this what you would want to work with?

Fortunately, I’ve just discovered two real pearls completely solving the two problems leaving me with the hassle that is Java itself, but it’s always nice to keep some practice in multiple programming languages, as long as it doesn’t involve C shudder.

The first component I’m going to talk about is JNA (Java Native Access) which is for Java what P/Invoke is for .NET: A way for directly calling into the native API from your Java code. No JNI and thus no custom glue code and C compiler needed. Translating the native calls and structures into what JNA wants still isn’t as convenient as P/Invoke, but it sure as hell beats JNI.

In my case, I needed to get find the directory corresponding to CSIDL_LOCAL_APPDATA when running under Windows. While I could have hacked something together, the only really reliable way of getting the correct path is to query the Windows API, for which JNA proved to be the perfect fit.

JNA of course comes with its own glue layer (available in precompiled form for more plattforms than I would ever want to support in the first place), so this leads us directly to the second issue: Native libraries and applets don’t go very well together.

This is where applet-launcher comes into play. Actually, applet-launcher’s functionality is even built into the JRE itself – provided you target JRE 1.6 Update 10 and later, which isn’t realistic in most cases (just today I was handling a case where an applet had to work with JRE 1.3 which was superseded in 2002), so for now, applet-launcher which works with JRE 1.4.2 and later is probably the way to go.

The idea is that you embed the applet-launcher applet instead of the applet you want to embed in the first place. The launcher will download a JNLP file from the server, download and extract external JNI glue libraries and finally load your applet.

When compared with the native 1.6 method, this has the problem that the library which uses the JNI glue has to have some special hooks in place, but it works like a charm and fixes all the issues I’ve previously had with native libraries in applets.

These two components renewed my interest in Java as a glue layer between the webbrowser where your application logic resides and the hardware the user is depending upon. While earlier methods kind of worked but were either hacky or a real pain to implement, this is as clean as it gets and works like a charm.

And next time we’ll learn about scripting Java applets.

New MacMini (early 09) and Linux

The new MacMinis that were announced this week come with a Firewire 800 port which was reason enough for me to update shion yet again (keeping the host name of course).

All my media she’s serving to my various systems is stored on a second generation Drobo which is currently connected via USB2, but has a lingering FW800 port.

Of course the upgrade to FW800 will not double the transfer rate to and from the drobo, but it should increase it significantly, so I went ahead and got one of the new Minis.

As usual, I entered the Ubuntu (Intrepid) CD, hold c while turning the device on and completed the installation.

This left the Mini in an unbootable state.

It seems that this newest generation of Mac Hardware isn’t capable of booting from an MBR partitioned harddrive. Earlier Macs complained a bit if the harddrive wasn’t correctly partitioned, but then went ahead and booted the other OS anyways.

Not so much with the new boxes it seems.

To finally achieve what I wanted I had to do the following complicated procedure:

  1. Install rEFIt (just download the package and install the .mpkg file)
  2. Use the Bootcamp assistant to repartition the drive.
  3. Reboot with the Ubuntu Desktop CD and run parted (the partitioning could probably be accomplished using the console installer, but I didn’t manage to do it correctly).
  4. Resize the FAT32-partition which was created by the Bootcamp partitioner to make room at the end for the swap partition.
  5. Create the swap partition.
  6. Format the FAT32-partition with something useful (ext3)
  7. Restart and enter the rEFIt partitioner tool (it’s in the boot menu)
  8. Allow it to resync the MBR
  9. Insert the Ubuntu Server CD, reboot holding the C key
  10. Install Ubuntu normally, but don’t change the partition layout – just use the existing partitions.
  11. Reboot and repeat steps 7 and 8
  12. Start Linux.

Additionally, you will have to keep using rEFIt as the boot device control panel item does not recognize the linux partitions any more, so can’t boot from them.

Now to find out whether that stupid resistor is still needed to make the new mini boot headless.

Managed switch

Yesterday I’ve talked about configuring a VLAN in my home network.

VLAN is a technology using some bits in Ethernet frames to create virtual network segments on the same physical network, but just go ahead and read the linked Wikipedia article as it’s more detailed than what I would want to go into.

To really make use of VLANs, you are going to need at least one managed switch (two in my case). I knew this and I was looking around for something useful.

In the end, I ended up with two HP ProCurve 1800-8G’s: I wanted something that has at least 8 ports and was Gigabit capable as I was feeling the bandwidth cap on the previous 100M connection between shion and my media center when streaming 1080p content.

That’s something I hope to solve with the 1G connection, though the drobo may still be the limiting factor here, but theoretical 480Mbit is better (where are the MacMinis with the Firewire800 interface?) than the 100MBit I was constrained to with the old setup.

The ProCurves are fanless, provide 8 ports and have a really nice web interface which is very easy to use and works on all browsers (as opposed to some linksys things which only work with IE6 (not even IE7 does the trick)). Also, the interface is very responsive and it even comes with an excellent online help.

With only 10 minutes of thought going into the setup and another 5 minutes to configure the two switches I was ready to hook them up and got instant satisfaction: In my server-room I plugged a test machine to any of the ports 2-7 and got onto VLAN1 (the internal network). Then I plugged it into port 8 and promptly was on VLAN2 (as evidenced by the public IP I got).

I have only three minor issues with the configuration of the two switches so far:

  1. They come with an empty administration password by default and don’t force you to change it. Now granted, on a switch you cannot do as many mischief as on a router or worse, a NAS or access point, but it’s still not a good thing.
  2. They come preconfigured with the address 192.168.2.10 and DHCP disabled, practically forcing you to configure them locally before plugging them. I would have hoped for either DHCP enabled or, even better, the possibility of configuring them using RARP. Or they could provide a serial interface which they do not.
  3. To reset them, you have to unplug them, connect port 1 with port 2 and restart them. While this prevents you from accidentally resetting them, the procedure is a pain to do and when the time comes that I will have to do this, I’ll probably have forgotten the procedure.

But these are minor issues. The quick web interface, the excellent online help and the small fanless design make this the optimal switch once you have advanced requirements to fulfill despite not needing more than 8 ports.

There’s a larger 24 port cousin of the 1800-8G, but that one has a fan, so it was no option in my case – especially not in the sideboard where I’m now at the end of the 8 port capacity.

Life is good

Remember last week when I was ranting about nothing working as it should?

Well – this weeks feels a lot more successful than the last one. It may very well be one of the nicest weeks I’ve had in IT so far.

  • The plugin system I’ve written for our PopScan Windows Client doesn’t just work, it’s also some of the shiniest code I’ve written in my life. Everything is completely transparent and thus easy to debug and extend. Once more, simplicity lead to consistency and consistency is what I’m striving for.
  • Yesterday, we finally managed to kill a long standing bug in a certain PopScan installation which seemed to manifest itself in intermittently non-working synchronization but was apparently not at all working synchronization. Now it works consistently.
  • Over the weekend, I finally got off my ass and used some knowledge in physics and and a water-level to re-balance my projector on the ceiling mount making the picture fit the screen perfectly.
  • Just now, I’ve configured two managed switches at home to carry cable modem traffic over a separate VLAN allowing me to abandon my previously whacky setup wasting a lot of cable and looking really bad. I was forced to do that because a TV connector I’ve had mounted stopped working consistently (here’s the word again).

    The configuration I thought out worked instantly and internet downtime at home (as if somebody counts) was 20 seconds or so – the TCP connections even stayed all up.

  • I finally got mt-daapd to work consistently with all the umlauts in the file names of my iTunes collection.

If this week is an indication of how the rest of the year will be, then I’m really looking forward to this.

As the title says: Life is good.