Difference between revisions of "Parallella Speed Up Ubuntu"

From eLinux.org
Jump to: navigation, search
m
m
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:Parallella]]
 
[[Category:Parallella]]
This is a how to guide to speed up the official Ubuntu for Parallella, this is only for ubuntu-lxde-14.03.06-p16g1.img. Do not apply these tips to another version.
+
'''Almost all these techniques have been incorporated into the latest official Parallella Ubuntu image now.'''
 +
 
 +
This is a how to guide to speed up the official Ubuntu for Parallella, '''<big>this is only for ubuntu-lxde-14.03.06-p16g1.img on Parallella E16/Zynq7020. Do not apply these tips to another version/board</big>'''.
 +
 
 +
'''Please apply these instructions without modification.'''<br />
 +
Each configuration is carefully constructed and is interdependence, so if you modify something, it may get even worse.
 +
 
 +
[http://youtu.be/TsjjIpjYM3U Demo Video]
  
 
By applying these tips, you will get,
 
By applying these tips, you will get,
Line 8: Line 15:
 
*Sound output from HDMI
 
*Sound output from HDMI
 
*USB devices (e.g. webcam, USB stick)
 
*USB devices (e.g. webcam, USB stick)
 +
 +
'''Apply all the tips at once.'''
  
 
==Fix the permission of .gconf==
 
==Fix the permission of .gconf==
Line 75: Line 84:
 
</pre>
 
</pre>
  
==Disable Screensaver==
+
==Remove xscreensaver==
 +
 
 +
xscreensaver causes freeze on X startup. So remove it.
 +
 
 +
<pre>
 +
sudo apt-get purge xscreensaver
 +
</pre>
  
Menu->Preferences->Screensaver->Display Modes->Mode: Disable Screen Saver
+
'''Note: It is insufficient to disable xscreensaver by "Screensaver" configuration. We have to "apt-get purge" to completely disable xscreensaver.'''
  
 
==Make Leafpad the default editor==
 
==Make Leafpad the default editor==
Line 83: Line 98:
 
Right-click a text file on PCManFM, select Properties->General->Open with: Select Leafpad
 
Right-click a text file on PCManFM, select Properties->General->Open with: Select Leafpad
  
==Force screen resolution to 1280x720 and enable devtmpfs==
+
==Install fake-hwclock==
 +
 
 +
<pre>
 +
sudo apt-get install fake-hwclock
 +
</pre>
 +
 
 +
==Clear persistent-net.rules==
 +
 
 +
Clear garbage configuration.
 +
 
 +
<pre>
 +
sudo rm /etc/udev/rules.d/70-persistent-net.rules
 +
</pre>
 +
 
 +
==Enable devtmpfs==
 +
 
 +
Create device nodes of the SD card.
  
 
<pre>
 
<pre>
Line 91: Line 122:
  
 
sudo mknod -m 660 /dev/mmcblk0p2 b 179 2
 
sudo mknod -m 660 /dev/mmcblk0p2 b 179 2
 +
</pre>
  
 +
Install device-tree-compiler.
 +
 +
<pre>
 
sudo apt-get install device-tree-compiler
 
sudo apt-get install device-tree-compiler
 +
</pre>
  
 +
Mount partition1 of the SD card.
 +
 +
<pre>
 
sudo mount /dev/mmcblk0p1 /mnt
 
sudo mount /dev/mmcblk0p1 /mnt
  
 
cd /mnt
 
cd /mnt
 +
</pre>
 +
 +
Create devicetree.dts from devicetree.dtb.
  
 +
<pre>
 
sudo cp devicetree.dtb devicetree.dtb.bak
 
sudo cp devicetree.dtb devicetree.dtb.bak
  
 
sudo dtc -I dtb -O dts -o devicetree.dts devicetree.dtb
 
sudo dtc -I dtb -O dts -o devicetree.dts devicetree.dtb
 +
</pre>
 +
 +
Edit devicetree.dts.
  
 +
<pre>
 
sudo nano devicetree.dts
 
sudo nano devicetree.dts
 
</pre>
 
</pre>
Line 108: Line 155:
  
 
<pre>
 
<pre>
bootargs = "root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait devtmpfs.mount=1 video=HDMI-A-1:1280x720@60";
+
bootargs = "root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait";
 
</pre>
 
</pre>
 +
 +
Compile it to dtb to enable it.
  
 
<pre>
 
<pre>
sudo dtc -I dts devicetree.dts -O dtb -o devicetree.dtb
+
sudo dtc -I dts -O dtb -o devicetree.dtb devicetree.dts
 +
</pre>
 +
 
 +
==Configure Xorg==
  
 +
<pre>
 
sudo nano /etc/X11/xorg.conf
 
sudo nano /etc/X11/xorg.conf
 
</pre>
 
</pre>
Line 131: Line 184:
 
   Device "Card0"
 
   Device "Card0"
 
   SubSection "Display"
 
   SubSection "Display"
#---- Uncomment your preferred mode ----
+
     #Modes "1280x720"
    #Modes "1920x1200"
 
     #Modes "1920x1080"
 
    Modes "1280x720"
 
    #Modes "640x480"
 
 
   EndSubSection
 
   EndSubSection
 
EndSection
 
EndSection
 
</pre>
 
</pre>
  
==Install fake-hwclock==
+
==Reboot==
  
 
<pre>
 
<pre>
sudo apt-get install fake-hwclock
+
sync
 +
 
 +
sudo reboot
 
</pre>
 
</pre>
  
==Clear persistent-net.rules==
+
==(Optional) How to force framebuffer resolution to 1280x720==
 +
 
 +
This increases desktop performance on a full-HD monitor.
 +
 
 +
The preferred resolution is 1280x720, however you can set another resolution.
 +
 
 +
To check the available resolutions, type this command on a terminal. (with HDMI connected, on native X Window, not in ssh)
  
 
<pre>
 
<pre>
sudo rm /etc/udev/rules.d/70-persistent-net.rules
+
cat /sys/class/drm/card0-HDMI-A-1/modes
 
</pre>
 
</pre>
  
==Reboot==
+
Or, type this command on a terminal. (with HDMI connected, on native X Window, not in ssh)
  
 
<pre>
 
<pre>
sync
+
xrandr -q
 +
</pre>
 +
 
 +
'''Note: The resolution settings of the xorg.conf (Modes "1280x720") must match with the bootargs settings (video=HDMI-A-1:1280x720).'''
 +
 
 +
Then set the resolution in the settings above.
 +
 
 +
Edit bootargs and update dtb file.
  
sudo reboot
+
<pre>
 +
bootargs = "root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait video=HDMI-A-1:1280x720";
 
</pre>
 
</pre>
  
Do not touch the mouse till the Parallella logo appears.
+
Edit xorg.conf (Uncomment the "Modes" line and edit the resolution)
 +
 
 +
<pre>
 +
Modes "1280x720"
 +
</pre>
  
 
{{Template:Parallella Navbox}}
 
{{Template:Parallella Navbox}}

Latest revision as of 01:02, 8 January 2015

Almost all these techniques have been incorporated into the latest official Parallella Ubuntu image now.

This is a how to guide to speed up the official Ubuntu for Parallella, this is only for ubuntu-lxde-14.03.06-p16g1.img on Parallella E16/Zynq7020. Do not apply these tips to another version/board.

Please apply these instructions without modification.
Each configuration is carefully constructed and is interdependence, so if you modify something, it may get even worse.

Demo Video

By applying these tips, you will get,

  • Better desktop performance
  • Boot up stability
  • Sound output from HDMI
  • USB devices (e.g. webcam, USB stick)

Apply all the tips at once.

Fix the permission of .gconf

sudo chown -R linaro:linaro ~/.gconf

ALSA configuration

nano ~/.asoundrc

(copy, paste and save)

pcm.!default {
  type rate
  slave {
    pcm "hw:0"
    rate 48000
  }
  converter "samplerate"
}

Disable PCManFM Desktop mode

rm -f ~/.config/lxsession/LXDE/autostart

sudo nano /etc/xdg/lxsession/LXDE/autostart

Delete the line "@pcmanfm --desktop --profile LXDE".

Append this line to the bottom of the file.

@feh --bg-fill /usr/share/lxde/wallpapers/parallella.png

Select from Menu -> Preferences -> Desktop Session Settings, uncheck "GNOME Settings Daemon", [OK]

Speed up Firefox

Launch Firefox, Type "about:config" in the URL bar, Type "browser.cache.disk.enable" in the "Search:" bar, Change the value true->false by double-clicking.

Type "mousewheel.acceleration.start" in the "Search:" bar, Double click, set [2].

Speed up SSH login

Disable sshd hostname look-up.

sudo nano /etc/ssh/sshd_config

Append this line to the bottom of the file.

UseDNS no

Remove xscreensaver

xscreensaver causes freeze on X startup. So remove it.

sudo apt-get purge xscreensaver

Note: It is insufficient to disable xscreensaver by "Screensaver" configuration. We have to "apt-get purge" to completely disable xscreensaver.

Make Leafpad the default editor

Right-click a text file on PCManFM, select Properties->General->Open with: Select Leafpad

Install fake-hwclock

sudo apt-get install fake-hwclock

Clear persistent-net.rules

Clear garbage configuration.

sudo rm /etc/udev/rules.d/70-persistent-net.rules

Enable devtmpfs

Create device nodes of the SD card.

sudo mknod -m 660 /dev/mmcblk0 b 179 0

sudo mknod -m 660 /dev/mmcblk0p1 b 179 1

sudo mknod -m 660 /dev/mmcblk0p2 b 179 2

Install device-tree-compiler.

sudo apt-get install device-tree-compiler

Mount partition1 of the SD card.

sudo mount /dev/mmcblk0p1 /mnt

cd /mnt

Create devicetree.dts from devicetree.dtb.

sudo cp devicetree.dtb devicetree.dtb.bak

sudo dtc -I dtb -O dts -o devicetree.dts devicetree.dtb

Edit devicetree.dts.

sudo nano devicetree.dts

(Search(Ctrl-W) and Edit the "bootargs" line then save)

bootargs = "root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait";

Compile it to dtb to enable it.

sudo dtc -I dts -O dtb -o devicetree.dtb devicetree.dts

Configure Xorg

sudo nano /etc/X11/xorg.conf

(copy & paste and save)

Section "Device"
  Identifier "Card0"
  Driver "modesetting"
  Option "ShadowFB" "True"
  Option "SWCursor" "True"
  Option "HWCursor" "False"
EndSection
Section "Screen"
  Identifier "Screen0"
  Device "Card0"
  SubSection "Display"
    #Modes "1280x720"
  EndSubSection
EndSection

Reboot

sync

sudo reboot

(Optional) How to force framebuffer resolution to 1280x720

This increases desktop performance on a full-HD monitor.

The preferred resolution is 1280x720, however you can set another resolution.

To check the available resolutions, type this command on a terminal. (with HDMI connected, on native X Window, not in ssh)

cat /sys/class/drm/card0-HDMI-A-1/modes

Or, type this command on a terminal. (with HDMI connected, on native X Window, not in ssh)

xrandr -q

Note: The resolution settings of the xorg.conf (Modes "1280x720") must match with the bootargs settings (video=HDMI-A-1:1280x720).

Then set the resolution in the settings above.

Edit bootargs and update dtb file.

bootargs = "root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait video=HDMI-A-1:1280x720";

Edit xorg.conf (Uncomment the "Modes" line and edit the resolution)

Modes "1280x720"