Wednesday, January 26, 2011

Issues with 2.6.37rc2 Maverick (mainline PPA)

Going to have to put a little hold on the next tutorial. There are some other issues present in the upstream (mainline ppa) 2.6.37rc2 kernel for Ubuntu 10.10. After running the system and happily enjoying the graphics acceleration I rebooted to find that the system was having issues with acpi calls on bootup, causing a failed boot.

That being said, I intend to pull down the vanilla 2.6.37 stable source (www.kernel.org) and build a kernel from that. If it works, I'll build a tutorial that will offer up how to build the kernel, at least the options required in the kernel, and then how to setup the hardware acceleration. Unless of course Canonical pushes an updated kernel before I can knock this out. Maybe I'll figure out how to run my own ppa and make it really easy for those uninterested in taking the time to build the kernel.

Sunday, January 23, 2011

Working on refining the graphics setup

Hello all,
While the switchable graphics tutorial from a couple of days ago will get you up and running nicely on the integrated graphics, it will not get you anywhere with the hardware acceleration on your discrete card. At least not on the Envy 14 or any other machine that uses the 'Evergreen' series of ATI cards while running Ubuntu 10.10. The issue is that the newer open source driver that has the code to use the discrete graphics cards hardware acceleration isn't supported under the 2.6.35 kernel. Its possible to get the graphics card up and running with hardware acceleration under 2.6.37, but sadly doing so at this point will break the touchpad patch from earlier. I'm currently in work on a fix for this and will be quick to submit the change to the patch and also to put up a tutorial as soon as I can.

It should be noted that updating the kernel to one of the mainline kernels will make it very difficult for you to get support on the Ubuntu forums as you are moving away the standard system. Also while it may fix the graphics, its not uncommon to deal with feature regression even though you are updating the kernel. Its not hard or even impossible to boot off an earlier kernel that is still install on your system. In fact, this is why you are by default given the boot choices in Grub upon boot. Just in case a new version of the kernel breaks your system you are still able to back track.

Tutorial to come soon!

Also feel free to drop off a comment or an email if you have a particular feature or issue you'd like help setting up.

Monday, January 17, 2011

Battery Life Review

In a previous post I was asked what I was seeing when it came to power usage on the laptop. I thought it'd be interesting to do some tests and see what I could find.
Here's how I setup the computer:
  • Brightness = Max 100% (10)
  • On Demand CPU performance on = ( echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
  • Sound card power management enabled = (echo 1 > /sys/module/snd_hda_intel/parameters/power_save)
  • File System power saving = ON ( sudo echo 1500 > /proc/sys/vm/dirty_writeback_centisecs)

First Test
Wifi-Bluetooth-Web Browser (Chromium) = ON
ATI Discrete Graphics = ON
Intel Graphics = ONd
Power Usage = 54.1W
Second Test
Wifi-Bluetooth-Web Browser (Chromium) = ON
ATI Discrete Graphics = ON
Intel Graphics = OFF
Power Usage = 59.4W

Third Test
Wifi-Bluetooth-Web Browser (Chromium) = ON
ATI Discrete Graphics = OFF
Intel Graphics = ON
Power Usage = 17.7W


Fourth Test
Wifi-Web Browser (Chromium) = ON
BlueTooth = OFF
ATI Discrete Graphics = OFF
Intel Graphics = ON
Power Usage = 17.7W

Fifth Test
Wifi-Web Browser (Chromium) = OFF
BlueTooth = OFF
ATI Discrete Graphics = OFF
Intel Graphics = ON
Power Usage = 17.3W

Last Test
Wifi-Chromium = ON
BlueTooth = OFF
ATI Discrete = OFF
Intel Integrated = ON
Power Usage=20.5W

Now a suspend was done
Power Usage after Suspend = 44.2W



So to those that were asking. The suspend bug does seem to affect this system. Powertop isn't showing whats using the extra power either. Before and after suspend wakeups seem to be consistent.

Poor performance on Full screen flash videos

Problem: When viewing fullscreen flash videos the rendering is easily in the low 10s when it comes to frames per second.

Solution: Disable hardware acceleration in flash


Perhaps when we get ATI to give us a driver that will actually work with hybrid graphics we will also be able to enable the hardware acceleration.

To Disable Adobe Flash Hardware Acceleration

1) load a flash video like .... this:
2) Click the menu in the video on the bottom right that says 360, now select 1080P
3) Make the video full screen. See the poor performance I was talking about?
4) Exit fullscreen
5) Right click somewhere in the video and select settings
6) Uncheck "Enable Hardware Acceleration"
7) Make the video full screen and play
8) Ahhhhh much better

Enjoy!

Tackling the Switchable graphics

Okay. The big issue to tackle. First let me preface this post with pointing out that I've written no actual original code here. I've just pieced together all the scripts and information from other more knowledgeable users who were kind enough to share their expertise with the community.

