Nice work-around Willem!

I've enhanced your script to make it more modular. Users can install
this script and not have to check and set the PCI device ID as the
script will figure it out.

#!/bin/bash
# this file is /etc/acpi/resume.d/66-snd-hda-intel.sh
# workaround for HDA resume bug on 2.6.20 (fixed in .22)
# see https://bugs.launchpad.net/ubuntu/+bug/100114
# this requires xserver-xorg-core to be installed, which is usually the case

DEVICEPATH="`ls -d /sys/module/snd_hda_intel/drivers/pci\:HDA\ Intel/0*`"
if [ "x$DEVICEPATH" != "x" ]; then
 # extract PCI device ID from path
 PCI=`expr match "$DEVICEPATH" '.*\/[0-9]\+:\(.*$\)'`
 # replace dot with colon
 PCI=`echo $PCI | tr "." ":"`
 # read the register
 TCSEL=`pcitweak -r $PCI 0x44`
 echo "TCSEL=$TCSEL"
 # test TCSEL against required value
 if [ "$TCSEL" != "0x00000000" ]; then
  echo "HDA TCSEL register needs correcting"
  pcitweak -w $PCI 0x44 0
 else
  echo "HDA TCSEL register okay"
 fi
fi

-- 
snd-hda-intel: distorted sound after resume, until the module is reloaded
https://bugs.launchpad.net/bugs/100114
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to