Archive for the ‘Ubuntu’ Category.

Audible on Linux

Not a specific Android post, but due to necessity I’ve stumbled across a way of doing something moderately simply that is otherwise moderately difficult. Your definition of simple and difficult may be different to mine. YMMV.

I love the guys over at Audible for their cheap audio books and large selection of titles. One thing that has bugged the Linux community for a long time though has been the lack of a native Linux client.

A lot of the suggested ways to get the content involve tricking Linux into playing the content by passing it through Windows Media Player codecs or by using the Windows application to create virtual audio CDs that can then be ripped. Some people also say that Wine works, but it didn’t when I tried it.

The way I tried today is to install an Android emulator onto my Linux laptop, install the Audible Android app to the emulator and get the content legally (according to Audible’s ToS). This does eat up one of your Audible installs but I think this is one of the cleanest and safest (as in playing by the rules of Audible’s DRM) ways to access their content on Linux.

This post explains in detail how to install the Android emulator, the Android .apk can be found on the Android Market site and this post explains how to use ADB to manually install the .apk to the emulator. If, like me, you have your real phone connected at the same time, make sure that you use the -e switch with ADB to install to the emulator.

Then go to your apps screen in the emulator, fire up Audible and log in as you would on your phone. Works great.

Audible on Linux

Froyo, Ubuntu and Busybox

Tried to boot my Ubuntu build on the Nexus and got the shock of my life when it failed to boot. I initially got 2 error messages, the second of which was complaining about a lack of chroot.

The problem was a lack of BusyBox. Since the Froyo build was a stock + root only it is lacking some of the nice toys we are used to.

BusyBox can be downloaded from here. The busybox-armv6l works fine on my Nexus.

Instructions to install it can be found here and here.

Ubuntu now boots just fine.

Flash on the Nexus

I was put off at first for a long time by trying to get a flash player running on the Gnome build. I eventually stumbled on this thread and found out about Gnash. A simple apt-get install gnash was all that was needed on my build to install it.

Adobe now report:

Sadly, the Nexus went chunky under the load from albinoblacksheep and almost crashed like it did last time. I managed to save the Android by killing the VNC server from the ADB shell. It took a couple of minutes of sitting and thinking to recover but after that the UI was as normal and the VNC server came back up quickly. This is the best I have from that run:

Guessing that the load came from the double whammy of both the JavaScript and the Flash I turned to a lighter weight old favourite:

It worked perfectly, without the sound of course.

A half crash

Nothing major new to report. While I was downloading and extracting a large source archive Android was becoming sluggish and throwing up a lot of Force Close/Wait dialogs for standard services.

I kept hitting Wait but suddenly the Nexus rebooted, going to its shiny graphical X intro. Obviously my VNC died as the wireless rebooted but as soon as it was back up I could re-connect and my session was still live.

Quick configuration change

I have re-partitioned my microSD to give 3.5GB total in the ext2 partition. At this stage, 2.1GB of that is used.

I always use a Linux box to play with the partitions and I am very careful about the order in which things are unmounted and unplugged. Two resizes so far and no data loss.

Pure awesome

xstartup

For anyone playing along at home, my xstartup currently reads:

#!/bin/sh
unset SESSION_MANAGER
gnome-wm &
gnome-panel &
gnome-settings-daemon &
nautilus --no-default-window &
gnome-volume-manager &

Keyboard hack

It’s not pretty, but it works.

The bug seems to be with the way that Gnome interfaces with the VNC server. There are a lot of different suggestions over the net to fix it. I have found one that works for me, but I will be trying the vnc4server one at some point.

Hugues Fournier posted a reply to Scrambled Keys in feisty ubuntu desktop which saves a working good keymap and then runs it in the Gnome session.

To do this you need to VNC in to your LXDE environment and run the command:

xmodmap -pke -display :1 > ~/xmodmap.map ( if your VNC display is :1 )

Then create a shell script in your filesystem containing:

#!/bin/bash
cat ~/xmodmap.map | xmodmap -

and chmod u+x it.

This is where I differ from Hughes’ instructions. You need to run this script while within the Gnome environment. For now, I have managed to use mouse control to edit the Menu. You can browse to the script and then enter anything as a name (you can tidy this later). Run the script from the menu and test. I will be looking at ways to auto-boot it later.

Baby steps 2

Getting closer.

My xstartup now reads:

#!/bin/sh
unset SESSION_MANAGER
gnome-session &
gnome-settings-daemon &
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig -iconic &
x-window-manager

Background image still missing and keyboard mapping still screwed. It produces this:

Baby steps – the beginnings of Gnome on Android

So, this is what it’s really about. As well as what I mentioned you need earlier, the full list is:

  • Nexus One (or other fast Android device)
  • Root
  • microSD card of 2GB or bigger with enough space on the ext2 partition for a lot of stuff – as a guide I have a 1.5GB partition with only 350MB free
  • Apps2SD or a read/write filesystem and knowledge of mount

If you don’t understand any of the points above, please don’t consider following anything else.

Once you can root shell in via ADB you can get the Ubuntu build and LXDE running with Paolo Sammicheli’s wonderful blog posts. This build worked well on the G1 and I was able to run Fennec at a crawl with it. Getting the Nexus made me want more and I am aiming for Gnome.

Haven’t got there yet, but I’m on the way. After getting Paolo’s build working, you will need to install the following packages:

apt-get update
apt-get install gnome x-window-system-core xserver-xorg gnome-desktop-environment twm

Ref.

I think there is some redundancy in that list. Beware the package ubuntu-desktop, it’s a 500MB behemoth that includes Open Office and scanner software and such. I know I’m pushing the Nexus, but I doubt I’ll be scanning on it any time soon.

To work on the phone, I am using an ADB shell session over the USB and VNC over a wireless link. For this sort of work you need a keyboard and mouse, using the on-board VNC client to talk to localhost is pretty much unthinkable.

Imthiaz Blog posted a Gnome VNC guide, including the sample xstartup settings:

#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
gnome-session &
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
# xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

Boot your VNC server and log in in the normal way. I thought I had failed several times, as all I was getting was the X11 blank screen:

Finally, when I left it long enough I started to get elements appear, though it is obvious I still have a problem with a window manager:

I also seem to have a massive problem with keyboard mapping too. Those issues for another day..