Saturday, 1 September 2012

Debian on Pandaboard: Graphics

NOTE: Not finished !!! 3d doesn't work !!!

What is the choice ?

In relation to PandaBoard, we have a choice of 4 drivers:

---> FBDev (Linux framebuffer) - xserver-xorg-video-fbdev - a generic, hardware independent, primitive driver for Xserver
     * It is very easy to install
     * It is a framebuffer driver :P - no 2d acceleration, no 3d acceleration, no Xorg video (xv) output acceleration, etc
     * But, it will work, when everything else fails. You may need it initially to have at least GUI, or you may need it when the other two drivers crash.

---> OMAPFB - xf86-video-omapfb - open-source Xorg driver for OMAP boards, which uses DSS (display sub-system);a=summary
     * It is better than fbdev, as it is optimized for OMAP boards, specifically for DSS
     * It is a framebuffer driver; with support for overlays, XV video output, etc; but it doesn't provide 2d or 3d acceleration
     * It is open-source, so it shouldn't be too hard to install

---> x86-video-omap - open-source Xorg driver for OMAP boards, but which uses closed-source submodule for EXA acceleration.
     * It requires omapdrm support in kernel and (as I understood) SGX binaries.

---> PVR OMAP4 - pvr-omap4 - closed source driver for OMAP4 SGX GPU, which has the best performance and provides all the features
     * It is what we want the most - overlays, XV, GLES, GLES2, EGL, etc
     * It is closed source + depends on particular kernel version + depends on Xorg ABI major version + depends on armel / armhf arch. Thus, it can be a pain to install this driver. It will be ... for Debian

fbdev driver - xserver-xorg-video-fbdev

To install this driver, simply do:
sudo apt-get install xserver-xorg-video-fbdev
or just install your desktop environment straight away, e.g. LXDE
sudo apt-get install lxde
That's all. You have your driver. No need to configure anything. The default resolution I got on my HDMI TV was 640 x 480.

omapfb driver - xf86-video-omapfb

(This is not complete yet.)
Getting xf86-video-ompafb driver to work shouldn't be too hard (in theory), however the driver is old now and is no longer updated. Newest kernels seem to cause issues for this driver.
The driver can be installed as a package or built from source:

a) Installing via apt:
Two packages are provided:
--- xserver-xorg-video-omap3, which was built with -mfpu=neon flag and is thus optimized for NEON extension (which we have - gives performance boost)
--- xserver-xorg-video-omapfb, which is the same as -omap3, but is not optimized for NEON
To install the driver, simply run:
sudo apt-get install xserver-xorg-video-omap3
or, if you want the one without NEON optimizations:
sudo apt-get install xserver-xorg-video-omapfb
and set up the Xorg (will be described further).

b) Building and installing from source:
0) Install all the necessary tools and developmental packages:
sudo apt-get install build-essential autoconf libtool gettext xutils-dev x11proto-render-dev xorg-dev
(Some of them you might already have.)
1) Clone any of the following git repos:
(They give same results anyway)
git clone
git clone git://
2) Configure the driver:
cd xf86-video-omapfb
./configure --prefix=/usr --with-xorg-module-dir=/usr/lib/xorg/modules --enable-neon CFLAGS="-O2 -mtune=cortex-a9 -mfpu=neon"
3) Check makefiles (in xf86-video-omapfb and xf86-video-omapfb/src dirs) for CFLAGS variable, which should have "-mfpu=neon" flag. If this flag is missing, add it. Otherwise, the build will fail.
4) Compile and install the driver:
sudo make install
5) Configure Xorg

Configuring Xorg for xf86-video-omapfb:
We will create new configuration file in /usr/share/X11/xorg.conf.d directory. I have looked at Xorg configuration file for pvr-omap4 drivers, so I named the file "99-omapfb.conf" (you can give it any other name). So:
sudo nano /usr/share/X11/xorg.conf.d/99-omapfb.conf
and add the following configuration (true for HDMI certainly), or something similar:
Section "Device"
    Identifier    "OMAPFB Video Device"
    Driver        "omapfb"
    Option        "fb"    "/dev/fb0"

Section "Monitor"
    Identifier "hdmi"

Section "Screen"
    Identifier    "Screen0"
    Monitor        "hdmi"
    Device        "OMAPFB Video Device"
    DefaultDepth     16
Save and exit. Reboot:
sudo reboot
Xorg should start.

