Sunday, March 10, 2013

Asus GTX 650TI on Linux

So after suffering through the (self-inflicted) pain of trying to run an AMD GPU under Linux, I bought an nVidia-based GTX 650ti to try out next.

Asus GTX 650ti

The 650ti doesn't have the best reputation for value (with performance that is similar if not worse than the much cheaper HD7770), but it seemed to go okay in reviews and is realistically already overkill for anything I'm going to use it for.

In box

I narrowed the choices down to an Asus version versus the MSI Power Edition. While I'd heard goods things about the MSI PE cards, in the end it came down to:

  • DVI-D ports (compared to DVI-I).
  • HDMI ports (compared to mini-HDMI. I have plenty of HDMI cables, but no mini ones).
  • Low noise level and temperatures in reviews (though the MSI is similar here anyway).

Ports

Installation

Compared to the troubles I had with the AMD, getting the nVidia card up and running is a breeze. Admittedly, I cheated this time and went straight to the proprietary driver. The open-source driver (nouveau) worked fine straight after installing the card, and I'll probably keep an eye on it (it's apparently made some recent advances in capability). But, I was tired, and just wanted something to work, so I cheated.

Plugged in to motherboard

To see which drivers are installed, you can use:

$ sudo lspci -v

For more (or heaps more) information, you can use -vv or -vvv to the above command. Running with sudo gives you a bit of extra output as well.

Initially you'll see a line something like this in the VGA controller section:

Kernal modules: nouveau, nvidiafb

These are the open-source drivers installed automatically in recent kernels.

To install the proprietary drivers, you can use aptitude to look up the possible targets:

$ aptitude search nvidia

To get going, all you need is to do the following:

$ sudo apt-get install nvidia-current nvidia-settings
$ sudo nvidia-xconfig
$ sudo <reboot>

The xconfig command above writes a default file to /etc/X11/xorg.conf. If all installs correctly, repeating the lspci command above will now output something like:

Kernel modules: nvidia_current, nouveau, nvidiafb

Results

Everything worked without a hitch. Running nvidia-settings lets you set up dual monitors. After rebooting, for the first time the login screen was actually two separate screens, rather than mirrored.

There was no obvious increase in noise levels with the Asus card, which is nice.

It's definitely far from perfect though. There are some noticeable artifacts when watching HD video, for example, and some minor tearing while running the game Dungeon Defenders. But at the moment I'm going to take "everything's working and it was easy to set up" over "pixel perfect display". Maybe if it annoys me enough I'll investigate some more, but I'm happy to run as is for the time being.

Update 15/6/2013:

Some months later, I've still been unable to resolve the tearing issue. It also occurs when scrolling up or down in web pages as well as in games/video, and is frustrating beyond belief that such a trivial action causes screen tearing with vendor-provided drivers.

The issue occurs on multiple computers I've used, all with different hardware and distros, so I can only conclude that nVidia's driver is broken.

Update 3/7/2013:

Forgot to link to it, but I ended up fixing the tearing issue. Unfortunately, I found it only worked with Mint/Cinnamon rather than Xubuntu.

Splitting Large MP4 Files

Flash drive formatted with FAT32 has a ~4.3GB maximum file size. I wanted to use the USB to watch the movie on my TV, but it wouldn't fit. To split a large mp4 file into more manageable chunks, I found this forum post on MP4Box. It works great.
$ sudo apt-get install gpac
$ MP4Box -split 3600 <filename>.mp4
The above splits the file into one hour chunks.

Monday, February 11, 2013

Linux SSD Setup

A solid state drive (SSD) is often the cheapest way to improve all-round performance in a computer.

