One tip - if you are using ST at a higher sample rate and also doing the same with encoding, make sure that the sampling rate is actually supported by pulseaudio! Resampling can ruin the quality of your output and also add extra load on to the CPU. And it also causes buffer underruns as reported by ST which also ruins the audio!
By typing this - pacmd list-sinks | grep sample
I found that pulseaudio was sampling at 44.1khz! I had 48khz on both ST and the encoder. No wonder things didn't work nor sound right!
So to fix this, I created a file ~/.pulse/daemon.conf
and added a single line to it - default-sample-rate = 48000
I then looked for the PID for Pulseaudio and killed it. I restarted it by typing pulseaudio -D (to start it again as a daemon)
To double check it worked, I typed this again - pacmd list-sinks | grep sample
You should now find that the sampling rate is 48000.
Now things sound better with less load on the CPU and less buffer underruns!
I hope this helps someone out there!