How-To: Setup Debian Linux Desktop with Full Multimedia Support and Faster Processing


debian screenshot

Recently Debian-based distributions have been making the headlines these past few months (i.e. Ubuntu, MEPIS, Linspire, Xandros) and taking away some of the glory from its root source, so I decided to see if I had the chops to figure out how to take a stock Debian desktop install and tweak it to function on par or better than the competition. Proudly, I can report, I have accomplished what I have set out to do and now have a solid workhorse multimedia PC that has made me a convert.

* Update 7/21/2006 – I optimized the instructions for a default Etch system. Previously, I suggested switching everything to a perpetual testing/unstable system (further details).

* Update 7/26/2006 – I just noticed that the current nvidia-kernel-common package is not playing nice with kernel images newer than 2.6.15-1-686-smp. Your mileage may vary, though.

Preconditions
I’ve just done a fresh install with Debian’s NetInstall Disc (aka netinst CD image – i386) on a PC with a Pentium 4 3.0Ghz HT processor, NVIDIA GeForce graphics card, and a direct broadband connection via Ethernet (of course, there’s more to those specs ;). FYI, the netinst image will fit on one CD if you download and burn it. And if you’re interested in seeing screenshots of the installer, OSDir.com has an excellent walk-through here.

Notice: All commands entered into the Terminal will be shown in bold red. To easily copy and paste text into the Terminal, use Ctrl+Shift+V. Also, if you don’t know what sudo is, please reference the “Extras” section at the bottom of the page.

APT Configuration
APT Pinning
Set your default release preference to “Etch” (learn more about the different releases):
sudo gedit /etc/apt/preferences

Enter the following text:
Explanation: Etch (expected to become stable in Dec. 2006)
Package: *
Pin: release a=testing
Pin-Priority: 990

Explanation: Sid
Package: *
Pin: release a=unstable
Pin-Priority: 90

Explanation: Experimental
Package: *
Pin: release a=experimental
Pin-Priority: 10

FYI, Etch is expected to become “stable” around December 2006. When this happens, you’ll have to change the “a=” value for Etch to “stable” and Sid to “testing”.

Tip: To see all available package versions and install candidates, use the extremely useful apt-cache policy packagename function.

Package Repositories
Here we’ll want to add the contrib and non-free packages (needed for things we’ll be doing later). We’ll also be removing the cdrom options since it’s no longer needed.
sudo gedit /etc/apt/sources.list

Change [original]:
#
# deb cdrom:[Debian GNU/Linux testing _Etch_ - Official Snapshot i386 Binary-1 (20060704)]/ etch main

deb cdrom:[Debian GNU/Linux testing _Etch_ - Official Snapshot i386 Binary-1 (20060704)]/ etch main
deb http://ftp.us.debian.org/debian/ etch main
deb-src http://ftp.us.debian.org/debian/ etch main

deb http://security.debian.org/ etch/updates main
deb-src http://security.debian.org/ etch/updates main

To [new]:
# Debian Etch (testing)
deb http://ftp.us.debian.org/debian/ etch main contrib non-free
deb http://security.debian.org/ etch/updates main contrib non-free

# Debian Sid (unstable)
deb http://ftp.us.debian.org/debian/ sid main contrib non-free

# Debian Experimental
deb http://ftp.us.debian.org/debian/ experimental main contrib non-free

Now type:
sudo apt-get update
sudo apt-get -t unstable reinstall gnome-desktop-environment
sudo apt-get upgrade

Tip: Say Y or Yes to all questions when the upgrade starts. The reason why we’re reinstalling the gnome-desktop-enviroment is to get all related packages up to date to 2.14 (some parts are held back at 2.12 for some reason).

[OPTIONAL] Upgrading Kernel to 686 SMP
By doing this you’ll see about a 50% improvement in x86 chip processing speeds over default 386 kernel setups if your CPU supports HyperTheading or is a Multi-Core processor. Note: the default non-SMP 686 kernel that Debian sets you up with – if it detects a modern processor – is pretty damn fast already.

To install the new 686 SMP kernel:
sudo apt-get install linux-image-2.6.15-1-686-smp
sudo reboot

