Sunday, February 1, 2015

Ubuntu postinstall tuning

SSD tuning

All I did here was to add noatime for the mount command. In my opinion it’s a game of diminishing returns, with increasing risk of problems, to implement all the special SSD performance enhancing tricks you may find various places on the net. The noatime flag however is worth it, as it disables the writing of a new value in the file access time/date field every time a file is accessed. This feature is rarely used, and as files are accessed a lot turning this off saves a lot of small writes to the SSD that wears the drive unecessarily and probably slow things down:
$ sudo nano /etc/fstab
then add ",noatime" in options for the / mount. Reboot and try mount to verify that / is mounted with noatime option:
$ mount
/dev/sda5 on / type ext4 (rw,noatime,errors=remount-ro)
(...)

Increasing trackpoint speed

The trackpoint is one of my favorite navigational devices for laptops. But it must be set to a pretty high speed to work well for me. If you simply increase the general mouse speed it will also affect the touchpad and external mouse speeds. It has to be done at the trackpoint driver level. I couldn’t find the settings in any GUI config, but it is possible to adjust by command line:
1. Experiment with the speed / sensivity values with:
$ echo -n 80 > /sys/devices/platform/i8042/serio1/serio2/speed 

$ echo -n 250 > /sys/devices/platform/i8042/serio1/serio2/sensitivity
2. To make the favorite settings permanent, create a /etc/udev/rules.d/trackpoint.rules file containing:
SUBSYSTEM=="serio", DRIVERS=="psmouse", WAIT_FOR="/sys/devices/platform/i8042/serio1/serio2/sensitivity", ATTR{sensitivity}="250", ATTR{speed}="80"
3. Reboot or use the following to load the new settings:
$ sudo udevadm control --reload-rules
$ sudo udevadm trigger 

Improving fan control

The built-in hardware fan control has a tendency to ramp up to ~4000 RPM and stay there, which is quite audible and not at all necessary. I managed to implement a custom temperature regulation (use at your own risk!) with the thinkfan tool:
1. Install required packages
$ sudo apt-get install lm-sensors thinkfan
Run sensors once and let the tool configure the sensors.
2. Enable software fan control by creating file /etc/modprobe.d/thinkfan.conf containing:
options thinkpad_acpi fan_control=1
3. Create or edit /etc/thinkfan.conf to select the right sensors and fan speed rules. This is what I use:
sensor /sys/devices/platform/coretemp.0/temp1_input (0)
sensor /sys/devices/platform/coretemp.0/temp2_input (0)
sensor /sys/devices/platform/coretemp.0/temp3_input (0)
sensor /sys/devices/virtual/hwmon/hwmon0/temp1_input (0)

(0,     0,      40)
(1,     35,     45)
(2,     40,     51)
(3,     42,     53)
(4,     46,     60)
(5,     53,     66)
(7,     60,     72)
(127,   70,     32767)
4. I prefer to run the thinkfan tool with 5 seconds poll interval (-s 5) and no “exaggeration” on rising temperature (-b 0). I installed the tool as an upstart service by creating /etc/init/thinkfanservice.conf containing:
exec /usr/sbin/thinkfan -s 5 -b 0.0 -q -n

respawn

start on runlevel [2]
5. Check status / start / stop of service with:
sudo initctl status thinkfanservice
sudo initctl start thinkfanservice
sudo initctl stop thinkfanservice
You can test the current temperatures and fan speed with the sensors command:
$ sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +38.0°C  (crit = +97.0°C)

thinkpad-isa-0000
Adapter: ISA adapter
fan1:        1973 RPM

coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:  +42.0°C  (high = +86.0°C, crit = +100.0°C)
Core 0:         +42.0°C  (high = +86.0°C, crit = +100.0°C)
Core 1:         +39.0°C  (high = +86.0°C, crit = +100.0°C)

Battery life optimization

