Configuring Your Laptop for GNOME and Sound

April 17th, 2003 by Jay Docherty in

In part 3 of his series on Linux and the laptop, Jay explains how to get GNOME configured, sound modules working and its appearance changed.
Your rating: None

If you followed my tutorial, “Setting Up a Base Linux Install on a Laptop”, you should have a base Linux install up and running Window Maker, Debian's default window manager. Although Window Maker is useful, I find the feature-rich environments of GNOME and KDE to be more useful in a desktop/laptop configuration. In this article I'm going to discuss how to further configure your Debian laptop with GNOME 2.2 and enable sound using the basic modules that come stock with the 2.4 kernel.

Installing GNOME 2.2

Let us start by installing GNOME 2.2. There are multiple ways to install it, but really only one way is viable for a Debian user. All that you have to do is run apt-get install gnome-core. Debian's apt-get system goes out to the Sid repositories listed in /etc/apt/source.list and downloads Debian's latest build of GNOME and all of its many required packages. This automation saves you tons of time. Although I have found a couple of missing packages here and there, the convenience of an apt-get install by far outweighs the downside of compiling it from source. Using apt-get, the entire process takes a matter of minutes; if you were to do a source compile from scratch it could take you hours. For those of you who need to have the absolutely newest build of GNOME, you're stuck with a source install. Fortunately, a utility called Gargnome can assist you with a source compile. Although Gargnome is no apt-get, it is a heck of a lot better then messing with each individual package.

Once apt-get has finished installing GNOME, you need to change the default window manager from Window Maker to Metacity. If Metacity is not made the default default window manager, GNOME does not work correctly; windows and menus pop up in funny spots and its overall appearance is a mess. To change the default window manager run update-alternatives --config x-window-manager. This lists all of the available window managers available on your system and allows you to pick which one should be the default. After you have made the selection, run startx and prepare for the amazement of what is known as GNOME 2.2.

Initial Sound Setup

The first time GNOME 2.2 runs, you will receive errors about xscreensaver being missing and /dev/sound/mixer not existing. apt-get install xscreensaver fixes the screensaver error. The mixer popup occurs when you have yet to configure sound support. Due to the wide variety of available embedded chipsets, there is no way I can go through every variation in this article. What I can do is go through configuring one of the more popular sound chipsets, the i810. In my next article I'm going to explain how to set up the Alsa modules, which offer a more standardized configuration. If you don't want to wait, here's some direction to get your sound cranking using the stock kernel modules:

1. Compile the kernel with support for the i810 chipset. Here's the settings to be made for the 2.4 kernel:

Sound card support

  • Intel ICH (i8xx)

  • OSS sound modules

    • Verbose initialization

    • Persistent DMA buffers

    • Crystal CS4232 based (PnP) cards

2. After you recompile the kernel to incorporate the changes made in the previous step, the sound-oriented modules are created. We need to load two of them, i810_audio and ac97_codec. If you want to load the modules by hand you could run insmod $module_name. Or, to have the system load them at boot time, add them both to /etc/modules. In addition, for i810_audio to load properly, ac97_codec must be loaded first.

3. Add the following lines to /etc/modules/aliases. This step is dependent on your sound card; for the i810 you should add these to the bottom of the file:

        alias sound-slot-0                                 i810_audio
        alias sound-service-0-0                i810_audio
        alias sound-slot-2                           off
        alias sound-service-0-2                off
        alias sound-slot-3                           i810_audio
        alias sound-service-0-3                i810_audio
        alias sound-slot-4                           i810_audio
        alias sound-service-0-4                i810_audio

4. Run update-modules

5. Create a group called audio, and add to it all users that are to implement sound. Make sure that /dev/dsp belongs to the audio group as well.

