GIDNetwork > Linux on Dell Precision M90 - Part V: Sound
Register
« Linux on Dell Precision M90 - Part IV: Networking Colonial Marines RPG now on Sourceforge »

Linux on Dell Precision M90 - Part V: Sound

by: dsmith - May 15, 2006

This section of the document describes the setup of the Intel HD Audio sound card in Linux. It also describes a neat way to get your Dell media keys to work under Linux. This is written specifically for Slackware and the Precision M90, but could be used with about any Dell laptop and any distribution.

Sound Setup

Using lspci, the sound card is identified as:

Generic Code Example:

Class 0403: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)

Depending on what kernel version you are using (see below), this functions properly using the ALSA Intel HD Audio driver in the kernel:

Generic Code Example:

Device Drivers -->
	Sound -->
		Advanced Linux Sound Architecture -->
			Intel HD Audio

Make sure to enable the OSS Mixer, Sequencer and API emulation under ALSA to assure that your sound will work with legacy OSS programs.

Kernel 2.6.16 Note: Interestingly enough, the driver for the Intel HD Audio in kernel 2.6.16 is broken. Everything appears to work fine, but alas there is absolutely no sound no matter what you do. I was able to get my sound card working by installing the latest ALSA driver, lib and utility.

If you need to do this, you need to turn off ALSA support in the kernel. You still need to enable sound support though:

Generic Code Example:

Device Drivers -->
	Sound

Then download the latest drivers and software from The Alsa Project. You will need the driver, the library and the utilities.

Alsa has some of the best installation instructions possible. You can go to this page for installation instructions specific to the Intel HDA.

I will briefly highlight the critical points. If you need more detailed instructions, look at the above link to the ALSA instructions. The files should be installed in this order:

  • alsa-driver

  • alsa-libs

  • alsa-utils

Use the standard configure; make; make install routine for each. The only caveat being at the drivers, make sure to use this configuration line:

Generic Code Example:

./configure --with-cards=hda-intel --with-sequencer=yes

To test/load the drivers, you need to do several modprobes to load the driver and the oss emulation devices for full sound support:

Generic Code Example:

modprobe snd-hda-intel;modprobe snd-pcm-oss;modprobe snd-mixer-oss;modprobe snd-seq-oss

With kernel autoloading modules enabled, I did not have to do anything to get these to install at boot time. The kernel recognizes the card and loads the necessary modules including the oss emulation modules. If you don't get the same results, the instructions at ALSA give a detailed procedure for getting the modules to work at boot-up. Failing all else, place the modprobe line above into your rc.local file.

Note: Since these are kernel modules, they will be wiped out every time that you have to recompile your kernel. They are very easy and quickly re-installed however, by going to the source alsa-driver directory and typing make install.

Keyboard Multimedia Buttons

I have never worked on getting the media buttons on my Dell laptops to work with Linux. I am not sure why. I use them all the time in Windows and now that I have them working, I am ecstatic about it. They are pretty easy to get working and very customizable, thanks to lineakd.

The following steps should get you set up:

Step 1 - Get and Install lineakd
You can download lineakd from here. The installation follows the same general rules as most tar balls. After extracting it and changing to the directory, use:

Generic Code Example:

./configure
make
make install

Step 2 - Edit the Global Keyboard Definition file
Unless you specify otherwise, the base install directory is /usr/local. The global keyboard configuration file is a file called /usr/local/etc/linekbd.def. This file has default configurations for many keyboards, including quite a few Dell laptops that could probably be used for the Precision M90. I could not find any with the "WWW" key defined however, so I made my own at at the very end of the file. The following is what was added:

Generic Code Example:

[DELL-M90]
	brandname = "Dell"
	modelname = "Precision M90"
	[KEYS]
		Mute|Unmute	= 160
		VolumeDown	= 174
		VolumeUp	= 176
		Play|Pause	= 162
		Back		= 144
		Forward		= 153
		Stop		= 164
		WWW			= 178
	[END KEYS]
