Thursday, May 6, 2010

Managing your Droid Incredible with Ubuntu 10.04 Linux

Hey everybody!  It sure has been a while since I updated this blog, but I think it's time I did.  Last week I picked up an HTC Droid Incredible, which is the Verizon version of the Incredible, and I've found that nobody has really written about what you can do with this thing using Ubuntu (a Debian-based Linux distribution.)  So, I'm here to tell you that you don't need a Windows PC to manage your device, and when I say that, I'm not implying you have to be a Linux expert or manually put all your files on the device.  So, to avoid most of that cryptic Linux stuff, I'm going to almost completely avoid the command line (I'll tell you the command, but I'll also tell you how to do it without the command...except for DVD playback, you have to copy and paste that command.)  I will also assume you have a default Ubuntu installation, so you may think I'm just being silly by installing some of this stuff.

Please note that I won't cover the mobile broadband functionality because the setup I have for it is very complicated and unstable at the moment.  Once I figure out a simple way for people to get it working, then I will write a post about it.

The super duper quick version



For those of you who know Ubuntu/Linux well, just install and configure the Restricted Extras Packages, libdvdcss2, Banshee, and Arista with this command (All of it is in the Ubuntu Software Repositories):

sudo apt-get install ubuntu-restricted-extras kubuntu-restricted-extras xubuntu-restricted-extras libdvdcss2 banshee arista; sudo /usr/share/doc/libdvdread4/./install-css.sh

Then you're setup is done.  Go to the section about Banshee if you want your device to display with the correct name and use the correct folder, and Arista is so simple, all you have to do is: choose a video file or DVD device as the source, select Ipod as your device, and Low as the Preset, then click Add to Queue (I can't really tell the difference between the low and high presets when using the device, but low uses half the memory.)


Codecs and DVD Playback

     So, let's spend a little time getting your system ready, and then our entire experience will be a little nicer.  First things first, you will want codecs for videos and music.  So, open up the Ubuntu Software Center (Applications -> Ubuntu Software Center), then type "restricted" into the search bar in the upper right corner.  You will see three packages that you want*: Ubuntu Restricted Extras, Kubuntu Restricted Extras, and Xubuntu Restricted Extras.  I don't think you really need all of them, but I always just install all three, so I'm going to tell you to do the same.

* Please note that the Restricted Extras Packages and the libdvdcss2 package are not allowed in some countries.  My primary audience is people in the US.

Ok, I kinda lied a little about the cryptic stuff thing... If you want to play back DVDs, you need to do one thing:

  1. Press Alt+F2 on the keyboard, and the Run Application dialog pops up.
  2. copy and paste this command into the Run Application dialog:
    "sudo apt-get install libdvdcss2; sudo /usr/share/doc/libdvdread4/./install-css.sh"
  3. Check the Run in terminal checkbox
  4. Click Run.
  5. A window with a bunch of text pops up, and I think you might have to hit "y" to accept the license agreement.
So, that wasn't too bad was it?  Because of restricted licenses, Canonical can't just distribute the DVD playback libraries with Ubuntu, so you have to get that separately and accept the EULA (End User License Agreement.)  Then you have to run a script that sets everything up for you; that is what the above command does.

Ok, now everything is set up, and you are ready to play all your music, watch movies, and all that kind of stuff.  

Media Management Software

Now, there are two more programs that you will want:  Banshee Media Player, and Arista Transcoder.  Both of these are available in the Ubuntu Software Center, so just type them both into the search box (one at a time of coarse) and you have all the software you need.  There is just one thing though, Banshee detects your Android Phone as a generic Android Device.  I don't mind the picture of the G1, but I just want the program to use the default music folder (/emmc/MP3/ for internal storage, or /sdcard/MP3/ for the microSD card), and I want the correct name for my phone.  This is actually a really simple thing to do.   You just create a text file, and save it to the device with a very specific name.

Get Ubuntu to See your Phone

By default, my phone goes into charge only mode when I plug it into a USB port, which you can change, but I like it that way.  So first, connect your phone to your computer.  Now, on the phone, open the notification area, tap the USB Icon that says "Charging Only" next to it, then select Disk Drive from the menu that appears.  Once your phone appears on your computer, you need to save a file into the root folder of the device.

The root folder would typically be called something like C:, D:, E:, etc... on a Windows computer.  You can recognize it because it shows up as a USB stick on the Places menu and on the side bar in the file browser (or in this case the save as window.)

Also note that if you have a MicroSD card, that will show up as a separate drive/device, You can set the name for the phone and MicroSD card separately in Banshee by repeating the following steps with a different name for the memory card.  You have to manage both of them separately.  Most software in the Android marketplace will not recognize media on the phone's internal storage yet, but if you just use MP3s and Ipod-formatted videos, you can just use the default media software on the phone.

Get Banshee to show the correct Name for your device:


Now that your device is connected and Ubunti can see it, you can save a text file to the device.  So, Open a text editor (Applications -> Accessories -> gedit Text Editor.) Then type two Lines (just copy the stuff between the quotation marks):
  • Line 1: "name=Droid Incredible"
        - This name can be what ever you want Banshee to call the device
  • Line 2: "audio_folders=MP3/"
        - This is an optional line; I chose to add it because I had already manually copied files to the MP3 folder, and now I wanted to keep everything simple.
Ok, now save that file as (File->Save As...) ".is_audio_player" and put it on the root of your device or SD card.  (You need the period at the beginning of the file, and the file has no extension at the end)  

Note that from now on, this file will be hidden, so to view the file in the file browser, you need to select View -> Show Hidden Files (or Press Ctrl+H.)

Ok, so now Banshee should show the name you specified, any music you have already put into the default folder, and sync new music to the folder you specified.

If you want a complete list of what you can put into the .is_audio_player file, you can refer to this page:

The Floccinaucinihilipilification Homepage - .is_audio_player file format by Darin Ohashi


Formatting Video for Your Device

So, after spending hours of trying different video transcoders, and different video players, I found that Arista Transcoder is the easiest option available.  You just open the program, choose a source, choose a device, choose a preset, and add to queue.  You can even queue up several video files and let them all go.  Then, when all is said and done, you can put the media on your SD card or the internal storage and play it through the photo browsing tool that came pre-loaded on the phone.

The source is either a DVD drive or video file.  For the device, just choose Ipod.  For the preset, choose low.  You can use High, but you will need to stop all non-essential processes or the video can go out of sync if you get an email or something.  Plus, the High preset uses twice as much memory, and I think about 200MB is much more reasonable than about 500MB.

Using Banshee

Banshee is really easy to use.  It will download album art, but it doesn't use the correct format for the HTC Incredible.  If you really need your album art, I have been using Media Monkey on Windows to update Album art directly on the device, and that works pretty well... I'll have a Linux solution soon, but that's not really a priority for me.

I've also found that playlists don't quite work right "out of the box."  I'll figure that out later, because I normally just press shuffle all, then stop looking at the device until I want to skip a song.

As far as video is concerned, you can just import everything to the library from the file menu.

At this point, you can use Banshee to sync all of your music and videos to your device in a very similar way to how you would sync everything with your iPod or other devices.  In fact, you can even use Banshee to sync to your iPod!  So, I hope this helps make every Ubuntu user that much happier with Android.

Check back soon to see updates on my favorite Android Apps, Linux tips, and general Tech stuff.

Later,

     SteveO