OpenSuSE 42.1 Installation

Hardly anything is as annoying as having to install a new version of an operating system. Especially if you want to keep all your old settings and tricks...

Allow TRIM on encrypted volumes

This has its pros and cons, that is why it is not enabled by default. Allowing the SSD to know which blocks are unused also tells a potential attacker which parts of the disk are actually holding encrypted content. This is more relevant for disks that are pretty empty. However even if the attacker knows which parts are data, they still have to break the encryption. Since an SSD becomes extremely slow and also degrades more quickly without TRIMming, one might want to enable it, particularly if the security does not have to be top-notch. Basically, this was taken from here.

  1. First layer: Device Manager. Edit /etc/crypttab and set the 4th field of the respective mount point to discard if it is none, or add discard, separated by a comma. It could then look like this:
    crypteddisk-part2 /dev/disk/by-id/ata-somedisk-part2 none discard
  2. If you are using LVM on the encrypted disk (for example to be able to decrypt swap, root and home partitions by entering a password a single time), then edit /etc/lvm/lvm.conf. Look for issue_discards and change the line to say
    issue_discards = 1
  3. To actually make discards happen, you either need to add discard to the mount options (not recommended), add a cron job or do it manually. The problem with adding it to the mount options is that it causes TRIMs to be issued quite frequently. Apparently this can cause some SSDs to reshuffle data too often, achieving the opposite of the intended effect (i.e. the SSD wears out more quickly). Whether this is still true I cannot say.
    A cron job could look like this:
    # minute hour DoM month DoW command
    13       */5  *   *     *   /sbin/fstrim /

    Doing it manually is not that bad either, especially if you are playing games or doing hard-disk intensive simulations or anything else where you really cannot afford to have your performance eaten by cron running your fstrim command. Basically just run fstrim when you have time, once a week should probably still suffice.

Disable nouveau

Nouveau is the open-source driver for Nvidia graphics cards. Personally I have found that on my Notebook, which additionally to the intel graphics has a dedicated Nvidia graphics card, the nouveau driver seriously degrades the stability of the system. Apparently it is confused - the display is connected to the intel graphics card, so it does not make sense to even load the driver (except for power management) in normal circumstances. Maybe they already try to offload some desktop effects or other fancy stuff - anyhow none of this works properly. It fills the logs with errors and causes the system to hang...

This is more or less fixed by editing /etc/modprobe.d/50-blacklist.conf and adding the line

blacklist nouveau

Then you have to run

# mkinitrd

to make sure the system is not already booted with the driver loaded. You can skip this if you install bumblebee, since it is then executed later anyway. Next, whether or not you want to use the dedicated graphics card, I would strongly recommend to install Bumblebee as described here. Otherwise, your graphics card will not be power-managed and happily heat up your computer. If you are using btrfs for your root filesystem, it is useful to create a snapshot first.

# snapper create -d BeforeBB

Add the repo:

# zypper ar http://download.opensuse.org/repositories/X11:/Bumblebee/openSUSE_Leap_42.1/ Bumblebee

Install:

# zypper in bumblebee

Add users to the required groups so that they can use bumblebee to offload their graphics to the dedicated card:

# usermod -G video,bumblebee <username>

Enable the daemon:

# systemctl enable bumblebeed

Write whatever is needed to the initrd:

# mkinitrd

For the proprietary driver, run

# zypper in linux-glibc-devel
# zypper in -t pattern devel_kernel
# zypper in nvidia-bumblebee
# systemctl enable dkms

If you want to run 32 bit applications (i.e. wine):

# zypper in nvidia-bumblebee-32bit

You need to reboot here - at least it is the most convenient way to get everything to work.

Fixing washed out colors

For some hopefully really good reason, the intel graphics driver sometimes decides to set an HDMI connection to "Broadcast RGB" which makes everything look really washed out by default. That's because by default, "Broadcast RGB" limits the colorspace to the range of 16-235. Apart from patching the kernel, what you can do is set the range to Full manually:

xrandr --output HDMI1 --set "Broadcast RGB" "Full"