[END DELL-M90]

If you want to make your own entry, you can use the xev program to find the keycodes. Simply type xev at the command prompt. Then type the key for which you want the keycode and it will display the keycode (along with a whole bunch of other stuff). Again, this is only if you want to create your own keyboard entry.

Once you are finished, you will want to list the entries to verify that your new entry is there:

Generic Code Example:

lineakd -l  

This will list every keyboard configuration (in alphabetical order). Scroll up and make sure that the DELL-M90 is there.

Step 3 - Load and Setup the userconfiguration file
This needs to be done for every user that is going to use lineakd. That may seem like a pain, but what it does in reality is allow every user to use the media buttons for whatever they wish.

Make sure that you are the user for whom you want to configure lineakd and type:

Generic Code Example:

lineakd -c DELL-M90

This will make a configuration file for the DELL-M90 keyboard and place it in $HOME/.lineak/lineakd.conf.

Open the lineakd.conf file in your favorite text editor. Down at the bottom of it you should see, a blank setup for all of the custom keys that you defined in the global configuration file. Now you simply need to tell lineakd what to do with these keys when they are hit. Here is my configuration:

Generic Code Example:

Back = "xmms --rew" 
Forward = "xmms --fwd"
Mute = "amixer sset \"Master\" mute"
Unmute = "amixer sset \"Master\" unmute"
Play|Pause = "xmms --play-pause"
Stop = "xmms --stop"
VolumeDown = "amixer sset \"Master\" 5%-"
VolumeUp = "amixer sset \"Master\" 5%+"
WWW = "firefox"

As you can see, I am using the ALSA amixer for the volume controls. I am using xmms for playing media files. And finally, I have the web key assigned to Firefox.

There are several ways to assign keys to work on several items at once, but I have set mine up to use modifier keys. For example, I have set up xine to work off of the control modifier keys with the following entries:

Generic Code Example:

Back+control = "xine -S pl=prev"
Forward+control = "xine -S pl=next"
Play|Pause+control = "xine -S play"
Play|Pause+shift = "xine -S pause"
Stop+control = "xine -S stop,quit"
VolumeDown+control = "xine -S volume=0"
VolumeUp+control = "xine -S volume=100"
WWW+control = "xine -S mrl=dvd:/,volume=100 -f" 

Now, if I hit ctl-WWW, X will pull up xine, load a DVD, put the xine volume (not master) up to full,go to fullscreen mode and start playing the DVD.

Feel free to come up with your own. There are probably some limits to what you want to do based upon how much you can remember. :wink:

Once you have created your file, you need to start it (as the user), with the following command:

Generic Code Example:

lineakd &

You can test your configuration. You will need to kill and restart the process if you want to reload a new configuration file. Or you could restart the computer if that is easier.

Step 4 - Make it work everytime
The way to get this set up will differ a bit depending upon your Xmanager. I use KDE and as it is pretty popular, I will describe that method.

Under the directory $HOME/.kde/Autostart create a file. It can be called anything, such as startup. Anything contained in Autostart will be ran at login, whether from KDM or a console screen. Edit this file to say:

Generic Code Example:

#!/bin/bash
lineakd &

This is a basic bash script and you can add anything else that you wish to here as well. It is executed whenever that particular user logs on.

Set the executable bits:

Generic Code Example:

chmod 755 $HOME/.kde/Autostart/startup

It appears to also take care of closing the daemon when the user logs out as well.

That about does it for sound. You should now have a fully functional audio system complete with panel controls that you can configure to do just about anything.

Would you like to comment? This story has been viewed 24,247 times.
« Linux on Dell Precision M90 - Part IV: Networking Colonial Marines RPG now on Sourceforge »

__top__

Copyright © GIDNetwork™ 2001 - 2014

Another website by J de Silva

Page generated in : 0.04172 sec.