Is it better to turn up the volume in the software or on the speakers?
superuser.com
superuser.com
Let's ignore the discussion about dynamic range and bit depth etc., and assume that the volume control on your operating system controls the DAC rather than doing the stupid thing of digital volume reduction. The fundamental issue is signal to noise ratio on the analog line. If you turn the volume too far down on the computer and turn the volume up on your speakers, the sound on the analog line is too low with regard to the electrical noise and will be hissy. If you turn the volume up too much on the computer and turn the volume down on your speakers, then the signal will be so loud as to produce distortion either in the DAC or on the line itself. You're looking for a middle ground: as loud an output from the computer that you can produce without causing distortion in your loudest music parts. Once you've got that set, change the volume on the speakers to compensate.
As discussed, lowering the volume in software (which is what you likely mean by "controlling the DAC") is accomplished by reducing bit depth. By definition you're reducing the amount of signal present which makes your S/N worse. If by "controlling the DAC" you mean reducing the signal at the DAC's analog stage then there's nothing theoretically wrong with that (except that it's rarely if ever the case in computer sound cards or hi-fi DACs) as it is the equivalent to adjusting the volume on your (integrated) amp.
Probably the most common exception to the above is people using a digital EQ to attempt to improve the sound of a mediocre computer audio setup. Most digital EQs allow for both "boost" and "cut" -- increasing or decreasing the amplitude of individual frequency bands. If you EQ the music the proper way you should only cut frequency bands in order to emphasize the other bands to suit your listening tastes. For example if you want to try to increase the amount of bass you should cut the mids and the highs and turn up the volume (on your amp) to compensate. EQing this way ensures that you're not forcing the signal into clipping by boosting too much.
You still won't get great results because if you're lacking bass or highs then it's most likely because you're not running full range speakers. If the sound does change when you EQ it's most likely due to increased distortion, not because you're appreciably increasing the amount of bass present. That's not true for full range speakers but if you have full range speakers you probably wouldn't need to EQ in the first place. (Full range speaker are usually 20 - 50hz to 20khz.)
If it's still not clear than think of it this way: Standalone CD players don't have volume controls. Their output will be "max volume" of what's on the CD. You can think of your computer and sound card like a (crappy) CD player. Make sure it's at max volume and adjust the level on your external amp or amplified speakers.
No, reducing the amplitude of a digital signal does not change its bit depth. If the amplitude of the digital signal is reduced, then a couple of bits on the MSB side will be constant. However, reducing the bit depth would make bits on the LSB side constant.
To state it differently, a lower bit depth increases the quantization levels and results in lower quality audio. Reducing the amplitude retains the same quantization level, and therefore has no reduction in audio quality (At least, not due to bit depth, it does change the SNR as you suggested)
To further muddy the waters, in most cases using software volume control won't noticeably reduce audio quality. The main point I was trying to make is that on most computer setups 100% volume should be the least noisy, most accurate signal that it's capable of.
Is this a safe assumption though? As much as I consider myself knowledgeable in this area, this is way off my radar.
Even if this assumption does hold, the answer does make a good point when it comes to per-application volume controls, which are certainly performed digitally.
Your point on SNR is a very good one, particularly on the low-end, but I would question whether any computer at max volume would produce a signal strong enough to cause distortion. I generally run my computer at around 90% volume but that's merely a habit carried over from having an analog hifi stack.
Take the example of a guitarist. He turns his guitar up as high as he can, then the amp gain as high without distorting it. Then at the sound console. etc
The reason for this the later in the chain you are, the more electronics and cable is involved which adds noise to your signal. Highest signal-to-noise is achieved by ensuring you have as much signal as you can running thru from the get-go.
In the case of a computer, again it doesn't matter how volume changes are done- crank up your software as high as you need (but not beyond the point of distortion), then adjust it further at the speakers.
In 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.
The sound console is different. You want everything in the console to be trimmed to around 0 dB on the console's meters, and NOT as loud as possible without distorting. Trimming it to 0 dB gives you consistency between channels making it easier to work with the faders, and gives you however much headroom the console is designed to work with. "Loud as possible" will mean somewhere like +24 dB on some consoles, which is too hot to work with. Yes, they have that much headroom -- nominal line level is +4 dBu, around 1.2 V, and consoles have internal voltages in the 15-24V range.
The same goes for recording, you typically want things to peak at something like -18 dBFS. Making things peak "loud as you can without distorting" is the job of the mastering engineer, and it happens right before you stamp out CDs or MP3s or whatever.
Without distorting it? Are you sure you have some sound knowledge? That doesn't sound like you know many guitarists... ;)
No it's not -- I was just pointing out that he's going on about various stuff without hitting the critical meat of the issue at all.
It would be nice to have some statistics about the number of lines of a reply on SO or HN and the amount of 'upvotes'. I think a lot of people would be surprised...
What would be the difference? I've never seen a DAC with an analog volume control. Any DAC I've ever seen with volume control does so digitally, usually with toggable steps (+6DB, +12DB, etc) or rarely with a programmable gain. Either way the DAC is adjusting the incoming digital signal prior to conversion. It would be really strange to try to make an analog adjustment to the output before the reconstruction filter.
http://www.xilinx.com/products/boards/ml505/datasheets/87560...
Digital audio levels are fixed -- i.e. 0 dBFS (dB relative to digital "full scale"), thus you want the audio as close to full scale (0dBFS) as possible. This is the reasoning behind what you've probably heard described as the "loudness war". 0dBFS is the reference point beyond which no signal can exceed.
Contrast that with analog audio, be it the DAC (digital-to-analog converter) on your soundcard that splits to a "line out" (likely 3.5mm a/k/a/ 1/8" TRS connector outputting audio at -10 dBV, the "consumer" level) and "headphone jack" (i.e. line level signal -> headphone amplifier). Once the audio signal becomes analog, you must then be concerned about gain staging. If you have a crappy sound card, you shouldn't reduce the analog output, because, in order to achieve the same loudness, you will have to increase the gain on your 'speakers' (a/k/a/ "pre-amplifier"; often integrated into cheap 'all in one' computer audio playback systems). Remember that the noise floor remains the same regardless of gain settings, so by reducing the "line out" level, you are only increasing the noise floor (i.e. level of noise).
For all of you geeks out there... If you are looking to cut through the bullst and get a quality playback system, look into a setup that has a quality DAC and/with monitor controller, a separate preamp, and quality monitors. Benchmark has a great USB DAC, and or Lavry Engineering is what the professional mastering studios use (their DAC costs well over $20k, and not because of crap like 'voodoo diamond dust covered gold-plated platinum wires', but, in part, because it has an internal oven and temperature monitoring circuitry to keep the internals at precise temperatures). You can get a great monitor controller from Dangerous Audio or Coleman. Bryston preamp's are very popular in the professional setting, as are PMC and Bowers & Wilkins monitors.
This happens both on my desktop Linux system and my Linux laptop.
You can verify it easily by playing either a 0dB sine-wave mp3 (first google hit: http://www.dr-lex.be/software/testsounds.html) or trying to get a sine-wave test-tone generator. You'll hear the point where distortion kicks in pretty drastic as soon as you reach the clipping level. With a spectrum-analyzer (e.g. FrequenSee on Android) even slight clipping will be very visible (peaks at 3x, 5x, 7x, ... the base frequency will suddenly appear).
(A) Pretend that everything except the DAC was noiseless: The noise would be due to the nonlinearities and quantization in the DAC.
(B) Pretend that the DAC was perfect: The noise would be dominated by the noise-equivalent input-power introduced by the resistance present in the components (including the transistors used for amps).
In short: (A) is a function of how wide the range of bitcodes that you use. The smaller the range, the larger the noise component relative to the signal.
OTOH: (B) is a function of temperature: All of the noise power before the final dial to your amp is passed through as is the signal, so the ratio stays constant. There is also a constant noise power introduced after that final amp, but I would guess it is negligible compared to the amplified noise power.
So tl;dr = For a decent sound card, maximize the software volume and then use the analog dial.
Max your software (usually this is 80% to prevent clipping and distortion), then attenuate speakers to 50% (analog boost is much worse than digital as it raises the noise floor).
Source: Mixing at studios for last 10 years
On a similar note, I learned and practised all this in another country and I always thought it strange why when I, for example, flipped to American channels, the volume would increase dramatically. I think a similar phenomenon occurs in radio (Loudness Wars) and in malls, etc. Now I wonder if it occurs in American software.
On the PC, though, I rarely set my system volume to anything other than 100%.
I used to own a Samsung Moment; trying to listen to music on it was almost unbearable due to the quality. It must have been dumping bits left and right during the conversion. I tried 320kbps Mp3s, Broadcast Wavs, Flac -- it didn't matter everything sounded like it was crushed down to a 32kbps.
I'd be interested in seeing a phone dedicated to high quality playback of music. As a somewhat audiophile-ish guy, I would snatch up such a piece of technology.
Assuming this is true, the correct option would be to maximize any application volumes (e.g. YouTube), to maximize master volume to a level just below the sound clips (distorts) at the amplifier input, and to reduce the amplifier's pre-gain (if it has any) so the master volume control has a reasonable range.
This method will minimize the three (not just one) culprits of poor computer audio quality: quantization at the application layer, electronic interference over the physical connection, and clipping at the pre-amp.
EDIT: Just to add. I would be extremely surprised to see a sound card that isn't a full on pro model have true analog gain control. I've designed a couple products with such controls (for pre-amp gain, but a similar concept) and you need digitally controlled resistors to accomplish it. They are large, expensive and touchy to route without inducing noise. As an example: http://www.analog.com/en/digital-to-analog-converters/digita...
Isn't that only true if you're using your sound card's analog output? If you're using a digital output, I would imagine you would want to keep it at 0dB (no gain and no attenuation). Am I right or am I missing something?
For example if you built the YouTube player, what makes you think you need a volume control?
Or if some Youtube video has obnoxious sound and I want to mute it, but want to keep my music playing from Spotify.
That doesn't make it a good reason...
This is really only true when The Audio System represents samples as integers and not floats like CoreAudio does.
App->CoreAudio->HWSoundCard->Speakers(or amplifier)
By using floats in the sound API you don't reduce the bit depth on the first step but you still do on the next two steps. Imagine a scenario where you want to set the volume at half the maximum volume. Your two options are:
1) You set the app to 50%. Core Audio handles that as floats but still has to program the hardware to only output half volume, so if the HW itself doesn't take floats the bit depth is halved. And the HW will always have to output half the voltage so the "voltage depth" of the third step is always halved.
2) You set the speakers to 50%. All the pipeline functions at 100% bit/voltage depth all the way to the speakers/amplifier. Only then, at the final amplification stage, does the signal not get boosted to 100% and only to 50%.
How much this affects real world performance beats me...
It's worth noting that perceptually, half the volume is actually closer to 3dB (a halving of energy), which is only half a bit of loss.
If a floating point audio pipeline correctly dithers the signal going into the DAC it's unlikely anybody will notice any quality loss by using a digital volume control (even at 16-bit). You might hear the hiss of the dithering if you turn up the analogue portion of the chain, although you'd have to turn it up quite a lot.
This is perfectly sensible, since our sense of hearing does not scale linearly from silent to loud. Our ears have a dynamic range of about 120 dB. On a linear scale, the 50% value would correspond to about -6 dB, which is perceptually one 50th of the full audible scale.
A sensible volume slider (on a PC) would range about 40-60 dB, since anything below -60 dB will be lost in background noise anyway. Thus, the 50% mark would be somewhere around -20--30 dB. Thus, this 50% setting would lose roughly 5 bits of information, not one.
Note however that a reduced dynamic range at "half loudness" is usually just fine, since the full dynamic range can only be heard at high volume anyway.
(Also note that the bottom value of volume sliders usually mutes. Analogue equipment sometimes does not do that, which results in very faint signal playing even when turned all the way down.)
That said, the whole argument about losing resolution probably does not make sense anyway since the operating system volume sliders attenuate the sound hardware DAC gain instead of actually decreasing digital gain...
We were talking about reducing volume in the App. If the app is using the system volume then the App->CoreAudio step is irrelevant (as nothing changes), the CoreAudio->DAC step doesn't change either (full bit-depth and an OOB message to lower the gain), but the DAC->Speakers analog step still has to output half the volume and thus reduce the range of the signal. For this not to matter the OS would need to be able to change the gain in the speakers instead of the DAC.
Again, how much this actually has an audible effect on quality beats me...
I know professional mixing consoles are not (at least not exclusively), but they offset that by calculating everything in 32 bit float and using very high bit length DACs. Sound cards do have a pre-amp stage but I don't know if they are software-controlled.
That's fine but what I was referring to was that after the digital-analog-conversion and the pre-amp now the analog signal that goes out of the audio jack to the speakers has been reduced in range, so on that final path to the speakers you've lost some range.
Audio recordings typically do not go beyond 16 bits of dynamic range after mastering. And even before that, microphones can't deliver more than 20. Neither can ears. So that part of the system won't likely be a problem.
Reducing the signal gain in the analogue domain does not decrease its dynamic range, it merely shifts it to a lower range of the same width. Of course, this will only be true in the operating range of the op-amps, but that is typically not a limiting factor.
After the DACs, the signal will likely go through another pre-amp, then main amp in the sound system, then some analogue filters, then loudspeakers. All these are analogue and not usually limiting the dynamic range (though they will add some distortion). Finally, the signal will enter a room with noise aplenty, which will limit the effective dynamic range of the signal significantly. But that is out of control of that volume slider we talked about in the beginning ;-)
Of course analog signals have an effective limited range. As you yourself mention the noise floor makes sure of that. Only an idealized analog signal of infinite precision doesn't have a limited range.
After the DACs, the signal will likely go through another pre-amp, then main amp in the sound system, then some analogue filters, then loudspeakers. All these are analogue and not usually limiting the dynamic range (though they will add some distortion).
Precisely. So that's why keeping the signal at as high a level as possible without clipping all the way through the pipeline and only limiting at the end is an advantage. All those stages have their own noise floor. Several other people have mentioned on the thread that this is also the general recommendation for audio work.
Finally, the signal will enter a room with noise aplenty, which will limit the effective dynamic range of the signal significantly. But that is out of control of that volume slider we talked about in the beginning ;-)
That's of course true, and again I admit my ignorance as to how much of a difference this really makes once it gets where it matters, your ears. Originally I was just responding to the idea that using floats in your audio framework eliminated all sources of reduction in precision.
My main point still stands that at half the amplitude or half the energy (perceptually half the volume) you're only losing half a bit to a bit of resolution. And even at -20 - -30dB, with 4-5 bits of resolution loss, you're probably not going to notice the degredation.
So if you use a 24-bit DAC, those bits doesn't matter...
So in other words, you are probably saying that reducing the signal loudness is reducing your signal-to-noise ratio and thus your audible dynamic range. However, your noise floor is probably far higher than 0 dB, more like 20-30 dB SPL (if you're lucky!). A normally-loud (that is, non-damaging) music playback will probably be at about 50-80 dB, so your usable dynamic range will be about 30-60 dB, which translates to about ten bits. Most environments will be worse.
0 dB are actually pretty hard to come by. Even well-insulated acoustical measurement chambers only go to about 10 dB. Only several meter of acoustic foam and a solid foundation and a purpose built air conditioning can go down to 0 dB. So, umm, 0 dB is usually a rather useless figure for non-scientific purposes.
One of my 'weird unverified theories of life' is that turning the volume on portable device down (laptop/phone/mp3 player) and the volume on the speakers up saves the battery of the device itself. (For example when you're in a car.)
1) The input impedance of powered speakers or any external processing stage will be high. ~5-10k ohms, compared to 80-500 ohms for an average set of headphones. This means regardless of the level you use on the player the current draw will be substantially lower than it would be if driving headphones. This means the level doesn't matter nearly as much.
2) The efficiency curve of the output amplifier. Depending on the topology of the output amplifier of the device it may be more or less efficient at different power levels. If the output driver is a class AB topology it actually gets more efficient as it nears its rated output (generally the relationship is logarithmic). As a result you can actually be 'better' overall on power to using a higher power level at some points in the curve. You use more power to drive the output but you also increase efficiency reducing your overall power usage. Class AB is pretty in-efficient anyway as your only going to see 30-50% peak efficiency. With a class D output which is becoming more popular you can see upwards of 90% but your efficiency vs output power curve is generally sharper, you get much closer to peak efficiency much faster (depending on the exact design of course, most portable devices will be filter-less class D topologies).
You can see the objective differences between 16-bit and 24-bit output in NwAvGuy's measurements of the 2011 MacBook Air's DAC: http://nwavguy.blogspot.com/2011/12/apple-macbook-air-5g.htm...
Considering your advice of setting the output to 24 Bit while your audio collection is (most likely) encoded in 16 Bit, should trigger a conversion while outputting the audio signal - this conversion is useless, of course, as you can't turn this material into something it isn't (imagine upscaling 720p video to 1080p, new packaging, same old content/quality). Yet, and correct me if I'm wrong, the conversion still happens and alters the signal.
So, to avoid this match those audio/midi settings with your music library. There are also expensive iTunes alternatives that deal with this problem by adjusting the output settings to the currently playing audio file on the fly - in case your library consists of mixed bit depth/sample rates. I don't use those solutions though.
As far as I can tell, I rarely if ever have this problem with the same hardware in Linux with PulseAudio (though I can intentionally cause it using alsamixer by pushing "Master" to 100%) and didn't have this problem in the past on Windows with Creative Labs soundblaster cards.
Not all machines work this way, though. One way to check is to hook up an external amp and headphones, turn the computer's volume way down and the amp up to listen levels. If the quality is crap the it's probably just decreasing the bit depth. Or you can do a teardown on the sound pathway.
(Oh, if it isn't clear by this point, keep all your apps turned all the way up for best quality. Only turn them down on an individual, as-needed basis. All-software stuff has to decrease bit depth to decrease volume on a per-app basis.)
For the case where an analog potentiometer immediately follows the DAC, of course, there's no practical difference.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa51...
Volume should always be controlled as close to the source as possible. Anything else is simply inefficient and a waste of processing power.
There is no reduction of bit depth. total hoo-eee.
Also worth noting, if you attenuate the signal (in software) from the computer you generally won't attenuate the noise, meaning that at the same perceived loudness from your speakers the sound will include a lot more noise. On my 2007 MacBook Pro this is very audible.