Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Perfect Volume Control? (Read 34486 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Perfect Volume Control?

Here's my next question in my 'Quest To Perfect Digital Audio'-series.

Assume:
Winamp (personal reasons, but the question applies to foobar2k too)
Play a bit-perfect copy of a CD source
All volume controls on 100%
Playback to digital out (straight to an external DAC)
and..

Current output is too loud! (Ouch!)

The question is:
Will turning down the digital volume (either winamp or windows master volume) impact the quality disproportionately negatively?

More specifically: turning down the volume will force some part of the digital audio chain to resample the output audio before it gets sent to the DAC. A lot of quality loss can be incurred (or prevented) by doing (or not doing) things like upsampling to higher kHz'es or bit depth, dithering/anti-aliasing etc etc etc.

Is there any way to determine what happens in my audio chain? I realise that it's probably best to just attenuate volume by my analog hardware (preamplifier) but the digital way is much more convenient for me. Does anyone have the detailed stats on:

- Does the windows mixer do stuff itself, or is it purely controlling the soundcard vendor's driver
- What does the vendor driver do? Are all vendors equal or do you have to have a good one?
- Does winamp hurt things? Is the MAD plugin a viable choice? Some other plugin? Kernel streaming?

Thoughts would be welcome!

Perfect Volume Control?

Reply #1
Not resample but you lose bit depth obviously. The merits of digital and analog volume control are debated. Use 24 bits rather than 16 of course and if you have a DAC with good resolution it should be OK to use digital volume control provided you don't need too much digital attenuation.

Now as for your questions (NB unrelated to this subject):
-Don't use windows mixer; use the ASIO interface so nothing you don't intend will interfere with your audio output
-you need a sound card which supports this
-Winamp supports ASIO

Perfect Volume Control?

Reply #2
Not resample but you lose bit depth obviously. The merits of digital and analog volume control are debated. Use 24 bits rather than 16 of course and if you have a DAC with good resolution it should be OK to use digital volume control provided you don't need too much digital attenuation.

Very true. As I indicated elsewhere, my current thinking is that it's best to upsample to a 24bits version (same sample frequency, of course), and not downsample to the source bitrate again.
Quote
Now as for your questions (NB unrelated to this subject):
-Don't use windows mixer; use the ASIO interface so nothing you don't intend will interfere with your audio output
-you need a sound card which supports this

Tomorrow I will have my new soundcard (which I explicitly bought for ASIO support).
Quote
-Winamp supports ASIO

What does this mean EXACTLY:
- What does ASIO volume control do? Upsample? Send volume setting data along with the digital audio data (some sort of 'replaygain' data included in SPDIF?)
- So I am correct in assuming that changing the winamp volume slider will use the ASIO interfaces?

Thanks for your response!

Perfect Volume Control?

Reply #3
ASIO is a the protocol for the sound card to communicate with software.
The volume control will be done by winamp which sends the results to your soundcard by ASIO. Winamp just sends the final audio stream. Winamp should be using 24 or 32 bit accuracy internally I should imagine so it's volume control will be fine. It is not a difficult thing to do; it's just multiplication.

Perfect Volume Control?

Reply #4
ASIO is a the protocol for the sound card to communicate with software.
The volume control will be done by winamp which sends the results to your soundcard by ASIO. Winamp just sends the final audio stream. Winamp should be using 24 or 32 bit accuracy internally I should imagine so it's volume control will be fine. It is not a difficult thing to do; it's just multiplication.


Well .. as long as winamp does NOT go from CD (16bit) to internal (24/32bit) and then BACK to 16, that would be 'perfect'. If winamp hands ASIO its corrected signal in 16bit then the loss is there again.

I guess that if we can put 'ASIO' in 24bit mode, we can hope that winamp will not go 16 -> 24 -> volumechange -> 16 ->pass to asio -> 24 but instead will go 16 -> 24 -> volumechange -> pass to asio

Perfect Volume Control?

Reply #5
Yes. The ASIO stream probably uses a 32 bit bit depth. That is how it is with my sound card anyway.

How much digital attenuation do you need in db?

Perfect Volume Control?

Reply #6
Firstly, changing the bitdepth is not called upsampling or downsampling.

Secondly, working in floating point, and dithering the output at 24bits, you lose nothing by reducing the volume of a 16-bit signal input by up to 48dB. In theory! You have 48dB "to work with" before losing data, but it's less than this since the dither noise will add. Further, if the original 16-bit dither+quantisation was noise-shaped, but the dither you apply to the 24-bit version isn't, then you have less still.

Beyond this, your D>A and associated electronics will have a fixed noise floor. By reducing the volume of what is contained in the digital input signal, you are sinking further into that noise floor. Whether this is relevant depends on the noise floor, the original recording, how much you reduce the volume, and yourself.

If the listening volume ("analogue" gain setting) is such that the noise floor (with dither) of the D>A is inaudible, then in theory no audible harm can be done by any digital reduction of the volume (e.g. what you lose in the digital domain by reducing the volume by 80dB would be inaudible had you chosen to reduce the analogue volume by 80dB!)

In practice, a less than perfect DAC could do damage (e.g. via distortion), but then in practice the signals which you attenuate digitally the most (i.e. the ones which are loudest in the first place) probably have least to lose.

In short, don't worry about it. Unless, if course, you find the noise floor of your 24-bit D>A is similar (or worse than!) that of a 16-bit recording - in that case, abandon this idea!

Cheers,
David.

 

Perfect Volume Control?

Reply #7
A note:  Winamp is relying solely on the soundcard API (waveOut, DirectSound, ASIO, KS, etc. depending on what plugin you are using) for volume control.  It does not do any digital volume adjustment (except for replaygain and the preamp on the EQ)

Perfect Volume Control?

Reply #8
Yes. The ASIO stream probably uses a 32 bit bit depth. That is how it is with my sound card anyway.

How much digital attenuation do you need in db?


Well, anywhere between 0 and 100dB, give or take.  Essentially Im pondering if it would be a good plan to use winamp's volume slider as my main sound system volume. (more specifically: I really like remoteamp2 and am using it, paired with winamp, to browse my music collection and play back thru my PC's digital out)

