07 September, 2019

Debian Buster: Prevent the "POP" from audio device when sound played

Debian Buster by default will have the power saving features enabled for most devices, this includes the audio device. This is all well and good when buster is installed on a mobile device, but is annoying on a desktop device.

The problem that this causes is that the kernel will shutdown the audio device in order to save power, with the downside that an audible pop/click will be heard when a sound is made (and example would be the "bell" in the terminal or a notification sound).

A few seconds after the sound is played the kernel will put the audio device back into power saving.

This can be temporarily disabled with the following two commands. Note that this if for the intel hda and will not survive a reboot.

echo 0  > /sys/module/snd_hda_intel/parameters/power_save 
echo N > /sys/module/snd_hda_intel/parameters/power_save_controller

This will only work if you have an intel system board and are using the inbuilt sound. If you are unsure, examine the pci bus with lspci -v 

To make this setting stick I setup rc-local support in systemd. This will make systemd execute the /etc/rc.local script if it exists.

First, check to see if systemd has a rc-local service defined.

sudo systemctl status rc-local

By default this will not exist, so lets create one !
first we create a service definition file rc-local.service in /etc/systemd/system/

sudo nano /etc/systemd/system/rc-local.service

and past in the following contents

 [Unit]
 Description=/etc/rc.local Compatibility
 ConditionPathExists=/etc/rc.local

[Service]
 Type=forking
 ExecStart=/etc/rc.local start
 TimeoutSec=0
 StandardOutput=tty
 RemainAfterExit=yes
 SysVStartPriority=99

[Install]
 WantedBy=multi-user.target

Next, create /etc/rc.local and put the commands we used before to turn off the power saving feature.

sudo nano /etc/rc.local

Paste in the following:


#!/bin/bash

sleep 10
echo 0 > /sys/module/snd_hda_intel/parameters/power_save 
echo N > /sys/module/snd_hda_intel/parameters/power_save_controller


Set the script to be executable with chmod +x /etc/rc.local
Next we enable our service in systemd with:


sudo systemctl enable rc-local

and start it with:

sudo systemctl start rc-local.service

To confirm that the service is running:

sudo systemctl status rc-local.service

You should see output similar to this:

● rc-local.service - /etc/rc.local Compatibility
   Loaded: loaded (/etc/systemd/system/rc-local.service; enabled; vendor preset:
  Drop-In: /usr/lib/systemd/system/rc-local.service.d
           └─debian.conf
   Active: active (exited) since Sat 2019-09-07 09:37:45 AEST; 33min ago
  Process: 4583 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)

Reboot and enjoy your pop free sound.




 
 

09 July, 2019

How to install steam on Debian 10 (Buster)


Note: console commands are listed as bold and italic.

Ensure that contrib and non-free are added to your sources.list (/etc/apt/sources.list). I've provided an example of mine below:

deb http://mirror.aarnet.edu.au/debian/ buster main contrib non-free
deb-src http://mirror.aarnet.edu.au/debian/ buster main contrib non-free

deb http://security.debian.org/debian-security buster/updates main contrib non-free
deb-src http://security.debian.org/debian-security buster/updates main contrib non-free

# buster-updates, previously known as 'volatile'
deb http://mirror.aarnet.edu.au/debian/ buster-updates main contrib non-free
deb-src http://mirror.aarnet.edu.au/debian/ buster-updates main contrib non-free




update your apt cache with sudo apt update. If all goes well, you can install your non-free grapohics driver, which in my case is nVidia.

with sudo apt install nvidia-driver

Since the Steam client is a 32bit application we will also need to enable the i386 architecture in apt.

use dpkg --add-architecture i386 since we've made a change to apt, you'll need to update your apt cache again with sudo apt update.

Finally install the nvidia-driver-libs-i386 package with sudo apt install nvidia-driver-libs-i386.

You should end up with both the 64bit and 32bit nvidia libraries, which should look similar to this:

dpkg -l | grep nvidia-driver
ii  nvidia-driver                        418.74-1 amd64 NVIDIA metapackage
ii  nvidia-driver-bin                  418.74-1 amd64 NVIDIA driver support binaries
ii  nvidia-driver-libs:amd64     418.74-1 amd64 NVIDIA metapackage (OpenGL/GLX/EGL/GLES libraries)
ii  nvidia-driver-libs:i386         418.74-1 i386 NVIDIA metapackage (OpenGL/GLX/EGL/GLES libraries)
ii  nvidia-driver-libs-i386:i386 418.74-1 i386 NVIDIA metapackage (OpenGL/GLX/EGL/GLES 32-bit libraries)


Finally, we can install steam with sudo apt install steam.