There are many guides for setting up an SSD for each operating system. When I did a recent reinstall of Xubuntu, I looked through a few of the guides and picked what I felt were the most important things. To my mind, these are the two biggest things:

  • Ensure that the drive controller is running in ACHI mode. This is an option in the BIOS. (Note: With Windows, you need to change this mode before installing. I haven't tried changing it with a Linux install, but it will trash a Windows install).
  • Edit /etc/fstab to add "noatime,nodiratime,discard" options for the SSD partitions.

Since SSDs have a lifetime measured in "number of writes", much of the tuning advice is aimed at reducing the number of unnecessary writes.

Here's a few other things I did.

WARNING: I based doing this on the principle of "OS/applications on SSD, data/media on HDD", and "reduce unnecessary writes". Whether or not they are good things to do (particularly, mapping /tmp to a different drive while the system was running), I have no idea. It worked for me, but I didn't base this activity on any existing guide.

System Setup

I have one SSD (Samsung 830 128GB) and one HDD (Seagate Barracuda 2TB). During installation, I partitioned the SSD into ~80GB for the "primary" OS and the remainder for "experimental" OS installs.

I allocated the swap space to the HDD, since this could case a lot of writes if the system ever needs to swap out (probably rare, given the RAM available). I mounted the HDD as "/files".

Mapping Files in User Home Directory

By default /home contains all the user's files. When I was using Mint, it automatically created "Documents", "Downloads", "Pictures", "Videos" etc. in the user home directory. I maintained this with Xubuntu (can't remember if Ubuntu variants do this by default), but replaced the true directories with symbolic links to the equivalent directories in the HDD (in the /files partition).

For example:

    $ rmdir Documents
    $ ln -s /files/ashley/Documents Documents

This means that all these files are stored on the HDD, keeping the SSD free from associated writes.

Mapping Email and Browser Data

The user's home directory also contains email and browser data. So I symbolic linked my thunderbird mailbox to the HDD as well. This Firefox support post explains how to move the Firefox cache to another drive. In hindsight, I probably should have just linked the entire Firefox folder as well.

Remapping /tmp

I remapped /tmp from the SSD to the HDD. This one was a bit of an experiment. It could have killed my system, I suppose, but everything seemed okay, so I'll explain what I did.

The system uses the directory /tmp to store random runtime stuff as needed. It's a special directory in that anyone can write to it. You need to set the "sticky" flag for this. If you do an "ls -l" on it, you'll see something like this:

    drwxrwxrwt  2 user user 4096 Nov 19 20:13 tmp

The "t" character at the end of the first column indicates the sticky bit is set. This is what I did to move my /tmp directory:

    $ sudo mkdir /files/tmp
    $ sudo chmod 777 /files/tmp
    $ sudo chmod +t /files/tmp
    $ sudo rm -rf /tmp
    $ sudo ln -s /files/tmp /tmp

The reason I noticed I needed to set the sticky flag (the "chmod +t"), is that without it, filename completion in the terminal stopped working. I imagine a whole heap of other stuff would have to.

Also, when I look at my tmp folder now, the "t" flag no longer appears. Not sure why, but everything still seems to work.

So, there it is: cowboy setup for reducing SSD writes.

Tuesday, February 5, 2013

AMD HD7770 GPU in Linux


Update (Oct 2013): For anyone who stumbles across this, I've posted an update where I got the proprietary driver to work acceptably (but only on single screen).


After researching and asking around on forums about GPUs and Linux, I decided to get an AMD Gigabyte HD7770 1GB as an experiment. From what I could gather, AMD support in Linux was pretty bad, (or at least, more problematic than nVidia cards), so I went in with low expectations, willing to wear the difference of flogging it off secondhand if it didn't work out.

TL;DR: It wasn't all bad, but nothing "just works" (as was pointed out in forum responses). From my experience, I have to conclude that the AMD Linux drivers are effectively broken at the moment.

Rationale