If all went correctly, after a reboot you should have sound in GNOME. A good way to test this is to try to play a music CD. This will avoid any possible problems you may be having with ESD, GNOME's sound dæmon. Which brings us to one of the problems I found to be an outcome of apt-getting GNOME 2.2, in regards to missing packages. Four multimedia related packages are missing: esound, esound-clients, gnome-audio and gstreamer-plugins. If you want to use your machine for any type of multimedia, you should apt-get these packages yourself. This may not necessarily be a problem with the install itself, because not all GNOME 2.2 users are interested in sound. But, if you don't specifically know to install them, it can be difficult to troubleshoot the cause of the resulting problems.

Scroll Mouse Fun

Although trackpoints and touchpads are useful, there can be times when the accuracy and swift abilities of a traditional mouse can't be matched. If you plan on doing any graphics editing or game playing on your laptop, you will be much better off if you have an external mouse in your laptop bag. Typically your trackpoint/touchpad is detected as a PS2 device, leaving USB ports as the most convenient interface for an external mouse. The hardest part of getting a USB mouse to work involves the kernel compile. In my experience, USB modules can be finicky to make function properly. I should add that before you start configuring a mouse, you should get an idea if all of its features are supported by Linux. For example, I know some of HP's and Compaq's rebranded Logitech mice are not fully supported. With that said, here are the USB options I had to set on my IBM Thinkpad R32:

Input core support

  • Keyboard support

  • Mouse support

  • (1024) Horizontal screen resolution

  • (768) Vertical screen resolution

Support for USB

  • Preliminary USB device filesystem

  • UHCI Alternate Driver (JE) support

  • USB HIDBP Mouse (basic) support

On a Dell Inspiron 8200, I set these options:

Input core support

  • Keyboard support

  • Mouse support

  • (1600) Horizontal screen resolution

  • (1200) Vertical screen resolution

Support for USB

  • Preliminary USB device filesystem

  • UHCI Alternate Driver (JE) support

  • USB Human Interface Device (full HID) support

If everything is in check with your kernel support, you then plug in the device. You should see a message similar to the following in the console or through dmesg:

hub.c: new USB device 00:1d.1-1, assigned address 3
input0:  USB Mouse on usb2:3.0

Upon unplugging the device you should see:

usb.c: USB disconnect on device 00:1d.1-1 address 3

These messages can be misleading, though. For example, on my Thinkpad I originally compiled the kernel using full HID support. When I plugged in a device, all the appropriate messages were displayed, but for some reason no input ever made it to my apps. When I switched my HID support driver to USB HIDBP, everything worked properly. So keep that in mind when reviewing the console messages. They are your first line of attack when troubleshooting a problem, but they are not the be all and end all of accurate USB reporting.

If all went well, then your mouse should be detected properly by the kernel. Which leads us to configuring X to see your external mouse. If you have been following this tutorial from part 1, you should be using X version 4.2.x, so my config snippets are from the file /etc/X11/XF86Config-4. In this example I was able to get my Razor Boomslang functioning perfectly. In your XF86Config-4 file, you should see an entry for your existing PS2 interface. The entry looks something like this:

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver            "mouse"
        Option          "Device"                "/dev/psaux"
        Option          "Protocol"              "PS/2"
        Option          "Emulate3Buttons"       "true"
        Option          "ZAxisMapping"          "4 5"
EndSection

For my Boomslang I added the following entry below that for my Configured Mouse:

Section "InputDevice"
        Identifier      "Boomslang"
        Driver            "mouse"
        Option          "Device"                "/dev/input/mice"
        Option          "Protocol"              "IMPS/2"
        Option          "ZAxisMapping"          "4 5"
EndSection

Some entries in the SeverLayout section also need to manipulated; you need to edit one line and add another line. The line to edit is:

InputDevice     "Configured Mouse"

You need to add CorePointer to the end of the line, so it looks like:

InputDevice     "Configured Mouse"      "CorePointer"

This line sets your primary device to that of your Configured Mouse, which should be the trackpoint/touchpad. So, no matter what other interfaces are plugged in or not plugged in, the system accepts input from that device.

Secondly, you need to add this line to the bottom of the “ServerLayout” section:

InputDevice     "Boomslang"             "SendCoreEvents"

