terça-feira, 16 de agosto de 2011

Contribute code to an Ubuntu defect with Launchpad and bzr in the RIGHT way

I am writing this post because I had to read some manuals and (wrongly) send a patch email to a mailing list to learn how to actually be able to contribute with code to an Ubuntu package. If you need detailed information, please google some official documentation. But if you just want to start coding, this is your place, here you'll find the cake recipe to do it.
  1. Sign up to a Launchpad account.
    1. The only really needed information is your username and your ssh key
  2. Choose a project. Ensemble, for example.
  3. Download the source code:
    1. mkdir ensemble
    2. cd ensemble
    3. bzr init
    4. bzr branch lp:ensemble master
    5. bzr branch master bug-whatever
    6. cd bug-whatever
    7. CODE! Those bugs won't get fixed itself!
    8. bzr commit #goto step 6, if needed
    9. bzr push
  4. Make your branch public
  5. Make a merge proposal
  6. Done!
Now go for it!

[update] another interesting documentation shared by rsalveti today: Ubuntu Packaging Guide

terça-feira, 9 de agosto de 2011

Enjoy old SNES games on your Xoom using PS3 controller

(image from eu, android)

Yes, that exactly what you read. Now you can play SNES games on your Motorola Xoom using your PS3 controller over bluetooth. Also, this tutorial is an adaptation from an article at Eu, Android and it's intended to be used on Ubuntu only, if you need to use the other OS, please check the original. The Linux specific information is from a cached ubuntu wiki, so I'll copy & paste the relevant part here in case it expire in the future. Right, so cut the crap and let's play! :-)


Needless to say, you must have proper root access on your device - details for brazilians here.

  1. Install Sixaxis Compatibility Checker, open the application, give root permissions and then a popup message will be shown telling you if your device is supported or not (hopefully yes).

  2. Install required libs:
    $ sudo apt-get install libusb-dev libusb-0.1-4

  3. Download sixpair.c (original also hosted at the ubuntu wiki, I did a copy on my github)

  4. Compile it:
    $ gcc -o sixpair sixpair.c -lusb

    Before running sixpair, you'll need the bluetooth mac addr of your Xoom. The easy way to get it is installing Sixaxis Controller - don't worry, you'll need the app anyway to use the controller. The app will display a message "Local Bluetooth Adderss" with the bluetooth mac addr you'll need.

  5. Run sixpair with the Motorola Xoom bluetooth mac addrs you just got as a parameter:
    $ ./sixpair 41:f4:89:6d:41:73

  6. Open the Sixaxis Controller and follow the onscreen instructions - important note: You'll might need to reboot your Xoom to make it work (I had to)
 NOW I WANNA PLAY!
easy... almost there

Install a neat SNES emulator, I choosed Snes9x EX. Now you have to configure your controller to map the keys the emulator uses: Go to Sixaxis Controller -> Menu -> Preferences -> Input Mapping -> 1st Controller mappings. Since I am using Snes9x EX, I set my mapping like this:
  • square: A
  • triangle: S
  • circle: X
  • cross: Z
  • left: Q
  • right: W
  • select: SPACE
  • start: ENTER
  • power: HOME
This way, for example, Snes9x EX will understand that when you press square you're actually pressing A which means the Y button on a normal SNES controller. Yes, I know, confusing as hell, but works.

Now go and have fun :-D

domingo, 15 de maio de 2011

Xoom Brasileiro Vivo 3G atualizado (sem querer) pro Android 3.1


en_US friends: Gonna write this post in pt_BR since this weird update only regards to brazilian devices. But if even you even though have questions, post it and I'll be glad to help :)

Já adianto que o procedimento que vou descrever aqui VIOLA SUA GARANTIA E DESABILITA A FUNÇÃO 3G, esse disclaimer é sempre o mesmo, mas não custa falar pra tirar o meu da reta :)

[obs: Desabilitar o 3G, pra mim, não é la grande problema já que eu não tenho plano de dados só pro tablet e uso majoritariamente em casa. Se essa dinâmica se aplica a você, e se você gosta de se meter a besta de atualizar seus devices, então siga em frente]