Firstly, changing the bitdepth is not called upsampling or downsampling.

My bad, I was unsure of the terminology there, but I think Ive conveyed a moderate understanding of the principles regardless of my mixup

Quote
Secondly, working in floating point, and dithering the output at 24bits, you lose nothing by reducing the volume of a 16-bit signal input by up to 48dB. In theory! You have 48dB "to work with" before losing data, but it's less than this since the dither noise will add. Further, if the original 16-bit dither+quantisation was noise-shaped, but the dither you apply to the 24-bit version isn't, then you have less still.

Indeed, but this is ONLY true if winamp indeed will go to 24 or 32bits internally. and ONLY if winamp (or some other part of the PC) does not downconvert to 16 again before sending the signal on.

Quote
Beyond this, your D>A and associated electronics will have a fixed noise floor. By reducing the volume of what is contained in the digital input signal, you are sinking further into that noise floor. Whether this is relevant depends on the noise floor, the original recording, how much you reduce the volume, and yourself.

If the listening volume ("analogue" gain setting) is such that the noise floor (with dither) of the D>A is inaudible, then in theory no audible harm can be done by any digital reduction of the volume (e.g. what you lose in the digital domain by reducing the volume by 80dB would be inaudible had you chosen to reduce the analogue volume by 80dB!)

In practice, a less than perfect DAC could do damage (e.g. via distortion), but then in practice the signals which you attenuate digitally the most (i.e. the ones which are loudest in the first place) probably have least to lose.

In short, don't worry about it. Unless, if course, you find the noise floor of your 24-bit D>A is similar (or worse than!) that of a 16-bit recording - in that case, abandon this idea!


Yes but there is a bit of a difference between the loss incurred by simply turning down the volume (that would occur with every type of attenuation) and rounding errors trying to fit a 24bit value into 16bits. At least, that is my understanding. The first loss is 'linear', everything drops exactly the same amount of '% of max volume', where of course some bits fall below the noise floor. The second one isn't as nice though, some 24bit values can be exactly mapped onto a 16bit value, where some others fall right between the 'cracks'. I could imagine this random variation could be quite a lot more noticable. (and stuff like dithering basically obscures the bad noise with better (more uniformly distributed)  noise..)

At least that's my understanding for now..

A note:  Winamp is relying solely on the soundcard API (waveOut, DirectSound, ASIO, KS, etc. depending on what plugin you are using) for volume control.  It does not do any digital volume adjustment (except for replaygain and the preamp on the EQ)


That bit surprises me, but you're the winamp dev so i guess you know. Still, on my computer i do have 3 independent volume controls.. 1/ master volume, 2/ wave volume, 3/ winamp volume. None are linked together. Does this mean that ASIO/KS also supply 3 high quality attenuation stages that will not result in theoretically relevant quality loss? The 3 stages are internally linked at (say) 32bit, and only the very first and maybe (if requested) the very last part of the chain are 16bit?

Thanks for your time humoring a newbie guys.. I do appreciate it.

Perfect Volume Control?

Reply #9
... some 24bit values can be exactly mapped onto a 16bit value, where some others fall right between the 'cracks'. I could imagine this random variation could be quite a lot more noticable. (and stuff like dithering basically obscures the bad noise with better (more uniformly distributed)  noise..)


Doesn't that bit about dithering answer your question? Like you say, you need to dither when you do this. Overall, the quality loss here is that the signal sinks a bit into the noise floor. Nothing else.
With 24bit converters (the best of which actually have analog performance equalling 20 bits), you just get a bit more breathing room. But I'll stop here since 2Bdecided already said it

About Winamp: is it still true that processing plugins have to return 16bit data? (I think that's the question you're really worried about?) the last version I used was 2.8x I think... so I don't know.

Perfect Volume Control?

Reply #10
I have no idea what winamp does. I haven't used it for years.

I have heard digital volume control systems operating at 16-bits, with the "analogue" volume set to allow a loud maximum possible listening level, even on dynamic (i.e. not over-compressed) material. In this situation, you can easily hear the 16-bit non-noise shaped dither if you put your ear near the tweeter speaker, even in a non-quiet environment.

