martedì 1 maggio 2012

Ubuntu 12.04 on BeagleBoard xM

I just installed Ubuntu 12.04 LTS "Precise Pangolin" on my BeagleBoard xM. The installation was just flawless (and I mean it: flawless). After a few minutes, in the first boot, I am now composing this page online using Firefox browser (and a number of open tabs) while in background I have a number of other windows and tasks. Installing Ubuntu was never that simple.


Yes, it is not as snappier as my gorgeous multigigahertz-multigigabytes notebook (this is also due to the class 4 microSD card I popped in) but is somewhat usable.


First, I fetched on cdimage.ubuntu.com/releases/ the "omap" image (not "omap4") and uncompressed it on an 8Gb microSD card (a 4Gb one will leave some 2Gb free space; I just happened to have a spare 8Gb one).

Then I attached my Samsung 21" 1440x900 display on the DVI port, the ethernet cable going to my Internet connection, and a Logitech wireless keyboard+mouse combo. Then I attached the 5V cable and in a few seconds... ecco qua! the Ubuntu booting display:


I am now upgrading/installing some stuff (duh, 930Mb download ongoing... LyX and QT4 are quite heavy) while writing this page. Wonderful. An Ubuntu machine sporting Firefox and the usual stuff... totally silent and with absolutely no moving parts.

