• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Get the best sound quality in windows using wasapi

Krunok

Major Contributor
Joined
Mar 25, 2018
Messages
4,600
Likes
3,065
Location
Zg, Cro
I just checked with MusicBee (I don't have foobar installed) over ASIO and its volume control works independently from XMOS control panel volume control.

On the other hand I cannot imagine XMOS control panel to use any other volume control other than the one in XMOS chip, and that one is lossless.
 

bennetng

Major Contributor
Joined
Nov 15, 2017
Messages
1,634
Likes
1,692
Btw, this volume control operates in a same way when DAC chip does it. it is well described here.
It is same as any sane software volume control. Try the attached Javascript calculator with the numbers mentioned in ESS's pdf.
https://www.audiosciencereview.com/forum/index.php?attachments/db5-zip.37149/

Type 30003 in the "sample to dBFS" field, click Convert and copy the signed value (-0.7657050592638563) dBFS.
a.PNG



Minus that value by 10dB (-10.7657050592638563) and paste in the "dBFS to sample" field then click Convert. The result is 9487.781663803187.
b.PNG



Javascript uses 64-bit float (double) internally. To convert the value to 32-bit float (single) like ESS's pdf, click the "Convert to single" button and get 9487.7813.
c.PNG



ESS's pdf said -10dB(FS) is 0.3162, type -10 in the dBV field and click Convert. 0.31622776601683794 is that value in double precision. The formula of dBV to Vrms (+/-V in the calculator) is same as dBFS to float.
d.PNG



The only thing to concern is the input of DACs are not necessarily able to accept float formats even if they can do floating point math internally. Which means float values beyond +/-1.0 leaving the playback software will be clipped by the ASIO or WASAPI exclusive API or compressed by Windows' CAudioLimiter when using DirectSound before entering the DAC. This phenomenon can be examined by my test files posted in #6.
 
Last edited:

Krunok

Major Contributor
Joined
Mar 25, 2018
Messages
4,600
Likes
3,065
Location
Zg, Cro
It is same as any sane software volume control. Try the attached Javascript calculator with the numbers mentioned in ESS's pdf.

Type 30003 in the "sample to dBFS" field, click Convert and copy the signed value (-0.7657050592638563) dBFS.
View attachment 17741


Minus that value by 10dB (-10.7657050592638563) and paste in the "dBFS to sample" field then click Convert. The result is 9487.781663803187.
View attachment 17742


Javascript use 64-bit float (double) internally. To convert the value to 32-bit float (single) like ESS's pdf, click the "Convert to single" button and get 9487.7813.
View attachment 17743


ESS's pdf said -10dB(FS) is 0.3162, type -10 in the dBV field and click Convert. 0.31622776601683794 is that value in double precision. The formula of dBV to Vrms (+/-V in the calculator) is same as dBFS to float.
View attachment 17744


The only thing to concern is the input of DACs are not necessarily able to accept float input even if they can do floating point math internally. Which means float values beyond +/-1.0 leaving the playback software will be clipped by the ASIO or WASAPI exclusive API or compressed by Windows' CAudioLimiter when using DirectSound before entering the DAC. This phenomenon can be examined by my test files posted in #6.

Well of course everyone uses the same formulas to calculate the same thing, no surprise there.. :D
 

alashikata

Member
Joined
Sep 16, 2018
Messages
80
Likes
43
Depends.
WASAPI in shared mode (Direct Sound) is intended to run multiple streams
WASAPI in exclusive mode has an exclusive lock on de audio device

Really? I didn't see that options. I will look to see how to configure that. So far ASIO sounds beter. Thanks for info

BenchMark DAC has built-in volume control since it can act as preamp.
 

derp1n

Senior Member
Joined
May 28, 2018
Messages
479
Likes
629
On the other hand I cannot imagine XMOS control panel to use any other volume control other than the one in XMOS chip, and that one is lossless.
I'm not sure "lossless" makes sense when it comes to attenuation. Unless all of your computations through the entire path use infinite precision, which no real world system does.

That link just show to setup the windows drivers which I have never used Enhancements ASIO is way different. I would say ASIO sounds clear than the WASAPI. Probably 30% better.
Unless your WASAPI is configured incorrectly (audio enhancements or resampling) there's no reason for ASIO and WASAPI to sound different at all.
 

Vincent Kars

Addicted to Fun and Learning
Technical Expert
Joined
Mar 1, 2016
Messages
781
Likes
1,555
That link just show to setup the windows drivers which I have never used Enhancements ASIO is way different. I would say ASIO sounds clear than the WASAPI. Probably 30% better.

I was talking about the Advanced Panel
USBAdvanced.jpg


If you want to use WASAPI in exclusive mode you must explicitly enable it in this panel
 

Krunok

Major Contributor
Joined
Mar 25, 2018
Messages
4,600
Likes
3,065
Location
Zg, Cro
I'm not sure "lossless" makes sense when it comes to attenuation. Unless all of your computations through the entire path use infinite precision, which no real world system does.

You're absolutely right, better term would be 32 bit volume control.
 

bennetng

Major Contributor
Joined
Nov 15, 2017
Messages
1,634
Likes
1,692
Hair splitting: ESS shows this image in the volume control pdf:
internal.PNG


That means everything you do before entering the chip will be limited to 24-bit. In this sense the volume control within the chip is really better than external solutions. In case of USB to SPDIF converter, the output will also be limited to 24-bit since SPDIF can't do 32-bit anyway.

However, such precision differences will be masked by the DAC's output noise floor and distortion anyway. I would care more about 0dBFS+ compatibility and intersample peaks as these issues are easily measurable even at analog output.

Some may think that they don't use float formats and their DACs support a few dBs of intersample headroom so it is a non-issue. Not true. Some mastering engineers care about intersample peaks on lossless files and 0dBFS+ values caused by lossy encoders.

http://cdn-downloads.tcelectronic.com/media/1018207/nielsen_lund_2000_0dbfs_le.pdf
https://images.apple.com/itunes/mastered-for-itunes/docs/mastered_for_itunes.pdf

Look at those suggestions, TC was suggesting -3dBFS mastering many years ago and Apple uses their own tools to estimate 0dBFS+ peaks in AAC encoding. Some engineers also leave a dB or so in their lossless masters in order to reduce the chance of clipping. Such practices of "leaving headroom" cause quality degradation at the very beginning. Leaving 1dB of headroom for a 16-bit file makes the available values for 16-bit (-32768 to +32767) reduce to about +/-29205. Therefore, even if your equipment can avoid or you know how to avoid clipping, you still suffer from permanent quality loss, and this quality loss is bigger than 24 vs 32-bit precision since it happens at the file's bit-depth (16). Some engineers may simply set their limiter to limit more severely to "provide" headroom so that their true peak meters don't complain, but result in higher distortion.

Encourage people to use a potentially problematic volume control means encourage mastering engineers to leave more "headroom".
 

sergeauckland

Major Contributor
Forum Donor
Joined
Mar 16, 2016
Messages
3,440
Likes
9,100
Location
Suffolk UK
Look at those suggestions, TC was suggesting -3dBFS mastering many years ago and Apple uses their own tools to estimate 0dBFS+ peaks in AAC encoding. Some engineers also leave a dB or so in their lossless masters in order to reduce the chance of clipping. Such practices of "leaving headroom" cause quality degradation at the very beginning. Leaving 1dB of headroom for a 16-bit file makes the available values for 16-bit (-32768 to +32767) reduce to about +/-29205. Therefore, even if your equipment can avoid or you know how to avoid clipping, you still suffer from permanent quality loss, and this quality loss is bigger than 24 vs 32-bit precision since it happens at the file's bit-depth (16). Some engineers may simply set their limiter to limit more severely to "provide" headroom so that their true peak meters don't complain, but result in higher distortion.

Encourage people to use a potentially problematic volume control means encourage mastering engineers to leave more "headroom".

Yes, but leaving headroom is just good engineering practice, as clipping sounds a LOT worse than the potential loss of quality of leaving a few dBs headroom. It's normal, at least in Broadcasting, for 0dBFS = +18dBu whilst peak level as measured on a PPM is +4, +6 or +8 dBu depending on the country. (The UK works on +8) This means that there is at least 10dBs headroom, which I think is Good Practice, as it allows for the few dBs of underreading from most PPMs, and for the occasional unexpected peak.

I understand American practice to be for 0dBFS = +24dBu, which leaves 20dB headroom above normal operating level of 0VU = +4dBu. This again is sensible when using VU meters which underread by many dBs although it's more programme dependent than PPMs.

S.
 

bennetng

Major Contributor
Joined
Nov 15, 2017
Messages
1,634
Likes
1,692
Yes, but leaving headroom is just good engineering practice, as clipping sounds a LOT worse than the potential loss of quality of leaving a few dBs headroom. It's normal, at least in Broadcasting, for 0dBFS = +18dBu whilst peak level as measured on a PPM is +4, +6 or +8 dBu depending on the country. (The UK works on +8) This means that there is at least 10dBs headroom, which I think is Good Practice, as it allows for the few dBs of underreading from most PPMs, and for the occasional unexpected peak.

I understand American practice to be for 0dBFS = +24dBu, which leaves 20dB headroom above normal operating level of 0VU = +4dBu. This again is sensible when using VU meters which underread by many dBs although it's more programme dependent than PPMs.

S.
Leaving headroom during recording, broadcasting and live events is of course a good practice, since no one can predict the highest level when doing such things.

For mastering and editing it is different, when you see clipping just undo and lower the fader.

Here is a real example of using all values (left) and brickwalling for headroom (right). The white line is -1dBFS.
headroom.PNG
 
Last edited:

sergeauckland

Major Contributor
Forum Donor
Joined
Mar 16, 2016
Messages
3,440
Likes
9,100
Location
Suffolk UK
Yes, but that second example, all too typical of today's CDs, is just an abomination. Frankly, whether there's headroom or not on that CD, it's foul.
I'm really only concerned about good engineering practice on decent recordings with proper dynamic range.

Also, on that second picture, it's quite possible that there's clipping even if the peak level is -1dBFS. I've got lots of such recordings that when you expand the waveform, you see flat-topping going on for many samples, even though the peak level has headroom. That's due to clipping earlier in any mixing or mastering process, and is just bad practice, although very common these days as the CD is LOUDER THAN ANYTHING ELSE.

S.
 

xr100

Addicted to Fun and Learning
Joined
Jan 6, 2020
Messages
518
Likes
237
Location
London, UK
Leaving headroom during recording, broadcasting and live events is of course a good practice, since no one can predict the highest level when doing such things.

For mastering and editing it is different, when you see clipping just undo and lower the fader.

Here is a real example of using all values (left) and brickwalling for headroom (right). The white line is -1dBFS.
View attachment 17763


The example on the left is a good candidate for slight brickwall limiting, it would be virtually transparent since there are only a few peaks to take care of.

The one on the right is has been "nuked," the artifacts and distortion generated by that are of greatly more concern than a slight loss of SNR.
 

bennetng

Major Contributor
Joined
Nov 15, 2017
Messages
1,634
Likes
1,692
The example on the left is a good candidate for slight brickwall limiting, it would be virtually transparent since there are only a few peaks to take care of.

The one on the right is has been "nuked," the artifacts and distortion generated by that are of greatly more concern than a slight loss of SNR.
I think I should make a reply anyway, and in this thread as the other thread is more relevant to dithering.

The screenshot doesn't have file names and I forgot which songs they are already. However these are published and mastered recordings, so when you see there are seemingly "stray peaks" on the left one, the peaks could be even higher before mastering. On the other hand, the track on the right appears to have stray peaks at around 3:50 to 4:20 so they can even be further "optimized" depends on how the engineer thinks.

And regarding this post:
https://www.audiosciencereview.com/...ot-a-psychoacoustic-process.11169/post-327676

Bascially it is simply clipped, so even if the level is reduced to avoid showing any positive true peak values, it won't make a different to the clipping. At best you can use a declipper to somehow repair them but it is more like restoration rather than mastering. So basically irrelevant to ISP. When talking about ISP something like my chiptune example is much more suitable. When you showed me how you "repaired" the chiptune... because you did it to demonstrate something in a discussion, so it makes no sense to screw up the file and show something bad to me. However it does not reflect how other engineers are doing.

One of my hobbies is transcript/rearrange video game music, and I'll show you some of my works before this discussion, and before BS.1770/EBU R128 became more popular.

Final Fantasy 13 - Saber's Edge
https://www.nicovideo.jp/watch/sm9917356

Original:

Ikaruga all 10 tracks
https://www.nicovideo.jp/watch/sm16395588

Original: (a playlist so please copy and paste the link on your browser)
Code:
https://www.youtube.com/watch?v=mKCtUe0zLFQ&list=PL0FBDE87A34B6D290

nicovideo.jp doesn't allow seeking for non-premium members. To save you some time I uploaded the exact same videos on Google Drive so you can extract the audio and examine them. There could be sample values at exactly 0dBFS, or higher if decoded in float, but can you find severely clipped portions like the example you posted?

https://drive.google.com/open?id=1mkZLPEl2X55Q2EMw8lYAq_t_F71il8AX
https://drive.google.com/open?id=1doZZtj4ZplIJ8BP_pDrXXoyWiGpDAYiA

That's why I said tools are tools. If you hire someone like Ian Shepherd to do the mastering and allow him to do anything he likes, with the exception of using ANYTHING related to true peak. Even without those tools he won't give you a finished file with any real clipping.
 

xr100

Addicted to Fun and Learning
Joined
Jan 6, 2020
Messages
518
Likes
237
Location
London, UK
The screenshot doesn't have file names and I forgot which songs they are already. However these are published and mastered recordings, so when you see there are seemingly "stray peaks" on the left one, the peaks could be even higher before mastering.

It is true that the peaks could have been higher before mastering. On the other hand, the peaks could be there because of "overshoot" in dynamic range compression processes, i.e. gain is being reduced but not fast enough to catch the peak so it actually ends up being more "peaky." The waveform image you have posted is not detailed enough (zoomed too far out) to see quite what's going on.

Here is an example of a (pop-tastic, or dire, depending on your point of view) synth-pop track from 1987. The CD from which it was extracted is the original '87 release.

1581927936199.png


Two excerpts are available from the link below, one that is the original, the other has been peak limited (max. gain reduction ~1dB.) Where the limiter's gain reduction is 0, i.e. most of the time, the signal is left untouched. (64-bit float process w/ 64-bit float I/O.) It is only acting on the odd peak, rather than all of them (as was the case with your chiptune example.)

Files are 24-bit/44.1kHz. TPDF dither was added to the peak limited version, and for the sake of consistency, the original also (although of course the source is 16-bit.)

Download link.

(Link expires in one week.)

The entire track on the original CD has a maximum "True Peak" reading well under 0dBTP. It's just a demonstration of high quality peak limiting on the odd "overshoot" being rather transparent.

Here is an example from the above linked files--original:

1581928760234.png


And the peak limited:

1581928792425.png


It can be seen that the waveform is not hard clipped but rather smoothly and transitorily modified.
 
Last edited:
Top Bottom