Poise, consegui a façanha bizarra de atualizar meu Motorola Xoom brasileiro sem querer. Certo, certo, a idéia era sim rootear e atualizar pro 3.1, mas eu só consegui isso depois de flashar todos os boot[root].img que encontrei. Só depois de quase brickar (e me cagar nas calças) eu decidi reflashar as imagens originais e FÃ: Descubro que a Motorola ainda não liberou as imagens pro modelo MZ605, o 3G brasileiro. Só me restou flashar a imagem do MZ604 (que é wifi only e por isso o disclaimer) e qual a surpresa? No dia seguinte tinha atualização OTA disponível pra mim! Yay! [obs: No site da Motorola tem sim outras imagens, com suporte a 3G inclusive, mas só as imagens do modelo MZ604 bootaram]

[UPDATE 16/maio] Só pra constar, para flashar uma imagem no Motorola Xoom você vai precisar de M$ Windows e seus Motorola drivers, além do Android SDK (para usar o fastboot). O procedimento para de fato flashar estão no próprio site da Motorola.

Mas no fundo no fundo atualizar o tablet era só foguinho de nerd. As atrações legais que a atualização trás (filmes no Market e o Google Music) ainda não estão disponíveis aqui no Brasil ainda.

segunda-feira, 25 de abril de 2011

Using mtpfs as storage device with Motorola Xoom and Ubuntu

Meta info: No, I am certainly not going to make review for this device. For this sort of content you can find tons of information on the web, one better than another. My post would be yet another in this sea of information :-) INSTEAD, let's learn how to mount it as "mass storage device" on Ubuntu Maverick.

(default image for this post :P)


This tutorial is needed because the new Android version (3.0 aka Honeycomb) DOES NOT support mass storage device YET. It uses MTP (Media Transfer Protocol). This is not bad at all! In fact, the transfer rates are pretty faster than in usual mount as mass storage.

The procedure is pretty straightforward, I found a complete guide on XDA developers forum, which I'll describe here in short words:

1) Install mtpfs package on Ubuntu:
otubo@vader ~ $ sudo apt-get install mtpfs

2) Create new rules in udev for the Xoom:
otubo@vader ~ $ cat > /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", SYSFS{idVendor}=="22b8", SYMLINK+="libmtp-%k", MODE="0666"

3) Create the mount point and make it yours:
otubo@vader ~ $ sudo mkdir /media/xoom
otubo@vader ~ $ sudo chown otubo:otubo /media/xoom

4) Configure your /etc/fstab to mount it automatically by adding this line:
mtpfs /media/xoom fuse user,noauto,allow_other 0 0

5) Uncomment the option user_allow_other on the fuse configuration file at /etc/fuse.conf

6) Add yourself to the fuse group.

7) Reboot, plug your Xoom in and click "xoom" on the "Places" menu on your Ubuntu. Simple as that :)

BUT, if you face any problems, like "Transport endpoint is not connected", you may need to reinstall mtpfs from a different version. This sort of error is a bug on mtpfs, it segfaults when trying to mount/access it. So I installed from Natty's repository and everything worked fine :) BUT, if you're reading this post after the Natty's release, you probably won't need to worry about this.

[IMPORTANT UPDATE - May/3/2011]

Later on I figured out that even with Natty's version of the mtpfs I was getting a segfault when trying to mount/access the device. So, I downloaded the source code from the maintainer's page, compiled and now EVERYTHING is working pretty fine. Thank God :) It's important to notice that the segfault is on the mtpfs package and not in libmtpfs (which I also tried to uninstall and install from source). If you need to mess with your system (install from source and not from repository) always try to mess as little as possible :)

[IMPORTANT UPDATE 2 - same day]

I got a segfault AGAIN. Trying to reproduce all the steps I figured out that I had to REBOOT my Motorola Xoom to make it work with the same setup. Looking forward to have a CyanogenMod ROM for my device. Sigh. :-(