A note about this tutorial. I have it currently working on my laptop, the HP Envy 14. It should work for the other Hp Envy series laptops with hybrid graphics. From what I've been reading if you are here looking for a fix for the NVidia Optimus chipset you are still out of luck. At least as of this posting [17 January 2011]. The instructions included here should work for other laptops with ati/intel combinations. It should also work with other laptops with ati/ati combinations. I maintain that should statement until proven otherwise. If you have such a setup and use these directions please leave me a comment so that others will also know that they have hope ;-).

Also, so far the main purpose of this graphics switching is to improve battery life. Turning off a GPU saves a great deal of power. I'm researching right now if there is a way to enable hardware acceleration on the discrete graphics card if it is manually switched. As of right now the answer I have is it is not. To the best of my knowledge if you install the ATI Catalyst closed source drivers you will not have a working video setup any longer. I've tried twice during experimentation and been let down. I'll post an update to this article if I find a way to make it work, or find somebody else who does.

For the sake of giving credit where its due I'll list the blogs and forums and such that I used to piece this info together:

Now that we have that out of the way, I highly recommend you piece your way through those links to follow along. Its important I suppose, something about teaching a man to fish.

This blog is following my experience with Ubuntu specifically, the information can be used in other distributions with a little know how. This is important in this case because even the Debian derived distributions like Ubuntu, opensuse or xandros have some basic system level differences. Most of the directions and blogs detailing the work needed to get this working seemed to be based on Fedora. The big difference here is that Ubuntu do
esn't use a /etc/rc.local file. So copying the directions line for line won't work up front. Don't despair, there isn't a lot of difference, and I'll walk through the instructions.

Also, in a short time I hope to roll all these instructions into a script to make it a very easy install for other Ubuntu users.

How to Enable Switchable Graphics (Hybrid Graphics) in Ubuntu
1) Download my version of the rc.local script:
Now set the script as an executable, in the terminal:
"chmod +x local"

2) Change the username portion of the local script to your username





3) Move the local file from your home folder to /etc/init.d/local:
"sudo mv ~/local /etc/init.d/local"


4) Update rc! Now we tell the system that we added a bootup script:
"sudo update-rc.d local defaults 80"


5) Setup scripts to enable easy switching of cards.
This code is taken from the Hybrid Graphics link above. It can be copied and pasted from there, for convenience I've made it available for download:
I recommend saving the file to your home directory. As thats where my guide assumes its going.

In your terminal issue this command:
"cd ~; chmod +x switch_between_cards.sh"





6) Now download the shutdown script:
We'll be using this script to circumvent a bug that causes the fan to run at high speed at all times after a reboot if the power is not on for both cards at boot time. Thanks to the hybrid graphics in linux blog in the links above for this script and the time and effort spent troubleshooting the issue.

7) In the terminal:
"cd ~; chmod +x shutdown.sh"

8) Now reboot.

Welcome back. You are just about done. Just need to make those handy scripts we downloaded a bit more accessible.

9) Right click on the top toolbar in some of its empty space and select "Add to panel"


10) Now select "Custom Application Launcher"

11) Now fill in the information below. Point the command portion directly at the script where-ever you happened to save it.

12) Now do the same for the shutdown script. Use the buttons to switch between graphics and shut down the machine.

Congrats. Now your battery life should be markedly improved.

Friday, January 14, 2011

Touchpad Fixed!

After a bit of research and trial and error I've gotten the touchpad (really its a clickpad) working correctly. Depending on which forums you search or directions you follow there are a couple of ways to 'fix' the touchpad.

The first is to change the driver from a touchpad to psmouse. This will essentially make the touch act like an older ps/2 mouse. Meaning no native multi-touch support. It will remove the touchpad option from System->Preferences->Mouse. I tried this and did not like it as
I had issues with adjusting the sensitivity and speed of the pad and cursor. Also I love the two-finger scrolling option. I was going to include the links to make the touchpad work
this way but I've lost them and honestly don't feel like finding
them again as I think this is the inferior option. The only upside to using this solution is that you will get a true right click back. Meaning if you click the lower right button it will register and
use it.

The better option (in my opinion), is to follow the instructions from this Bug report: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/308191/+index?comments=all . In the interest of saving time I'll make an easy to follow list of instructions below.

Directions to Install:

One of the dependencies for this package is dkms. I prefer to use the terminal and apt-get to manage packages. I've included both methods for compatibility with newer users or those that like the GUI method better.

1) "sudo apt-get install dkms"
Alternate: System->Administration->Synaptic Package Manager
Now search for dkms. Mark the package for installation. Now click the check at the top toolbar to apply the changes.




2) "cd ~; cd Downloads; sudo dpkg -i synaptics-dkms_1.1.1_all.deb" - In this step replace Downloads with the location you saved the synaptics package to.for dkms, mark the package for installation and click the check mark in the top toolbar to apply changes.