Tip: The reboot operation may take a few seconds, so sit tight.

Once your PC boots back up you’ll notice that the GRUB boot loader now lists the 686-SMP kernel as the new default boot up choice. To see if the 686-SMP kernel is really functioning correctly, go to Applications->System Tools->System Monitor. You should see two CPUs functioning (previously you would only have seen one). At this point you have the option to remove the non-SMP kernel since you no longer need it. To do this, type: sudo apt-get –purge remove linux-image-2.6.15-1-686

Tip: To future proof this how-to a bit, you can always open up the Synaptic Package Manger and search for “686” and see what the latest kernel numbers are if the above doesn’t apply anymore.

NVIDIA GLX Driver Upgrade
Getting NVIDIA’s GLX drivers working is critical from here on out if we want full multimedia support. (Sorry ATI guys. You’ll have to look elsewhere for configuring your drivers.)

Tip: The following instructions were inspired by this post.

sudo apt-get install module-assistant nvidia-kernel-common
sudo m-a prepare
sudo m-a auto-install nvidia
sudo apt-get -t unstable install nvidia-glx

Next you have to alter the xorg.conf file to use the new driver.
sudo gedit /etc/X11/xorg.conf

Scroll down to Section “Device” and change Driver value from “nv” to “nvidia”.
sudo reboot

Tip: If you really want to configure xorg.conf the right way, use sudo dpkg-reconfigure xserver-xorg and select the “X server driver” to be nvidia and uncheck (use space bar) rending module dri. Unfortunately, at this time, it has a flaw that won’t let the xorg.conf file be updated (here’s a fix until xorg gets updated).

After the reboot you should now see the NVIDIA splash screen come up just before the log in screen. In the future, if you do not want to see the splash screen, add the following option to you xorg.conf file in the same “Device” section as explained above: Option “NoLogo” “true”.

Sound Mixing
In order to get sound applications to play nice together, you have to configure the system to share audio. However, there’s a couple things you should know. If you want to turn on GNOME’s system sounds, go to Desktop->Preferences->Sound then click on both “Enable software sound mixing (ESD)” and “Play system sounds”. Unfortunately, there are still a few applications like Audacity (unless you open it with the command aoss audacity) and VMware (hack to get around this) that will require you to disable ESD sound mixing to function properly. So it’s your call if want to enable system sounds are not.
sudo apt-get install gnome-audio libesd-alsa0 alsa-oss esound-clients
sudo reboot

Tip: Continue to the multimedia section to see how to configure Firefox and XMMS to share audio with other apps.

Multimedia
OK. Now the fun begins. By the end of this you’ll be able to play every media file a Windows or Mac PC can (i.e. DVD movie playback, OGG / THEORA / AAC / MP3 / WMA / WMV/ DIVX / XVID / MPEG-1/2/4 / QuickTime support and more) sans DRM-wrapped files.

First thing we need to do is add the Debian-Multimedia repository to our sources.list and enter their public key.

sudo gedit /etc/apt/sources.list

Add the following repository address:
deb http://www.debian-multimedia.org etch main

gpg –keyserver hkp://wwwkeys.eu.pgp.net –recv-keys 1F41B907
gpg –armor –export 1F41B907 | sudo apt-key add -

sudo apt-get update

The following are what I like to call the “multimedia power packages” (IMPORTANT: When prompted with a [Y/N] question in the Terminal window while running the command, ALWAYS select Y for yes.):
sudo apt-get install totem-mozilla w32codecs libdvdcss2 liblame0 flashplugin-nonfree streamtuner xmms msttcorefonts banshee realplayer

sudo apt-get -t unstable install f-spot sun-java5-plugin

XMMS – SHARE AUDIO TIPS
Go to Applications->Sound&Video->XMMS and right-click the player Options->Preferences and change the “Output Plugin” to ALSA.

Firefox – SHARE AUDIO TIPS
sudo gedit /etc/firefox/firefoxrc

Change FIREFOX_DSP=”none” to FIREFOX_DSP=”aoss” and save.