This tells X to expect input from the Boomslang but not to use it as the primary device. With this configuration you can use your USB mouse and not have to worry about rebooting or changing config files when switching back to the trackpoint/touchpad. The transition between the two interfaces will be seamless.

Advanced Power Management

Advanced power management (APM) is the primary link a user has between his laptop and its power consumption. Due to APM's integration in the Linux kernel, there is little difficulty to get it running. All you need to do is compile your kernel with the APM support enabled, and you will have basic APM functionality. You must set the following options in the 2.4 kernel compile for APM:

  • Power Management support

  • Advanced Power Management BIOS support

At boot time APM reports as to what type of BIOS is detects. After the machine is booted you can verify APM is functioning correctly by running more /proc/apm. If this file does not exist, you have a problem.

Once APM is enabled, GNOME provides an extremely useful battery monitoring applet that you can add to the control panel. Right click on the panel, then go to Add to panel, then Utility and then click on Battery Charge Monitor. This utility if perfect for monitoring your battery; it tells you your power source and your charge level. If you want to use sleep and suspend, you can use this applet to kick it off. Due to the proprietary nature of enabling those features, I am not going to delve into explaining how to enable sleep and suspend. If you are looking to enable them, however, you will find your needs met by consulting a howto manual for setting up your exact laptop model. Such tutorials can be found here.

Fun with GDM

By default the current build of Sid comes with XDM installed for your X login needs. Although XDM was great in its day, it is bare bones when compared to the newer versions of GDM. XDM is more appropriate if you are running a server, whereas GDM offers more desktop, or in our case laptop, oriented features. The ability to shut off or restart the system is only one of GDM's many abilities. In a server environment, shutting off a system without logging in is a security nightmare. But, for a laptop this type of worry is trivial. A few of GDM's other advantages are: it can be configured on the fly without starting a window session; it has a lavish GUI where you can configure many aspects of it's appearance; and it enables you to manage multiple sessions. With GDM you even can manage remote sessions.

Unfortunately, the Sid repository does not currently have the latest version of GDM, 2.4; it offers the older, 2.2 version. In regards to laptop use, the big difference between these two version is the graphic greeter option. The graphical greeter provides a much more customizable (XML) theme-oriented environment. If you want to use GDM 2.4, you have to acquire it from an alternate source. A tool like this one can be used to find alternative download sources for GDM. After a source is found, you have a choice of apt-getting it or downloading it directly from a site for a manual dpkg install. I think you'll find the latter method to be faster than editing your apt-sources and updating. I was able to download the gdm_2.4.1.3-2_i386.deb package directly from this site, which I found through www.apt-get.org.

From the standpoint of the end user, the appearance of the graphical greeter is big plus, and it's pretty simple to enable and configure. When GDM is first installed, it defaults to using the standard greeter. To change this click on the System drop-down menu and select Configure. You will be asked to enter the system's root password and then presented with GDM's configuration window. To switch to graphical greeter mode, under the General tab, use the drop-down menu next to Local: to select graphical greeter. To configure it further, select the graphical greeter tab at the top of the window. From here you can add new themes or switch between existing ones.

To add a new theme, you must first download the .tar.gz file of your preferred theme. Such themes can be acquired at many web sites. A great place to start is art.gnome.org. Once you have downloaded the theme, you must go back into the configuration menu for GDM and click on the Install new theme button under the graphical greeter tab. This allows you to browse your system for a downloaded theme; it also uncompresses the tar.gz theme and installs it into the appropriate /usr/share/gdm/themes folder on your system. If you are familiar with XML, you can go into that folder manually and manipulate any theme. Each theme's primary configuration file resides in the directory by the theme's name and is named $themename.xml.

GNOME's Appearance

GNOME itself has many different aspects to alter in regard to visual appeal. Although some users may find this a far-from-critical area and not spend much time on it, it should not be overlooked. With proper customization, a machine running GNOME 2.2 easily can rival any Windows box in terms of eye candy and graphical convenience. There is an infinite number of different ways to customize your GNOME workspace. The three basic things any GNOME user can change without much hassle are the GTK+ 2.0 theme, Metacity theme and the Nautilus theme. According to the GNOME theme control panel, these three translate to controls, window border and icons, respectively.

