Linux on Lenovo t410s #4: Kernel 2.6.34 and a Permanent Solution for Audio

This is an updated post to the workaround posted here. It provides a permanent solution for the sound problems, as well as provide better ACPI support.

Short Version

  1. Remove pcspkr (if you hadn’t done so already), as described here
  2. Install latest Alsa (1.0.32 and higher):
    sudo apt-get update && sudo apt-get dist-upgrade
  3. Install kernel build dependencies:
    apt-get install kernel-package libncurses5-dev fakeroot wget bzip2 build-essential
  4. Get and unpack the kernel sources:
    mkdir -p ~/src/

    cd ~/src/

    wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.34.tar.bz2

    tar xvfj linux-2.6.34.tar.bz2

    cd linux-2.6.34

  5. Config your kernel based on the system’s existing configuration:
    cp /boot/config-`uname -r` .config
    make silentoldconfig

    (Enter your way throught the several dozen new options)
  6. Build and install the kernel:
    make-kpkg -j6 --rootcmd fakeroot --append_to_version -custom-1-`dpkg --print-architecture` --initrd kernel_image kernel_headers

    sudo dpkg -i ../linux-headers-2.6.34-custom-1-amd64_2.6.34-custom-1-amd64-10.00.Custom_amd64.deb ../linux-image-2.6.34-custom-1-amd64_2.6.34-custom-1-amd64-10.00.Custom_amd64.deb

    sudo update-grub

  7. Reboot to your new kernel

Long Version
We’ll install a newer version of Alsa provides support of the soundcard in the t410s. We’ll also go through installing a new kernel version ‘the debian way’. This means we’ll compile a fresh kernel and create .deb packages for the image and headers. In addition this solves the ACPI buttons issues, so screen brightness can be controlled from the keyboard.

  1. If you still have pcspkr enabled, remove it as described here
  2. Alsa 1.0.32 was migrated to testing earlier today (see here). This version has initial official support of the HDA-Intel soundcard on the t410s. To get it, make sure you have ‘testing’ in your /etc/apt/sources.list, and run:
    sudo apt-get update && sudo apt-get dist-upgrade
    Once upgrade completed, check you have the latest version by running:
    dpkg -l | grep alsa-utils
    Check the installed package version >= 1.0.32-2
  3. The kernel requires several packages to build properly. For more information about kernel building in Debian see the The Debian GNU/Linux FAQ. Install the packages by running:
    apt-get install kernel-package libncurses5-dev fakeroot wget bzip2 build-essential
  4. Next up we’ll get the kernel sources and unpack them:
    mkdir -p ~/src/
    cd ~/src/
    wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.34.tar.bz2
    tar xvfj linux-2.6.34.tar.bz2
    cd linux-2.6.34

    Do not use /usr/src for custom kernel sources. Kernel headers will be installed there via a debian kernel headers package. For more information on the matter see Linux’s README.
    If you still choose to install the sources to /usr/src, it is highly recommended to build the kernel out-of-tree. For more information consult the README again, search for a reference to “make O=output/dir”
  5. Now we’ll configure the new kernel, based on the current running system configuration:
    cp /boot/config-`uname -r` .config
    make silentoldconfig

    A few dozen new options were added between 2.6.32 and 2.6.34, so you will be prompted to make a choice. From a quick look, the defaults seem perfectly fine, so just hit enter until you get the prompt back.
  6. Compiling the kernel will be done with debian’s make-kpkg tool, that will also build appropriate headers:
    make-kpkg -j6 --rootcmd fakeroot --append_to_version -custom-1-`dpkg --print-architecture` --initrd kernel_image kernel_headers
    The –append_to_version string is used to distinguish our version from the official ones. The resulting kernel image name will look like vmlinuz-2.6.34-custom-1-amd64
    Next up, installing the new package, with dpkg:
    sudo dpkg -i ../linux-headers-2.6.34-custom-1-amd64_2.6.34-custom-1-amd64-10.00.Custom_amd64.deb ../linux-image-2.6.34-custom-1-amd64_2.6.34-custom-1-amd64-10.00.Custom_amd64.deb
    Finally, update grub to append the new kernel to the boot image:
    sudo update-grub
  7. Now the system can be rebooted into the new kernel

In addition to sound working out-of-the-box, the new kernel also provides much better support for ACPI functions. Special keys like screen brightness and audio control now work. For some reason grub lost its VGA mode setting during boot (perhaps because AGP_INTEL is now loadable module and not compiled in).

Advertisements

Leave a comment

Filed under devenv, howto, linux

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s