Extras
Firefox – Enable mouse middle-click for closing tabs
Type about:config in the URL bar. Type middlemouse in Filter Search. Look for middlemouse.contentLoadURL and double-click to set to false.

GNOME Nautilus – Switch to browser mode (much nicer interface!)
To get the default manager back to browser mode:
Edit->Preferences->Behavior and check “Always open in browser windows”

Skype 1.3 Beta install (remember to turn your mic on in the GNOME’s volume control)
Download from: http://www.skype.com/download/skype/linux/13beta.html
cd Desktop
sudo apt-get install libqt3-mt
sudo dpkg -i skype-beta-1.3.0.30-1_i386.deb

SUDO Tweaks
Configure sudo (what’s sudo) so you – as an “administator” user – can easily have root privileges when needed. To do this go to Desktop->Administration->User and Groups and click on the Groups tab. Next, click on “Show all users and groups,“ click on adm and verify that you are a group member (in the future you can add other users to this group to give them admin privledges). Then go to Applications->Accessories->Terminal and type (will prompt you for the root password):
su
visudo

Insert the following line at the bottom (under privilege specification):
%adm ALL=(ALL) ALL

Then Ctrl+O to write (click enter for yes) and then Ctrl+X to exit.
exit

Now to open programs in GNOME with admin permissions (i.e. Synaptic) with your own password instead of root as sudo, enter:
gconftool-2 -t bool -s /apps/gksu/sudo-mode 1

OR (the long way)
Applications->System Tools->Configuration Editor->apps->gksu and check off “sudo-mode”

Tip: If you don’t like or want to use sudo, be sure that you run commands as root and skip the sudo part in the above how-to instructions.

——

Disclaimer: The instructions shown here should get you off and running. However, if you decide to deviate from what’s suggested, you’re on your own. If anyone would like to contribute and make this guide better, feel free to add your suggestions to the discussion comments.





Filed in: Software


  • bodhi.zazen

    Nice, I have almost the exact same hardware.

    One suggestion: Include Google Earth

  • http://www.alexandergrundner.com Alexander Grundner

    Below is the original APT instructions that I’ve opted to remove so people can setup a default Etch system as opposed to a perpetual “testing” system — result: a more stable computer with less headaches and bugs:

    SET APT DEFAULTS & PINNING
    Set your default release preference to “testing” (FYI, if you’re running a server, “stable” is probably best. However, if you want to run a cutting-edge desktop stick with “testing” to have access to all the recent packages, applications, and security updates – learn more about the different releases.):
    sudo gedit /etc/apt/apt.conf

    Add the following text:
    APT::Default-Release “testing”;

    sudo gedit /etc/apt/preferences

    Enter the following text (more info):
    Package: *
    Pin: release o=Debian,a=testing
    Pin-Priority: 900

    Package: *
    Pin: release o=Debian,a=unstable
    Pin-Priority: 300

    Package: *
    Pin: release o=Debian
    Pin-Priority: -1

    UPDATE SOURCES.LIST
    Here we’ll want to add the contrib and non-free packages (needed for things we’ll be doing later). We’ll also be removing the cdrom options since it’s no longer needed.
    sudo gedit /etc/apt/sources.list

    Change [original]:
    #
    # deb cdrom:[Debian GNU/Linux testing _Etch_ - Official Snapshot i386 Binary-1 (20060704)]/ etch main

    deb cdrom:[Debian GNU/Linux testing _Etch_ - Official Snapshot i386 Binary-1 (20060704)]/ etch main
    deb http://ftp.us.debian.org/debian/ etch main
    deb-src http://ftp.us.debian.org/debian/ etch main

    deb http://security.debian.org/ etch/updates main
    deb-src http://security.debian.org/ etch/updates main

    To [new]:
    deb http://ftp.us.debian.org/debian/ testing main contrib non-free
    deb-src http://ftp.us.debian.org/debian/ testing main contrib non-free

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

    deb http://ftp.us.debian.org/debian/ unstable main contrib non-free
    deb-src http://ftp.us.debian.org/debian/ unstable main contrib non-free

    Now type:
    sudo apt-get update
    sudo apt-get -u dist-upgrade

    Tip: Say Y or Yes to all questions when the upgrade starts.