IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Perfect Volume Control?, What dial do we turn? (high qualitty digital volume reduction?)
puntloos
post Aug 21 2006, 14:50
Post #1





Group: Members
Posts: 149
Joined: 20-July 03
Member No.: 7881



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!
Go to the top of the page
+Quote Post
CSMR
post Aug 21 2006, 15:39
Post #2





Group: Members
Posts: 758
Joined: 10-May 04
Member No.: 14009



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
Go to the top of the page
+Quote Post
puntloos
post Aug 21 2006, 15:43
Post #3





Group: Members
Posts: 149
Joined: 20-July 03
Member No.: 7881



QUOTE (CSMR @ Aug 21 2006, 06:39) *
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!

This post has been edited by puntloos: Aug 21 2006, 15:49
Go to the top of the page
+Quote Post
CSMR
post Aug 21 2006, 15:48
Post #4





Group: Members
Posts: 758
Joined: 10-May 04
Member No.: 14009



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.

This post has been edited by CSMR: Aug 21 2006, 15:50
Go to the top of the page
+Quote Post
puntloos
post Aug 21 2006, 15:58
Post #5





Group: Members
Posts: 149
Joined: 20-July 03
Member No.: 7881



QUOTE (CSMR @ Aug 21 2006, 06:48) *
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
Go to the top of the page
+Quote Post
CSMR
post Aug 21 2006, 16:12
Post #6





Group: Members
Posts: 758
Joined: 10-May 04
Member No.: 14009



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?
Go to the top of the page
+Quote Post
2Bdecided
post Aug 21 2006, 16:28
Post #7


ReplayGain developer


Group: Developer
Posts: 5089
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



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.
Go to the top of the page
+Quote Post
benski
post Aug 21 2006, 16:42
Post #8


Winamp Developer


Group: Developer
Posts: 670
Joined: 17-July 05
From: Brooklyn, NY
Member No.: 23375



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)

This post has been edited by benski: Aug 21 2006, 16:42
Go to the top of the page
+Quote Post
puntloos
post Aug 22 2006, 10:08
Post #9





Group: Members
Posts: 149
Joined: 20-July 03
Member No.: 7881



QUOTE (CSMR @ Aug 21 2006, 07:12) *
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. tongue.gif 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)

QUOTE (2Bdecided @ Aug 21 2006, 07:28) *
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 tongue.gif

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..

QUOTE (benski @ Aug 21 2006, 07:42) *
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.

This post has been edited by puntloos: Aug 22 2006, 10:12
Go to the top of the page
+Quote Post
Patsoe
post Aug 22 2006, 10:21
Post #10





Group: Members (Donating)
Posts: 591
Joined: 11-February 03
From: UK
Member No.: 4952



QUOTE (puntloos @ Aug 22 2006, 10:08) *
... 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 smile.gif

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.
Go to the top of the page
+Quote Post
2Bdecided
post Aug 22 2006, 13:56
Post #11


ReplayGain developer


Group: Developer
Posts: 5089
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



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.
Go to the top of the page
+Quote Post
bansal98
post Aug 25 2006, 12:33
Post #12





Group: Members
Posts: 42
Joined: 1-June 05
Member No.: 22443



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.


--------------------
Manish Bansal
http://manishbansal.wordpress.com
Go to the top of the page
+Quote Post
Stone Free
post Aug 25 2006, 16:01
Post #13





Group: Members
Posts: 57
Joined: 24-September 04
From: London
Member No.: 17277



QUOTE (bansal98 @ Aug 25 2006, 12:33) *
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?
Go to the top of the page
+Quote Post
bansal98
post Aug 25 2006, 16:18
Post #14





Group: Members
Posts: 42
Joined: 1-June 05
Member No.: 22443



QUOTE (Stone Free @ Aug 25 2006, 20:31) *
QUOTE (bansal98 @ Aug 25 2006, 12:33) *

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.


--------------------
Manish Bansal
http://manishbansal.wordpress.com
Go to the top of the page
+Quote Post
puntloos
post Aug 30 2006, 21:05
Post #15





Group: Members
Posts: 149
Joined: 20-July 03
Member No.: 7881



QUOTE (bansal98 @ Aug 25 2006, 03:33) *
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! biggrin.gif

This post has been edited by puntloos: Aug 30 2006, 21:07
Go to the top of the page
+Quote Post
grkn
post Aug 27 2008, 22:01
Post #16





Group: Members
Posts: 42
Joined: 23-August 03
From: Norway, Trondheim
Member No.: 8478



Can anyone confirm that this man is not just fooling himself? wink.gif

I have the same issue:
http://www.hydrogenaudio.org/forums/index....mp;#entry584973

Cheers, Johan
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd August 2014 - 08:35