Installing new controls and window boarder themes is a simple process. You can download new themes from many locations on the Web. My old standby for GNOME-oriented themes is art.gnome.org. Most themes can be downloaded as a tar.gz file. You can install them using the GNOME theme manager located in your Applications menu through Desktop Preferences, Themes. Once in the theme manager, use the Install Theme button to choose the theme element in question. This installer uncompresses it and installs the new theme element into the .themes directory underneath your home directory. Now, if you restart your GNOME session, you should see an option for the new theme element in the Themes panel.

A bug in GNOME 2.2.1 affects adding Nautilus themes with the Theme control panel. New icon themes are supposed to be copied into the .icons directory, but they actually are being copied to the .themes directory. As a result, after you restart the session your new icon theme is not available on the control panel. The fix for this is pretty simple: link the .icons directory to .themes.

ln -s ~/.themes ~/.icons

Another area of confusion is which themes should be downloaded to change the icons. At the art.gnome.org site you need to download the themes under the section Icon and not the themes under the section Nautilus. The easiest way to tell if a theme will work is, after you have installed it, look in its directory (~/.icons/$themename) for a file called index.theme. If the directory is missing index.theme, it's not going to work.

A Bright Future

The world of X GUIs has come a long way and is moving rapidly to whatever it is destined to become. GUI versions a mere year old seem outdated and uncomfortable when compared to what we have today. I attribute much of this progression to the healthy competition between Linux development and user communities. I don't think GNOME would be where it is today without KDE, and vice versa. Giving users a choice in their windowing environment is one of the many freedoms the Linux user base has come to embrace. So pick your GUI and enjoy!

__________________________


Special Magazine Offer -- Free Gift with Subscription
Receive a free digital copy of Linux Journal's System Administration Special Edition as well as instant online access to current and past issues. CLICK HERE for offer

Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anonymous's picture

Re: Configuring Your Laptop for GNOME and Sound

On April 1st, 2004 Anonymous says:

jones_chap@yahoo.com

for 2.4.X kernels the CS4232 in config-2.4.X is not needed and incompatible as I checked it when inserting it as a module which failed during the initial module selection for bf24.

recompiled without it, worked

now trying alsa with 2.6.4 currently, need help, got sound but choppy
need to change sampling? rate?

Anonymous's picture

Re: Configuring Your Laptop for GNOME and Sound

On May 28th, 2003 Anonymous says:

I have not been able to get GNOME working on my Debian laptop at all. I had GNOME 1.4 working fine, but when I tried to upgrade to 2.2, I got a series of errors about broken dependencies and locked files. I'd love to remove the GNOME 2.2 files and start over, but I have no idea how to do that.

Anonymous's picture

Re: Configuring Your Laptop for GNOME and Sound

On April 29th, 2003 Anonymous says:

