# Error when emerging ALSA-DRIVER

## johnnyICON

Hi,

I am following the Gentoo HOWTO Guide for configuring ALSA on my system. I am up to the point where I must emerge the alsa driver and for which I get an error. Check it out:

```
nel source directory:

 *     /usr/src/linux

 * Found sources for kernel version:

 *     2.6.9-gentoo-r13

 * Checking for suitable kernel configuration options

 *   ALSA is already compiled into the kernel.

 * Please check to make sure these options are set correctly.

 * Once you have satisfied these options, please try merging

 * this package again.

!!! ERROR: media-sound/alsa-driver-1.0.7-r4 failed.

!!! Function check_extra_config, Line 424, Exitcode 0

!!! Incorrect kernel configuration options

!!! If you need support, post the topmost build error, NOT this status message.
```

----------

## NeddySeagoon

johnnyICON,

With your 

```
2.6.9-gentoo-r13
```

kernel, you can use either alsa-driver or the modules included with the kernel, not both.

alsa-driver has detected you have used the kernel modules, which is probably better, since they are know to build with your kernel.

Skip the alsa-driver step.

----------

## johnnyICON

Right, I suspected so. 

So can I emerge alsa-utils, or is it not necessary?

----------

## johnnyICON

Nevermind, I got an error when I tried to emerge alsa-utils:

```
configure: error: Cannot link ncursesw library

!!! ERROR: dev-util/dialog-1.0.20040731 failed.

!!! Function econf, Line 449, Exitcode 1

!!! econf failed

!!! If you need support, post the topmost build error, NOT this status messag
```

This is getting annoying, I've been getting so many errors when I try emerging. I can't emerge xscreensaver either.

----------

## NeddySeagoon

johnnyICON,

You should have ncurses. Thats what makes make menuconf work.

Does that still work or is ncurses badly broken?

----------

## johnnyICON

I wouldn't even know how to tell   :Shocked: 

----------

## NeddySeagoon

johnnyICON,

As root, do

```
cd /usr/src/linux

make menuconfig
```

Do you get an error message  or does the kernel configuration tool start?

The 'graphic' you are looking at, if all is well,  is drawn by the ncurses package on the text console.

----------

## johnnyICON

Nope, no error at all.

----------

## NeddySeagoon

johnnyICON,

Run the 

```
emerge alsa-utils
```

and post the last screenful of text please. Your previous message says that the configure broke.

Can you post the results of 

```
emerge --info
```

 too please.

----------

## johnnyICON

emerge alsa-utils:

```
checking for nl_types.h... yes

checking for malloc.h... yes

checking for stddef.h... yeschecking whether the C compiler works... yes

checking whether we are iconnb root # emerge alsa-utils

Calculating dependencies ...done!

>>> emerge (1 of 2) dev-util/dialog-1.0.20040731 to /

>>> md5 src_uri ;-) dialog_1.0-20040731.orig.tar.gz

>>> Unpacking source...

>>> Unpacking dialog_1.0-20040731.orig.tar.gz to /var/tmp/portage/dialog-1.0.20040731/work

>>> Source unpacked.

unicode

 * econf: updating /var/tmp/portage/dialog-1.0.20040731/work/dialog-1.0-20040731/config.guess with /usr/share/gnuconfig/config.guess

 * econf: updating /var/tmp/portage/dialog-1.0.20040731/work/dialog-1.0-20040731/config.sub with /usr/share/gnuconfig/config.sub

./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --with-ncursesw

configure: WARNING: If you wanted to set the --build type, don't use --host.

    If a cross compiler is detected then cross compile mode will be used.

checking for package version... 1.0

checking for package patch date... 20040731

checking for i686-pc-linux-gnu-gcc... gcc

checking for C compiler default output... a.out

cross compiling... no

checking for executable suffix... 

checking for object suffix... o

checking whether we are using the GNU C compiler... yes

checking whether gcc accepts -g... yes

checking how to run the C preprocessor... gcc -E

checking whether gcc needs -traditional... no

checking whether make sets ${MAKE}... yes

checking for i686-pc-linux-gnu-ranlib... no

checking for ranlib... ranlib

checking for a BSD compatible install... /bin/install -c

checking for i686-pc-linux-gnu-ar... no

checking for ar... ar

checking for POSIXized ISC... no

checking for gcc option to accept ANSI C... none needed

checking for an ANSI C-conforming const... yes

checking for makeflags variable... 

checking if filesystem supports mixed-case filenames... yes

checking for ctags... no

checking for etags... no

checking if you want to see long compiling messages... yes

checking build system type... i686-pc-linux-gnu

checking host system type... i686-pc-linux-gnu

Configuring for linux-gnu

checking if we must define _GNU_SOURCE... yes

checking version of gcc... 3.3.4

checking for ANSI C header files... yes

checking for inline... inline

checking for sys/types.h... yes

checking for sys/stat.h... yes

checking for stdlib.h... yes

checking for string.h... yes

checking for memory.h... yes

checking for strings.h... yes

checking for inttypes.h... yes

checking for stdint.h... yes

checking for unistd.h... yes

checking for off_t... yes

checking for size_t... yes

checking for working alloca.h... yes

checking for alloca... yes

checking for stdlib.h... (cached) yes

checking for unistd.h... (cached) yes

checking for getpagesize... yes

checking for working mmap... yes

checking whether we are using the GNU C Library 2.1 or newer... yes

checking for argz.h... yes

checking for limits.h... yes

checking for locale.h... yes

checking for stdlib.h... (cached) yes

checking for string.h... (cached) yes

checking for unistd.h... (cached) yes

checking for sys/param.h... yes

checking for feof_unlocked... yes

checking for fgets_unlocked... yes

checking for getcwd... yes

checking for getegid... yes

checking for geteuid... yes

checking for getgid... yes

checking for getuid... yes

checking for mempcpy... yes

checking for munmap... yes

checking for putenv... yes

checking for setenv... yes

checking for setlocale... yes

checking for stpcpy... yes

checking for strchr... yes

checking for strcasecmp... yes

checking for strdup... yes

checking for strtoul... yes

checking for tsearch... yes

checking for __argz_count... yes

checking for __argz_stringify... yes

checking for __argz_next... yes

checking for iconv... yes

checking for iconv declaration... 

         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);

checking for nl_langinfo and CODESET... yes

checking for LC_MESSAGES... yes

checking whether NLS is requested... no

checking if -lm needed for math functions... yes

checking if you want to link with dbmalloc for testing... no

checking if you want to link with dmalloc for testing... no

checking if you want to build libraries with libtool... no

checking for multibyte character support... yes

checking for ncursesw header in include-path... curses.h

checking for ncurses version... 5.4.20040208

checking for Gpm_Open in -lgpm... yes

checking for initscr in -lgpm... yes

checking for initscr... no

checking for initscr in -lncursesw... no

checking for -lncursesw in /usr/local/lib... no

checking for -lncursesw in /usr/lib... no

configure: error: Cannot link ncursesw library

!!! ERROR: dev-util/dialog-1.0.20040731 failed.

!!! Function econf, Line 449, Exitcode 1

!!! econf failed

!!! If you need support, post the topmost build error, NOT this status message.
```