Despite being warned away from AMD cards, the 7770 is an entry-level gaming card and not overly expensive. It was also overkill for the games I expect I would be trying to play (of which there isn't a huge selection on Linux yet anyway).

Since it wasn't too expensive ($119), I was willing to take the risk and try it out, partly for the chance to experiment, partly because AMD are reckoned to be good value for money in that price range, and partly because AMD at least supports an open source driver (for varying degrees of "supports").

Machine and OS Specs

Hooked into the i5 3470 system I built in December 2012, running LinuxMint 14 (Nadia) Cinnamon 64-bit.

On with what I found.

Card Installation

Quick and easy. Dropped right into the PCI-E slot without the firm coaxing that RAM and SATA cables usually need. I chose the second port because it looked like the USB 3.0 cable might get in the way of the card. After I put it in, I thought it probably wouldn't have been a problem, but I left it where it was.

Plug in the 6-pin power cable and away we go.

Note: If I'd got the slight less powerful 7570 (which I was considering) I wouldn't have needed the power, but I got a beefy PSU and it seemed a shame to not try out some of those cables sitting around in the bottom of the case).

With the GPU plugged in the on-board graphics is disabled. This is (I gather) expected behaviour.

Open Source AMD Video Driver

Single Screen

After plugging in the GPU and booting up, I didn't have have to do anything in particular. LinuxMint 14 has drivers installed by default to drive the GPU.

First test I plugged into the DVI port. It started up fine at full resolution.

A command you can use to see how the system has detected your GPU is:

    lscpi --nn | grep VGA

Mine displayed "[Radeon HD 7700 Series]"

Dual Screen

Then I added in the second monitor. If you've ever heard someone claim the dual-monitor support in Linux is limited, you can believe them.

Initially with both plugged in, only the HDMI monitor would work. The other monitor (plugged into the DVI, which was originally working), displays its "Current input timing not supported by monitor display" message.

I worked out how to get things going by using xrandr, a command-line tool that configures the displays.

By itself, executing xrandr outputs details about the detected displays. You need to know the "names" the system has given the monitors plugged into each port in order to control their output settings. In my case, the monitor plugged into the DVI port was "DVI-0", and the one plugged into the HDMI port "HDMI-0".

To make my main screen on the left and the second screen on the right, I used the following command:

    xrandr --output DVI-0 --auto --output HDMI-0 --auto --right-of DVI-0

This works, but leaves the taskbar on the right hand side screen (HDMI-0 in this case). To make the system use a particular screen as the "primary", use the following command:

    xrandr --output DVI-0 --preferred --auto --primary

This shifts the taskbar to the DVI-0 display.

Saving Dual Screen Setup -- Attempt 1

So, after using these commands to set up the displays as desired, I had to work out how to make the changes permanent. The "normal" way to do this (if that's the right word) is to put the configuration into the /etx/X11/xorg.conf file.

Using this answer, I adapted a minimal xorg.conf file and came up with this:
Section "Monitor"
  Identifier "First monitor"
  Option     "PreferredMode"   "1920x1200"
EndSection

Section "Monitor"
  Identifier "Second monitor"
  Option     "PreferredMode"   "1920x1080"
  Option     "RightOf"          "First monitor"
EndSection

Section "Device"
  Identifier  "Radeon HD 7700 Series"
  Driver      "radeon"
  Option      "DVI-0"   "First monitor"
  Option      "HDMI-0"   "Second monitor"
EndSection

Something went wrong when I ran it though. At least, the HDMI-0 monitor got a new name, and became "HDMI-3". So it didn't quite work.

Saving Dual Screen Setup -- Attempt 2

Next I thought I'd try and set things up with xrandr, then go into the Preferences/Display dialog and use the "Keep current configuration" option to save the setup.

This creates a monitors.xml file in ~/.config with the current settings. However, it only applies after you login. The HDMI screen, if plugged in, always seems to be considered the "primary".

Saving Dual Screen Setup -- Give Up

I tried a couple of other wild and fancy things that I found on various sites to set up dual screens, but in the end just gave up. No matter which way I plugged the monitors in, if the smaller 23" LCD was attached, it was the one that "lights up" for the splash screen. After login the 24" came to life, but not before.

I couldn't work out how to get both screens going at the system level, rather than the user level, so I gave up.

Open Source Driver Performance

First test was running a fullscreen 1080p video. It ran with lots of glitches and jaggies when playing. The CPU went up to 50-55 degrees on all cores -- was is actually processing in software?

Then I downloaded the Phoronix Test Suite. The suite package itself is reasonably small, but the full test suite takes over 5GB of download and can take a few hours. I managed to run a few of them, but none of them ran very well. For example, Nexuis looked like it was running at about 0.1 FPS.

It was clear that, unfortunately, the open source driver was not even close.

Proprietary AMD Video Driver

It seemed I could choose between the Catalyst driver from AMD's site, or one of the fglrx drivers that were listed in the software centre. I still haven't worked out what the difference between these two things is -- I think they're related in some way, but I'm not sure how.

So after looking at askubuntu.com/questions/142627, I did:

    sudo apt-get install fglrx-updates flgrx-amdcccle-updates

Bam! Upon reboot, the video was completely broken. I could see the motherboard post, and then nothing -- not even a prompt. The onboard video also wasn't working (at the time I didn't realise you have to unplug the GPU completely for the motherboard to activate the onboard video).

