Nokia and Canonical, the Odd Couple?

What would you say about Canonical and Nokia merger?

On one hand Canonical created Ubuntu, the most popular Linux distribution on desktops, but isn’t getting a significant share in the growing mobile market. Nokia on the other hand, once mobile king, is struggling to hold its place in the new world of smatrphones and tablets. Nokia’s traditional friendly approach to phones now seemed quaint and uninspired on a touch-screen smartphone and Canonical is all but invisible in that market.

Both companies has more in common. Nokia’s experience with open source software hasn’t been completely successful. In the past Nokia purchased and open sourced the Symbian mobile OS, but failed to create community traction. Nokia’s other major open source move, the purchase of the popular Qt framework, has been fruitful , but Nokia isn’t capitalizing on it yet.
Nokia’s latest adventure is a strategic effort to enter the Linux world with Meego, a Linux distribution for the mobile market (actually a joint venture with Intel, AMD, and other non-leaders in the mobile world).
From Canonical’s side things are similar. During the netbook-smartphone-tablet turmoil of the past couple of years, Canonical remained oddly quiet, releasing only the Ubuntu netbook edition. Only recently Canonical started investigating the whole mobile interface with Unity. That marked another step closer to Nokia by choosing Qt as the framework for Unity 2D (which turned to a hit even before official release with upcoming Ubuntu 11.4).
On the practical end of things, Nokia had very little to show in the last CES, especially when it comes to Meego. This may mean Nokia is taking it slow with Linux. Canonical had some mixed experience cooperating with hardware vendors in the past, but it is obvious that both firms has lots to gain from this move. Nokia can become a major player in the Linux world, and Ubuntu can be a valid Apple competitor with the powerful combination of OS and an experienced hardware house.

Advertisements

Leave a comment

Filed under linux, opinion

Powering-Off Discrete Graphics on Switchable Graphics Laptops

Switchable graphics is gaining popularity as a solution to balance performance and power consumption. Linux support for this feature is still very much in development, and until it is the discrete graphics card may take resources even when you don’t use it.

The development of switchable graphics on Linux is being led by Hybrid graphics Linux group. They recently released a driver to turn off the external graphics card. On my system shutting down the card reduced power consumption by 5-10 watts.
Note: This is experimental stuff, your computer may hang or act unexpectedly. Please make sure the discrete graphics card is not being used before proceeding.

Here’s how to test it:
First, install and run poewrtop to get an idea for power consumption (the laptop needs to be disconnected from AC adapter):

sudo apt-get install powertop
sudo powertop

Second, it is recommended to rmmod any kernel modules that may be mapped to the device. For example if you have an Nvidia discrete graphics with the closed source driver running, you should:

sudo rmmod nvidia

Next, download and build the driver:

sudo apt-get install git linux-headers-`uname -r` build-essential
git clone http://github.com/mkottman/acpi_call.git
cd acpi_call
make
sudo insmod acpi_call.ko
sudo ./test_off.sh

The result of a run should look like (depending on your laptop’s hardware):

Trying \_SB.PCI0.P0P1.VGA._OFF: failed
Trying \_SB.PCI0.P0P2.VGA._OFF: failed
Trying \_SB_.PCI0.OVGA.ATPX: failed
Trying \_SB_.PCI0.OVGA.XTPX: failed
Trying \_SB.PCI0.P0P2.PEGP._OFF: failed
Trying \_SB.PCI0.MXR0.MXM0._OFF: failed
Trying \_SB.PCI0.PEG1.GFX0._OFF: failed
Trying \_SB.PCI0.PEG1.GFX0.DOFF: failed
Trying \_SB.PCI0.XVR0.Z01I.DGOF: failed
Trying \_SB.PCI0.PEGR.GFX0._OFF: failed
Trying \_SB.PCI0.PEG.VID._OFF: works!

Running powertop now should give you about 5-10 watts less.
To test the card is really off you can run the following command:

sudo lspci -vvx

Locate your external graphics card (look for VGA controller with the right make). The card’s PCI configuration space should not be accessible, so it should look something like:

01:00.0 VGA compatible controller: nVidia Corporation GT218 [NVS 3100M] (rev ff) (prog-if ff)
        !!! Unknown header type 7f
00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
...

To re-enable the card, reboot the machine.

Please consider joining the Hybrid graphics Linux mailing list to help the development effort.

1 Comment

Filed under howto, linux

Standalone Coffee Timer – Programming Standalone Arduino by Example

This is a follow-up post on Programming Arduino with Arduino. I’ll show an example of the process based on the Coffee Machine timer. Just to recap the original setup, when connected to Arduino it looked something like:

Coffee machine timer based on Arduino

The Circuit

Here is an updated circuit for the standalone setup:

Coffee timer standalone based on ATMega8

The .sch file can be found here.

You may notice that the new circuit is almost identical to the original. The only significant changes are I/O pin assignments for easier wiring. The IC that drives the circuit is an ATMega8. I chose it since I had a few lying around but it can be replaced with ATMega168 or similar. Note that the footprint here uses Arduino pin annotations. This simplifies identification for software usage. You can get the part from here.
Note: Although not explicitly shown, the 74HC165N shift register should have pin 8 connected to GND and pin 16 to VCC.

The circuit diagram doesn’t include a power supply unit. You can use a basic circuit like this or connect to any regulated 5V power brick (I use a USB wall charger like this or this).

Here’s a picture of the assembled circuit on a breadboard:

Standalone circuit. Things get a little crowded on a single breadboard.

The Code

The CoffeMan.pde sketch was updated to the latest version of Arduino which makes the LiquidCrystal patch redundant. I/O pins are reassigned to match the circuit above.

The Method

First, setup a programming station as described here and place the standalone ATMega chip in the programmer. Alternatively, you can connect your Arduino directly to the standalone by following the ISP pin assignments. If you’re using a new chip, upload the bootloader as explained in step #3. Next, follow steps #4-#7 to set up Arduio IDE to upload sketches via the programmer. Open the CoffeeMan.pde sketch and hit the upload button:

Uploading the sketch with Arduino IDE via a programmer

Once programming completed successfully insert the chip in the target circuit. Connect it to a power source and test it.

Adding Serial Access

Troubleshooting standalone setups can be a pain. Although debugging with LED’s may work, I suggest connecting a serial console via an FTDI breakout or an FTDI cable. The connection is simple enough:

FTDI USB-RS232 connected to Arduino as basic serial console

The FTDI USB-RS232 header is cross connected to the Arduino chip. This means the FTDI TXO (pin 4) is connected to Aruino RX (pin 2). The FTDI RXI (pin 5) is connected to Arduino TX pin (pin 3).
Note: The FTDI Pin 3 can be used as a 5v supply pin. Do not connect it to input voltage.

When connecting the FTDI cable/breakout to a USB port, a new serial port will be registered. You can start it from sketches with standard Serial.begin(…) command and communicate normally as you would with Arduino.

