Showing posts with label linux-mint. Show all posts
Showing posts with label linux-mint. Show all posts

Wednesday, November 23, 2016

Fix "Cinnamon Just Crashed" on Linux Mint 17.3

A recent update in Linux Mint included the nVidia 367 driver. Even though my HTPC was using integrated graphics, having the driver installed causes Cinnamon to crash with the error message:

Cinnamon just crashed. You are running in fallback mode.

A fix is to remove the nVidia 367 driver completely:

sudo apt-get purge nvidia-367

Reboot and Cinnamon should be running okay again.

Friday, January 15, 2016

HTPC OS Upgrade

My HTPC was running off a non-LTS distro for a while, finally got around to reinstalling. The process wasn't without hiccups, but overall wasn't too bad.

The two primary applications I run are Kodi (aka XBMC) and MythTV. The Kodi reinstall was easy, MythTV a little trickier to get right. These are the steps I followed:

Initial Install/Setup

  • Reinstall the new OS. I used LinuxMint 17.3 with Cinnamon as I'd been using Mint 15 previously. I also partitioned the existing SSD so that the old install is still available.
  • Set up standard stuff like web browser, terminal config, graphics drivers, etc.
  • Set system audio to appropriate device — as I was using audio over HDMI, the default sound device wasn't the right one.
  • Probably want to turn off the screen saver.

Kodi Install

  • Install Kodi
    sudo apt-get install kodi
  • Copy old ~/.xbmc/userdata directory to new install. Kodi data is stored in ~/.kodi.
  • Start Kodi. User settings like which videos you've watched should be retained. May need to configure the audio settings, I did as I was using HDMI.

MythTV Install

  • Boot back into the old OS install and follow the MythTV database backup procedure. I used:
    /usr/share/mythtv/mythconverg_backup.pl --directory <path_to_shared_drive>
  • Boot back into new OS install.
  • Install MythTV (this will install dependencies like MySQL).
    sudo apt-get install mythtv
  • Recreate the database. Note that this will create the database with a default username and password of "mythtv", which caused problems for me when restoring the database backup in the next step.
    mysql < /usr/share/mythtv/sql/mc.sql
  • Restore the database. Could not get the preferred method to work — it kept failing with a "could not connect to database" error. Could not get mythconverg_restore.pl to connect. At first I thought it was a password issue, but setting the correct password in /home/mythtv/.mythtv/config.xml didn't help. In the end I found this post, which gave the command to manually paste the database backup back. As the mythconverg_backup.pl script gzips by default, I did the gunzip on the backup file before running the following:
    mysql -umythtv -pmythtv mythconverg < backup_filename.sql
  • Run mythtv-setup. I needed to add the TV tuner adapters and sources — so I guess this wasn't part of the backup — and scan for channels. Also add the existing hard drive paths as storage directories.

I had to unplug the tuner (DigitalNow TinyTwin) to get it to appear — not sure why, but other than that the OS upgrade went pretty seamlessly.

Tuesday, November 12, 2013

Review: TP-Link TL-WN722N USB Wifi Adapter

Yesterday a friend from work lent me his TP-Link TL-WN722N USB wireless adapter to try out.

I plugged it into a machine running Linux Mint 15 (Cinnamon) 64-bit. At first everything seemed fine: it connected to the router flawlessly, and started getting data as fast as the internet could provide it.

Then I moved the machine into another room, to see how it would go through walls. It was about 8 metres away, going through two brick walls. It could no longer connect.

You mad bro? (Definitely didn't like being moved away from the router)

I gradually moved the machine closer, but found that I had to be in direct sight of the router and less than 1 metre away before it would connect up. I can't imagine this is normal, and must be a fault with the hardware. Bit unfortunate! If you've got one of these and get similar symptoms, I'd be returning it straight away.

Unfortunately I can't really do a proper review (even for me, I'm pretty rough after all) with these results. :(

Monday, June 17, 2013

Fixing nVidia Graphics Tearing on LinuxMint Cinnamon

So, after installing an nVidia GTX 650TI a while back, I put up with tearing in pretty much all applications because it was easy to install and get going.

But eventually I got sick of it and tried to fix it. After trying about every fix I could find, I jumped to a different distro (from Xubuntu 12.10 to Mint 15) in the hope that might have some effect. It didn't, but I re-tried a fix I thought I'd already tried, and found it eliminated the tearing 100%.

The fix is to add this to the /etc/environment file:

CLUTTER_PAINT=disable-clipped-redraws:disable-culling
CLUTTER_VBLANK=True

This is using the nVidia proprietary driver 304.88. Hope to confirm on other Xubuntu systems whether this fix also works.

Update 20 June 2013:

Unfortunately, the fix only seems to work in Mint/Cinnamon. Title updated to reflect this.

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.)

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.

Saturday, October 29, 2011

Automatically Start a Script in Linux Mint LXDE

In a default install, the directory to put an autostart script doesn't exist.

I found it was:
    ~/.config/lxsession/Mint-LXDE

Add a file called autostart here to automatically run scripts or start applications.