Fixing distorted audio with Intel HDA on Ubuntu

edit /etc/pulse/default.pa
before:

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif

after:

### Automatically load driver modules depending on the hardware available
#.ifexists module-udev-detect.so
#load-module module-udev-detect tsched=0
#.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
#.endif

Restart pulseaudio or the whole system.