19 commenti:

  1. No, at first you cannot install POVray.

    No, at first boot the audio driver is "dummy" only (no sound output).

    No, I didn't need to use the RS232 console port: it just went on flawless.

    Yes, I used an HDMI-to-DVI cable to connect to my old Samsung DVI monitor.

    Yes, at first boot the screen resolution is set up to 1280x720.

    Yes, it was easy because I plugged in a keyboard and mouse (Logitech wireless using a single USB port for both: it was silently and safely recognized), and the DVI display (using an HDMI-to-DVI cable adapter).

    Yes, I also plugged a 500+Gb USB disk but, hey, I want this rig working 24h near my bed, and I don't want to hear those "bzzzzzz" every night... :-)

    RispondiElimina
  2. Yes, you may configure for a mini boot setup from microSD and then mount the sb disk. But this is useful only if you need lots of gigabytes. An 8Gb microSD will appear way too big for your personal data... if you place all of your multimedia stuff in some other disk.

    Yes, the stock kernel shows from time to time some errors in the dmesg output, something like:

    [ 2731.960449] smsc95xx 1-2.1:1.0: eth0: kevent 2 may have been dropped

    and even:

    [10149.336944] warn_alloc_failed: 96 callbacks suppressed
    [10149.336975] swapper: page allocation failure: order:3, mode:0x4020
    [10149.337005] [c0019790] (unwind_backtrace+0x0/0xf8) from [c00c24b0] (warn_alloc_failed+0xc8/0x108)

    I guess these will be fixed in some later kernel release. Both are related to the ethernet+USB chip (the SMSC one) driver.

    RispondiElimina
  3. Yes, I love Ubuntu because it lets me avoid lots of details. If you love the command-line and want to configure using a text-editor, go for Angstrom Linux or Arch Linux ARM.

    No, when you use the stock Linux kernel (before upgrading Ubuntu), the command cat /proc/cpuinfo does not show the current processor speed.

    Yes, the /sys/class/gpio tree is there, and the /sys/kernel/debug/omap_mux as well: you can play with GPIO, serial, I2C, etc, evemand-lin. Remember that the BeagleBoard xM has 1.8V outputs: don't plug in 3V or 5V stuff without using level converters.

    RispondiElimina
  4. Yes, by default Ubuntu does not open any TCP port (you cannot enter using ssh if you don't install the "ssh" multipackage).

    Yes, Ubuntu 12.04 sports Firefox 11, but at the first update I found the version 12. And yes, Firefox is a memory hogger: currently this one uses more than 500Mb "virtual+total" memory, 100Mb in RAM. Try to use the epiphany-browser if you don't need all those whistles and bells.

    No, the Adobe Flash Plugin is not available for the BeagleBoard. Firefox will allow you to watch a good portion of Youtube videos anyway.

    Yes, I even installed the ttf-xfree86-nonfree package with those stupid Micro$oft fonts.

    Yes, I even installed gcc-avr and avrdude, I plan to do MSP430 Launchpad development using the BeagleBoard xM as host computer.

    And I installed also cheese because I want to try my webcam as well...

    RispondiElimina
  5. Yes, a class 4 memory card is way slower than a class 10. But, believe me, you can't rely on the "class" label on anything that has a "Made in China" label.

    Thinking about people reading their httpd.log and asking themselves: "this guy was browsing internet with... Firefox on BeagleBoard!!??!?" #LOL


    Oops. Ubuntu 12.04 LTS sports three versions of Ruby (ouch!):
    - Ruby 1.8 for compatibility reasons
    - Ruby 1.9.1 (actually updated to 1.9.2), "new generation"
    - Ruby 1.9.3 (only the base package, no "gems", no development libraries), "bleeding edge".

    And yes, I installed all of them.

    RispondiElimina
  6. Yes, it will assign a random MAC-address (ethernet medium access control, the 6-byte identifier) at every boot. You won't notice any difference if you don't need fixed IP addresses.

    RispondiElimina
  7. Yes, by default one of the user LEDs will be "on" when the microSD card is busy reading/writing (sort of an "disk activity" indicator).

    Yes, I installed the cpu/network applet (apt-get install indicator-multiload) and placed it in the startup applications.

    If you use "show seconds" in the clock applet, it will suck some extra CPU power. This is because the Ubuntu/Gnome/Unity setup requires an OpenGL-accelerated graphics card.

    RispondiElimina
  8. Well, is that Z88DK compiler available? Let's see if it is available:

    apt-cache search z88dk

    (list of all z88dk related packages follows...)

    And now, let's install it:

    sudo apt-get install z88dk

    (download and install of all required packages for "z88dk" target).

    RispondiElimina
  9. The Midori browser appears to be less memory-hungry than Firefox. And works better with smaller-resolutions screens. Give it a try!

    sudo apt-get install midori

    RispondiElimina
  10. Just wondering if you managed to get the xserver-xorg-video-omap3 working with xvideo going, I have been trying with no luck

    RispondiElimina
  11. After full update (which included a 3.2.0-p24 kernel) I cannot yet get audio working. The Ubuntu 12.04 interface only shows a "Dummy" driver. Even requesting the snd-audio-omap driver in the /etc/modules, only the timer and sequencer device appear.

    On Ubuntu/Beagleboard my "mplayer" shows FLV and AVI videos (currently without sound). The screen uses "framebuffer", so I don't think you'll get xvideo.

    Let's wait for next update patches...

    RispondiElimina
  12. I just want to remark that for performance it is most important to switch to Gnome Classic.

    RispondiElimina
  13. la beagleboard ha tracciato il solco, ora ci sono queste "supposte" (indirizzate a microsoft) che stanno seguendo la strada :D

    http://www.netbooknews.it/tag/mini-pc/

    RispondiElimina
  14. I am trying to accomplish the same task with not luck. Did you have to create a uEnv.txt on the boot partition?

    RispondiElimina
  15. The Ubuntu installation has its own automatic partition resizing and its own uEnv.txt (yes, an uEnv.txt must be present in the boot partition).

    RispondiElimina
  16. Ciao Urgentissimo, ho un pò di domande.
    1.La versione di ubuntu da scaricare è :
    " 23-Apr-2012 14:07 495M Preinstalled desktop image for Texas Instruments OMAP3 (Hard-Float) computers (preinstalled SD Card image)" che si trova in questo link?--> http://cdimage.ubuntu.com/releases/12.04.2/release/
    2.Devo solo scompattarla sulla micro sd e infilarla nella BB..parte in automatico il boot?

    grazie

    RispondiElimina
  17. Esatto, l'installazione della 12.04 LTS è davvero semplicissima. Da Linux si fa in un solo comando: da root usare:
    zcat immaginecompattata.gz > /dev/sdb

    (dove al posto di "sdb" si mette il device della microSD, che ovviamente in quel momento non doveva essere "montato").

    Dopodiché si avvia sulla Beagleboard xM e la si lascia lavorare un quarto d'ora, che allarga le partizioni, fa il reboot, completa l'installazione.

    L'ideale è avere la xM collegata a internet via cavetto ethernet, così durante l'installazione fa anche gli aggiornamenti.

    Oppure si può chiedere manualmente, sempre da root:
    apt-get update && apt-get upgrade && apt-get dist-upgrade && apt-get autoremove

    Infatti subito dopo l'installazione e gli aggiornamenti, ora la release è stata aggiornata alla 12.04.2 LTS (long term support).


    I problemi, almeno fino a questo momento, sono solo tre:

    1) niente output sonoro, perché il kernel Ubuntu non ha ancora il driver audio patchato (ha solo il driver "dummy", cioè vuoto); penso che mettendo un kernel abbastanza recente (Linux 3.8, per esempio) il problema sia risolto

    2) la ethernet cambia, ad ogni reboot (e persino ad ogni reload del driver: anche questo è un problema risolto dai kernel Linux più recenti) il mac-address della ethernet, per cui non puoi configurare un indirizzo IP fisso dal network manager ma solo il DHCP; da parte mia, ho usato il DHCP e poi ho messo nell'rc.local un IP fisso secondario dopo un certo lasso di tempo.
    (sleep 120 ; ifconfig eth0:1 192.168.1.99) &

    3) la risoluzione video va decisa prima del boot, modificando l'uEnv.txt; funziona tranquillamente anche a risoluzione full-HD 1920x1080, ma il default è 1280. Attenzione a non togliere il cavetto video dalla board mentre la board è accesa, perché non ci sono circuiterie di protezione e quindi rischi di friggere la sezione video. Il cavetto HDMI (oppure come il mio, da HDMI a DVI, poiché il mio monitor è DVI) va messo e tolto solo quando la board è spenta e non alimentata.


    Per il resto ho installato una montagna di roba che uso anche sul PC Ubuntu: a parte le cose strettamente "x86" (come ad esempio Virtualbox e Wine), praticamente ho sulla xM esattamente tutto quello che uso sul PC (occupando più della metà di una microSD da 8 giga).

    La velocità non è supersonica ma è a causa della microSD che uso, che è una "classe 4". Vedo su Amazon che una Sandisk Extreme Pro da 16Gb costa quanto una Sandisk Mobile Ultra 64Gb; entrambe vengono classificate come "classe 10", ma notoriamente la Extreme Pro è più veloce (si fa presto a dire "classe 10" sottintendendo "solo per grossi block transfer").

    Di mettere un hard disk USB non se ne parla proprio perché il vantaggio assoluto delle board come la xM è che sono totalmente silenziose (niente ventole, niente dischi rotanti).

    RispondiElimina
  18. Ciao Urgentissimo! Potresti dirmi dove si trova il file UEnv.txt?e come si modifica? Lo devo modificare prima del primo boot oppure anche dopo?
    ho uno smart tv (da 40 pollici) che mi dice di cambiare la risoluzione del dispositivo esterno

    Grazie

    RispondiElimina
  19. Volevo dire che il modo video va impostato "prima" di avviare Ubuntu poiché, una volta partito il kernel Linux, il modo video non si può più cambiare da software fino al successivo riavvio.

    La microSD card contiene due partizioni: una in formato FAT/MSDOS di pochi megabyte (che contiene i vari files necessari per il boot: MLO, uboot, uimage, uEnv.txt) e una in formato Linux che occupa tutto il resto della memorycard e contiene il filesystem completo.

    Il file uEnv.txt si trova nella prima partizione. Per modificarlo si può mettere la microSD in un lettore di memorycard sul PC e modificarla da lì con un editor qualsiasi.

    Oppure si può modificare direttamente dalla Beagleboard "montandola" su una directory. Entrati nel "terminale" dell'Ubuntu sulla Beagleboard (va bene anche via ssh) si può fare così:

    sudo mount /dev/mmcblk0p1 /mnt
    sudo vi /mnt/uEnv.txt
    sudo umount /mnt


    Nel file uEnv.txt andrebbe messa (non commentata dal carattere '#') una riga che dica il modo video sul connettore HDMI/DVI, per esempio una delle seguenti:

    dvimode=800x600MR-16@60
    dvimode=1280x720MR-16@60
    dvimode=1440x900MR-16@60

    Rinvio a Google per ulteriori chiarimenti; per esempio a questa discussione.

    RispondiElimina