>
start at the source of the sound, and working your way towards the speakers, turn it up as loud as you can without distorting itIn practice that will often be right. In theory it is not.
With an analog signal what you actually want to do is avoid gain, whenever possible. You don't want to add as much gain at every step and then attenuate later. Gain adds noise and removes dynamic headroom.
So, assuming a guitar with passive electronics, you want to turn it all the way up (which adds no gain, passive electronics only attenuate a signal) and put everything else at unity gain (i.e. no attenuation and no additional gain). That will be labeled "0" on mixer faders and is about 80% of the way up on the fader.
We'll ignore guitar amplifiers for the moment, where the distortion that happens when you run out of headroom (clipping, i.e. "fuzz") and the sonic properties of vacuum tubes when they're near the top of their dynamic range (i.e. "tube warmth") are desired effects.
Now, so assuming you have a signal that you want clean all the way to the output, you've got things at unity all the way across the board, and it's not loud enough, then you start looking at where to add gain.
This is where we get to the part about you being in practice correct for many cases.
What we're looking to avoid is adding noise. Cabling exposes signals to RF interference and attenuate the signal since they're not perfect carriers. The more cables and interconnects down the road from the source we are, the more noise will have been introduced. Since we don't want to amplify the noise, it's usually best to amplify the signal at the point closest to the source since less noise will have leaked in. If you amplify a signal 4 connects down your signal path, there will be a lot of noise that you're amplifying along with your source's signal.
However, not all (pre-)amplifiers are created equal. Some, in fact, are pretty noisy themselves. There are certainly points where with a noisy pre-amp, you'll degrade the signal more by amplifying it in an earlier-in-your-signal-path pre-amp than you would boosting it at a very clean pre-amplifier one step down the chain. One of the big differences between cheapo mixers and high-end mixers is the quality of their first-in-the-signal-path pre-amps. A gain-adding stomp box is almost certainly going to be noisier than a Mackie pre-amp.
Now, since this started off talking about the sound coming out of consumer grade computer components (rather than a nice break-out box), it's worth noting that their analog amplifiers are pretty universally terrible. If you have a reasonably short and well-shielded cable, you'll generally be better off leaving it at "unity" (i.e. not boosting the pure signal that's coming out of the digital-to-analog converter), but adding it at the next step in your chain -- the mixer, receiver or powered monitors.
Now, to finish up, I'll circle back around to my first point -- since boosting the signal itself adds noise, if you're having to attenuate it later on, you're adding unnecessary noise. Your strategy of turning things up all the way until they clip is not a good one if you're having to then attenuate the signal later on for it to be at the correct levels for the mix. Ideally what you want is to have all of your faders at unity (again, labeled 0) and then to add gain at the quietest pre-amp (usually early in the chain) available until you hit the loudest volume that the channel will need to be in the mix. Fortunately, the folks designing mixers know that sometimes the situation on the ground is different in a live sound context and you'll actually need to go beyond unity, which is why mixers don't peak-out at there, but allow you to boost the signal there on an as-needed basis.
Edit: Minor addendum -- this assumes that you're not sending weak signals down long, unbalanced cables. If you are, that changes the calculus a little since they'll pick up a lot of RF on the way and you hack that around that by boosting before the cable and attenuating afterwards. But don't do that. That's what DI units are for.