I managed to tweak battery life to a pretty respectable typical 5 hours. This is what I did:
1. Bluetooth radio default off. I don’t use bluetooth and don’t want to manually turn it off all the time. This is the only way I found to reliably turn it off after boot, in a way where you can still turn it on using the tray icon:
Edit /etc/rc.local and add:
rfkill block bluetooth
2. Install power mode changing script. This script sets a lot of hardware settings depending on AC / battery power state. Create file /etc/pm/power.d/power with execution rights containing:
#!/bin/sh

 # Shell script to reduce energy consumption when running battery. Place
 # it in /etc/pm/power.d/ and give execution rights.

 if on_ac_power; then

 # Start AC powered settings --------------------------------------------#

 # Disable laptop mode
 echo 0 > /proc/sys/vm/laptop_mode

 #NMI watchdog should be turned on
 for foo in /proc/sys/kernel/nmi_watchdog;
 do echo 1 > $foo;
 done

 # Set SATA channel: max performance
 for foo in /sys/class/scsi_host/host*/link_power_management_policy;
 do echo max_performance > $foo;
 done

 # CPU Governor: Performance
 for foo in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
 do echo performance > $foo;
 done 

 # Disable USB autosuspend
 for foo in /sys/bus/usb/devices/*/power/level;
 do echo on > $foo;
 done

 # Disable PCI autosuspend
 for foo in /sys/bus/pci/devices/*/power/control;
 do echo on > $foo;
 done

 # Disabile audio_card power saving
 echo 0 > /sys/module/snd_hda_intel/parameters/power_save_controller
 echo 0 > /sys/module/snd_hda_intel/parameters/power_save
 
 # End AC powered settings ----------------------------------------------#

 else

 # Start battery powered settings ---------------------------------------#

 # Enable Laptop-Mode disk writing
 echo 5 > /proc/sys/vm/laptop_mode

 #NMI watchdog should be turned on
 for foo in /proc/sys/kernel/nmi_watchdog;
 do echo 0 > $foo;
 done

 # Set SATA channel to power saving
 for foo in /sys/class/scsi_host/host*/link_power_management_policy;
 do echo min_power > $foo;
 done

 # Select Ondemand CPU Governor
 for foo in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
 do echo ondemand > $foo;
 done

 # Activate USB autosuspend
 for foo in /sys/bus/usb/devices/*/power/level;
 do echo auto > $foo;
 done

 # Activate PCI autosuspend
 for foo in /sys/bus/pci/devices/*/power/control;
 do echo auto > $foo;
 done

 # Activate audio card power saving
 # (sounds shorter than 1 seconds will not be played)
 echo 1 > /sys/module/snd_hda_intel/parameters/power_save
 echo 1 > /sys/module/snd_hda_intel/parameters/power_save_controller

 # End battery powered settings -----------------------------------------#

 fi

Source: linux-mint-on-lenovo-tp420s

Monday, July 28, 2014

 I built an Android 4.4.2 KitKat custom firmware for the FNF iFive X3 tablet. This firmware is based on the official iFive X3  firmware 2.1.3 dated 2014/04/02. 


Build information:
Linux Kernel: Linux version 3.0.36+ (five@five-server2) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #68 SMP PREEMPT Wed Apr 2 16:59:31 CST 2014

Android build: 
IFive/rk3188/rk3188:4.4.2/KOT49H/eng.root.20140402.170132:eng/test-keys ro.rksdk.version=RK30_ANDROID$(PLATFORM_VERSION)-SDK-v1.00.00

RK3188Loader(L)_V2.09.bin

Custom firmware features:
  • removed most Chinese and unnecessary applications
  • increased space for applications (/data partition) to 4 GB
  • disabled OTA updates (may cause problems)
  • kernel modules (cifs, tun, lan, serial, xpad) compiled by Oma & Crew RKTablets.
  • ClockworkMod (CWM) Recovery
  • FiveDateTime, FiveWeather, FiveVideoPlayer, FiveMusic translated to Russian language
  • fix kerning in Russian language on LockScreen
  • changed ugly wallpaper in LockScreen and DateTime

Download: ifivex3_custom_firmware.zip

Use RKDeviceManage version 1.7 to flash the firmware, use Restore button. 

Thursday, December 23, 2010

NEC will launch new Android products

By Rob Coppinger A DUAL SCREEN tablet will be unveiled at the Consumer Electronics Show by NEC, following its November release of the single display Cloud Communicator Lifetouch. The dual-screen tablet also comes under the Cloud Communicator Lifetouch banner and both tablets use an unspecified Android operating system, and have 7-inch LCD touchscreens, 3G and WiFi and Bluetooth connectivity plus a stylus for pen input. NEC also says that the dual-screen tablet will do "multi-tasking, with the ability to run different programs on each LCD screen", which it claims is an industry first. The apps for the Cloud Communicators can be found at the Andronavi online store. The fact that NEC has felt the need to use a third party store tells us two things, (a), that the tablets' OS won't be the highly anticipated tablet friendly Honeycomb, and (b), neither Communicator will have a phone function. Where tablets are also phones, such as the Samsung Galaxy Tab, they have access to Google's Android marketplace, but if the device is not a phone it is not compatible with Android apps.