Wednesday, November 20, 2013

Assorted Linux Tweaks - Over a Month in Linux

Here's another list of various tweaks I've made to my setup today to get it working with all the hardware I have (and a request for help!)

These include:
* Preventing USB Mouse poweroff on battery power
* Fixing video playback (green screen) issues in Qt applications
* Finding CA Certificates to get eduroam Wifi Working
* Avoiding duplicate entries in Bash up-arrow history


USB Mouse on Batteries
To save battery power, I installed the "laptop-mode" package, as it seemed that i was only able to get just under half the battery life I could get under Windows (as reported by the uncalibrated battery level indicator).

However, I found that by default, this ends up killing my USB mouse moments after plugging it in when running off batteries - a big no-no, as the touchpad is really nasty for long term use (e.g. if giving presentations or during meetings).

The solution (inspired by this) was to open:
gksu gedit /etc/laptop-mode/conf.d/usb-autosuspend.conf
and add the device ID (046d:c019 - found using lsusb) to the list of devices that the auto-suspend is not performed for. That is:
AUTOSUSPEND_USBID_BLACKLIST="046d:c019"

Other USB-Related Issues
As mentioned in an earlier post, I had some issues getting my Canon 7D connected on Linux so that I could get images off it. While my current workflow isn't nice (there's still quite a lot to be desired in terms of speed and ease of use for grabbing just the new files and dumping them in folders in a way that I like), at least it works.

The solution there was to kill the "gvfs-gphoto2-volume-monitor" process. For whatever reason, this bugger seems to have issues with USB 3.0 ports and anything that looks like it might host some images.

I haven't confirmed this yet, but from initial tests, it seems that after killing this process, not only does my Canon 7D work nicely, but I can also get the 2Degrees 3G USB Modem Stick I got (as backup for when my Telecom broadband gives up the ghost and pulls a hissy fit - like it did for 3-4 days after I uploaded the silvereye videos) working! Previously, it refused to be detected, despite all the lights showing the correct indications.


Video Playback Issues in Qt Applications
For various reasons I'm not sure of, it appears that various Qt-based applications have trouble displaying video, whereas their GTK based alternatives work perfectly fine. Examples of broken applications include VLC, Skype, and Minitube. Alternatives which work include Totem and Cheese.

For reference, my graphics setup is now:
* Intel HD 4600 + NVidia 750M (i.e. a Nvidia Optimus setup)
* Bumblebee + NVidia-319 (proprietary drivers)
* Cinnamon 1.8.8
* 64-bit Linux

While I haven't managed to get Skype or Minitube working, I have managed to fix the problems with VLC: In the end, it boiled down to disabling "Accelerated Video Output (Overlay)" under Video in the Preferences.

This didn't initially work (NOTE: it only seemed to work after I enabled 'Use GPU Accelerated Decoding' in the Input&Codecs section once, though this is no longer necessary). Many of the other output options (for the "Output" setting) however didn't work, and would either crash VLC with some error about an unsupported OpenGL function, or with some error about other unsupported flags (and still no video).

Doing the same for Skype or Minitube however seems much trickier and perhaps impossible, until I find the right settings/config files to work around this. Better advice on this issue is welcome!


Finding CA Certificates to Get "eduroam" Wifi Working
Getting the wifi at uni working has always been a challenge with many of the devices I use. On Linux however, this proved extra difficult, as it kept requiring me to specify where an appropriate CA Certificate is located.

Thanks to this very detailed set of instructions (which were much more helpful than our IT department's page - which only really catered to the Windows users out there), I learnt that actually, all the relevant certificates can often be found by navigating to:
/usr/share/ca-certificates/mozilla/
and choosing one of the certificates there which matched the name of the certificate used. This ca-certificates directory also contains a few other useful certificates should the need arise, but the mozilla one is the most complete.

Finally, after setting that, and trying a few times (and cursing each time the connection dropped just when it looked like it would work), I finally managed to connect my laptop to the wifi at uni. Yay!


No Duplicate Entries in Bash Up-Arrow History
One thing that has been annoying me for a few days while working on Blender is that the up-arrow history for Bash seems to include duplicate entries for commands. This means that, when doing quick edit/compile/test cycles, sometimes you might accidentally compile twice, and as a result the history gets polluted with a sequence of two compile steps followed by a test. Eventually though, this all builds up, and it starts getting confusing/annoying to quickly switch between the two.

The solution is to the add the following line to your ".bashrc" file in your HOME directory:
export HISTCONTROL=ignoreboth:erasedups

See this page (where I got this tip from) for more details about why this works :)

No comments:

Post a Comment