• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required as is 20 years of participation in forums (not all true). Come here to have fun, be ready to be teased and not take online life too seriously. We now measure and review equipment for free! Click here for details.

Kernel Streaming, ASIO, WASAPI... and music players (Foobar, JRiver...)

daftcombo

Major Contributor
Patreon Donor
Joined
Feb 5, 2019
Messages
1,166
Likes
887
#1
Hi,

I create this thread to follow a discussion begun here:
https://www.audiosciencereview.com/...ard-h20-headphone-amplifier.7407/#post-171053

I'd like to know the state of knowledge about sound quality on a Windows PC, using Kernel Streaming (KS) rather than ASIO or WASAPI.

I've been using ASIO in Foobar and JRiver for several years.
Whenever I play youtube vids (with Kernel Streaming I think), they sound equally good to me.
But I didn't do any ABX.

What is your opinion, folks?

Cheers.
 

daftcombo

Major Contributor
Patreon Donor
Joined
Feb 5, 2019
Messages
1,166
Likes
887
#2
Here is what we can find on a Jplay forum. This commands discussion I think.

Kernel Streaming is lowest 'audio' layer in Windows: Why go through more layers (=WASAPI) if direct access is possible? In audio, less is usually more. (unlike WASAPI, ASIO _can_ be direct although it's not a given: there are 'ASIO' drivers out there which are using KS internally…) KS also allows for things that WASAPI does not: whereas both ASIO & WASAPI require memory copy operation per design, KS does not. Again, less is more. ASIO usually has _fixed_ Buffer size – it has been established from experience that various Buffer sizes can have sonic impact with smaller values sounding 'better' for most. Not being able to manipulate Buffer size is a clear restriction for ASIO. In addition, ASIO may require even more memory copy operations then WASAPI as it expects left & right channel to be 'separated' (WAV format has samples interleaved). WASAPI allows for different Buffer sizes but requires certain 'minimal' size – Usually this is 192/256 samples for CD and 512+ for HiRez. One cannot go below that minimum. Kernel streaming, on the other had, has no such restrictions: one can even use Buffer of a single sample! ('DirectLink' as unique feature of JPLAY) Hopefully this makes it clear now why we recommend KS: Lowest layer, no restrictions on Buffer size, zero-copy scenarios possible. Again, we believe 'less is more': not everyone agrees this makes a sonic difference and that is ok – but it does not change the facts
Why JRiver (=Matt) does not recommend KS is something you will have to ask him: links you posted do not have a single reason mentioned.
http://jplay.eu/forum/index.php?/topic/1143-why-kernel-streaming/#entry18613
 

edechamps

Active Member
Joined
Nov 21, 2018
Messages
208
Likes
564
Location
London, United Kingdom
#3
I'd like to know the state of knowledge about sound quality on a Windows PC, using Kernel Streaming (KS) rather than ASIO or WASAPI.
ASIO, WASAPI Exclusive, and WDM-KS are all bit-perfect as far as a typical software stack is concerned, so there shouldn't be any difference between them.

MME, DirectSound and WASAPI Shared do not provide bit-perfect guarantees. However, if the sample rate matches the one configured in the Windows audio control panel, and assuming you don't have any APOs ("audio effects") enabled, the worst that can happen is an extra layer of dithering, which is benign. If the sample rate doesn't match, then you're at the mercy of the Windows sample rate converter. I'm not sure how good Windows SRC is; maybe some day I'll do some measurements to investigate. However, it's quite unlikely you'll hear a significant difference even with a crappy SRC.

I've been using ASIO in Foobar and JRiver for several years.
Whenever I play youtube vids (with Kernel Streaming I think), they sound equally good to me.
Unsurprising. You're highly unlikely to hear any difference between audio output methods. That's not what matters.

Here is what we can find on a Jplay forum. This commands discussion I think.
There are a few inaccuracies in the statement you quoted. (My credentials: I wrote two ASIO drivers, including FlexASIO which is basically a bridge between ASIO and other output methods. As part of that work I investigated the various Windows audio APIs quite extensively.)

Kernel Streaming is lowest 'audio' layer in Windows: Why go through more layers (=WASAPI) if direct access is possible?
This is wrong. WASAPI Exclusive also (typically) gives you direct access to the hardware audio buffers. The difference between WDM-KS and WASAPI is that the former has a lower-level interface for enumerating and configuring devices. But when it comes to the audio buffers themselves, both should provide direct access to hardware memory (if applicable).

both ASIO & WASAPI require memory copy operation per design
I'm not sure what this statement is supposed to mean. ASIO, WASAPI and WDM-KS can all provide direct access to hardware memory buffers, which is typically what is meant by "zero-copy" operation. Maybe WDM-KS has a way of telling the audio driver to get the data directly from a user-space buffer, which would indeed remove one copy operation, but that would be the first I hear of it. Also, I don't see the point of discussing copies: copying data can affect performance (although not significantly), but it can't affect audio quality, since it's bit-perfect.

Buffer size – it has been established from experience that various Buffer sizes can have sonic impact with smaller values sounding 'better' for most.
That's an extraordinary claim, and it would take extraordinary evidence for me to believe it.

Not being able to manipulate Buffer size is a clear restriction for ASIO.
That statement is false; ASIO absolutely allows the user to customize the buffer size very easily. It's right there in the core ASIO API that all ASIO drivers have to support. Maybe some ASIO drivers only allow one buffer size, but then that's a limitation of that specific driver, not a limitation of ASIO in general.

In addition, ASIO may require even more memory copy operations then WASAPI as it expects left & right channel to be 'separated' (WAV format has samples interleaved).
True. But again, I don't see the point of discussing copies.

Kernel streaming, on the other had, has no such restrictions: one can even use Buffer of a single sample!
No matter what output method you use, a buffer size of only one sample will never work on a general-purpose OS such as Windows, which doesn't have the necessary real-time scheduling capabilities to make that work. It's also quite pointless. What the author might be referring to is single-sample granularity (i.e. the application knows the cursor position with a precision of one sample), which I guess is pretty cool, and might be useful for achieving very low latency or precise synchronization between multiple clocks, but again I don't see how that's related to audio quality. (I'm also quite sceptical of the claim that KS can offer single-sample granularity on typical hardware.)

My personal opinion: if I had to choose between bit-perfect output methods, I would choose WASAPI Exclusive because that's the modern API that Microsoft actively supports and that audio devices are tested with nowadays. It's also a simpler API than WDM-KS, which means applications using it are less likely to have bugs where they're using the API incorrectly. ASIO is also a good choice if there is a native driver provided by the audio device manufacturer.
 
Last edited:

SIY

Technical Expert
Technical Expert
Joined
Apr 6, 2018
Messages
2,888
Likes
5,003
Location
Phoenix, AZ
#4
My credentials: I wrote two ASIO drivers, including FlexASIO which is basically a bridge between ASIO and other output methods. As part of that work I investigated the various Windows audio APIs quite extensively.
This is very interesting. I have had native ASIO driver issues with several products, CEntrance being the worst. I got odd results using ASIO4ALL so am very curious to try your driver as a substitute to see if it fixes the problem. I may be asking you some stupid questions along the way...
 

daftcombo

Major Contributor
Patreon Donor
Joined
Feb 5, 2019
Messages
1,166
Likes
887
#5
Thanks a lot @edechamps !

What do you think of ASIO4All? I use it when I don't have proprietary drivers for a DAC.
Once again, I can't hear any difference between ASIO4All or anything else.


I also wish here to indicate to all people who have latency issues with their DAC that it might be solved, not only by increasing buffer (which sometimes is limited) but also by putting an exception for your DAW folder in Windows Defender, Avast or any other protection system. Worked wonders on my computer, that's how I god rid of clicks/pops in Foobar with the Scarlett 2i4nd Gen.
 

edechamps

Active Member
Joined
Nov 21, 2018
Messages
208
Likes
564
Location
London, United Kingdom
#6
What do you think of ASIO4All?
It's a bridge between ASIO and WDM-KS. It's basically the same as using WDM-KS with one additional layer on top. Still bit-perfect and there's nothing wrong with it as far as I know, but if the application you're using already supports WDM-KS (or WASAPI Exclusive) directly, you could simplify your pipeline and just use that instead of adding unnecessary layers.
 

DDF

Active Member
Joined
Dec 31, 2018
Messages
249
Likes
238
#8
MME, DirectSound and WASAPI Shared do not provide bit-perfect guarantees. However, if the sample rate matches the one configured in the Windows audio control panel, and assuming you don't have any APOs ("audio effects") enabled, the worst that can happen is an extra layer of dithering, which is benign. If the sample rate doesn't match, then you're at the mercy of the Windows sample rate converter. I'm not sure how good Windows SRC is; maybe some day I'll do some measurements to investigate. However, it's quite unlikely you'll hear a significant difference even with a crappy SRC.
Great post, thanks for sharing your expertise. Archimago's taken a step towards characterizing Windows sample rate conversion and the outcome wasn't too promising unfortunately:
http://archimago.blogspot.com/2015/11/measurements-windows-10-audio-stack.html
 

BillG

Addicted to Fun and Learning
Joined
Sep 12, 2018
Messages
849
Likes
770
Location
Auckland, New Zealand
#10
Great post, thanks for sharing your expertise. Archimago's taken a step towards characterizing Windows sample rate conversion and the outcome wasn't too promising unfortunately:
http://archimago.blogspot.com/2015/11/measurements-windows-10-audio-stack.html
That analysis is from '15, though and Win 10 has been significantly updated several times since then.

In terms of SRC on my own Win 10 based system: I set the media player, MusicBee which uses the BASS library for processing, to match the bit depth and sample rate of the Windows master audio output in WASAPI Shared mode. (Yeah, I could use Exclusive, but I've other things running on the machine that I want to hear, if they require my attention.) Am I bypassing any nastiness by doing so? I don't know as I've not bothered running an analysis. However, in my brief, and totally casual, comparison of Shared and Exclusive modes, I've heard no difference and I'm not noticing any distortion.
 
Last edited:

maty

Major Contributor
Joined
Dec 12, 2017
Messages
1,411
Likes
566
Location
Tarragona (Spain)
#11
Years ago neither appreciated the differences. With foobar2000.

Afterwards I have been eliminating different bottlenecks and I have optimized Windows for multimedia and I clearly appreciate the differences even with foobar2000.

ASIO4ALL

When the v2.13 came out the sound got worse in my system and I had to go back to v.2.12. I should check it again, because I did a clean installation of the W10 Pro compilation 1809. It used to be one that was updated for years (from 1503 compilation? ). I did it, among other reasons, because the DR meter plugin sometimes hung on foobar2000. Now it is perfect.

And the sound changes according to ASIO4ALL settings.

Weeks ago I participated in a test to verify which expensive cartridge sounded the best. About 50 responses and only two chose a different cartridge. One of them was me! It turns out that I did a quick test using foobar2000 with ASIO4ALL. It was to switch to KS and easily detect that my choice was incorrect. I did it again this time with JRMC and KS and the difference was even greater.

To finish, with JRMC v24 64 bits I can hear very easy the difference between ASIO4ALL, Wasapi, Kernel Streaming and Direct Sound. Why? I do not know.
 

March Audio

Major Contributor
Manufacturer
Patreon Donor
Joined
Mar 1, 2016
Messages
3,918
Likes
3,752
Location
Perth Western Australia
#12
Years ago neither appreciated the differences. With foobar2000.

Afterwards I have been eliminating different bottlenecks and I have optimized Windows for multimedia and I clearly appreciate the differences even with foobar2000.

ASIO4ALL

When the v2.13 came out the sound got worse in my system and I had to go back to v.2.12. I should check it again, because I did a clean installation of the W10 Pro compilation 1809. It used to be one that was updated for years (from 1503 compilation? ). I did it, among other reasons, because the DR meter plugin sometimes hung on foobar2000. Now it is perfect.

And the sound changes according to ASIO4ALL settings.

Weeks ago I participated in a test to verify which expensive cartridge sounded the best. About 50 responses and only two chose a different cartridge. One of them was me! It turns out that I did a quick test using foobar2000 with ASIO4ALL. It was to switch to KS and easily detect that my choice was incorrect. I did it again this time with JRMC and KS and the difference was even greater.

To finish, with JRMC v24 64 bits I can hear very easy the difference between ASIO4ALL, Wasapi, Kernel Streaming and Direct Sound. Why? I do not know.
As explained above just use wasapi exclusive or ASIO and you won't have any issues. Additional OS "optimisations" are simply unnecessary.
 
Last edited:

maty

Major Contributor
Joined
Dec 12, 2017
Messages
1,411
Likes
566
Location
Tarragona (Spain)
#13
I notice a lot of difference in sound and image (very little) if I have finished optimizing Windows for multimedia every time I start it.

It is not only the OS, but also how the CPU works and manages the registers and the accesses to the hard disk.

Unfortunately I have not found measurements on this but I can not deny the obvious, VERY evident.
 

March Audio

Major Contributor
Manufacturer
Patreon Donor
Joined
Mar 1, 2016
Messages
3,918
Likes
3,752
Location
Perth Western Australia
#14
I notice a lot of difference in sound and image (very little) if I have finished optimizing Windows for multimedia every time I start it.

It is not only the OS, but also how the CPU works and manages the registers and the accesses to the hard disk.

Unfortunately I have not found measurements on this but I can not deny the obvious, VERY evident.
Can you explain how you performed a blind controlled listening test on this?

Just for info here is a link to some measurements I performed with my DAC1 and various different SBCs, laptop and NUC. No difference in the dac output between all of these items.

https://www.audiosciencereview.com/...end-points-are-they-any-good.5707/post-127194
 

edechamps

Active Member
Joined
Nov 21, 2018
Messages
208
Likes
564
Location
London, United Kingdom
#15
It is not only the OS, but also how the CPU works and manages the registers and the accesses to the hard disk.
The only way this could possibly, remotely make sense is if your audio hardware (e.g. DAC) is picking up on power fluctuations from your computer's PSU. Which would of course be extremely abnormal, and points to faulty hardware.

No properly functioning hardware and software will exhibit the behaviour you describe. That's just not how it works.
 

maty

Major Contributor
Joined
Dec 12, 2017
Messages
1,411
Likes
566
Location
Tarragona (Spain)
#16
My PC has a good and silent Bequiet! PSU with low DC ripple. An cheap. < € 50. Intel i5 4400.

dafcombo asked in another thread if there was one open to the respect of the KS, ASIO ... and I answered quickly that no. Why? Because it is been a while since I have had the intention to open one about it. If I did not do it, it is because I can not demonstrate my impression with measurements, which would initiate an endless conversation.

A few years ago I had budgeted to spend about 2,000 euros on a new amplifier for my second system. Since I did not see it clearly, especially since there were almost no measurements, I decided to solve my problems first. The worst of all, the terrible electrical power I had at home. After I optimized Windows and did the same with Linux Mint (I am one of its first users) and Archlinux and some audiophile distro. I was unable to get the same improvement. Later I focused on the CPU, registers and hard disk, great new improvement, and force the use of the AVX2 instructions code. And process priority too, of course.

https://en.wikipedia.org/wiki/Advanced_Vector_Extensions

Almost two months ago the last: I changed the refrigerator (it broke). It turns out that it was the culprit of the huge DC present in my grid. I still do not explain it but the improvement was very appreciable.

In short, I have spent less in my knickknacks and and I have greatly increased the frequency with which I get excited when I hear the good / very good recordings that I usually listen to.
 
Last edited:

daftcombo

Major Contributor
Patreon Donor
Joined
Feb 5, 2019
Messages
1,166
Likes
887
#17

daftcombo

Major Contributor
Patreon Donor
Joined
Feb 5, 2019
Messages
1,166
Likes
887
#19
That is the key question for anyone saying they hear differences, when none are measured, and yet it's the one that goes unanswered time and time again.
True. It would be easy to say: "if one spots a difference, THEN there is a measurable difference".
But I can tell the difference between the smell of a banana and the smell of coffee, while I can't show it via a measurement.
 

Soniclife

Major Contributor
Patreon Donor
Joined
Apr 13, 2017
Messages
1,647
Likes
1,217
Location
UK
#20
True. It would be easy to say: "if one spots a difference, THEN there is a measurable difference".
But I can tell the difference between the smell of a banana and the smell of coffee, while I can't show it via a measurement.
But you could show it in a blind test, using just your nose. Also the correct test equipment would also show they smell different. However many claims about audible differences just stink.
 
Top Bottom