PROBLEM DESCRIPTION
In alsa-lib-1.0.14 final version, all of the floating point formats were
disabled. Because discord uses doubles for internal processing and
passes doubles to alsa-lib for conversion to the sound card's native
internal format, it cannot work with alsa-lib-1.0.14. The latest
development version of alsa-lib fixes this problem. Here is a step by
step description of how to install the latest version of alsa-lib
without breaking your package management system's automatic update
capability.
NOTE: Some parts of these instruction require that you become the
superuser, root. You can, of course, follow the directions in the
INSTALL file from alsa-lib to create a static library and link against
it without being root. I won't be covering that option here, though.
I have put the commands on a line by themselves to avoid delimiters.
The location of some of the commands might be different on your
distro. If you login as root or do su - to get to root, you will have
root's path and it will find the command wherever it is.
WORKAROUND PROCESS
- Go to ftp://ftp.suse.com/pub/projects/alsa/snapshot/lib/ and
download the file alsa-lib-hg20080301.tar.bz2 if it is available.
This is the version I tested with, so I know it works. If it isn't
there, use the latest file. Right now, alsa-lib-hg20080301.tar.bz2 is
the latest file.
- Run the command
tar -jxvf alsa-lib-hg20080301.tar.bz2
This will create a directory named alsa-lib-hg20080301.
- Go into the directory.
cd alsa-lib-hg20080301
- Type command
./configure
- Type command
make
If make fails with python errors, check that there is a directory python
under /usr/include. If there is only a directory like python2.5, as on
Fedora 7, make a symbolic link so the make file can find the python
headers. You will need to be root to do this.
cd /usr/include
ls -d python*
ln -s python2.5 python
- From this point on you have to be root as you are altering system
files. Make a new alsa subdirectory. This is necessary to avoid
activating other libraries in /usr/local/lib.
mkdir /usr/local/lib/alsa
- As root, go into the directory alsa-lib-hg20080301/src/.libs/.
Copy the file libasound.so.2.0.0 to /usr/local/lib/alsa.
cd src/.libs
cp libasound.so.2.0.0 /usr/local/lib/alsa/
- Change to the /usr/local/lib/alsa directory.
cd /usr/local/lib/alsa
- Check that the library is there.
ls -l libasound*
-rwxr-xr-x 1 root root 2772460 2008-03-04 20:22 libasound.so.2.0.0
- Create a new symbolic link to the shared library you just moved.
ln -s libasound.so.2.0.0 libasound.so.2
- Check that the link is there.
ls -l libasound*
lrwxrwxrwx 1 root root 18 2007-03-04 08:28 libasound.so.2 -> libasound.so.2.0.0
-rwxr-xr-x 1 root root 2772460 2008-03-04 20:22 libasound.so.2.0.0
- Change to the /usr/lib directory.
cd /usr/lib
- Find the setup for the libasound library.
ls -l libasound*
-rw-r--r-- 1 root root 1458654 2007-08-01 01:45 libasound.a
lrwxrwxrwx 1 root root 29 2007-08-06 08:31 libasound.so -> /lib/libasound.so.2
-rwxr-xr-x 1 root root 899872 2007-08-16 07:42 libasound.so.2.0.0
- Remove the current link to the package library in /usr/lib.
rm libasound.so.2
- Check that it is gone.
ls -l libasound*
-rw-r--r-- 1 root root 1458654 2007-08-01 01:45 libasound.a
-rwxr-xr-x 1 root root 899872 2007-08-16 07:42 libasound.so.2.0.0
- Create a new symbolic link here to the library you copied to /usr/local/lib/alsa.
ln -s /usr/local/lib/alsa/libasound.so.2.0.0 libasound.so.2
- Check that the link was created.
ls -l libasound*
-rw-r--r-- 1 root root 1458654 2007-08-01 01:45 libasound.a
lrwxrwxrwx 1 root root 29 2008-03-04 08:31 libasound.so -> /usr/local/lib/alsa/libasound.so.2.0.0
-rwxr-xr-x 1 root root 899872 2007-08-16 07:42 libasound.so.2.0.0
- Change to the /lib directory.
cd /lib
- Find the setup for the libasound library.
ls -l libasound*
-rw-r--r-- 1 root root 1458654 2007-08-01 01:45 libasound.a
lrwxrwxrwx 1 root root 29 2007-08-06 08:31 libasound.so -> /lib/libasound.so.2
-rwxr-xr-x 1 root root 899872 2007-08-16 07:42 libasound.so.2.0.0
- Remove the current link to the package library in /lib.
rm libasound.so.2
- Check that it is gone.
ls -l libasound*
-rw-r--r-- 1 root root 1458654 2007-08-01 01:45 libasound.a
-rwxr-xr-x 1 root root 899872 2007-08-16 07:42 libasound.so.2.0.0
- Create a new symbolic link here to the library you copied to /usr/local/lib/alsa.
ln -s /usr/local/lib/alsa/libasound.so.2.0.0 libasound.so.2
- Check that the link was created.
ls -l libasound*
-rw-r--r-- 1 root root 1458654 2007-08-01 01:45 libasound.a
lrwxrwxrwx 1 root root 29 2008-03-04 08:31 libasound.so -> /usr/local/lib/alsa/libasound.so.2.0.0
-rwxr-xr-x 1 root root 899872 2007-08-16 07:42 libasound.so.2.0.0
- Change to the /etc/ld.so.conf.d directory.
cd /etc/ld.so.conf.d
- Use a text editor to create a file called alsa.conf. I use vim with the
following commands.
vim alsa.conf
i to put it into insert mode
Type /usr/local/lib/alsa
Hit the escape key to get back to command mode
Type :wq
If you get in trouble with vim's modes, hit escape a few times, then type :q to quit.
An alternative is to use cat to put the text into the file.
cat > alsa.conf
/usr/local/lib/alsa
Control-d -<-- type ctrl key and d at the same time to close the file.
- Check that the file is there and has /usr/local/lib/alsa in it.
cat alsa.conf
/usr/local/lib/alsa
- Run the ldconfig command to recreate the dynamic library cache in order
to pick up the new libasound we have just configured.
/sbin/ldconfig
- Change to directory /usr/share/alsa in order to check whether the alsa
configuration files are in the default location. If they are, you have nothing to do.
If they aren't, as on Fedora 7, you have to provide links to their location or
discord will fail because it can't resolve any devices.
cd /usr/share/alsa
ls -l
-rw-r--r-- 1 root root 8611 2007-07-13 17:55 alsa.conf
drwxr-xr-x 3 root root 4096 2007-07-13 17:55 cards
drwxr-xr-x 2 root root 4096 2007-07-13 17:55 pcm
-rw-r--r-- 1 root root 132 2007-07-13 17:55 smixer.conf
-rw-r--r-- 1 root root 3205 2007-07-13 17:55 sndo-mixer.alisp
drwxr-xr-x 2 root root 4096 2007-08-03 07:37 speaker-test
- Create the links to the alsa configuration files in /etc/alsa if
necessary. It is necessary if the ls gave only the speaker-test entry.
ln -s /etc/alsa/alsa.conf alsa.conf
ln -s /etc/alsa/cards cards
ln -s /etc/alsa/pcm pcm
ln -s /etc/alsa/smixer.conf smixer.conf
ln -s /etc/alsa/sndo-mixer.alisp sndo-mixer.alisp
- Check that the links are all there and correct.
ls -l
lrwxrwxrwx 1 root root 19 2007-08-11 13:40 alsa.conf -> /etc/alsa/alsa.conf
lrwxrwxrwx 1 root root 15 2007-08-11 13:40 cards -> /etc/alsa/cards
lrwxrwxrwx 1 root root 13 2007-08-11 13:40 pcm -> /etc/alsa/pcm
lrwxrwxrwx 1 root root 21 2007-08-11 13:40 smixer.conf -> /etc/alsa/smixer.conf
lrwxrwxrwx 1 root root 26 2007-08-11 13:40 sndo-mixer.alisp -> /etc/alsa/sndo-mixer.alisp
drwxr-xr-x 2 root root 4096 2007-08-09 16:17 speaker-test
- If you do not already have an audio group, you will need to add
one or alsa will complain. The -f means if it already exists, return
as success.
/usr/sbin/groupadd -f audio
- Check that the load module resolves to the new library.
ldd /usr/local/bin/discord
It should look like
$ ldd /usr/local/bin/discord
linux-gate.so.1 => (0x00110000)
libm.so.6 => /lib/libm.so.6 (0x00947000)
libpthread.so.0 => /lib/libpthread.so.0 (0x0098e000)
libasound.so.2 => /usr/local/lib/alsa/libasound.so.2 (0x00111000)
libncurses.so.5 => /lib/libncurses.so.5 (0x03c50000)
libsndfile.so.1 => /usr/lib/libsndfile.so.1 (0x001d4000)
libsamplerate.so.0 => /usr/lib/libsamplerate.so.0 (0x00234000)
libc.so.6 => /lib/libc.so.6 (0x007f1000)
/lib/ld-linux.so.2 (0x007d2000)
libdl.so.2 => /lib/libdl.so.2 (0x00972000)
libtinfo.so.5 => /lib/libtinfo.so.5 (0x03c36000)
Make sure that libasound.so.2 points to /usr/local/lib/alsa as above.
That's it, you're done. Discord will now work properly. When your package
manager updates your system to the next version of alsa-lib, you can remove
the file alsa.conf in /etc/ld.so.conf.d/ and run /sbin/ldconfig to enable the
package version. Then recompile and test discord to see if it works with the
new version. If it does, you can remove the link and library in
/usr/local/lib/alsa and forget about alsa-lib again. If it doesn't, put the file
alsa.conf back into ld.so.conf.d, rerun /sbin/ldconfig, recompile discord
and you are back to operational status.