So, at a loss, I booted up and started typing blind the following steps:

  • Reboot
  • Ctrl-Alt-F1 (open a console, that wasn't visible at all)
  • Enter username
  • Enter password
  • sudo apt-get -y remove --purge fglrx-updates
  • Enter password again (for the sudo)
  • <wait>
  • sudo reboot

Fortunately, this fixed the problem. So I can't really recommend installing the fglrx-updates variant of the driver.

Next I tried installing the Linux Catalyst driver from AMD's website. This was version 12.11beta at the time (see upubuntu.com/2012/08/install-amd-catalyst-128-on-ubuntu.html for the steps I followed).

This driver seemed to work fine (it at least didn't black out my screen) but came with the "beta" watermark in the bottom right. To get rid of that, follow the instructions at askubuntu.com/a/216730.

Dual Screen -- Proprietary

Unfortunately, getting dual screens set up with the proprietary driver was, if anything, more difficult than with the open source driver.

I tried the following mechanisms:

  • Steps at unixmen.com/howto-install-ati-driver-in-ubuntu
  • Then superuser.com/questions/395927, but the Virtual 3820 caused tearing when the taskbar animated up
  • Then I used arandr to get the 2nd display going
  • Then I tried the amdcccle (admin) application to apply "Digital Monitor(2) -> Adjustments -> Scaling (0%)" This resulted in another refresh problem on the second monitor, where it would only update while the taskbar on the primary screen was animating during hover.

So I gave up on the dual screen idea in order to get some testing done for the driver. With the dodgy dual screen setup, running the test application fgl-glxgears got 500-600 FPS, but was very choppy.

Proprietary Driver Performance

To revert to a single screen, I entered the following at the command line:

    aticonfig --initial -f

Now running fgl-glxgears got around 2500-3000FPS. So, same driver but running with only a single screen instead of dual screen improved the performance of this benchmark application by 6x, and it no longer looked choppy. But this is a pretty simple little application, I wanted something with a bit more meat.

So I installed xonotic and ran it up fullscreen (1920x1200) with the highest settings I could set. Within the game is ran just fine (too fast for my old hands), but my old eyes couldn't discern any difference between the "default" versus the "high" settings, so I'm not sure if I did it right.

But, after running this (or, it seemed, any "fullscreen" game), the taskbar animation back in the desktop became choppy and caused tearing all over the screen.

Last Ditch

All this playing had taken a couple of weeks by this stage. I got recommended to run the sgfxi script at smxi.org (a "fix it all" graphics driver script). When I downloaded it and ran, it exited saying I needed to run it from outside X.

Which was fine, I thought, so I tried to Ctrl-Alt-F1 into a console. But I couldn't see the console, at all. I could see the X session, but none of the TTY console (1 through 6) were working.

Somewhere along the way I'd borked those. By this time I'd had enough "experimentation".

Blew away Mint. I'm now running Xubuntu with the onboard video. Anyone want to buy a barely used Gigabyte HD7770?

Conclusion

My experience has led me to conclude that both the open source and proprietary drivers for AMD GPUs on Linux are broken. The Intel drivers for the onboard video aren't without their quirks (for example, I find it really hard to configure the login screen to start on a specific monitor at a specific resolution, and setting up dual monitors is still a bit of a chore). But for the most part they work.

With the AMD proprietary drivers I had crashes, no screen at all for a while, and dual screen setup was diabolical. With the open source driver I had tearing and I wasn't quite sure it was actually using the GPU to do anything.

Hopefully I'll get an nVidia card at some point to get another perspective, but I'll be starting with pretty low expectations.

Thursday, January 17, 2013

Run Script Automaticaly with LinuxMint Cinnamon

I worked out how to automatically run my Wacom tablet setup script in Xubuntu, but in Cinnamon none of those options worked.

Eventually I found the .config/autostart directory and modified an existing .desktop file to start the script. This is what I came up with (I assume the file can be called anything, I just called it xsetwacom.desktop):

[Desktop Entry]
Type=Application
Name=xsetwacom
Exec=/home/<username>/.xsetwacom.sh
Terminal=false
Icon=terminal
Comment=Set up the Wacom tablet rotation
Categories=Utility;Application;

(Then I found this post that describes how to do it graphically, which might be easier.)

Wednesday, January 16, 2013

Building i5-3470: Summary

The following is a summary post for my i5-3470 build. Unfortunately a lot of the photos didn't turn out all that well, which will teach me for using my phone instead of a real camera. Oh well.

Part 1: Build Overview

Over Christmas 2012 I gathered together parts to build a new computer.

Group shot!

Machine requirements: general purpose day-to-day workhorse. Needs to be able to do most tasks from email/internet, document/artwork creation, software development, light gaming, virtual machines and (possibly) animation rendering. The last two are not going to be often, but it'll need to handle them.

Chosen parts (desktop box):

  • Case: Corsair 300R
  • PSU: Antec Neo Eco 520C
  • Motherboard: ASRock H77 Pro4/MVP
  • CPU: Intel i5 3470
  • RAM: G-Skill Ares 2x4GB
  • SSD: Samsung 830 128GB
  • HDD: Seagate Barracuda 2TB
  • ODD: Samsung 22x DVD R/W
  • OS: LinuxMint 14 (Cinnamon) [since ditched in favour of Xubuntu 12.10]

The Corsair 300R

Accessories (some added post-build):

  • Monitor: Dell U2412M (24" IPS)
  • Keyboard: Ducky DK9008 Shine II (Cherry Browns)
  • Mouse: Logitech G400

(Yes, I splashed out on an expensive keyboard. Don't you judge me!)

Part 2: Case and Power Supply

After unboxing the case and the power supply, I had a couple of minor conerns:

  • The case had a blemish on the inside about where the motherboard would sit (see image). While it might have been an indication that the case was a return and not brand new, everything else seemed fine and I'm not really sure what difference a "returned" case would make. Also, this could have just been a manufacturing thing anyway.

    Corsair 300R with minor blemish on interior

    This pic also shows up the "bump risers" in the 300R, which comes up later.
  • The box the PSU came in was a little bit beat up, but there was nothing on the inside that made me think it was anything but new.

    The Antec Neo Eco 520C

The first step is to mount the PSU in the case and screw it in. This immediately led to the question: PSU fan up or fan down? A quick web search suggested that down may be slightly better (potentially lower temps on the system, but also someone pointed out you're less likely to drop small items like screws into the fan).

The 300R has a bottom vent, so I decided to go with "fan down".

Case with PSU installed

Next potential concern: there was no voltage selector on the Neo Eco 520C. Other (cheaper) power supplies I've used have had selectors. The lack of one suggested that the Antec could handle either 115V or 240V, and reading the labelling confirmed this. So there was no need to "select" an option.

It's also worth noting that the Antec Neo Eco 520C (and I guess all Neo Ecos?) doesn't come with a power cable. For me this wasn't a problem since I had half a dozen laying around, but might be a problem for some people.

Part 3: Motherboard Installation

Some people like to install the CPU/heatsink/RAM before putting the motherboard into the case. I just whacked the motherboard in there right up front, mainly because I didn't have a place where I felt comfortable putting it to then push and prod other parts into it.

The first issue I had with the motherboard was: where are the motherboard risers? The Corsair 300R only came with one motherboard riser in the pack of screws. This confused me, since in the past the cases I'd used needed at least half a dozen risers to prop the motherboard up so it wouldn't touch the case and short out.

It turns out that the 300R has "bump" style risers, where you don't actually need to screw in anything. Convenient...once you know about it.

Motherboard with CPU installed

After that, the CPU went in without an issue. It can only go in one way, you just have to line up the bumps and indentations. The heatsink/fan was a different story.

I've done it a couple of times now, so I seem to have a knack for seating the heatsink in such a way that the power cord for the CPU fan won't reach the spot on the motherboard where it plugs in. This time I misread the "CHA1 fan" as "CPU fan", and seated the heatsink accordingly. After realising my mistake, I pulled it off and rotated 90 degrees so it would plug into the correct spot. (Technically, since I pulled the heatsink off after being seated on the CPU, I should have redone the thermal paste, but since the machine hadn't ever been powered up, I felt it wasn't that much of a risk. But I noted it to check the temps first thing after powering on).

CPU fan plugged into wrong spot

The only interesting thing with the RAM is that the ASRock motherboard doesn't colour-code the slots like, say, a Gigabyte motherboard. But to use dual-channel, the RAM goes in the same way (that is, leave a gap between the RAM sticks to run in dual-channel).

Motherboard with RAM installed

Part 4: Plugs, Cables and Initial Bootup

Next was to plug in all the drives (DVD, HDD, SSD), case fans and the front-of-case switches, LEDs and USB cables.

Corsair 300R cable management (back view)

The cabling with the 300R turned out fairly nice, with the USB3 and leftover molex/PCI power cables being the most obtrusive. It really helps having someone else around to hold and adjust cables from one side while you're trying to tie them (thanks Dad).

Corsair 300R cable management (front view)

That brings us to the moment of truth: the first power on.

I flicked the switch and passed the first test: it didn't explode. However, the power cables for the CPU fan were wound so tightly around the heatsink that they caught on the fan and prevented it from spinning. This has happened almost every time I've installed an Intel stock fan, so from now on I check this before turning on.

After noticing the fan not spinning, I shut down straight away. Even though the CPU should protect itself from overheating and kill the power, it's not something you want to risk if you don't have to. I rearranged the wires of the CPU fan and everything went okay on the next powerup.

I'd forgotten that I had a Bodhilinux distro installed on the SSD from when I tested it out in a previous machine. When I turned it on (in this completely new build), it ran up without a glitch.

Initial impression of the sound is that the stock CPU fan is a little louder than the i3 3220. May have just been imagination, or something to do with re-seating it, but it's still a bit louder than what I was expecting/hoping for.

Build complete

Overall, pretty happy with the build. Next step is installing (and experimenting) with a GPU while running Linux.

Sunday, January 6, 2013

Dual-booting Vista and Linux

I found these notes from a while back on re-partitioning (and then reverting) a dual-boot Linux install on Windows. After working this out I now prefer to install on physically separate disks (due to the problem of reverting it if you ever want to). However, someone might find the following process of use.

Installation is easy; reverting back to a single boot, single partition is much more difficult.

If you're thinking of installing Linux as an alternative to the wonderland of Windows, consider these things:

  • Run Linux from a Live DVD (basically the .iso image of the distribution burnt to a CD/DVD) to test device drivers for all your hardware. This way you don't have to change disk partitions until you're happy that it's going to work. Consider the software you want to run as well.
  • Decide what is a showstopper, hardware compatibility-wise.
  • If you want to go ahead and dual-boot Linux and Windows on the same drive, be really sure because you will need to repartition the hard drive. Repartitioning isn't hard -- the Linux installer takes care of it -- but if you want to reverse the process and remote the partition, it is a pain in the arse.
  • Backup everything first.
If you install and then decide you want to revert, these are the steps I found worked (note: this was done in Vista. Process may be different for Windows 7):
  1. Download mbrfix to restore the Master Boot Record (MBR). Run the following from a command prompt:
    mbrfix /drive 0 fixmbr /vista
    Important: To start the command prompt, right click on the shortcut and choose "Run as administrator" (even if you're logged in as administrator), otherwise you will get the following error:
    System error 5 has occurred. Access is denied
  2. Check that Windows boots normally.
  3. Delete and reallocate the partitions. Avoid Vista's partition management -- it doesn't work. I burnt a GParted Live CD (iso image) and used that. It takes a long time, but it works.
  4. After re-partitioning the drive, I had a problem with a missing winboot.exe. Inserting the Vista installation DVD and choosing the "Repair your computer" option fixed this problem.

Sunday, December 30, 2012

A4Tech KLS-5 Makeshift Interim Keyboard

So I built a new computer, and while I'm transferring stuff from the old one to the new one I'm running both at the same time. And I found that I only have one keyboard in the house (!).

Rather than get irritated swapping keyboard cables over all the time, I looked up what was the cheapest wired keyboard I could find, then went out and got an A4Tech KLS-5 wired USB keyboard for $9.

Size comparison to my old Logitech keyboard

It's small, and the build quality is...light, but for the price, I was actually pleasantly surprised. I hit keys and the characters appear on the screen. I couldn't ask for more.

There is only one problem (keep in mind, this is a $9 keyboard we're talking about), and that is the location of the \| key: it's right where Enter is on a normal keyboard. Every single carriage return I hit the \ key instead.

But for a short-term "give me a keyboard so I can type" solution, I would heartily recommend...well, nothing. My cheap keyboard worked. Now you know.

Saturday, December 29, 2012

Remove annoying "WD SmartWare" automount

If you've got a WD USB hard drive plugged in, it will probably automount both the "content" part and the annoying "WD SmartWare" part.

The SmartWare is WD's attempt to help people out with some backup and other data management software. It cops a fair bit of flack from what I can see. I never used it, so can't comment, but I'm pretty sure it's all Windows-based anyway. On Linux it makes no sense to have it appear all the time.

To get rid of the automount, edit /etc/fstab (requires sudo) and add the following line:

LABEL=WD\x20SmartWare none udf rw,noauto 0 0

This solution was one of many possible solutions I found, but it worked and was easy. Thanks saltydog.

Update: While initially I thought the above solution worked, it stopped working at some point, because the "WD SmartWare" has now reappeared on my desktop. So I'm open to any other solutions...

Saturday, December 15, 2012

Crowdsourcing FTW

Awesome example of a crowd-sourced investigation and solution:

http://forums.whirlpool.net.au/forum-replies.cfm?t=2025126.

Sunday, November 4, 2012

Wacom Intuos 5 Rotation

To rotate the Intuos 5 for sinister left-handed people:

$ xsetwacom set "Wacom Intuos5 M Pen stylus" Rotate half
$ xsetwacom set "Wacom Intuos5 M Pen eraser" Rotate half
$ xsetwacom set "Wacom Intuos5 M Pen cursor" Rotate half
$ xsetwacom set "Wacom Intuos5 M Pen pad" Rotate half

To get these commands to run at startup, I added them to $HOME/.profile (after trying .bashrc and .Xsession, neither of which worked [running Xubuntu]).

Adapted from notes at linuxwacom sourceforge site.

Dual-screen Setup

(Updated 24 Feb 2013)

After getting an nVidia GPU, I had much more luck getting dual-monitors to work than with either AMD or Intel graphics. By default though the tablet will span across all monitors. If you want to reduce this to a single monitor, do this:

$ xsetwacom set "Wacom Intuos5 M Pen stylus" MapToOutput HEAD-0

Note: if you're not using nVidia drivers, the output of xrandr will give you the names of your screens, rather than HEAD-0, HEAD-1, etc. as shown above.

Sunday, June 10, 2012

Lock Screen Command in Gnome/Cinnamon

The correct lock screen command in Gnome (and hence Cinnamon) is:
gnome-screensaver-command --lock
This is useful in the context of remapping keyboard shortcuts. For some reason, lots of internet searches come up with the equivalent X-based command for locking the screen.

Mapping Keyboard Shortcuts in Cinnamon

Using gconf-editor, follow instructions at http://www.maphew.com/Linux/Use_WinKey_in_Ubuntu.html.

The example is to map Super+E (or Windows+E) to start nautilus, like Windows opens Windows Explorer. The important steps (in gconf-editor) are:
  1. Go to /Apps/metacity/global_keybidings
  2. Set run_command_1 to <Super>E
  3. Go to /Apps/metacity/keybinding_commands
  4. Set command_1 to /usr/bin/nautilus

Installing Canon-MF4140 Drivers on Mint 64-bit

I'd installed drivers for my Canon MF4140 on Linux Mint 11 (32-bit) with a bit of fluffing around. For the 64-bit Linux Mint 13, more fluffing around was required, but of a different sort.

To start with, the drivers from Canon don't have .deb files for 64-bit, so you need to install alien and convert the .rpm files to .deb.
sudo apt-get install alien
sudo alien -k --scripts cndrvcups-common-2.40-2.x86_64.rpm
sudo alien -k --scripts cndrvcups-ufr2-uk-2.40-2.x86_64.rpm
This creates two .deb files, which can be installed with dpkg -i <filename>.rpm. This all worked fine, the printer was detected and added, but nothing would print.

Following this thread, I ended up getting it working, but I did a number of steps suggested, so I'm not sure which ones were necessary.

Overall:
  1. Copy the files as suggested here from /usr/lib64 to /usr/lib. Some of the files might already exist.
  2. Install some more "silent dependencies" as described here: sudo apt-get install libc6-i386 ia32-libs lib32z1. This adds 150Mb or so of dependencies -- quite a lot. Not sure if they were actually needed...
  3. In the end, because this was Mint 13, the important files to copy from /usr/lib64 to /usr/lib were libcanonc3pl.so and libcanonc3pl.so.1. This was the step that got things working, so I'm not sure if steps 1 and 2 were actually necessary. My printer is working, I'm not touching these files again.

Running Diablo II under wine in Linux Mint Cinnamon

Disabling or re-mapping Alt+Click
If you're playing Diablo II in wine, the default Alt+Click mapping in Cinnamon (which moves the underlying window) is kind of annoying. Since the desktop environment is based on Gnome (I guess), you can use the gconf-editor tool to edit the mappings.

Under Mint 13, the configuration editor isn't installed by default, so you might have to do this:
    sudo apt-get install gconf-editor
    gconf-editor
Then navigate to apps/metacity/general and edit the mouse_button_modifier key to something else (I used "Control" which seems to be fine).

Getting "pick up items with Alt held down" to work
Holding down Alt highlights items. If you can't pick up items with Alt held down, you may need to disable the window manager control of the wine window.

To do this, run winecfg, go to Graphics tab, and uncheck the "Allow the window manager to control the windows" option.

Alt+Click for item pick up now works. The downside is that the window won't appear in the taskbar any more, and when you minimise it you get a little icon in the bottom left-hand corner. But it works.

Note: While initially I did this and it seemed to helped, it might also cause keyboard interaction to stop working. I was playing around with the "Window focus mode" in Cinnamon -> Window Settings at the same time, so at the moment I've turned the window manager control back on in winecfg and it's okay.