It's just about good enough for serious listening if you choose the analogue volume setting carefully, but not ideal. It's possible (easy?) to do much better these days.

Anyway, there's an obvious question: have you tried it yourself? I don't know about Winamp, but it's easy enough to do in foobar2k, or Cool Edit etc. Do you hear any problems?

Cheers,
David.

Perfect Volume Control?

Reply #11
My setup:
Winamp Kernel Streaming (FLAC) --> Live! 24-bit --> a cheap amp and cheap speakers.

I bypassed the Windows kmixer by using KS. Then I went to the control panel, chose 'Sounds and audio devices',
chose 'Hardware' tab (the last one),
Clicked on 'Sound blaster live! 24-bit',
Chose 'Properties' (the middle tab),
clicked on 'Sound blaster live! 24-bit' under mixer devices,
and chose 'Do not use mixer features on this device'.
Rebooted.

After doing all this, the volume icon was gone from the system tray and control panel showed that there was no audio device present etc. But when I played some songs thru winamp, they played just fine.

Here is the interesting part (and hence this post). When I played those songs, they played at a much higher volume. I had to reduce the volume on the amp to 1/3rd its original value. And what clarity. Amazing. I didn't know my system could sound so good.

I also played a song thru foobar KS side-by-side and that also showed up in the output. That was expected as Live! 24-bit has 64 hardware buffers.

PS- The above hardware mixer bypassing did not work for my office PC which has an on-board soundcard. My home PC also has an on-board soundcard which I don't use.

Perfect Volume Control?

Reply #12
My setup:
Winamp Kernel Streaming (FLAC) --> Live! 24-bit --> a cheap amp and cheap speakers.

I bypassed the Windows kmixer by using KS. Then I went to the control panel, chose 'Sounds and audio devices',
chose 'Hardware' tab (the last one),
Clicked on 'Sound blaster live! 24-bit',
Chose 'Properties' (the middle tab),
clicked on 'Sound blaster live! 24-bit' under mixer devices,
and chose 'Do not use mixer features on this device'.
Rebooted.

What does that do?  I have a A7N8X motherboard which is connected to some Logitech Z5300 speakers.  Does it make sense to do this when there is a volume control on your speaker system?

Is the similar option under Audio Devices (use audio features of this device) used to disable one of the soundcards in your system?

Perfect Volume Control?

Reply #13

My setup:
Winamp Kernel Streaming (FLAC) --> Live! 24-bit --> a cheap amp and cheap speakers.

I bypassed the Windows kmixer by using KS. Then I went to the control panel, chose 'Sounds and audio devices',
chose 'Hardware' tab (the last one),
Clicked on 'Sound blaster live! 24-bit',
Chose 'Properties' (the middle tab),
clicked on 'Sound blaster live! 24-bit' under mixer devices,
and chose 'Do not use mixer features on this device'.
Rebooted.

What does that do?  I have a A7N8X motherboard which is connected to some Logitech Z5300 speakers.  Does it make sense to do this when there is a volume control on your speaker system?

Is the similar option under Audio Devices (use audio features of this device) used to disable one of the soundcards in your system?



The point is to have as few volume controls as possible. Regarding disabling the other soundcard, I did not  understand your question. I have one on-board soundcard which is disabled in BIOS and doesn't show up under devices.

Perfect Volume Control?

Reply #14
I bypassed the Windows kmixer by using KS. Then I went to the control panel, chose 'Sounds and audio devices',
chose 'Hardware' tab (the last one),
Clicked on 'Sound blaster live! 24-bit',
Chose 'Properties' (the middle tab),
clicked on 'Sound blaster live! 24-bit' under mixer devices,
and chose 'Do not use mixer features on this device'.
Rebooted.

After doing all this, the volume icon was gone from the system tray and control panel showed that there was no audio device present etc. But when I played some songs thru winamp, they played just fine.

A good tip! I have a m-audio revolution next to my audigy soundcard, I use the revolution strictly for winamp playback so indeed I don't need the volume control!
Quote
Here is the interesting part (and hence this post). When I played those songs, they played at a much higher volume. I had to reduce the volume on the amp to 1/3rd its original value. And what clarity. Amazing. I didn't know my system could sound so good.

This sounds a bit suspect. More specifically: when using (winamp) kernel streaming on my soundcard, none of the volume controls on that card worked. I suspect your soundcard might have dodgy drivers. [ed: oh wait, you have a soundblaster.. scratch the might]

Anyway, I think Im getting close to the perfect setup.

Im using:

- http://www.hqsoftproc.upcnet.ro/ the HQSoftproc resampler, which upsamples my 16bit cd sources to 24bit.
and:
- http://www.stevemonks.com/ksplugin/ - Steve Monks kernel streaming plugin, which basically directs digital input and output directly to the soundcard without any interference from pesky windows/drivers mixers. It also has volume control if you have to turn it down a touch.

With this setup, I losslessly upconvert from 16 to 24bits (this process just adds '00000000' i.e. 8 zeroes at the low end) and then attenuates if need be (but the quality loss from attenuation should be hidden from 'view' by the fact that we've added the precision bits)

Happy!