Alternate: Using file browser find the package you downloaded. Right click on it and choose 'Ubuntu Software Center'. From there you can install the package.
3) Now reboot and enjoy. The touchpad will no longer go haywire when your palm touches it, or more than one touch at time. Furthermore now you can enable the two finger scrolling.

To Enable Two Finger Scrolling
1) System->Preferences->Mouse

2) Select the touchpad tab
3) Turn on two finger scrolling. The horizontal option will enable you to side scroll with two fingers just like you do vertically.


Another problem solved. It should be noted that with my preferred method the right click will not work. In order to right click with the touchpad you simply tap with two fingers at one time. Similar to a tap to click but with two fingers. Its not a perfect solution but it makes the touchpad usable at least.

Thursday, January 13, 2011

Black Screen at Boot


This is in a separate post to make finding answers easier later.

Problem: Switching between virtual terminals with the typical Ctrl+alt+F1 (or other function key) doesn't work.

Solution: Use Ctrl+Fn+Alt+F1 (or other function key)



Problem: Screen brightness set to 0% at boot

Temporary Fix: use the brightness control on the keyboard. No need to use the Fn key to get the brightness to work, just hit F3 a couple of times while booting. This works with the Live CD as well.

Solution: Enter this into a terminal without the quotations of course -
1) "cd /etc/init.d"
2) "sudo gedit local"
3) If you already have some commands in this file from one of my other tutorials then just add this code. If not just add this line "echo 5 > /sys/class/backlight/acpi_video0/brightness"
4) Now add the exit code: "exit 0" <--that is 'exit ZERO'
5) Exit gedit, saving your work
6) "sudo chmod +x ./local"
7) "sudo update-rc.d local defaults 80"
8) Enjoy the lack of a black screen.

A quick explanation of what this little code does and a warning for the new users! Ensure that you follow the first step! This command will enable you to fix the system if this breaks anything. Simply do a "sudo cp /etc/rc.local.org /etc/rc.local".
The explanation of this code:
sudo = Run code as root
echo -e = output text that follows and execute escape characters
"#!/bin/s...rc.local" = File text that will tell the computer to set the backlight to 30% brightness at start. Change the 3 to a value up to 10 if you'd like it brighter or darker.

Some more in depth reference material:
Sudo - http://linux.about.com/od/commands/l/blcmdl8_sudo.htm
Echo - http://linux.about.com/library/cmd/blcmdl1_echo.htm
Escape Characters - http://steve-parker.org/sh/escape.shtml

Thats all for today. Tomorrow I'll be working on the erratic clickpad.

Hello World!

I've recently just gotten an HP Envy 14 and dumped the default Windows 7 install. I've installed Ubuntu 10.10 and intend to chronicle the issues and hopefully fixes that are encountered.

First my specific model with specs:
HP Envy 14-1111nr
Specifications from Microsoft's Store:
"Display:14.5 in diagonal High Definition HP BrightView Infinity LED (1366 x 768)
Processor: Intel Core i5-460M 2.53 GHz
Memory: 4 GB DDR3
Hard Drive: 640 GB SATA 7200 RPM
Operating System: Windows 7 Home Premium
Optical Drive: Slot-loading SuperMulti 8x DVD±R/RW with double layer support
Media Drive: 2-in-1 integrated digital media reader for Secure Digital cards and MultiMedia cards
Audio: Beats Audio
Video: ATI Mobility Radeon HD 5650 with 1 GB graphics memory
Ports: 3 USB 2.0; HDMI; Headphone output (combo mic in); Microphone input (combo headphone out); eSATA; LAN (RJ-45)
Battery: 8-cell lithium-ion, 59 WHr (6.5 hours)*
Camera: HP TrueVision HD webcam
Wireless: 802.11b/g/n
Bluetooth: Yes
Dimensions: 14.01 x 9.33 x 1.16 in (355.85 x 236.98 x 29.46 mm)
Weight: 5.2 lbs (2.3 kg)
Color: Brushed Aluminum
Model number: 2767774
"

The video card is actually a combo. It has the ATI video card for 3D Support and an Intel i915 integrated graphics chip for 2D (Intel Arrandale). This setup is supposed to save battery life by using the less power hungry integrated graphics while the extra power of the 3D card isn't needed. Sadly the Linux kernel doesn't yet smoothly support switching between the two.

So a quick rundown of the issues that I've noticed so far:
1) Synaptics Touchpad (Clickpad) doesn't handle multi-touch
2) Screen brightness set to 0% at boot
3) Ctrl+alt+F1 doesn't switch to a new virtual terminal.
4) Switchable Graphics are not switchable
5) Battery Life is nowhere near the 4ish hours others are getting in Win7

Thats all for now.