Comment 18 for bug 914290

Revision history for this message
Cefn (6-launchpad-net-cefn-com) wrote :

# Here's an improved version of the script which tests every possible model in series trying to make a noise.
# It's improved by using sort -u (which eliminates duplicate values, reducing the number of trials from 315 to 222) and
# having a more conservative substitution, (which only removes and replaces the last line if it already specifies a snd-hda-intel model)
# It doesn't help me, (as none of the models work), but it might be handy for someone else

if [ "$(id -u)" != "0" ]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi
for MODEL in `cat /usr/share/doc/alsa-base/driver/HD-Audio-Models.txt.gz| zcat | tail -n +3 | awk '/^ / { print $1; }' | sort -u `
do
 perl -i -ple "s/^options snd-hda-intel model=.*$/options snd-hda-intel model=$MODEL/ if eof" /etc/modprobe.d/alsa-base.conf;
 alsa force-reload;
 aplay /usr/share/sounds/alsa/Front_Center.wav
done