		 Advanced Linux Sound Architecture Version 0.9
			  Debian-specific README file

This is the Debian GNU/Linux prepackaged sources of the ALSA drivers.

This README covers the following items:
1) Configuration of the alsa-source package and build environment
2) Building the drivers

1) Configuring of the alsa-source package and build environment

    During the installation of the alsa-source package, you should have been
    asked several questions related to some build options for the modules. If
    you didn't get asked those questions, or you'd like to review them, run
    'dpkg-reconfigure alsa-source' as root. Configuring the source package
    outside of the debconf/dpkg-reconfigure interface is done through
    /etc/alsa/alsa-source.conf, but is beyond the scope of this document.

    The alsa-source package installs /usr/src/alsa-driver.tar.gz. Before
    you go any further, ensure that your userid is a member of the "src"
    group.  Running the 'groups' command will list all groups you are a
    member of. If you are not a member of the group "src", you must run
    'adduser your_user_name_here src' as root. After running 'adduser',
    you must log out completely, and log back in.

    Unpack the tarball:

	$ cd /usr/src
	$ tar jxvf alsa-driver.tar.bz2

    You may unpack the sources outside of /usr/src if you wish, and
    without being a member of the group "src", but doing so is beyond
    the scope of this document.

2) Building the drivers

    Before attempting to build the modules, be sure to have the
    "build-essential", "fakeroot", and "kernel-package" packages
    installed. For instance, 'apt-get install fakeroot build-essential
    kernel-package' as root.

    There are three ways to build the ALSA drivers:

    a) Using make-kpkg, building the drivers for a custom Debian kernel
       image.
    b) Using the scripts in /usr/src/modules/alsa-driver/debian to build
       the drivers for a stock Debian kernel image (one you installed
       via, for instance, apt-get)
    c) Building the drivers manually, without any Debian scripts. This
       is required if your kernel image was also built completely
       manually, and is not packaged.

    ------------------
    a) Using make-kpkg
    ------------------

    This method of building assumes that you have configured and
    compiled your own kernel, using make-kpkg.

    This is the simplest method with which to build the ALSA drivers.
    From the kernel source directory (perhaps /usr/src/linux), run
    'make-kpkg --revision some_number_here --added-modules alsa-driver
    modules_image'. For instance:

	$ cd /usr/src/linux
	$ fakeroot make-kpkg --revision 0.1 --added-modules alsa-driver modules_image

    The generated .debs will be in "../". In our example, that means
    they would be in /usr/src/linux/../. In other words, /usr/src/. You
    can install them via 'dpkg -i filename.deb', for instance:

	$ cd ../
	$ su
	Password:
	# dpkg -i alsa-modules-2.4.20_0.9.0rc7-5+0.1_i386.deb

    -----------------------------------------------------------
    b) Using the scripts in /usr/src/modules/alsa-driver/debian
    -----------------------------------------------------------

    In the example above, make-kpkg called the script
    /usr/src/modules/alsa-driver/debian/rules, which is a complex
    Makefile.  make-kpkg sets a number of variables, and when you're
    building these modules for a stock Debian image, you'll need to
    supply them yourself.

    Before continuing, be sure you have the appropriate -headers package
    installed for the kernel you're using. For instance, if you're using
    kernel-image-2.4.20-k7, install the "kernel-headers-2.4.20-k7"
    package.  If you're kernel-image-2.4.21-386, install the
    "kernel-headers-2.4.21-386" package.

    Using the above scenario, let's look at an example:

	$ cd /usr/src/modules/alsa-driver
	$ fakeroot debian/rules binary_modules KSRC=/usr/src/kernel-headers-2.4.20-k7/ KVERS=2.4.20-k7

    Obviously, the variables you set will be dependent upon the flavour
    of kernel you have installed. If you're using
    kernel-image-2.4.21-386, you need to set KSRC to
    "/usr/src/kernel-headers-2.4.21-386/", and KVERS to "2.4.21-386".
	Please note that since version 0.9.2-3, KVERS will be worked out
	automatically if it can be, so you don't need to specify it.

    The generated .debs will be placed in KSRC/../, just like with the
    first example which used make-kpkg. This time, however, we started
    in /usr/src/modules/alsa-driver. The packages will actually be
    placed in /usr/src/kernel-headers-2.4.20-k7/../, or rather
    /usr/src/. Where the package is generated depends on what you set
    KSRC to, obviously. In our example:

	$ cd /usr/src/
	$ su
	Password:
	# dpkg -i alsa-modules-2.4.20-k7_0.9.0rc7-5_i386.deb

    ---------------------------------------------------
    c) Not using any Debian-specific scripts whatsoever
    ---------------------------------------------------

    This is required if you aren't using a packaged kernel. A packaged
    kernel will have been installed through dpkg, or apt-get (for
    example). It might have been a kernel you built yourself with
    make-kpkg, or one you installed from a Debian mirror with apt-get.

    How to build the modules without using any Debian scripts is beyond
    the scope of this document, and is covered in other documentation.
    For reference:

	http://www.alsa-project.org/alsa-doc/alsa-howto/alsa-howto.html
	file:///usr/src/modules/alsa-driver/INSTALL
	file:///usr/src/modules/alsa-driver/FAQ
