Saturday, December 17, 2011

Prevent Speaker Static in Ubuntu on Mac

One of the minor problems I've had since making the switch to ubuntu on a mac has been the static noises coming from the speakers. It's not loud and if there is any ambient noise around, it is almost impossible to hear, however after a bit of googling, I came across this post which suggests a fix which worked for me. In summary:
  1. Run the following from a terminal to create an init script:
  2. echo -e '#!/bin/bash\nrmmod snd-hda-intel\nmodprobe snd-hda-intel' | sudo tee /etc/init.d/soundrestart
  3. Make the script executable by running:
  4. sudo chmod +x /etc/init.d/soundrestart
  5. Set the init script to run early in the startup sequence
  6. sudo update-rc.d soundrestart start 10 2 3 4 5 .
You will need to restart for the changes to take effect. Should this not resolve your problem, it can be reverted by running the following from the terminal: sudo update-rc.d -f soundrestart remove && sudo rm /etc/init.d/soundrestart