An added bonus is the ability to upload sketches to the chip via the bootloader directly from the Arduino IDE. To accomplish that you’ll need to follow some steps:

  1. Burn bootloader via programmer as shown above
  2. Revert the Arduino IDE preferences file to use bootloader as an upload method
  3. Connect a push button switch between GND and Arduino reset pin (pin #1 on the ATMega)
  4. Open the Arduino IDE and find the FTDI serial port under Tools Serial Port
  5. Load your sketch
  6. Hold the reset button and hit Upload.
  7. Release the reset button
  8. Hope for the best…

The manual reset procedure can be quite annoying. From Sparkfun’s product page on the FTDI breakout, the DTR pin (pin 6) on the FTDI breakout can be used to auto-reset the chip for sketch upload. I didn’t get it quite working, but I’ll post an update if I’m successful.

Conclusion

This post meant to show some handy methods to convert an Arduino based projects to a standalone setup, while maintaining Arduino compatibility for programming and debugging. The method can be used as a step in the life-cycle of a project from concept to production.

Leave a comment

Filed under coffee, production

Programming Arduino with Arduino

Arduino is a great development tool. It’s got an IDE, the community supplies code for almost any device imaginable and everything is completely open source. While it is easy to develop a project around Arduino, sometimes you want to give your new creation a life of its own. Using the method explained here you can create a standalone Ardiono and load sketches to any compatible ATmega chip.

The target chip can be ATmega 8/168/328 etc. (List of compatible IC’s listed here). The target chip is not required to be preloaded with bootloader.
Uploading code to the chip requires a programmer. One common type of programmer is an ISP (In System Programmer). Its advantages are that it requires only few connection pins and is easy to operate. There are many available dedicated ISP’s (for example one from Atmel). But, a programmer is a little more than a microcontroller with a serial connection to the computer. This means that you can easily program chips using Arduino itself with no need of an extra programmer!

As we’ll see, the target chip (the chip we want to program), requires little supporting circuitry, and can run any code that runs on Arduino. This allows designing your circuit around the chip directly, as you would with Arduino and load it with your favourite sketch.

The Circuit

Target chip connected connections to ArduinoISP

Eagle .sch file can be downloaded here. The center of the circuit is the target chip. Notice that the pins are numbered like Arduino, rather than vanilla ATMega. You’ll need this eagle part.
This makes the inclusion of this circuit a very easy reference as it mirrors the Arduino board. Note that the ‘meaning’ of the pins will be valid only after you program the chip with either a bootloader or and Arduino applet.

ATMega Supporting Circuitry

The circuit supporting the target chip is as simple as it can be. The reset pin is chained to a resistor and a 16Mhz crystal (with two 22pf capacitors) provides clock. We’ll discuss alternative clock sources later.

SPI Programmer

We will program our new Arduino using an existing Arduino. This novel idea of bootstrapping was presented here. The software used for the programmer is MegaISP (Recently integrated into the Arduino IDE). MegaISP is an open source Arduino applet that allows it to act as an ISP, with normal programming tools, including Arduino IDE.

To connect the circuit to the Arduino, let’s look at the documentation of ArduinoISP:
// this sketch turns the Arduino into a AVRISP
// using the following pins:
// 10: slave reset
// 11: MOSI
// 12: MISO
// 13: SCK

 

// Put an LED (with resistor) on the following pins:
// 9: Heartbeat - shows the programmer is running
// 8: Error - Lights up if something goes wrong (use red if that makes sense)
// 7: Programming - In communication with the slave

To summarize connections:

SPI Programming Interface
ATMEGA-PIN19(SCK) ARDUINO-DIGITAL13
ATMEGA-PIN18(MISO) ARDUINO-DIGITAL12
ATMEGA-PIN17(MOSI) ARDUINO-DIGITAL11
Reset
ATMEGA-PIN1 ARDUINO-DIGITAL10
Status LEDs
(each connected to ground via a resistor)
heartbeat LED ARDUINO-DIGITAL9
error LED ARDUINO-DIGITAL8
programming LED ARDUINO-DIGITAL7

Finally, here’s the circuit connected to the Arduino:

Arduino connected as an ISP to an ATmega168

In this setup the chip is placed in a ZIF socket. This is not mandatory, but ensures the chip is easily extracted.

The Method

    1. Make sure your version of Arduino IDE is at least 0018.
      From the IDE go to File → Examples → ArduinoISP.

      Click upload. If all went well the heartbeat LED should start winking
    2. Next up, setup the IDE to work on the target board. Click Tools → Board and choose the board according to the chip you want to program:
      ATmega8 – Arduino NG or older w/ ATmega8
      ATmega168   – Arduino Diecimila, Duemilanove, or Nano w/ ATmega168
      ATmega328 – Arduino Duemilanove or Nano w/ Atmega328
    3. If this is the first time you program the target chip, upload the Arduino bootloader. This will make sure the fuses are set properly (more on that later).
      Click Tools → Burn Bootloader → w/ Arduino as ISP

      This process can take some time! Give it a minute or two to complete.

⇒ You should now have a chip running the Arduino bootloader. If you want to program a sketch onto the new chip do the following:

  1. Close all Arduino IDE windows
  2. Find the preferences.txt file (a list of common places can be found here)
  3. Open preferences.txt and change:
    upload.using=bootloaderto:
    upload.using=arduinoisp
    This is explained in details here
  4. Open the Arduino IDE, open your sketch
  5. Make sure Tools → Board is set to the target chip
  6. Compile and upload the sketch
  7. Your new chip should now be running the new sketch!
  8. Revert preferences.txt (remember to close all IDE windows first)

Using these steps you can upload any sketch that would normally work on Arduino. Remember that each target chip has different capacity and limitations.

An alternative to steps 4-11 would be to upload sketches to the target chip using a serial connection like you use on Arduino. This will be explained in details in the next section.

Communicating with the New Chip

While the method showed above in steps 4-11 is useful and stable, it is a bit cumbersome. The manual steps can be avoided with some additional hardware; The new chip can be transformed to a full fledged Arduino by adding it serial access. This will allow loading sketches directly from the IDE without jumping through programmer hoops. As a bonus, this can even be accomplished remotely! Here are a few ideas:

  1. Use an FTDI cable (available here or as a breakout). Once connected, it will register as a new serial port, which can be accessed normally from the Arduino IDE.
  2. Another possibility is to leverage the existing FTDI chip on the Arduino board. This requires removing the original chip from Arduino and use its TX/RX pins. Directions can be found here
    Note: extracting the chip from the Arduino board should be done with care to prevent damage. Also remember to store the chip in proper container to avoid static-discharge damage.
  3. And how about doing a remote-wipe Dollhouse style using an XBEE as a remote wireless uploader? Some links on this: Connections basics, forum discussion.

Additional Use Cases

  1. The simple circuit shown here can be used as a ‘skeleton’ for many projects. Just drop-in an ATmega suited for your needs with supporting circuitry and load it with your favourite sketch. We can also replace the IC with a low power version, like the one used in Arduino LilyPad. These IC’s excellent for projects with special space / power-usage / weight requirements.
  2. This method can be applied to upgrade your Arduino Duemilanove from ATmega168 to Atmega328. Get an ATmega 328 and follow steps 1-3 shown above to bootstrap it with a bootloader. Finally, replace the chip on your Arduino with the new one.

Alternative Clock Sources
Traditionally, Arduino uses an external 16MHZ crystal as a clock source and this is source we used above. The ATmega chip supports various other clock sources:

  1. Use an internal resonator inside the chip
  2. Use an external resonator
  3. Use a low frequency oscillator/crystal (frequency < 8MHZ, usually a watch 32KHZ cryatal)
  4. Use a high frequency oscillator/crystal (frequency >= 8MHZ) ← this is Arduino default

External crystals are more accurate than resonator and require no calibration. For an in-depth comparison see here.
If you decide to use a resonator, it is highly recommended that you run a calibration. Details can be found in the ATmega datassheet

For examples on how to use a resonator instead of a crystal, see some alternative designs: here, here and here.

When selecting a clock source, the ATmega chip in the circuit needs to be configured to be aware of that source. This is done by changing ‘fuse-bits’. We usually don’t need to do this manually, as the process of burning bootloader also sets the fuses for high frequency oscillator usage. If you plan to use a different clock source, see the next section for details.

About the Fuses

Fuse-bits control behaviour of the ATmega chip that usually you wouldn’t change. The most widely used feature is the clock-source. As explained above, there are several possibilities on how to supply clock signal to the chip. To get started on the topic, here’s a recommended reading list:

  1. Introduction and some do’s and don’ts: here
  2. Article focusing on clock sources: here
  3. In depth guide to fuse-bits: here
  4. Walkthrough with the AVR toolchain: here

Finally, a very handy fuse-bit calculator can be found here.

WARNING! Misconfiguration of the HIGH bits can cause ISP’s to stop working. Just in case you bricked your chip, it’s always good to know there’s a little piece of hardware to unbrick it: Fusebit Doctor.

Manual Method to Upload Sketches

The steps described to upload sketches can be done manually. The manual method uses the same tools as Arduio IDE uses in its underlying process. Rather than using the Arduino IDE configuration and buttons, these tools are called directly from the command-line interface. For guides see: an Instructable and this blog entry.

Please note that this method requires manual setting of fuses. This process should be done with care, as it can brick the chip.

Update (18/09/2010): For an extended usage example see the standalone coffee machine post.

4 Comments

Filed under howto, production, prototype

Switch to Phonon-VLC for Better Sound in KDE

Short Version

  1. Install vlc (version should be >= 1.1.1):
    apt-get install vlc
  2. Install phonon-backend-vlc:
    apt-get install phonon-backend-vlc
  3. Change backend selection in Phonon: Go to System Settings → Multimedia → Backend
    Choose VLC and click Prefer. Your screen should look like:
    Choosing Phonon backend

Long Version

KDE uses the Phonon framework to play media. Its architecture allows to switch audio backend. This small fact can change the sound quality immensely. Until now, under Linux there was official support for a single backend, namely Xine (and partly official support for GStreamer). About a week ago, the first stable version of VLC backend hit Debian testing and Ubuntu 10.10. If you don’t know VLC, it’s a very popular media player. Check out their website for details: http://www.videolan.org/vlc/

The backend is the piece of code that does all the playing. It gets the data to play (from file, stream etc.), runs it through codecs, apply equalizer and sends it to the audio server. No wander that the backend effects the quality of the sound. Turns out that VLC does a better job at channel mixing, gain control and more. Practically it just sounds better!

There’s only one thing that I miss at the moment is equalizer support. But even without an equalizer the sound quality is terrific.
A note about stability: After using this backend since April, I can say it is fast and stable, at occasions even better than Xine. Nevertheless remember this is still Beta software, still under development.

2 Comments

Filed under Uncategorized

Skype on Debian Testing (Squeeze) 64-bit (Workaround)

Short Version

  1. Install 32-bit libs:
    apt-get install ia32-libs ia32-libs-gtk
  2. Download 64-bit version for Ubuntu from skype.com, install the deb:
    dpkg -i skype-ubuntu-intrepid_2.1.0.81-1_amd64.deb
    apt-get install -f
  3. Get skype-wrapper from here
    (You need two files skype_wrapper.c and Makefile)
  4. Install a compiler and 32-bit headers:
    apt-get install gcc libc6-dev-i386
  5. Compile the shared library:
    make
  6. Run Skype with the wrapper:
    LD_PRELOAD=./libskype_wrapper.so skype

    Note: If you want to add LD_PRELOAD to a script or Skype shortcut remember to use its absolute path (i.e: LD_PRELOAD=/home/user/src/skype-wrapper/libskype_wrapper.so)

Long Version

Although not free software, Skype is found on many Linux installations. A couple of bugs in Debian testing prevents it from running properly. This guide supplies a workaround to get it working.

Skype for Linux 64-bit is actually a 32-bit application packed in a 64-bit package. Since it’s a dynamically linked application, you’ll need all the 32-bit libraries it uses:
apt-get install ia32-libs ia32-libs-gtk

Note that we installed ia32-libs-gtk, even though Skype is a Qt application. There’s an open Debian bug for this.

After installing the  dependencies, you can download Skype for Linux from skype.com. Note that there is no Debian 64-bit version, only Ubuntu. It will install fine anyway:
dpkg -i skype-ubuntu-intrepid_2.1.0.81-1_amd64.deb
And update dependencies by running:
apt-get install -f

Now if you’ll try running Skype, the main interface will load, but once you sign in you’ll get the following error:
Inconsistency detected by ld.so: dl-open.c: 611: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!
This is caused by another bug in Debian. When Skype tries to open libpulse.so (the library for PulseAudio), it crashes. Running ldd /usr/lib32/libpulse.so.0 shows why:

linux-gate.so.1 => (0xf7700000)
libpulsecommon-0.9.15.so => /usr/lib32/libpulsecommon-0.9.15.so (0xf7666000)
libX11.so.6 => /usr/lib32/libX11.so.6 (0xf754a000)
libICE.so.6 => /usr/lib32/libICE.so.6 (0xf7531000)
libSM.so.6 => /usr/lib32/libSM.so.6 (0xf7529000)
libXtst.so.6 => /usr/lib32/libXtst.so.6 (0xf7524000)
libwrap.so.0 => not found
libasyncns.so.0 => /usr/lib32/libasyncns.so.0 (0xf751f000)
libdbus-1.so.3 => /lib32/libdbus-1.so.3 (0xf74e5000)
libpthread.so.0 => /lib32/libpthread.so.0 (0xf74cc000)
libcap.so.2 => /lib32/libcap.so.2 (0xf74c8000)
libgdbm.so.3 => not found
librt.so.1 => /lib32/librt.so.1 (0xf74bf000)
libdl.so.2 => /lib32/libdl.so.2 (0xf74ba000)
libm.so.6 => /lib32/libm.so.6 (0xf7494000)
libc.so.6 => /lib32/libc.so.6 (0xf734d000)
libwrap.so.0 => not found
libgdbm.so.3 => not found
libxcb.so.1 => /usr/lib32/libxcb.so.1 (0xf7333000)
libuuid.so.1 => /lib32/libuuid.so.1 (0xf732f000)
libXext.so.6 => /usr/lib32/libXext.so.6 (0xf7321000)
libresolv.so.2 => /lib32/libresolv.so.2 (0xf730d000)
libnsl.so.1 => /lib32/libnsl.so.1 (0xf72f6000)
/lib/ld-linux.so.2 (0xf7701000)
libXau.so.6 => /usr/lib32/libXau.so.6 (0xf72f2000)
libXdmcp.so.6 => /usr/lib32/libXdmcp.so.6 (0xf72ed000)

See the ‘not found’ entries? That means the library is linked with those libraries, but they do not exist in the system. That’s a packaging bug.
To prevent Skype from ever running into the bug, we need to prevent it from loading the library. That would be easy enough with an open source application, where we have access to the code, which is not the case here. Fortunately Skype can fail-over to libalsa, which works like a charm. Instead of removing the file from our system, we’ll trick Skype to think it’s not there.
The code can be found at here (You need two files skype_wrapper.c and Makefile). This little piece of code wraps the running application and prevents it from loading libpulse.so.0. That’s a very brute-force way, but non-destructive to the rest of the systems.
Since Skype is a 32-bit application, we’ll need to compile our wrapper as such. Install a compiler and 32-bit headers:
apt-get install gcc libc6-dev-i386
Compile the shared library:
make
Finally, run Skype with the wrapper:
LD_PRELOAD=./libskype_wrapper.so skype

You can now run Skype this way safely from scripts or shortcuts, just remember to point the absolute path of libskype_wrapper.so in LD_PRELOAD

Extra credit – Changing microphone volume in alsamizer:
If you run the test call and no one is able to hear you, your microphone may be mute. Run alsamixer and hit (you’ll see it points to ‘Capture’ in the View menu on top). Now you can unmute it by hitting m and setting the volume with the arrow keys.

10 Comments

Filed under howto, linux

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).

Leave a comment

Filed under devenv, howto, linux