Current result:
It did start. Resolution is still the same though - 640x480. XRandr doesn't give any choices. XVideo is still useless - "No adaptors present." The following is my Xorg.0.log output, in relation to omapfb:
anton@arm:~$ cat /var/log/Xorg.0.log | grep omapfb
[    20.313] Kernel command line: console=ttyO2,115200n8 console=tty0 vram=16MB omapfb.mode=hdmi:1280x720MR-16@60 omapdss.def_disp=hdmi root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait fixrtc buddy= buddy2=
[    20.427] (II) LoadModule: "omapfb"
[    20.432] (II) Loading /usr/lib/xorg/modules/drivers/
[    20.436] (II) Module omapfb: vendor="X.Org Foundation"
[    20.437] (II) omapfb: Driver for OMAP framebuffer (omapfb) and external LCD controllers:
[    20.437] (WW) Error opening /sys/devices/platform/omapfb/ctrl/name: No such file or directory
[    20.438] (II) omapfb(0): Base plane capabilities:
[    20.438] (II) omapfb(0): Base plane supports the following image formats:
[    20.438] (II) omapfb(0): VideoRAM: 600KiB (SDRAM)
[    20.438] (II) omapfb(0): Creating default Display subsection in Screen section
[    20.438] (--) omapfb(0): Depth 16, (==) framebuffer bpp 16
[    20.438] (==) omapfb(0): RGB weight 565
[    20.438] (==) omapfb(0): Default visual is TrueColor
[    20.438] (II) omapfb(0): Detecting outputs
[    20.438] (II) omapfb(0): Output dvi using monitor section hdmi
[    20.438] (II) omapfb(0): Output hdmi using monitor section hdmi
[    20.439] (II) omapfb(0): overlayPoolInit: Found 3 framebuffers, 4 overlays and 3 managers
[    20.440] (II) omapfb(0): Printing probed modes for output dvi
[    20.440] (II) omapfb(0): Modeline "640x480"x59.5   23.50  640 688 720 800  480 483 487 494 (29.4 kHz P)
[    20.440] (II) omapfb(0): Printing probed modes for output hdmi
[    20.440] (II) omapfb(0): Modeline "640x480"x60.1   25.18  640 656 688 800  480 491 511 524 (31.5 kHz P)
[    20.440] (II) omapfb(0): Output dvi connected
[    20.440] (II) omapfb(0): Output hdmi connected
[    20.440] (II) omapfb(0): Using exact sizes for initial modes
[    20.440] (II) omapfb(0): Output dvi using initial mode 640x480
[    20.440] (II) omapfb(0): Output hdmi using initial mode 640x480
[    20.440] (II) omapfb(0): Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.
[    20.440] (II) omapfb(0): XRandR extension initialized
[    20.440] (--) omapfb(0): Virtual size is 640x480 (pitch 640)
[    20.440] (**) omapfb(0):  Mode "640x480": 25.2 MHz, 31.5 kHz, 60.1 Hz
[    20.440] (II) omapfb(0): Modeline "640x480"x60.1   25.18  640 656 688 800  480 491 511 524 (31.5 kHz P)
[    20.440] (==) omapfb(0): DPI set to (96, 96)
[    20.458] (EE) omapfb(0): FBIOBLANK: Invalid argument
[    20.458] (==) omapfb(0): DPMS enabled
[    20.458] (II) omapfb(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[    20.640] (II) omapfb(0): Setting screen physical size to 169 x 127
[    20.922] (WW) omapfb(0): overlayPoolApplyConnections: Disconnecting overlay 0
[    20.922] (WW) omapfb(0): overlayPoolApplyConnections: Connecting 0 -> 0 -> 1
I played a lot with options in Xorg configurations. I will try to build custom kernel and test this driver. Also I will try omapfb optimized mplayer. This driver should be useful, at least better than fbdev.

omap driver - xf86-video-omap

Will test later ...

pvr-omap4 driver

The problem:
Debian Wheezy currently provides Xserver version, which is not supported and ,most likely, will not be supported by OMAP PPA team:!topic/pandaboard/BYFaLYzCniQ
(Thanks to ndec for letting me know.)
So, what does it mean ? Well, the pvr-omap4 driver depends on Xorg server version. Ubuntu OMAP ppa trunk provides drivers for Xserver version 13 (for Ubuntu 12.10 ), which is not yet out. Ubuntu OMAP ppa release provides drivers for Xserver version 11 (for Ubuntu 12.04), which is older than what we have. If you try to install these drivers without upgrading / downgrading your Xorg, the Xorg will crash and you will get:
"module ABI major version (11) doesn't match the server's version (12)"

"module ABI major version (13) doesn't match the server's version (12)"
Thus we have only 2 choices in this situation:
---- a) Downgrade Xorg from 1.12.xx to 1.11.xx and install drivers for Xserver version 11
---- b) Wait when Xorg 1.13.xx becomes available, upgrade Xorg from 1.12.xx to 1.13.xx and install the drivers for Xserver version 13
Upgrade is much safer than downgrade, usually. But I hate to wait.

Option A - Xorg downgrade, using the drivers for Xserver ABI 11:

1) Build and install Ubuntu kernel, if you haven't done it already:
2) Uninstall Xorg (1.12.xx), if you have it:
sudo apt-get remove xserver-xorg-core xserver-xephyr
(don't worry about other packages, which will be removed).
3) Download specific .debs, which will give us Xserver ABI 11, keyboard / mouse support and fbdev:
(Source page: )
4) In the same directory (where your downloaded packages are), run the following to install the packages:
sudo dpkg -i xserver-xephyr_1.11.4-1_armhf.deb xserver-common_1.11.4-1_all.deb xserver-xorg-core_1.11.4-1_armhf.deb xserver-xorg-input-evdev_2.6.0-2_armhf.deb xserver-xorg-video-fbdev_0.4.2-4_armhf.deb
OR run this, if you are lazy and have nothing else in that directory:
sudo dpkg -i *
5) If you have got NO errors, reboot to test your downgraded Xserver:
sudo reboot
 and verify that you mouse / keyboard still work.
(If you have errors during installation, remove the problematic packages, reinstall the working Xserver and try again. If you fail to install fbdev - you will have no video, if you fail to install evdev - your keyboard + mouse will be unresponsive.)

Building and installing the omapdrm_pvr module (from pvr-omap4-dkms source):

0) Install dos2unix (needed for building), if you don't have it:
sudo apt-get install dos2unix
1) Download the right version of pvr-omap4-dkms:
    a) For Xorg 1.11.xx