Hi there!! I'm just gettin' nuts with the sound stuff!!! I did not have any trouble with the r6 when it came to sound (I'm a recording engineer),so I'll apreciate any help on this matter either with alsa configuring or OSS (it just don't "see" my sound card and don't have the /dev/dsp)

Anonymous's picture

System Settings folder is empty?

On April 28th, 2003 Anonymous says:

Followed the article instructions for installing gnome 2.2, but I'm disappointed to find the StartHere::SystemSettings folder empty. I expected to see some of the nifty controls described in April 2003 LJ article, "The Gnome2 desktop environment" by Russell Dyer.

Do I apt-get some pkgs to change network IPs, or reconfig Xwin, etc?

Anonymous's picture

Re: Configuring Your Laptop for GNOME and Sound

On April 18th, 2003 Anonymous says:

I appreciate this series of articles as I've had some trouble getting some distros to work on my Dell Inspiron 2650. May I suggest, especially for newbies, Xandros Linux 1.0? It's a Debian Woody-based system, very stable, and does an excellent job of configuring even many laptops without having to edit config files. I love Debian, too, but not everyone will want to delve so deeply into their OS until they are more experienced.

Patrick

Anonymous's picture

Re: Configuring Your Laptop for GNOME and Sound

On April 28th, 2003 Anonymous says:

I've also found debian libranet to be great with hardware

recognition

Anonymous's picture

Xfree on IBM Thinkpad

On April 18th, 2003 Anonymous says:

You know if you have a Thinkpad and you want that third button to work like it does on windows, where when you hold it down you can control scrolling of applications I suggest you use this in your XFree config file as the TrackPoint input device.

Section "InputDevice"
Identifier "TrackPoint"
Driver "mouse"
Option "Protocol" "PS/2"
Option "Device" "/dev/mouse"
Option "Emulate3Buttons" "true"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
EndSection

With that added I can hold down that blue button and move the trackpoint up and down to get scroll action, it's pretty sweet I suggest you try it.

http://cosi.clarkson.edu/

Anonymous's picture

Re: Configuring Your Laptop for GNOME and Sound

On April 17th, 2003 Anonymous says:

>> Now, if you restart your GNOME session, you should see an option for the new theme element in the Themes panel.

I've never tried to install a theme using that install button, but shouldn't it automatically get installed _without_ restarting the session?

Sounds a bit strange to me to restart a session just for getting to see a new theme in the theme panel.

(I don't see any reason why that should have to be done)

(perhaps the author of this article wasn't running FAM correctly?)

Anonymous's picture

Re: Configuring Your Laptop for GNOME and Sound

On September 26th, 2004 Anonymous says:

Hi
I am facing problem while playing the sound files on my laptop.
I could see my sound card getting detected but when I attampt to play any type of sound file say mp3 I am not able to listen any sound. Even I could not able to listen the test files like info.wav which are present on system by default.
I have gone through the article and like to seek the opinion of experts to get something positive to be able to listen sound on my laptop. I am not that much expert to alter kernal to get it working for me.
Following are the system configuration on my laptop.
kernal - Linux version 2.6.8.1-10mdksmp (nplanel@n3.mandrakesoft.com) (gcc version 3.4.1 (Mandrakelinux (Alpha 3.4.1-3mdk)) #1 SMP Wed Sep 8 16:41:52 CEST 2004
Arch - Intel x86
Sound card detected - intel8x0 82801DB ICH4
Module - snd-intel8x0
file /etc/modules.conf is empty
No file /etc/modules/aliases present.
audio group is present.
All files in /dev/sound are owned by prasad user and audio group.
I am using user - prasad.
ESD version is 0.2.35

Do I need to add the lines specified in /etc/modules.conf

-Prasad.

Anonymous's picture

Re: Configuring Your Laptop for GNOME and Sound

On April 18th, 2003 Anonymous says:

I usually install a theme by clicking on the install button, and it works flawlessly (assuming the theme itself is correct) *without* having to logout and in again.

Post new comment

Please note that comments may not appear immediately, so there is no need to repost your comment.
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <pre> <ul> <ol> <li> <dl> <dt> <dd> <i> <b>
  • Lines and paragraphs break automatically.

More information about formatting options

Newsletter

Each week Linux Journal editors will tell you what's hot in the world of Linux. You will receive late breaking news, technical tips and tricks, and links to in-depth stories featured on www.linuxjournal.com.
Sign up for our Email Newsletter

Tech Tip Videos

From the Magazine

December 2009, #188

If last month's Infrastrucuture issue was too "big" for you then try on this month's Embedded issue. Find out how to use Player for programming mobile robots, build a humidity controller for your root cellar, find out how to reduce the boot time of your embedded system, and if you're new to embedded systems find out the basics that go into one. You can also read about the Beagle Board, the Mesh Potato and a spate of other interestingly named items. And along with our regular columns don't miss our new monthly column: Economy Size Geek.


Read this issue