For me, this problem turned up very abrupty after months of no trouble.
In my case the problem only was there when headphones were plugged in, and as it turns out was caused by the headphones cord becoming loose and broken. I didn't notice anything else wrong with it until after another week...