viernes, 24 de agosto de 2007

Suspender e Hibernar en ubuntu feisty 7.04 en dell inspiron 1501

After upgrading to Feisty, my new favorite feature suspend-to-disk (aka hibernate) was broken badly; basically, the resume would never be found, so it’d act as if it had a corrupted swap partition and unmounted disks. A lot of people share my grief, suspend is a notoriously tricky thing to nail down because of bad drivers, companies who won’t cooperate with kernel developers, and the fact that software suspend itself is tricky business.

However, after a ton of investigation, it appears there is another solution to the standard one shipped with Ubuntu in µswsusp, which is a different method of suspending to disk. It turns out after some research, that the kernel method works for some people and µswsusp works better for others. If you’re having trouble with the former, here we go (this is written for Feisty Fawn, but most of the stuff works for Edgy):
How to try uswsusp

Before we set it to be the default, we want to try it out to make sure that it works for your laptop. First, make sure you’re running Feisty Fawn, then from the terminal type:
Code Sample:

sudo apt-get install uswsusp
sudo s2disk ## CAUTION: make sure data is saved for this test!
Making uswsusp the default in Ubuntu

If it worked, hurrah! Now, to make this the default way to hibernate/suspend the computer (including the logout dialog, and GNOME Power Manager) involves some hackery but it’s not too bad, and it’s not likely to cause any problems. Download these two files:

* hal-system-power-hibernate-linux
* hal-system-power-suspend-linux

Then run the following command in the Terminal:
Code Sample:

sudo cp hal-system-* /usr/lib/hal/scripts/linux/
sudo chmod 755 /usr/lib/hal/scripts/linux/*

Note that for Edgy, the scripts are named differently and are in /usr/share/hal/scripts
Technical details of what that does

When HAL is given the command to shutdown by gnome-panel or by g-p-m, it ends up executing these scripts, which end up going through a list of files trying to find some command to shut the machine down. The first command it usually finds is pmi, which invokes the kernel hibernate code. My file rearranges the priority so that s2disk/s2ram is called instead (and also corrects a dumb bug where it had the wrong path coded in the file). Since most all userspace requests now go through HAL to shut the machine down, this has the convenient effect of fixing hibernate for everything. Yahtzee!

Update: It appears bcm43xx (Broadcom Wireless driver) and uswsusp really don’t get along; use ndiswrapper instead. I also switched to the native ati driver instead of fglrx, but the latter still might work, I haven’t tried it.

domingo, 12 de agosto de 2007

Compiz Fusion en Feisty Fawn con Ati

Compiz Fusion in Feisty with Xgl

This is the guide everyone has been waiting for, this not only works for the Dell Inspiron 1501 but works for any computer running an ATI card using Xgl.

Check ATI Driver
In a terminal type:
fglrxinfo

You should see this output in your terminal window:
display: :0.0 screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: RADEON XPRESS Series
OpenGL version string: 2.0.6334 (8.34.8)

If you get something different make sure you enable the proprietary ATI driver via the Restricted Driver Manager. You can find it in the top left menu bar under System>Administration>Restricted Drivers.
(This is what you get when using the Dell Inspiron 1501, other users can check for enabled 3D by using the command glxgears, you should see spinning gears)

Install Xgl
In a terminal type:
sudo apt-get install xserver-xgl

Setting Up XGL
In a terminal type:
sudo gedit /usr/local/bin/startxgl.sh

and this to the file:
#!/bin/sh
Xgl :1 -fullscreen -ac -accel xv:pbuffer -accel glx:pbuffer &
DISPLAY=:1
cookie="$(xauth -i nextract - :0 | cut -d ' ' -f 9)"
xauth -i add :1 . "$cookie"
exec dbus-launch --exit-with-session gnome-session
save and close file

Then make the xgl script executable by entering this into a terminal:
sudo chmod a+x /usr/local/bin/startxgl.sh

Creating a XGL Login
Make the script, by typing this into a terminal:
sudo gedit /usr/share/xsessions/xgl.desktop

add this text to the file:
[Desktop Entry]
Encoding=UTF-8
Name=Xgl
Comment=Start an Xgl Session
Exec=/usr/local/bin/startxgl.sh
Icon=
Type=Application
save and close file

Remove Compiz & Desktop Effects
sudo apt-get remove compiz-core desktop-effects

If you have Beryl Installed Remove Beryl Too
In a terminal type:
sudo apt-get remove beryl-ubuntu beryl-manager emerald

If you want to use emerald as your decorator for Compiz Fusion do not remove the emerald package.

Add the Compiz Fusion Repository
In a terminal type:
sudo gedit /etc/apt/sources.list

Add this to the end of your your source list:
deb http://download.tuxfamily.org/3v1deb feisty eyecandy
deb-src http://download.tuxfamily.org/3v1deb feisty eyecandy
save and close file

Add the tuxfamily Repository Key
In a terminal type:
sudo wget http://download.tuxfamily.org/3v1deb/DD800CD9.gpg -O- | sudo apt-key add -

Update Your System
In a terminal type:
sudo apt-get update

Install Compiz Fusion
In a terminal type:
sudo apt-get install compiz compizconfig-settings-manager compiz-plugins compiz-gnome compiz-fusion-plugins-extra libcompizconfig-backend-gconf

Now you just have to log off, log into your Xgl session and run Compiz Fusion.

To run Compiz Fusion:
compiz --replace

To run the Compiz Setting Manager:
ccsm

I find Compiz Fusion to be faster and more responsive then Beryl. I don't use Beryl's window manger, Emerald. If you want to use emerald with Compiz Fusion, it's as easy as sudo apt-get emerald and to launch it's emerald --replace. I didn't mention it in my guide because I prefer Compiz's gtk-window-decorator, and don't want to put up with the hassle of people asking my questions about software I don't use.

Troubleshooting
Q: Compiz Fusion doesn't load/work?
A: Make sure you are you logged onto your Xgl session. Select it at startup from sessions.

Q: I don't have windows decorations?
A: Did you run ccsm (compiz setting manager) and enable Window Decorations

Q: I don't have a cube?
A: Did you run ccsm (compiz setting manager) and enable 3D cube

Hope you guys like the guide.
redDEADresolve