2) Extract the source:
tar xzf pvr-omap4-dkms_$DKMS.orig.tar.gz
3) Set some variables (DISCIMAGE variable is probably useless...):
export KERNELDIR=$HOME/ubuntu-precise
export DISCIMAGE=/
This, of course, assumes that your kernel source is ubuntu-precise folder in your home directory. Change the value of the variable if it is not the case. (The module needs kernel sources to be built.)
4) Cd into driver directory and build the module:
cd git-import-orig/sgx/eurasiacon/build/linux2/omap4430_linux
5) Install the module (uname -r extracts the release number of the kernel - it is needed to make a correct directory for modules):
sudo mkdir /lib/modules/$KERNELRELEASE
sudo mkdir /lib/modules/$KERNELRELEASE/kernel
sudo mkdir /lib/modules/$KERNELRELEASE/kernel/extra
sudo cp $HOME/git-import-orig/sgx/eurasiacon/binary2_omap4430_linux_release/target/omapdrm_pvr.ko /lib/modules/$KERNELRELEASE/kernel/extra

Loading omapdrm_pvr module:

Now that we have installed the module, we need to load it. To check that your module is not loaded indeed, run:
and you will get nothing, i.e. this:
Module                  Size  Used by
which means that no modules are currently loaded.

If you want to check that your module can be loaded, run the following:
sudo insmod /lib/modules/$KERNELRELEASE/kernel/extra/omapdrm_pvr.ko
and you should get this:
Module                  Size  Used by
omapdrm_pvr           157683  0
which means that the module is loadable. But this is not exactly what we want ... We need auto-loading, at boot time

To load the omapdrm_pvr module at boot, proceed as follows:
0) Gain root privileges and set a variable
1) Create modules.builtin and modules.order files in your kernel modules directory
touch /lib/modules/$KERNELRELEASE/modules.builtin
touch /lib/modules/$KERNELRELEASE/modules.order
2) Add "kernel/extra/omapdrm_pvr.ko" as the contents for both of them
echo "kernel/extra/omapdrm_pvr.ko" > /lib/modules/$KERNELRELEASE/modules.builtin
echo "kernel/extra/omapdrm_pvr.ko" > /lib/modules/$KERNELRELEASE/modules.order
3) Run depmod (this will create all the necessary files for automatic loading of the module)
depmod -a
4) Edit /etc/modules file, which will load the module for us at boot
nano /etc/modules
and add the following line
to the end, save and exit.
5) Reboot your system to test the module
and at the next boot, use lsmod again. You should have the module loaded at each boot.

Installing pvr-omap4 libraries, binaries and configuration files:

1) Download, extract the correct version of the pvr-omap4 drivers to your home directory, gain root privileges and set a variable:
    a) For Xorg 1.11.xx:

tar xzf pvr-omap4_1.
2) Copy all the necessary files (including headers, but without debug data and documents):
cp -f usr/lib/$PVRVERS usr/lib/$PVRVERS usr/lib/ usr/lib/$PVRVERS usr/lib/$PVRVERS usr/lib/$PVRVERS usr/lib/$PVRVERS usr/lib/$PVRVERS usr/lib/$PVRVERS usr/lib/$PVRVERS usr/lib/$PVRVERS usr/lib/$PVRVERS usr/lib/$PVRVERS usr/lib/$PVRVERS /usr/lib
cp -f usr/lib/pkgconfig/* /usr/lib/pkgconfig
cp -f usr/lib/xorg/modules/drivers/ /usr/lib/xorg/modules/drivers
cp -f usr/share/X11/xorg.conf.d/99-pvr.conf.panda /usr/share/X11/xorg.conf.d
cp -r -f usr/share/sgx-lib /usr/share
cp -f usr/bin/* /usr/bin
cp -r -f usr/include/KHR /usr/include
cp -r -f usr/include/GLES /usr/include
cp -r -f usr/include/VG /usr/include
cp -r -f usr/include/EGL /usr/include
cp -r -f usr/include/GLES2 /usr/include
3) Make all the necessary symbolic links:
ln -s /usr/lib/$PVRVERS /usr/lib/
ln -s /usr/lib/$PVRVERS /usr/lib/
ln -s /usr/lib/$PVRVERS /usr/lib/
ln -s /usr/lib/$PVRVERS /usr/lib/
ln -s /usr/lib/$PVRVERS /usr/lib/
ln -s /usr/lib/$PVRVERS /usr/lib/
ln -s /usr/lib/ /usr/lib/
ln -s /usr/lib/$PVRVERS /usr/lib/
ln -s /usr/lib/ /usr/lib/
ln -s /usr/lib/$PVRVERS /usr/lib/
ln -s /usr/lib/ /usr/lib/
ln -s /usr/lib/$PVRVERS /usr/lib/
ln -s /usr/lib/$PVRVERS /usr/lib/
ln -s /usr/lib/$PVRVERS /usr/lib/
ln -s /usr/lib/$PVRVERS /usr/lib/
ln -s /usr/lib/$PVRVERS /usr/lib/
ln -s /usr/lib/ /usr/lib/
ln -s /usr/lib/$PVRVERS /usr/lib/
 4) Warning: The next command will apply changes to your Xorg configuration ! Up to this point your Xorg was untouched. Now, you have a potential to crash your Xorg at the next boot ! You have been warned.
Run this to use PVR driver at the next boot:
mv /usr/share/X11/xorg.conf.d/99-pvr.conf.panda /usr/share/X11/xorg.conf.d/99-pvr.conf
5) Reboot your system:

And, this is as far as I can get. What are the results you ask ? Well:
- Xorg starts
- From the logs, I can state that pvr driver is being used indeed
- Mouse pointer freezes from time to time and I can assume that there is a massive SD card I/O activity
- Xrandr works and I can switch between resolutions
- Rendering doesn't work !!! All tests fail. Xeglinfo fails.
- Details are here:!topic/pandaboard/FLegeDRqzzQ

So, pvr driver works, but 3d doesn't. I would love to finish the guide and get the 3d to work, but I run out of time (I am a dental student - my term starts from the 3d of Sept).

Thus, I would be very happy if someone could finish this thing off and get the rendering to work :) But please, let me know !

Additional details:
- All versions of sources have been used as stated in the guide
- libdrm was installed (most likely when I have installed lxde)
- libdri was not installed (well, apt-get stated that it could not locate the package: libdr, libdri2, etc - but if DRM is installed, DRI must also be installed, or, at least, installable ???)
- I tried to install libdrm from source from OMAP PPA Release. Succeeded. But no effect - no 3d :(
- Tried to apply OMAP patch to libdrm (for OMAP support - but I don't think it is needed - armin76 didn't tell anything about it ?). Failed, couldn't successfully run autoconf and configure (i have installed autoconf beforehand ).
- Tried to install libdri2 from source from OMAP PPA Release. Asked for xorg-macros. Tried to install it from source (1.10, debian unstable) - failed. Configure failed.
- Made extensive changes to kernel configuration - changed all things that are related / could be related to GPU, DRM, Power Saving, DMA, etc to be the same as in Ubuntu configuration - didn't help in any way - same results.
- Used modprobe - no effect
- Installed Modules.symvers from built pvr-omap4-dkms - no effect ...
- Tried passing BUILD=debug for pvr-omap4-dkms. Failed to compile ...
- Tried BUILD=timing ... Succeeded, but no effect ...
- Tried passing W=1 for pvr-omap4-dkms - lots of warning ! No effect
- Tried to install kernel with modules (Ubuntu configuration, modules as modules). Failed ! make modules install gives me errors and doesn't work no matter what I do ! This is why I make them all built-in (if I can) ....
- Tried 3.2.0-1412.16 kernel ... Changed some commands to download, extract ... The procedure didn't work. Armin76's config didn't work after using sed commands. And I can't install kernel with modules ...
- Tried 3.2.0-1412.16 kernel with omap4_defconfig + all odules built-in ... Failed - didn't boot successfully.
- Tried the newest 3.4 kernel (from OMAP release ppa) with omap4plus_defconfig + all modules built-in. Failed again - didn't boot successfully
- I run out of ideas :(

Monday, 28 May 2012

Debian on Pandaboard: Building Ubuntu kernel

Setting up basic build environment:

There is a nice package, called "build-essential", by installing which you should have all the tools needed to compile and packed applications/kernels from their respective sources:
sudo apt-get install build-essential libncurses5-dev
(You would want to have libncurses5-dev - without it, you would be unable to run "menuconfig".)
If that didn't work, use this:
sudo apt-get install gcc g++ make libncurses5-dev

Building your kernel: (with enabled WiFi, Bluetooth, etc)

In this tutorial, we are going to use Ubuntu kernel source. Why ? Because Ubuntu kernels are officially supported by TI devs - we will get all the fixes Ubuntu has and all nice features. But the most important point is: GPU driver binaries are built for specific versions of Ubuntu kernels. (If I am correct, the only binary blobs provided are for Ubuntu and Android. Source.) We want GPU drivers, right ?
There are very nice tutorials provided by armin76 about installing and configuring Gentoo Linux on Pandaboard. ( They had really helped me.
We will use the kernel source of Ubuntu Precise (we obviously want hard float).
(Run everything in this paragraph as a normal user - non-root. Don't use su.)

Step-by-step process: (Skip it, if you just want to build the kernel, without running menuconfig.)

1) Download the kernel source:
wget --no-check-certificate wget --no-check-certificate$KERNELVERSION/+files/linux-ti-omap4_$KERNELVERSION.tar.gz
2) Extract:
tar zxvf linux-ti-omap4_$KERNELVERSION.tar.gz
3) Change to ubuntu-precise directory:
cd ubuntu-precise
4) Download a nice .config, provided again by armin76.
wget -O .config
5) Solve annoying CONFIG_SCSI_WAIT_SCAN=m "damn persistent module" problem (will set it as built-in - will explain why we want this):
sed -i 's/default m/default y/g' drivers/scsi/Kconfig
6) Force the kernel to built no modules (not even that scsi_wait_scan.ko module):
sed -i 's/=m/=y/g' .config
So, why do we need this ? Well, having no modules around makes the installation process hell like easy. More importantly, however, as reported by a number of users, is that you need to have modules built into your kernel or use initrd to have a normal booting procedure. ( - post by Pavol Cupka)
(By the way, the kernel that armin76 provides didn't boot for me on Debian - waited 15 mins - no login, no read/write activity. In fact it happened on Angstrom also. The reason, I think, is that it fails to find a number of modules and stops booting. My usb keyboard + mouse were completely unresponsive. But then it works just fine on Gentoo ... I don't get it.)
7) Edit your kernel configuration (optional):
make menuconfig
(Make sure NOT to disable debug in display section. My picture was a mess after I disabled it.)
8) Build you kernel:
make -j2 ARCH=arm uImage
This will take a while. Find something to do for an hour or so. (Depends on your card speed.) After that you will get your uImage file (this is our new kernel).

Single-step process: (No menuconfig - will just build the kernel.)

Run this:
wget --no-check-certificate$KERNELVERSION/+files/linux-ti-omap4_$KERNELVERSION.tar.gz && tar zxvf linux-ti-omap4_$KERNELVERSION.tar.gz && cd ubuntu-precise && wget -O .config && sed -i 's/default m/default y/g' drivers/scsi/Kconfig && sed -i 's/=m/=y/g' .config && make -j2 ARCH=arm uImage
and you should get your uImage.

Installing your kernel:

1) Make a backup of your boot files to "backup" folder on "boot" volume and clean "boot" volume:
sudo mv -f /boot/uboot/MLO /boot/uboot/u-boot.img /boot/uboot/zImage /boot/uboot/initrd.img /boot/uboot/uEnv.txt /boot/uboot/ /boot/uboot/backup
2) Restore MLO and u-boot.img:
sudo cp -f /boot/uboot/backup/MLO /boot/uboot/backup/u-boot.img /boot/uboot
3) Install your new kernel (make sure you are in ubuntu-precise directory):
sudo cp -f arch/arm/boot/uImage /boot/uboot
4) Just reboot the system:
sudo reboot
NOTE: It could take 2 - 4 minutes before you get to the login screen with the new kernel. During this time, you may or may not have video signal. If you have a signal, you will most likely see only 2 penguins on a black background, with no other output.

My comments about my new kernel:

- Version: 3.2.0-1416.22
- Boot time with this kernel (from cold to login screen): 2 - 4 minutes
- HDMI out: yes, 1080p - default, but can change if you disconnect and then reconnect the cable or change the source from your TV (tested with fbdev video driver). Ony one resolution is available.
- DVI out: not tested
- Bluetooth: not tested
- Wifi: Works
- Ethernet: Not tested, should work
- SGX drivers:  Work, but with issues, more to come ...
- Audio: Not tested
- CPU frequency scaling: Not tested

Thanks to: armin76 for awesome tutorials.

Saturday, 26 May 2012

How to install Debian on Pandaboard + do basic configuration.

Installing Debian - very easy and fast:

EDIT: Updated for the latest version of rootfs. Some minor changes.
(Thanks to Dr. Ace Jeangle for providing those instructions: )
(And thanks to Robert Nelson, for creating and providing ARM hard float Debian rootfs. You can visit his site by following this link: .)

Insert your SD card into a card reader of your host PC and run the commands below on your host system, preferably Ubuntu or Debian. (We are using apt-get here.)


To check the latest rootfs available, visit:
and update the VERSION variable to that of the newest rootfs
sudo apt-get install uboot-mkimage wget pv dosfstools btrfs-tools parted
tar xJf debian-wheezy-minimal-armhf-$VERSION.tar.xz
cd debian-wheezy-minimal-armhf-$VERSION/
sudo ./ --mmc /dev/sdb --uboot panda

Use "panda" for PandaBoard Ax (non-ES). Use "panda_es" for PandaBoard ES.
In my case, the name of my card is "sdc", because I have external USB HDD, which is "sdb". But usually, the card would be "sdb". I use:
sudo ./ --mmc /dev/sdc --uboot panda
You can use the following command to see what is mounted:
df -h
Or you can use:
just after you have plugged-in your SD card.
Take a notice of "sdb" or "sdc". Estimate which is your card.

Another OS is installed on the card:

If your card has already got some OS installed on it, we can remove it using "fdisk":
sudo fdisk /dev/sdc
(Change "sdc" to what you have !!!) NOTE: Use "d" option to delete a partition. Each partition has a number (1, 2, etc). Use option "w" to save your changes. (Otherwise your changes will not be saved.)

Video output:

a) If you want to use DVI video output:
Open file uEnv.txt on "boot" partition of the card:
(for e.g.)
nano /media/boot/uEnv.txt
uncomment the line "defaultdisplay=dvi", uncomment "vram=16MB" (if it is commented), uncomment "dvimode=1280x720MR-16@60" and (if you want) change it to suit your display. Some examples (as I don't use DVI) can be found here, by Dr. Ace Jeangle:

b) If you want to use HDMI video output:
Same as above, except that you leave "dvimode=1280x720MR-16@60" commented in and change "defaultdisplay=dvi" to "defaultdisplay=hdmi".
More to come, when I do a little bit of testing with custom kernel, as with stock kernel, I have stubborn 640x480 60Hz output on my 1080i TV, via HDMI.

Booting process:

Insert your Debian populated SD card into Pandaboard and boot-up the board.
Ok, if your new Debian system is working, on boot you should see the video output being displayed on your monitor or TV. The booting process progresses much faster than on Ubuntu. After a minute or so you should see the login prompt (in Command Line Interface - no GUI).
(From here onwards, all the commands will be executed on our board.)


So, how do I login ? Well, the default user is "debian" and "temppwd" is its password. The root password is "root". (

Important security measures:

1 - Change root password ! (IMPORTANT !!!)
Login as root and run:
then enter and verify your new root password.
2 - Create new user.
Login as root (temporary) OR login as debian and use:
(sudo might not work), then run:
and answer all questions (password, full name, etc).
3 - Add the user to sudoers file. 
(Optional. Will grant the user the ability to use "sudo" command.)
This will open the /etc/sudoers file. (Visudo is made for this ! Don't think about using nano, vim, etc.)
Look for the following line:
root ALL=(ALL) ALL
and add this line just underneath:
user ALL=(ALL) ALL
changing "user" to your username. Save and exit: Ctrl + o, ENTER, Ctrl + x. Now you can use the "sudo" command. (Btw, "sudo" uses user password, not root password.
4 - Change debian password.
Login as debian or (your username) and run:
 sudo passwd debian
and type in + verify your new debian password. (This is strongly advised, as the default debian password is known and public.)

Set-up Internet connection:

Now, to download packages and etc we need to have an Internet connection. For Panda we have 2 options: Ethernet or WiFi - both work in our Debian Linux !
a) Ethernet: Just connect the cable between your router and the board. It should work straight away - no configurations are needed. Reboot is not necessary.
b) WiFi: Here a little bit of work is needed. But it will work: (This site has really helped me:
1 - Run "ifconfig -a" if you want to. We do have our WiFi adapter working though. Its name is: wlan0 (We also have wpasupplicant installed - no need to search or install it.)
2 - Create and edit the following file:
nano /etc/wpa_supplicant.conf 
Type in the following:
                 ssid="TYPE IN THE NAME OF THE ROUTER HERE"
                 psk="TYPE IN ITS KEY/PASSWORD HERE"
Complete the entries. Save and exit: Ctrl + o, ENTER and Ctrl + x .
3 - Run the following command:
wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf -Dwext
Then, when you see its output, hit ENTER.
4 - Run this last command:
dhclient wlan0
and now you should be connected.
5 - Following the next boot, you will be disconnected. To reconnect, you just repeat step 3 and 4.

Before installing anything:

Update your system. This is required, as you will run into problems if you don't do this:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
Depending on how old is your rootfs, this might take few minutes.

Installing Graphical User Interface:

The easiest way is by using the script, provided by Robert Nelson.
(This will give you a working LXDE environment, which I think is the best choice for us.)
cd /boot/uboot/tools/ubuntu
sudo sh
Or you can install LXDE with one command line:
sudo apt-get install lxde
If your choice is XFCE, then do:
sudo apt-get install xfce4
LXDE is the easiest option and is the guaranteed one. XFCE didn't work for me last time. GNOME / KDE would take a lot of time to install and are quite heavy (for fbdev in particular).
Installing any of these desktop environments will also cause installation of Xorg (1.12 currently), as well as xserver-xorg-video-fbdev driver, which we will use initially.

Achieving auto-connection (with Wifi):

We have a number of options here. The following are those, which I have tried:
(Choose option "c" if you want boot-up speed-up, but don't want Ethernet.)

a) Install Wicd client:
sudo apt-get install wicd
and answer one configuration question (which users will run wicd). Run the client, find your router, provide your password (in Advanced Settings), click "Automatically connect to this network" box and that's all ! (I don't know for sure, but in my case I had to reboot to get connection. Works perfectly.)


b) Debian has a rc.local start-up script, which we can edit. Open the /etc/rc.local file:
sudo nano /etc/rc.local
and just add the following commands:
wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf -Dwext
dhclient wlan0
to the end of the script (after all comments), BUT before "exit 0" command. Save and exit. You will be connected each time you boot.


c) This one is the best so far. Edit /etc/network/interfaces file:
sudo nano /etc/network/interfaces
,look for the following:
# WiFi Example
#auto wlan0
#iface wlan0 inet dhcp
#    wpa-ssid "essid"
#    wpa-psk  "password"
,comment out  the last 4 lines quoted here and substitute "essid" with (your router ssid), "password" with (your router password). Now look for:
# The primary network interface
auto eth0
iface eth0 inet dhcp
and comment in the last 2 lines quoted. In the end, the file should look like this:
auto lo
iface lo inet loopback

# The primary network interface
#auto eth0
#iface eth0 inet dhcp
# Example to keep MAC address between reboots
#hwaddress ether DE:AD:BE:EF:CA:FE

# WiFi Example
auto wlan0
iface wlan0 inet dhcp
    wpa-ssid "**********"
    wpa-psk  "**********"
Save and exit. Done.
This actually has a double value for us. 1st - you have a working Wifi, which will be connected at each boot. 2nd - your boot-up time is reduced significantly, as Ethernet is disabled at boot and there is no DHCPDISCOVER loop (which takes about a minute of time). Being in this section means that you don't need Ethernet anyway.

Clock skew and its solution (Important !):

The most annoying problem ... EDIT: Seems to me there are still problems with this, ugh ...
The initial time we have in Debian is .... ugh ... quite far from being accurate - 1st of January, 1970 ! This indicates that the clock was completely reset ... No wonder - Panda, by itself, doesn't have a battery to supply hardware clock.
First, we need to make sure that the timezone is correct. To edit the timezone, we use:
and follow the steps. In the end, you will get:
Therefore TZ='TIMEZONE YOU HAVE' will be used.
with you timezone. This is what we need. For example, I got:
Therefore TZ='Europe/Dublin' will be used.
Now, like stated, we will make this change permanent:
nano .profile
Scroll to the bottom of the file, leave an empty space after the last line and add the timezone line:
Save the file (Ctrl + o, ENTER, Ctrl + x), log out and log in again. Your timezone is set.
Next, we will set the correct time and date. For this task, we will use "date" command:
sudo date -s "Jun 1 20:27:00 2012"
The usage is obvious enough. The "-s" flag is used to set the date. Use first 3 characters of each month.
To see the date, use:
sudo date
Now, we wouldn't be able to maintain the correct time via hardware clock. (Unless you have modded your board.) So, we are going to rely on the Internet to sync the clock. Lets use NTP service.1) Install the package:
sudo apt-get install ntp
2) Edit the configuration file (if you want better accuracy):
sudo nano /etc/ntp.conf
Look for the following section:
server iburst
server iburst
server iburst
server iburst
Replace this section by a relevant section of the NTP server you want to use. For e.g. I live in Ireland - so I want a local NTP pool. I have added:
and saved the file.
Look here about which pools to use and how to add them:
3) Restart the NTP service:
sudo service ntp restart
Or, if the above command gives you a warning, you can use the combination:
sudo service ntp stop
sudo service ntp start
4) Your NTP service should be set up now and should sync the clock from time to time. Now, if you want to test whether it actually works, run:
sudo ntpq -pn
and you should see something like that:

Note the asterisk (*) (you will probably notice it only after reboot). If you have it, it means that this IP address is being currently used to provide the time for syncing the clock. Initially after reboot, you might notice that the time is set wrong again, but it is only temporally. After few minutes, the clock will be synced. That's all in relation to time.
If your desktop clock (clock applet) shows wrong time, run "sudo date" command to update it.
Note: I know, this paragraph might not sound important, but please, don't skip it. The reason being is that a clock skew will be a source of many annoying problems; such as those warnings you get during "tar" extraction, warnings during kernel configuration, potential errors during compiling, loads of other problems... We don't want them, right ?

Some tweaks:

Turn off SWAP:
SWAP is a form of virtual memory, which is:
- Completely useless for Pandaboard, as SD I/O is hellishly slow !!!
So, check if you have it disabled:
free -m
which should give you this line:
Swap:            0          0          0
meaning swap is disabled. This is how it should be.
If it is not disabled, run this to switch it off:
sudo swapoff -a
which should do the job. That's all.

Disable Ethernet at boot (if it is not needed):
(Skip this section, if you have used option "c" in "Achiving auto-connection (with Wifi)" section)
With Ethernet enabled, what you get is a couple of "DHCPDISCOVER...." lines and about 0.5 - 1 minute of wasted time during boot. If you don't use Ethernet, why wasting time because of it ?
To disable it, edit /etc/network/interfaces file:
sudo nano /etc/network/interfaces
and comment in the following:
auto eth0
iface eth0 inet dhcp
so it will look like:
#auto eth0
#iface eth0 inet dhcp
save and exit. Done !

Disable screensaver in LXDE:
Screensaver is useless in our case. It is an extra load for CPU, as we do not have OpenGL drivers (and will probably never have). We would be able to install GLES / GLES2 drivers, but they are most likely not used by screensaver. So, lets disable it.
Open /etc/xdg/lxsession/LXDE/autostart file:
sudo nano /etc/xdg/lxsession/LXDE/autostart
and remove "screensaver" line. Save and exit.

My comments about what I have so far: 

- The system is fast. Certainly much faster than Ubuntu. It boots quicker (edit: at least with original kernel) and is much more responsive.
- EDIT: But SD I/O is still slow :(
- The rootfs partition is Ext4 !
- Both USB keyboard and USB mouse work normally.
- Ethernet is working fine.
- WiFi is working. Firmware is installed.
- HDMI out works. With GUI, I get 640 x 480 picture at 60 Hz on my 720p HDMI TV (with default kernel). Fbdev driver is being used by default. Primitive, I know. But this is only temporary. Later, I will try to install GPU drivers. But first, I need to choose the right version of kernel and install it. (GPU drivers are heavily dependent on the version of the kernel you use.) Of course, you should be able to somehow change you resolution, by modifying your uEnv.txt file. Also, you can install the omapfb driver, which is for OMAP DSS (also uses NEON extension) - it doesn't use SGX though. The omapfb driver will be faster than fbdev driver.
- Sound doesn't work - no soundcard is found. We should be able to solve this ...
- I don't know whether Bluetooth works or not. However, according to some comments on , it should work.
- Obviously no 2d/3d hardware acceleration yet. I will try to install the drivers ...EDIT: 2d/3d in progress ...
- No hardware video decoding yet. This will probably take a lot of time to set up ...
- Edit: Clock skew problem solved. Took a lot of time !
- A lot more to come. I will try to get as much working staff as I can on this awesome board !

Why did I choose Debian in the first place:

1 - Heard it was much faster than Ubuntu.
2 - Debian uses .deb packages, like Ubuntu, and also shares a lot in common with it. Installing packaged drivers should work ... Of course some changes will be needed.
Actually, after I have done a little bit of reading, I understood that: INSTALLING UBUNTU PACKAGES ON DEBIAN IS NOT A GOOD IDEA AND CAN CAUSE A LOT OF PROBLEMS LATER ON. So, I am going to build everything from source.
3 - I just wanted to see what is Debian like ! (I have already tried Ubuntu, Angstrom, YDL and Fedora.)

What's next ?

Lets build Ubuntu kernel ! This way, we would be able to install SGX drivers and hardware decoders/encoders.

Tuesday, 22 May 2012

Installing Ubuntu on Toshiba Satellite L755G

- This is just my method - modify it as you like !

- To quickly install Ubuntu/Lubuntu/Kubuntu/etc on Toshiba Satellite L755G laptop

What do you need (or may need):
- Toshiba Satellite L755G laptop (I know - obvious)
- Ubuntu ISOs (Download links below.)
- Already installed OS + burning software. (My laptop had Windows 7 64-bit pre-installed and had, I think, 3 burning applications.)
- Blank CDs (A USB storage device may be used instead of optical disk, but I have never used such method - not going to explain. )
- Wired or wireless Internet connection is NOT necessary during installation, but is HIGHLY recommended.
- Maybe an hour or 2 of free time ?

Downloading Ubuntu ISOs:
- Ubuntu (the one with Unity desktop environment):
- Lubuntu (LXDE desktop):
- Kubuntu (KDE)
- Xubuntu (XFCE) (Didn't try this. Desktop - LiveCD.)
- Other flavors can be found here:
* I have used LiveCD ISOs. They are very good to show that your PC will actually run Ubuntu. Excellent way to test your Wifi also. The Wireless chip set is supported, by the way.
* Choose 64-bit, as we are using 64-bit AMD processor in our machine and we want to take advantage of 64-bit processing and more than 4 GB of RAM. (Of course, PAE - Physical Address Extension allows you to use up to 64 GB on 32-bit system. It is not the same as running on 64-bit though - .)
* Choose 32-bit only if you have a reason for it. What is the point of missing 64-bit features otherwise ? One reason would be if 64-bit doesn't work for some reason. (Than again you can just switch ISOs.) A good reason is if you want to run some 32-bit applications which are linked to 32-bit libraries. (There are other ways to have 32-bit applications - , but, honestly, this one is the easiest.) I wanted to have at least one 32-bit system to be able to run ePSXe without any problems. (ePSXe depends on some old 32-bit libraries.)
* Download with torrent client when possible

Making LiveCDs:
- Look here:
- We just need to burn the ISO onto a blank CD in a specific way. Easy. One thing to remember though: You are burning the ISO using a special burning software. So, you DO NOT extract the ISO file and you DO NOT burn the ISO directly, like you burn movies.
- Windows 7 should have some burning applications pre-installed. You just need to: insert a blank CD, right-click the ISO and choose the burning application. The application should burn the ISO and verify the disk.
- On Win 7 you can use this guide:

So, how do we start our Ubuntu CD ?
- It is straightforward enough.
1) Boot into your default system (most likely Win 7), if you are not there already.
2) Insert the CD, if it is not inserted already. No need to run anything.
3) Restart - now, pay attention to what you see on the screen.
4) When you see TOSHIBA splash screen - press F12 button quickly. This will open the Boot Menu.
5) Most likely, the first option will be "HDD/SSD". We need the "ODD" (Optical Disk Drive) option. Using up/down keys choose this option and press ENTER:
(This is my Boot Menu. As you can see, I have put "ODD" as the 1st choice - makes more sense. If you use USB storage devices to install OSs - use USB. Later I will show how you can change the boot priority/sequence, i.e. what is booted first. But this is BIOS staff, not Linux.)
6) Then you will see black screen with some white characters, or something like that. After a while a Ubuntu splash image should appear (at least for LiveCD), showing that Ubuntu is loading ...

LiveCD has loaded - what is next ?

Ubuntu (with Unity)
1) You will be greeted with this screen in Ubuntu:

2) Choose "Try Ubuntu". (Why not "Install Ubuntu" you might ask ? Well, this way we can first connect to a wireless router for example and have connection. This will than allow us to download staff during installation.)
3) Wait while the system loads. This will take some time. After that you will see the Unity desktop. There should be a "Install Ubuntu XX.XX" icon.
4) You should first make sure that you are connected to the net. If not - connect now. Then, when you are ready, double-click the installation icon.
5) A window pops-up and you can choose your system language ... Well, the rest is more or less straightforward.Visit this page for instructions:

NOTE: For Ubuntu 12.04 LTS I didn't have to do anything extra to get it working. GUI (Graphical User Interface) started perfectly, which means either:
- The GPU (Radeon HD) was detected correctly and a certain open-source graphics driver started successfully, or
- the VESA (very simple driver - no 2d, 3d staff) loaded automatically.
6) After the system has been installed, it will ask you to restart. Press restart, remove the disk when it is ejected, close the tray and press ENTER to continue.
7) The system should boot up without any surprises.
8) Now, lets install the property ATI Catalyst driver to get 3d and 2d acceleration. Go to: System -> Administration -> Additional Drivers
9) Install the "ATI/AMD proprietary FGLRX graphics driver". (NOT the one with "post-release updates" !) The updated one will most likely fail to install/work. (Failed for me.)
10) Restart again. Now you should have 3d acceleration. To test that it is actually working, lets run "glxgears" command from the terminal. (Install it by running: "sudo apt-get install mesa-utils"). This is what I get:
11) Enjoy !

1) In Lubuntu, you are will see the following:
2) Choose your language and press ENTER. You will see the following:

3) Don't press any of these yet ! Instead, press F6:
4) Now we can see some boot options. Press Esc. You will see the string of options. Remove the last 2 characters "--", change "splash" to "nosplash", change "quit" to "noquit" and, after that, add: "radeon.modeset=0 xforcevesa". So, the last 4 options will be:
noquit nosplash radeon.modeset=0 xforcevesa
5) "Try Lubuntu without installing" should be highlighted and the code should be shown as in the picture above. Press ENTER.
6) After a while a Lubuntu splash screen will be shown. Then, the LXDE desktop will appear. You will see the installation icon:
7) Double-click and the window will greet you. Choose language, etc ... Visit this page if you need help:
8) After the installation has finished, you will be prompted to restart the computer. The CD will be ejected, take it out, close the tray, press ENTER to continue the restart process.
9) As the system boots up, you will something you do not expect - black screen with white characters - no GUI (at least I got it with Lubuntu 12.04 LiveCD). Check whether you can type - if you can, follow next step. If you can not type, press the Ctrl + Alt + F1 combination. This will take you to Command Prompt.
10) At the command prompt, type your username, press ENTER, your password, ENTER. You must be connected to the Internet at the point. We need to download GPU drivers. Now we are ready to run some commands.
11) Type:
sudo apt-get install fglrx
press ENTER, type your password again, ENTER. The Apt program will then install the fglrx (Catalyst) driver for our ATI Radeon HD GPU. This will take few minutes or so:

12) After the fglrx driver has been installed, type and run the following code:
 sudo aticonfig --initial -f
This will provide the basic configuration for our video card.
13) Reboot:
sudo reboot
After the system has booted, you should be able to login normally (with GUI). Now you also have 3d acceleration !
14) To test that you have you 3d staff, just install "mesa-utils" package and run "glxgears" in the terminal window.
15) Enjoy !

- Should work the same way as Lubuntu
- Didn't work fully for me, as it could not download fglrx drivers for some reason :(