Archive for February, 2013

Getting Realtek Audio to Play Sounds Through Both Speakers and Headphones

Monday, February 18th, 2013

Running Multiple Channels of Audio Simultaneously in Linux

In Windows, I configure my Realtek audio to play sounds through my headphones (plugged into the front panel jacks) and my speakers (plugged into the rear panel jacks) simultaneously. I noticed in Ubuntu, the default is to mute sound in the rear when a device is plugged into the front. I wanted to stop this behavior, so here's what you have to do. Some people may also be looking to mute the rear speakers when a device is plugged into the front, so I have included both configurations. Download this nifty utility to manage and configure your audio settings by running these commands.

sudo apt-get install gnome-alsamixer
alsamixer

In this application, you can adjust volume and mess with several other settings.

At the bottom of alsamixer, scroll over to the "<Auto-Mute>" option.

To play audio through both headphones and speakers, change Auto-Mute to "Disabled".

To play audio through only one device, change Auto-Mute to "Enabled".

Hope that helps!

 

Install Latest Nvidia Drivers with a Custom Compiled Kernel in Ubuntu

Monday, February 18th, 2013

Installing Nvidia's Latest Drivers in Ubuntu using a Custom Compiled Kernel

I compiled the latest kernel 3.7.9 in my Ubuntu 10.04 Lucid following this guide here:  http://www.howopensource.com/2011/08/how-to-compile-and-install-linux-kernel-3-0-in-ubuntu-11-04-10-10-and-10-04/

Everything worked properly, but I ran into problems when attempting to install Nvidia's latest drivers (version NVIDIA-Linux-x86-310.32).  The DKMS build would not work and I received errors like "Unable to determine the target kernel version", "bad exit status 2", and "kernel header file does not exist" in the make.log file (along with others) in the /var/lib/dkms/nvidia folder.  The installer would always fail.  So, here's how to get the latest drivers installed and working properly with DKMS support.

First, we need to remove anything Nvidia that may already be installed.  There may be some Nvidia packages that are already installed on your system even though you've yet to install the Nvidia drivers!

Step 1: Download Nvidia Driver and Blacklist Other Drivers:

You can download the Nvidia drivers from http://www.geforce.com/drivers

Nvidia Drivers will only install if you are not running X, so you'll have to install this in a terminal.  Stop GDM before running the rest of the commands.

sudo service gdm stop

Now, we'll need to Blacklist some drivers.  To do this, launch a terminal, and use the following commands:

sudo nano /etc/modprobe.d/blacklist.conf

Add the following entries to the bottom of the file:

blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv

Run the following command:

sudo apt-get --purge remove nvidia-*

Step 2: Creating Symbolic Links

For some reason, after compiling the latest kernel, the symbolic links the Nvidia installer relies on do not exist.  We'll need to create them.  Run the following commands in a terminal:

sudo ln -s /usr/src/linux-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-$(uname -r)/include/linux/version.h
sudo ln -s /usr/src/linux-$(uname -r) /usr/src/linux

Step 3: Prerequisites

Install the following prerequisites by running these commands:

sudo apt-get install dkms

Step 4: Run the Nvidia Installer

Now, run the Nvidia installer and the DKMS module should build.

sudo sh NVIDIA-Linux-x86-310.32.run

Or whatever version you downloaded.