This is a topic I have hesitated to write about for a long time. Mostly this is because when I posted questions about this to the often helpful Linux Audio Users group, I found that many people don't experience this at all, they just plug everything in and go. However, in all of my developments, I have had a whole lot of trouble with hiss, and hum, and crackle, and other unwanted sounds mixed in with my desired output. Here is a discussion of what I have encountered and what I have done about it.
This cleanup has been one of the most stubborn problems I have had in the whole effort. I have studied hundreds of pages of professional guides, as well as direct input from professionals, and I have added grounding wires left and right and upside down, and run the whole rig through medical-grade transformer isolation, and more, without resolution. So given the utter failure of so much professional input, I have ceased trying to respect logic of causality, and contented myself with the factual solutions below.
One “vector”, or path, by which the gunk gets in, is clearly the AC power. This is obvious by recognition of sixty-cycle (in most places in the world, fifty-cycle) hum. But this is not all. In many places I need to play there are lighting systems which dump other gunk into the AC power line, and more; and all of this tends to show up in the BNR audio signal. One would think that transformer isolation of the whole playing rig would fix it, and this might work – except that I usually need to play through a PA, and covering everything isn't practical.
Happily, I found a great way to eliminate this, the Ebtech Hum Exterminator or Hum X for short. I own four of these things now, and will not be without them by choice, they are fantastic.
The second major class of gunk, is USB signals. I spent a ridiculous amount of time trying to figure out how this was happening; it happens whether I use USB MIDI interfaces or USB direct to the keyboard. If firewire is in use, there may be firewire gunk too. We can tell this is happening, if (for instance) gunk gets into the audio whenever a USB mouse moves, or a USB keyboard is typed on…!
I have tested a number of different signal filters against this problem. I was using Behringer HD400's, but I had two of them die in unexpected manner, so I moved to Rolls HE18 Buzz Off devices, and these have been the best of all, also best in both price and in build quality.
The third class I have had to deal with, I'm calling The PC Miscellaneous, but so far it's been case fans and CPU fans. We can verify the existence of this, simply by disconnecting a case fan (or just stopping one with a finger!) and hearing a buzz go away.
I have no idea why this happened or why I haven't seen reports of it elsewhere, but I knocked out the issue with the tools in the above sections. I received a lot of advice while working it all out, often involving making sure everything is grounded; it is, this is a steel case and a good metal-cased power supply.
One of the reasons it seemed very good to write up this page, is the recent production by Peavey of their USB-P; it is explicitly designed for this sort of use case (!), incorporates signal cleanup circuitry with isolation, and is highly recommended in this very way in reviews on certain major Internet retailers At this writing I am in the middle of rebuild, so have not tested the USB-P in noisy circumstances, but I will report when I have experiences!