However this is not permanent (i.e. gone after a reboot). To make it run automatically, I suggest you create a file /etc/X11/xinit/xinitrc.d/hdmifullcolor.sh with the following content:

#!/bin/bash
xrandr --output HDMI1 --set "Broadcast RGB" "Full"

Fixing suspend on lid close

If you are using your laptop like me, i.e. mostly closed with everything attached externally (screen, keyboard, mouse...) it is really annoying when, after setting up the system, logging in, configuring the external monitor and closing the lid, the system suddenly suspends, i.e. falls asleep. This has to be fixed at two locations:

  1. KDE (no idea where but there should be a similar setting for GNOME): Right click on the battery symbol in your control bar and select "Configure Power Saving..." or open the System Settings (Configure Desktop) and select "Power Management". Set "when laptop lid closed" to "Do nothing" in all of On AC Power, On Battery and On Low Battery. I am pretty sure that it does not help to keep it enabled in either of these states since the system acts "on change" (afaik) that means, the system will not suspend if the lid is closed and the battery suddenly runs low. If you want your system to instantly suspend on low battery, the right way to do it is to use "suspend session" after 0 minutes or run a script.
  2. Another puzzling thing is that when logging out with the lid closed, the system suddenly falls asleep - that is because the login daemon has its own rules for what to do when the lid is closed. These can be edited in /etc/systemd/logind.conf. Make sure that the following lines are set:
    HandleLidSwitch=ignore
    LidSwitchIgnoreInhibited=yes

    Though you can keep the second line commented, if it is in your case. Just check if it works, also read the manual.

Pulseaudio

Pulseaudio has always been one of my pet peeves. Unless you are working with audio a lot I cannot see why you would even want to have it. Some reasons:

  • It is a huge pile of crappy code - for what? For being able to set a soft-volume on every stream?
  • It eats your CPU. Not quite as badly as it used to but it still does.
  • It has a poor one-size-fits-all approach to sound hardware. Some controls might just vanish or use a completely stupid default setting.

Case in point: my intel sound card supports switching between "auto-muting" the external speaker if headphones are plugged and keeping the external speakers on even while headphones are plugged in. In pulseaudio, this control is just completely gone. If you want to listen to something using your speakers you better unplug your headphones. For me, this would mean plugging and unplugging a connector about twenty times a day, something that it was not designed for (neither was I). Besides, I really do not see the point in pulseaudio - most people do not use it for anything but to have separate volume sliders for every source. This adds a soft-volume on top of a soft-volume which mostly already exists in the applications (like flash, firefox html5 player, qmmp and various chat programs).

Of course, it also supports "easy" output to multiple soundcards, something that is truly a PITA to get to work in pure alsa. However, hardly anyone uses that. I would also be wary to use pulseaudio for serious DJing since it adds quite some latency and needs special settings to be low-latency - and then it is still slower than pure alsa, because in the end it still pipes everything into the alsa sinks.

So, how to disable it. In Leap, this has become quite easy: Just run

# setup-pulseaudio --disable

I am also using this .asounrc file to enable multiple programs to output sound simultaneously. It retains the possibility to run a pulseaudio server that does not grab the default alsa device and is then only used by programs which are configured to use pulse.

Another problem on intel platforms is that the sound cards are often initialized in the wrong order (i.e. the hdmi-sound from the cpu-integrated gpu is first). This sucks, especially since pulseaudio refuses to recognize that the "hw:0,0" which it likes to use as default output is a hdmi device which only accepts very few audio formats and settings. The same is unfortunately true for the default alsa setup. The best and easiest way to fix this is to swap the order of the sound cards. For this, edit /etc/modprobe.d/50-sound.conf and add the line

options snd-hda-intel index=1,0

after the first line which probably looks like

options snd slots=snd-hda-intel,snd-hda-intel

Unsolved: Desktop Gestures

I have not yet managed o get desktop gestures to work. The Shortcuts -> Custom Shortcuts settings dialogue does not even let me save the "Start the Input Actions daemon on login" setting. This is very annoying :(

If you have any suggestions, please send me an email.

© 2010-2021 Stefan Birgmeier
sbirgmeier@21er.org