emerge --info:

```
iconnb root # emerge --info

Portage 2.0.51-r2 (default-linux/x86/2004.3, gcc-3.3.4, glibc-2.3.4.20040808-r1, 2.6.9-gentoo-r13 i686)

=================================================================

System uname: 2.6.9-gentoo-r13 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz

Gentoo Base System version 1.4.16

Autoconf: sys-devel/autoconf-2.59-r5

Automake: sys-devel/automake-1.8.5-r1

Binutils: sys-devel/binutils-2.14.90.0.8-r1

Headers:  sys-kernel/linux-headers-2.4.21-r1

Libtools: sys-devel/libtool-1.5.2-r5

ACCEPT_KEYWORDS="x86"

AUTOCLEAN="yes"

CFLAGS="-march=pentium4 -pipe -O2"

CHOST="i686-pc-linux-gnu"

COMPILER=""

CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"

CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"

CXXFLAGS="-march=pentium4 -pipe -O2"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"

GENTOO_MIRRORS="http://gentoo.osuosl.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"

MAKEOPTS="-j3"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY=""

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="x86 X aac aalib acl acpi aim alsa apache2 apm arts audiofile avi bash-completion berkdb bitmap-fonts bzlib calendar cdr cpdflib crypt cups dbx dga dio directfb divx4linux dvd dvdr encode esd exif fam fbcon fdftk flac flash foomaticdb fortran ftp gdbm gif gnome gphoto2 gpm gstreamer gtk gtk2 icc icc-pgo icq imagemagick imlib ipv6 java jikes joystick jpeg kde kdexdeltas ladcca lcms libwww mad matrox memlimit mikmod ming mng motif mozilla mpeg mpi msn msql mysql mysqli nas ncurses netboot nls oci8 odbc oggvorbis openal opengl oracle7 oscar oss pam pcmcia pda pdflib perl php png pnp portaudio ppds prelude profile python qt quicktime readline samba sasl scanner sdl shared sharedmem simplexml slp snmp soap sockets speex spell spl sse ssl svg svga sysvipc szip taltk tcpd theora tiff tokenizer truetype trusted unicode usb videos wavelan wmf xine xinerama xml xml2 xmlrpc xmms xosd xpm xv xvid yahoo zlib"
```

----------

## NeddySeagoon

johnnyICON

```
checking for initscr in -lncursesw... no 
```

is where it appears to break. I get 

```
checking for initscr in -lncurses... yes
```

I wonder where you get the extra 'w' on the end of ncurses ??

The emerge that is breaking is 

```
dev-util/dialog-1.0.20040731
```

delete everything in 

```
/usr/portage/dev-util/
```

 with a name relating to dialog. If you are unsure remove the content of the directory. Now do an 

```
emerge sync
```

to get a new copy.

Is that any better?

----------

## johnnyICON

Delete everything in that directory??

----------

## NeddySeagoon

johnnyICON,

Its safe to delete everything in /usr/portage/dev-util/ or even /usr/portage/.  /usr/portage/ contains the portage tree as obtained and updated with emerge sync as well as all your source downloads.

Chopping off a small piece of that filesystem tree (in case its broken), that will be replaced with the following emerge sync is quite safe.

----------

## johnnyICON

Ok, syncing right now.

----------

## johnnyICON

Still getting the same error when I emerge alas-utils

----------

## johnnyICON

Got it working. Hopped on IRC and someone told me to emerge ncurses, did that, and I able to emerge alsa-utils successfully

----------

## NeddySeagoon

johnnyICON,

Hmm, thats either a bug in the dialog or alsa-utils ebuild or your ncurses was broken. The kernel make menuconfig uses ncurses, which is why as asked you to run that test.

From your PM, you still need to set up /etc/modules.d/alsa to reflect your system then run modules-update to regenerate /etc/modules.conf.

With that done

```
 /etc/init.d/alsasound restart
```

should load everything OK.

With a single sound card the defualt  /etc/modules.d/alsa should be OK with the exception of 

```
##  ALSA portion

## alias snd-card-0 snd-interwave

## alias snd-card-1 snd-ens1371

alias snd-card-0 snd-intel8x0
```

where the 

```
alias snd-card-0 
```

line is the line that loads your sound chip driver. The snippet is from my file.

----------

