-
Alsa issue: how to make it work after rebooting
Hi people,
This is my first post. I consider myself a newbie in Linux, but in general I can solve the problems by googling (which almost always ends up in this forum). For this strange problem I couldn't find out how to solve it.
Let's start. I have a knoppix, kernel version 2.6.19, installed on my hdd. Everything started when I noticed that flash animations on webpages don't play any sound, although I can hear sounds in other applications. Then I found out that flash plugin was compiled to work with alsa instead of oss. So, I just tried to know what was going on with alsa on my computer. When executed amixer, I get:
Code:
amixer: Mixer attach default error: No such device
After reading, googling and so on, I executed alsaconf to configure sound. So, after that I got
Code:
Running update-modules... Loading driver... Usage: /etc/init.d/alsa {unload|reload|force-unload|force-reload|suspend|resume}Setting default volumes... amixer: Mixer attach default error: No such device =============================================================================== Now ALSA is ready to use. For adjustment of volumes, use your favorite mixer. Have a lot of fun!
with no sound.
I remembered that the sound module was snd-cmipci, so I loaded it with modprobe. Sound was back! but when I execute amixer (or, rather, any application that uses alsa) I get that 'no sound card is installed'.
I repeat many times this, and the only way to get (non-alsa) sound is by manually loading the module.
What I did was to reinstall alsa-related packages. So, I executed
Code:
apt-get install --reinstall alsa-base
And, surprise!: alsaconf configured properly my soundcard! The consequence is that alsa-applications can play sounds! Great!
But when I restart my system, everything goes back to the beginning. The only way to get alsa system to work is by reinstalling it and running alsaconf afterwards (in this order).
btw, alsa-utils,base,all-other-alsa-related-packages version is 1.0.14-1
Any clue to make it work forever?
Thanks in advance for your help.
-
Senior Member
registered user
use this command to fix your alsa:
(as root)
dpkg-reconfigure alsa-base
You can add this to the very end of /etc/init.d/knoppix-hd-autoconfigure:
dpkg-reconfigure alsa-base >/dev/null 2>&1
OR:.... Use my script.
reconfigure_alsa.sh
Code:
#!/bin/sh
#
# Ripped straight from postinst in the alsa-base package.
#
[ "$UID" != "0" ] && echo "Must be run as root!" && exit 1
echo "Configuring ALSA..."
set -e
MYNAME="$0"
# $* message
warn() { echo "${MYNAME}: Warning: $*" >&2 ; }
# $* message
report_error() { echo "${MYNAME}: Error: $*" >&2 ; }
devfs_is_active()
{
test -e /dev/.devfsd
}
kernel_is_2_6_or_above()
{
case "$(uname -r)" in
1.*|2.[012345]*) return 1 ;;
*) return 0 ;;
esac
}
udev_is_active()
{
test -e /dev/.udev.tdb || test -d /dev/.udevdb || return 1
kernel_is_2_6_or_above || return 1
return 0
}
if [ -d /etc/sound ]; then
rmdir /etc/sound 2> /dev/null || :
fi
rm -f \
/etc/apm/event.d/alsa \
/etc/apm/event.d/alsa.dpkg-old \
/etc/default/alsa.debconf-backup \
/etc/devfs/conf.d/alsa \
/etc/discover.conf.d/10alsa \
/etc/discover.conf.d/10alsa.dpkg-old \
/etc/alsa/alsa-base.conf \
/etc/alsa/modutils/0.5 \
/etc/alsa/modutils/0.9 \
/etc/alsa/modutils/1.0 \
/etc/alsa/modutils/0.5.debconf-backup \
/etc/alsa/modutils/0.9.debconf-backup \
/etc/alsa/modutils/1.0.debconf-backup \
/etc/alsa/modprobe-post-install.d/alsa-base \
/etc/alsa/modprobe-post-install.d/alsa-base.dpkg-old \
/etc/modutils/alsa \
/etc/modutils/alsa-path \
/etc/modprobe.d/alsa
# Delete hotplug blacklist backup file since hotplug doesn't ignore
# it as it should (#299205)
rm -f /etc/hotplug/blacklist.d/alsa-base.dpkg-old
# Delete obsolete rc symlinks to alsa init.d script
# (update-rc.d produces an unnecessary warning message on stderr (see #164471) so print the error message only if its error status is nonzero)
STDERR="$(update-rc.d -f alsa remove 2>&1 >/dev/null)" || echo "Warning: 'update-rc.d -f alsa remove' reported: '$STDERR'." >&2
# Update modutils config
[ "$(which update-modules 2>/dev/null)" ] && update-modules >/dev/null || :
# Decide which conf file to read
conf_file=""
if [ -f /etc/default/alsa ] ; then
conf_file=/etc/default/alsa
elif [ -f /usr/share/alsa-base/alsa.default ] ; then
conf_file=/usr/share/alsa-base/alsa.default
else
report_error "No configuration file found"
exit 1
fi
# Read variables from conf file
force_unload_modules_before_suspend="$(
. "$conf_file" >/dev/null 2>&1
echo "$force_unload_modules_before_suspend"
)"
# Write new conf file
cat /usr/share/alsa-base/alsa.default | sed \
-e "s/force_unload_modules_before_suspend=.*/force_unload_modules_before_suspend=\"${force_unload_modules_before_suspend}\"/" \
> /etc/default/alsa
# Run snddevices if required
# We ignore #309581 "Creating devices not using MAKEDEV violates policy 10.6"
make_snddevices() { /usr/share/alsa-base/snddevices --no-wipe --owner=root.audio "$@" >/dev/null ; }
if devfs_is_active ; then
# devfs /dev/
# Run update-devfsd because we have eliminated the devfsd configuration file
[ "$(which update-devfsd 2>/dev/null)" ] && update-devfsd
else
if ! udev_is_active || [ "$WRITE_ON_UDEV" ] ; then
# static /dev/ or udev-controlled /dev/ that we should write on
[ -d /dev/snd ] || make_snddevices
else
# udev-controlled /dev/ which we shouldn't overwrite
if [ -d /dev/.static/dev ] && [ -e /proc/mounts ] && grep -qE '^[^ ]+ /dev/\.static/dev' /proc/mounts ; then
[ -d /dev/.static/dev/snd ] || make_snddevices --dev-dir=/dev/.static/dev > /dev/null
elif [ -d /.dev ] && [ -e /proc/mounts ] && grep -qE '^[^ ]+ /\.dev' /proc/mounts ; then
[ -d /.dev/snd ] || make_snddevices --dev-dir=/.dev > /dev/null
fi
fi
fi
# Set up apm symlinks
[ -f /etc/apm/scripts.d/alsa ] || warn "/etc/apm/scripts.d/alsa is absent"
# $1: file to check
already_linked_to_alsa()
{
[ "$1" ] || return 1
[ -L "$1" ] || return 1
[ "$(basename "$(readlink "$1")")" = alsa ] || return 1
return 0
}
ALREADY_LINKED=no
for F in /etc/apm/suspend.d/??alsa ; do
already_linked_to_alsa "$F" && ALREADY_LINKED=yes && break
done
[ "$ALREADY_LINKED" = yes ] || ln -sf ../scripts.d/alsa /etc/apm/suspend.d/80alsa
ALREADY_LINKED=no
for F in /etc/apm/resume.d/??alsa ; do
already_linked_to_alsa "$F" && ALREADY_LINKED=yes && break
done
[ "$ALREADY_LINKED" = yes ] || ln -sf ../scripts.d/alsa /etc/apm/resume.d/20alsa
exit 0
(as root)
Copy the above text and paste into a new file named: /etc/init.d/reconfigure_alsa.sh ...
Then issue (as root): ln -s /etc/init.d/reconfigure_alsa.sh /etc/rcS.d/S10reconfigure_alsa
Reboot ![Smile](images/smilies/icon_smile.gif)
Take Care,
-Justin
One Mynds Eye
-
The first suggestion didn't work. The second did, but the it takes some time at boot time. Does anybody know why I/we have to do this?
I just tried the sound in flash animations and it doesn't work
I think I'll spend some more days to find out what's going on...
Similar Threads
-
By fla in forum General Support
Replies: 1
Last Post: 11-15-2004, 07:20 PM
-
By ScreamingTemporalDoom in forum Hdd Install / Debian / Apt
Replies: 3
Last Post: 08-12-2004, 08:48 AM
-
By dzogchen in forum Hdd Install / Debian / Apt
Replies: 16
Last Post: 08-05-2004, 06:37 AM
-
By Groke in forum General Support
Replies: 1
Last Post: 11-12-2003, 02:45 PM
-
By cy in forum Hardware & Booting
Replies: 0
Last Post: 03-25-2003, 12:20 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
![Crucial 8GB 1x8GB PC RAM PC3L 12800U DDR3 1600MHz Desktop Memory DIMM picture](/store/img/g/S5oAAOSwIq5mcvT-/s-l225/Crucial-8GB-1x8GB-PC-RAM-PC3L-12800U-DDR3-1600MHz-.jpg)
Crucial 8GB 1x8GB PC RAM PC3L 12800U DDR3 1600MHz Desktop Memory DIMM
$8.99
![A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G picture](/store/img/g/RCAAAOSweqdeWaui/s-l225/A-Tech-8GB-DDR3-1600-PC3-12800-Laptop-SODIMM-204-P.jpg)
A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G
$13.99
![Lot of 2 4GB DDR4 Memory PC4-3200 SODIMM Laptop RAM 3200MHz picture](/store/img/g/oFUAAOSwQUNiVd61/s-l225/Lot-of-2-4GB-DDR4-Memory-PC4-3200-SODIMM-Laptop-RA.jpg)
Lot of 2 4GB DDR4 Memory PC4-3200 SODIMM Laptop RAM 3200MHz
$9.99
![Samsung 8GB (1x8GB) PC4-21300 DDR4-2666V Laptop Memory SDRAM M471A1K43CB1-CTD picture](/store/img/g/0OAAAOSwzVNmbQcK/s-l225/Samsung-8GB-1x8GB-PC4-21300-DDR4-2666V-Laptop-Memo.jpg)
Samsung 8GB (1x8GB) PC4-21300 DDR4-2666V Laptop Memory SDRAM M471A1K43CB1-CTD
$10.99
![Micron 16GB DDR4-2400 SODIMM MTA16ATF2G64HZ-2G3E1 Laptop Memory RAM picture](/store/img/g/erEAAOSw6Hdmb2EJ/s-l225/Micron-16GB-DDR4-2400-SODIMM-MTA16ATF2G64HZ-2G3E1-.jpg)
Micron 16GB DDR4-2400 SODIMM MTA16ATF2G64HZ-2G3E1 Laptop Memory RAM
$21.99
![Crucial DDR3L 16GB 1600 2x 8GB PC3-12800 Laptop SODIMM Memory RAM PC3 16G DDR3 picture](/store/img/g/mecAAOSw2Vlkv6Ot/s-l225/Crucial-DDR3L-16GB-1600-2x-8GB-PC3-12800-Laptop-SO.jpg)
Crucial DDR3L 16GB 1600 2x 8GB PC3-12800 Laptop SODIMM Memory RAM PC3 16G DDR3
$13.50
![Team T-FORCE VULCAN Z 32GB (2 x 16GB) PC RAM DDR4 3200 (PC4 25600) Memory picture](/store/img/g/~u4AAOSwK-liKn7t/s-l225/Team-T-FORCE-VULCAN-Z-32GB-2-x-16GB-PC-RAM-DDR4-32.jpg)
Team T-FORCE VULCAN Z 32GB (2 x 16GB) PC RAM DDR4 3200 (PC4 25600) Memory
$54.99
![Crucial 8GB SO-DIMM PC3-12800 (DDR3-1600) Memory picture](/store/img/g/iOoAAOSwgOhf~Jfl/s-l225/Crucial-8GB-SO-DIMM-PC3-12800-DDR3-1600-Memory.jpg)
Crucial 8GB SO-DIMM PC3-12800 (DDR3-1600) Memory
$9.49
![A-Tech 128GB 4x 32GB 2Rx4 PC4-19200R DDR4 2400 ECC REG RDIMM Server Memory RAM picture](/store/img/g/3-4AAOSwVhVjIlQP/s-l225/A-Tech-128GB-4x-32GB-2Rx4-PC4-19200R-DDR4-2400-ECC.jpg)
A-Tech 128GB 4x 32GB 2Rx4 PC4-19200R DDR4 2400 ECC REG RDIMM Server Memory RAM
$191.96
![A-Tech 64GB 4x 16GB 2Rx4 PC4-19200R DDR4 2400MHz ECC REG RDIMM Server Memory RAM picture](/store/img/g/gx4AAOSw3O5jIlQu/s-l225/A-Tech-64GB-4x-16GB-2Rx4-PC4-19200R-DDR4-2400MHz-E.jpg)
A-Tech 64GB 4x 16GB 2Rx4 PC4-19200R DDR4 2400MHz ECC REG RDIMM Server Memory RAM
$87.96