Duplex printing for HP Color printers in Ubuntu

In office we have this fast HP Color LaserJet CP3505 printer, that should be able to print on both sides. I installed the driver using some GUI (system-config-printer I think) and everything worked like a charm, except the duplex printing. Trying to enable duplex printing in kprinter, for example, resulted an error “Some options selected are in conflict” as the Duplex Unit was not installed.

The printer setup can be changed (as instructed in this thread) in the CUPS HTML interface, accessible via any browser:

http://localhost:631

1) Choose Manage Printers and Set Printer Options of the printer at hand.

2) In Options Installed change radio button to Duplex Unit : Installed.

3) Click Set Printer Options.
You may be asked for a user name and password. Type in your local login user name and password. Sometimes, as in my case, you may need to input root and the superuser password.

Presumably the same configuration can be done in the GUIs as well, for example:
sudo system-config-printer and tick Duplex Unit in Installable Options tab. (In KDE use kdesu instead of sudo.)

Japanese input method in KDE 3.5 (Hardy Heron)

The easiest (and recommended) way to enable Japanese input in KDE is through System Settings -> Regional & Accessibility -> Country/Region & Language. Installing support for Japanese also installs the scim-anthy input method. If you need to use Japanese in terminal, the easiest way is to set Japanese as system language (but that indeed changes the default language, e.g. most man pages and system commands like apt-get will be in Japanese).

However, this will not enable Japanese input in non-KDE programs like Firefox. For this you need to install scim-bridge-client-gtk and im-switch. Then run

im-switch -s scim-bridge

to set scim-bridge as default input method for all applications.

scim-bridge is a new socket based input method module that fixes the many annoying problems that were present with scim, like various crashes in Firefox and Thunderbird and whitespace mapping bugs in KDE. The only thing that doesn’t work is Japanese input in Skype, which is a pity. Apparently this is fixed in KDE 4.0.

All in all this is very painless procedure compared to what it used to be in Dapper or Edgy.

Using kompare to view Subversion differences

When you’re using Subversion (svn) repositories for code development, it is sometimes useful to check differences between code revisions (i.e. when things went wrong for the first time). If you are using KDE, Kompare is a graphical difference viewer that can be easily used for this task. Simply run

svn diff -r 1020:1047 | kompare -o -

in a directory that belongs to the svn tree. Kompare window will open showing comparison of all the changed files in that directory tree. The numbers refer to revision numbers, i.e. in this case revisions 1020 and 1047 are being compared. The revision switch -r accepts other formulations, too:

'{' DATE '}' revision at start of the date
'HEAD' latest in repository
'BASE' base rev of item's working copy
'COMMITTED' last commit at or before BASE
'PREV' revision just before COMMITTED

For more information on the svn difference command run svn -h diff.

nVidia 8600 GT direct rendering on Hardy Heron

I made a clean install of the new Kubuntu 8.04 on Shuttle SP35P2. Everything went reasonably smoothly, I could even install nVidia drivers though KDE->System->Hardware Drivers Manager.

However, setting up the compiz desktop effects (KDE->System->Desktop Effects) didn’t quite work out. After reboot I logged in and got the white screen of death. I had to switch to terminal by Ctrl+Alt+F1, restart the X server by

sudo /etc/init.d/kdm restart

and login in failsafe mode. One can access the desktop effects setup from terminal by running

desktop-effects-kde4

After disabling all the effects I was able to log in in normal mode again.

It turned out that although the driver was installed, it wasn’t working properly. Running glxinfo printed out


...
direct rendering: No (If you want to ...
server glx vendor string: SGI
...

Clearly there’s something wrong here…
I installed newest drivers from the repositories, and also installed drivers using EnvyNG. Even went to nVidia homepage and got the latest driver installer and when even that didn’t work I downloaded the nvidia beta drivers from the same site. No remedy.

In the end it turned out that the trouble was package xserver-xgl that prevents direct rendering (DRI) in all cases. Removing the package and rebooting did the trick for me. I’m now using the nVidia beta drivers (173.08) and the compiz effects seems to work ok. The drawback is that I noticed some decrease in performance when xserver-xgl was not installed.

To put the long story short:
If you are using nvidia drivers but don’t get direct rendering working, check if you have the latest (beta?) drivers and if xserver-xgl is installed (remove it if it is).

— Edit 2008-05-28 —
Upgrading to kernel 2.6.24-17 broke the nvidia driver. The nvidia kernel module would not load correctly anymore which was probably due to the manual beta driver installation (see Ubuntu forums). I decided to go back to nvidia-glx-new from Ubuntu repositories.

I had to remove the new kernel 2.6.24-17 and purge all nvidia related packages. After rebooting I reinstalled the new kernel and rebooted again. Then installed nvidia driver from Hardware Drivers Manager and rebooted. Everything was OK except that the 3d desktop effects still don’t work with xserver-xgl.

To summarize: It’s better to stick with Ubuntu drivers for future compatibility.