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: Winamp 2 Kernel Streaming Output Plugin (Read 437688 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Winamp 2 Kernel Streaming Output Plugin

Reply #250
I don't seem to be able to play back DTS-WAV files with this plugin.  My receiver reports that it is receiving a DTS signal when I use ASIO to output the stream from Winamp, but when I try to use KS I only get the static that indicates that the stream has not survived in bit-perfect form.  Any ideas why that might be, Steve?

Winamp 2 Kernel Streaming Output Plugin

Reply #251
For those who have a cheap CMI8738/8768 based card: the non wavert version of Dogbert's free CMI drivers works with the 3.63 KS plugin under Vista!

The soundcard isn't displayed in the output devicelist but it works... (only tested with PCM 44.1)

Winamp 2 Kernel Streaming Output Plugin

Reply #252
@Steve Monks
Hi,
i'm trying your plugin, and i came from DSOutputSSRC.
Now i wonder, how can i coniugate your KS and SSRC?
There is a separate SSRC plugin which i'm not aware of?
Or are you planning to add it directly to your KS?
Thank you

Winamp 2 Kernel Streaming Output Plugin

Reply #253
@Steve Monks
Hi,
i'm trying your plugin, and i came from DSOutputSSRC.
Now i wonder, how can i coniugate your KS and SSRC?
There is a separate SSRC plugin which i'm not aware of?
Or are you planning to add it directly to your KS?
Thank you


Hi, I have no plans to add SSRC (Software Sample Rate Conversion - I had to look it up) to the Kernel Streaming plugin. At one point I had a simple upsampler built in as a test but, as I could determine no perceivable improvement in sound quality I removed it. Any form of resampling effectively mangles HDCD data and as the primary point of the plugin for me was to get unmolested data out of the PC and into my outboard DAC it kind of went against the grain a bit.

If you really need SSRC, why not use the HQSoftProc Resampling Plugin, this can be setup to feed its output to the Kernel Streaming plugin. I've just tried this on my dev PC and it seems to work okay with a variety of sample rates and word lengths (I tried 96 and 192KHz and 16 and 24 bit) although at these higher rates the buffering takes a battering (open the KS status window to see) so it would be advisable to increase the buffer sizes from the defaults if you experience audio breakup.

Also be aware that support for certain frequencies and word lengths is somewhat variable in the Kernel Streaming interface across different sound cards, so you may find that certain combinations that you'd expect to work don't, you may also find that the volume control stops working with 24 bit feeds, this is due to variations in the data packing format that I haven't catered for.

Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #254
If you really need SSRC, why not use the HQSoftProc Resampling Plugin, this can be setup to feed its output to the Kernel Streaming plugin. I've just tried this on my dev PC and it seems to work okay with a variety of sample rates and word lengths (I tried 96 and 192KHz and 16 and 24 bit) although at these higher rates the buffering takes a battering (open the KS status window to see) so it would be advisable to increase the buffer sizes from the defaults if you experience audio breakup.

Thanks for the reply Steve,
i've downloaded HQSoft 4.6 Pro then trying it with your KS.
At 16 bit (96khz) all goes well, but setting the HQSoft to 24bit that's the result



At 32bit it just shows 0 0 0 0 etc

Why's this?

EDIT: I've tried all the versions on your site including the very old. And no one does work.

Winamp 2 Kernel Streaming Output Plugin

Reply #255
I don't know. As I said, it worked fine for me with 3.63 on my Dev machine using the following combinations;

96KHz 16 bit
96KHz 24 bit
192KHz 16 bit
192KHz 24 bit

Looking at your screen grab of the status screen, something's gone horribly wrong with what the plugin is being fed from the resampler, i.e. 26284288Hz, 29540 bits per sample into 401 channels - that's some level of resampling!

Assuming you've got logging enabled (tick the "enable logging" box in the Kernel Streaming Settings dialog) you should find a file called kernel stream,ing log.txt in the winamp folder. Can you PM this file to me and I'll take a quick look to see if I can work out what's happened.

Also, can you give me some details about your computer, i.e. CPU type/speed, memory size, operating system etc.

Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #256
You have a PM with the log.
I've an Audigy4 with 2Gig ram, AMD 64 FX, XpSp2

Winamp 2 Kernel Streaming Output Plugin

Reply #257
From the PM:

Quote
Code: [Select]
OpenOutput - Current Settings:
Chosen Filter:       kX Wave kX Generic [ac00] 0/1
Input Buffer Size:   65536
Output Buffer Size   8192
Output Buffer Count: 8


Attempting to CreateRenderPin with the following WaveFormatExtensible (first attempt):
Format.nChannels            = 2
Format.nSamplesPerSec       = 96000
Format.wBitsPerSample       = 32
Format.nBlockAlign          = 8
Format.nAvgBytesPerSec      = 768000
Format.cbSize               = 22
Samples.wValidBitsPerSample = 24
dwChannelMask               = 00000003


Failed to create pin on first attempt!

Attempting to CreateRenderPin with the following WaveFormat (2nd attempt):
Format.nChannels            = 2
Format.nSamplesPerSec       = 96000
Format.wBitsPerSample       = 24
Format.nBlockAlign          = 6
Format.nAvgBytesPerSec      = 576000
Format.cbSize               = 0
Samples.wValidBitsPerSample = 0
dwChannelMask               = 00000000


An important thing, it does work with standard DirectSound plugin in any combination up to 32bits.


By the look of it, the chosen Kernel Streaming interface for your card does not accept the requested format for output. The plugin first tries to establish the required output format using the newer WAVEFORMATEXTENSIBLE structure to describe the format to the driver, if the driver doesn't support this, the plugin then tries to use the older and less flexible WAVEFORMAT structure, which is more widely accepted. If the plugin had succeeded in establishing an output, you'd see something like the following in the log (taken from my Dev machine with onboard Realtek HD Audio);

Code: [Select]
Attempting to CreateRenderPin with the following WaveFormatExtensible (first attempt):
Format.nChannels            = 2
Format.nSamplesPerSec       = 96000
Format.wBitsPerSample       = 32
Format.nBlockAlign          = 8
Format.nAvgBytesPerSec      = 768000
Format.cbSize               = 22
Samples.wValidBitsPerSample = 24
dwChannelMask               = 00000003


OpenOutput: Successfully Created Pin, Format - BPS: 32 FREQ: 96000 NCHANNELS: 2 VALIDBPS: 24
Output Opened


As your log doesn't contain anything like this, it looks like even the fallback has failed for this format. Do you get any other options in the "Output Device" list of the KS config dialog? If so, it may be worth trying one of them.

The fact that using a directsound output plugin works is irrelevant here as it uses a different interface to communicate with the card. Kernel Streaming is not always well supported by the sound card driver, so, as I mentioned earlier you do get variable behaviour between different cards. If you haven't done so already, it may be worth getting the latest sound card driver, other than that I don't really know what to suggest.


Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #258
I informed you of the DirectSound compatibility just for chronicle. I suspected that Kernel Streaming was just a different matter, and that would involve a more strict contact with the hardware, and so possibly incompatibility.
So in other words you're saying it's a driver issue, that for some reason doesn't accept the 24bit (ore more precisely the WAV format)? But that's different from 16bit? Why 16bit yes and 24bit no?
In the output device i have a list of outputs but none works.
Oh i forgot, i use Kx Drivers 3537 (official), that is an alternative driver for creative cards.
I'll try stick with installing different driver version to see what happen.
BTW thanks for the moment

Winamp 2 Kernel Streaming Output Plugin

Reply #259
You have to output to kX HQ device in order to use 24 bit output. I have an Audigy2 ZS and use kX Driver 3538m. Everything works fine with HQSoftProc Resampling Plugin set to output to Kernel Streaming, and KS output set to kX Wave SB0350 10k2[d000] HQ device. Default device (0/1) won't accept 24bit streams through kernel streaming interface.
If age or weaknes doe prohibyte bloudletting you must use boxing

Winamp 2 Kernel Streaming Output Plugin

Reply #260
You have to output to kX HQ device in order to use 24 bit output. I have an Audigy2 ZS and use kX Driver 3538m. Everything works fine with HQSoftProc Resampling Plugin set to output to Kernel Streaming, and KS output set to kX Wave SB0350 10k2[d000] HQ device. Default device (0/1) won't accept 24bit streams through kernel streaming interface.


That would explain a lot, thanks eevan. 3ngel, does that sort it out for you?

Cheers,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #261
My issue with my playback seems to be related to your plugin (since its often reported as the crashing module). What my problem is is that I've told winamp to read in metadata when files are loaded. (preferences -> general -> titles) and then load a huuuuge playlist.

While this happens I think something is timing out. I do use the hqsoftproc module as well, by the way. Could it be that the kernel streamer still doesn't handle 'timeouts' well? Or is this maybe hqsoftproc after all?

Winamp 2 Kernel Streaming Output Plugin

Reply #262
I looked thorugh the thread but didn't find information about my problem, which doesn't mean there coulnd't be any, I just didnt' have time to look more thoroughly.
Everyhting is fine except one thing - settings for Number of output buffers are not remembered. No matter what number I set, the next time I start Winamp the number is back to 8. Is this a bug of some kind or is it intentional?
Hardware: TerraTec Aureon Space flashed into Audiotrak Prodigy
Software: Windows XP Pro SP2, Winamp 5.35 (but it applies for earlier versions as well), Audiotrak driver ver. 2.18

One more thing... I do hear difference between DirectSound and KS. As if KS makes music more dynamic, adds more volume to the whole sound and the treble is far more pronounced. If DS and KS truly should be the same, then I don't have an explanation as to why there is such a huge difference.

Winamp 2 Kernel Streaming Output Plugin

Reply #263
My issue with my playback seems to be related to your plugin (since its often reported as the crashing module). What my problem is is that I've told winamp to read in metadata when files are loaded. (preferences -> general -> titles) and then load a huuuuge playlist.

While this happens I think something is timing out. I do use the hqsoftproc module as well, by the way. Could it be that the kernel streamer still doesn't handle 'timeouts' well? Or is this maybe hqsoftproc after all?


Does this happen if you don't use HQSoftProc? A timing related error in the KS plugin is possible due to its mult threaded nature although, due to the way it's written (i.e. very little cross thread interaction) should be pretty unlikely. I'll have to see if I can recreate the crash to be sure.

Cheers,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #264
I looked thorugh the thread but didn't find information about my problem, which doesn't mean there coulnd't be any, I just didnt' have time to look more thoroughly.
Everyhting is fine except one thing - settings for Number of output buffers are not remembered. No matter what number I set, the next time I start Winamp the number is back to 8. Is this a bug of some kind or is it intentional?
Hardware: TerraTec Aureon Space flashed into Audiotrak Prodigy
Software: Windows XP Pro SP2, Winamp 5.35 (but it applies for earlier versions as well), Audiotrak driver ver. 2.18


You're right, I've just tried it and it doesn't retain the number of buffers, if you look at the Winamp.ini file, it does actually save the correct value, but it doesn't seem to act on it when initialising the plugin. I'm surprised no one (including myself) has spotted this earlier.

One more thing... I do hear difference between DirectSound and KS. As if KS makes music more dynamic, adds more volume to the whole sound and the treble is far more pronounced. If DS and KS truly should be the same, then I don't have an explanation as to why there is such a huge difference.


That doesn't surprise me at all as the Direct Sound plugin doesn't work in exclusive mode, so it's still at the mercy of KMixer (the dll that merges the sound output of windows programs together before passing them to the sound card), so, even if Winamp is the only thing playing, the bitstream it outputs still gets manipulated in one way or another by KMixer when using the Direct Sound plugin. Also, due to the general flexibility of Direct Sound (i.e. it will quite happily mix secondary bufers of varying sample rates and bit depths to yield a single output in whatever the primary buffer format is set to) I wouldn't be at all surprised if the bitstream gets trampled somewhat on its journey between the secondary buffer the Direct Sound plugin writes into and the sound card driver.

As I've said before, the sure fire way to check if the bitstream is being tampered with at all is to play a track of HDCD material digitally into a DAC capable of handling it (and signalling its presence). If the bitstream is being interfered with in any way, the DAC will fail to detect the HDCD encoding. Note that this will only work if you are not resampling and have the volume control disabled (or set to 100%) as both of these processes change the original bitstream.

I'm not sure about your particular model, but I used to use a Terratec Aureon Fun 5.1 and found that this could not pass HDCD streeams unchanged even with the KS plugin - although Kernel Streaming still sounded better than Direct Sound, it still sounded noticably rough compared to playing original CD's directly on my CD transport. I'm currently using an M-Audio Audiophile 2496 sound card digitally connected to my Tag McLaren AV32R and find that this works very well and (to my ears at least) is indistinguishable to playing material on the CD transport.

Cheers,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #265
I'm surprised no one (including myself) has spotted this earlier.

That's because I've never tried to lower the number of buffers. I'm ok with 8
If age or weaknes doe prohibyte bloudletting you must use boxing

Winamp 2 Kernel Streaming Output Plugin

Reply #266
You're right, I've just tried it and it doesn't retain the number of buffers, if you look at the Winamp.ini file, it does actually save the correct value, but it doesn't seem to act on it when initialising the plugin. I'm surprised no one (including myself) has spotted this earlier.

You and me both.  I tweak the number of output buffers as with 8 there is a small delay before Winamp actually reacts, which kinda irritates me. 

That doesn't surprise me at all as the Direct Sound plugin doesn't work in exclusive mode, so it's still at the mercy of KMixer (the dll that merges the sound output of windows programs together before passing them to the sound card), so, even if Winamp is the only thing playing, the bitstream it outputs still gets manipulated in one way or another by KMixer when using the Direct Sound plugin. Also, due to the general flexibility of Direct Sound (i.e. it will quite happily mix secondary bufers of varying sample rates and bit depths to yield a single output in whatever the primary buffer format is set to) I wouldn't be at all surprised if the bitstream gets trampled somewhat on its journey between the secondary buffer the Direct Sound plugin writes into and the sound card driver.

As I've said before, the sure fire way to check if the bitstream is being tampered with at all is to play a track of HDCD material digitally into a DAC capable of handling it (and signalling its presence). If the bitstream is being interfered with in any way, the DAC will fail to detect the HDCD encoding. Note that this will only work if you are not resampling and have the volume control disabled (or set to 100%) as both of these processes change the original bitstream.

I'm not sure about your particular model, but I used to use a Terratec Aureon Fun 5.1 and found that this could not pass HDCD streeams unchanged even with the KS plugin - although Kernel Streaming still sounded better than Direct Sound, it still sounded noticably rough compared to playing original CD's directly on my CD transport. I'm currently using an M-Audio Audiophile 2496 sound card digitally connected to my Tag McLaren AV32R and find that this works very well and (to my ears at least) is indistinguishable to playing material on the CD transport.

Cheers,
Steve

Both Terratec Aureon Space and Audiotrak Prodigy use the Envy24HT chipfrom IC Ensamble. M-Audio Revolution uses it too.
On my system KS works simultaneously with all other sounds and that actually makes me happy as I want to hear other sounds. This still means KS is independent and doesn pass through KMixer, right? It's also up to the audio driver to do be able to play KS AND other sounds simultaneously (correct me if i'm wrong).

Actually the only thing I'm missing from the DS plugin is the fading. I really liked the crossfading effect. But quality is more important so I'm getting used to listening without fades. It would be nice to add them to the KS plugin (if possible)

Winamp 2 Kernel Streaming Output Plugin

Reply #267
Steve,

When you're busy building the better and next version, may I humbly suggest an added feature:

- Could you build some code that allows us, the faithful users, to set the output bit depth?

This would make me (and possibly others) very happy. Additionally it is pretty simple to do. All you need to do is either add '00000000' at the end of each word, or removing the last bits.

The added bonus for adding bit depth is that since your plugin does allow volume control, small volume changes (ie. in the 17+ bitrange) will actually be lossless, and larger ones will be handled more precisely as well.

I don't know why anyone would need a reduction of bit depth at the KS plugin location but its equally easy to do, so why not.

Winamp 2 Kernel Streaming Output Plugin

Reply #268
- Could you build some code that allows us, the faithful users, to set the output bit depth?


You can effectively already do this by using the HQSoftProc resampler plugin and setting the output bit depth to 24 or 32.

All you need to do is either add '00000000' at the end of each word


Actually I would have thought that the correct maths would be to multiply each sample by 0x7fffff then divide it by 0x7fff because you would want 0x7fff to be output as 0x7fffff and not 0x7fff00.

Additionally it is pretty simple to do


I love it when people say that. Well, the source code is out there, feel free to add it 

Cheers,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #269
You can effectively already do this by using the HQSoftProc resampler plugin and setting the output bit depth to 24 or 32.

I know, but I strongly suspect the plugin of being the cause of my crashes, and the developer has given up on the project (doesn't respond to mails, last new version is years old)
Quote

All you need to do is either add '00000000' at the end of each word


Actually I would have thought that the correct maths would be to multiply each sample by 0x7fffff then divide it by 0x7fff because you would want 0x7fff to be output as 0x7fffff and not 0x7fff00.


My binary math dates back from 10 years ago, so uh.. maybe you're right.

All I know is that essentially a 16-bit sample would be (say) 111111111111111 and to make that 24bit you would need it to go 11111111111111100000000. Of course there are probably 'headers' etc that need to be modified as well, but raw-data-wise that is all there is, isn't it?
Quote

Additionally it is pretty simple to do


I love it when people say that. Well, the source code is out there, feel free to add it 

Hah, well, the thing is that
a/ I'm not a C programmer, I do an incredibly minor amount of java and the rest is PHP/SQL99 etc. While I'm sure there are some obstacles I could not foresee, I currently think that it shouldn't be that hard in general, just by comparing it to how hard it would be in PHP. Am I wrong?
b/ Even if I were a C programmer, you are the guy who is intimately familiar with your code. Regardless of my personal 'have to learn C first' startup time, I suspect that for you it would take a much shorter time to know where to put the code in your framework

But, I did not mean it disrespectfully, and don't want to imply that your time is less valuable etc. I just hope you will consider it  (plus hey Id be happy to donate.. paypal?)

Winamp 2 Kernel Streaming Output Plugin

Reply #270
Quote
But, I did not mean it disrespectfully, and don't want to imply that your time is less valuable etc.

Don't worry, I'm not offended in any way I just couldn't resist rising to that comment 

In many ways you're right, it is relatively simple to scale the sample data as it passes through the plugin (just a multiply followed by a divide or a shift if your not too bothered about absolute accuracy) although it's slightly more complicated because you'd have to deal with 32 bit overflow (unless we assume the availability of 64 bit operands on the CPU which introduces potential compatibility issues).

The more involved bit is adding extra interface code to let the user choose this mode of operation and additional setup code to handle attempting to set up the output pin accordingly and falling back to straight pass through should this fail and so on. None of this is truly difficult but it's a lot of work for minimal gain (none whatsoever for me as I just want a transparent digital pass-through from my PC) and runs the risk of introducing new bugs into the plugin.

Quote
but I strongly suspect the plugin of being the cause of my crashes

I'd forgotten about that. When I get a moment I'll have a go at recreating this crash to see what happens. Roughly how many files does it take to crash it and what type of files are they?

Regards,
Steve

 

Winamp 2 Kernel Streaming Output Plugin

Reply #271
Hi Steve.

I think the is a memory leak in status window. Memory and resources are consumed in a few seconds after I open the status window and are released only when I close Winamp.

I'm using: Windows 98 SE, Winamp v2.95 and KS v3.63.

Thank you.

Winamp 2 Kernel Streaming Output Plugin

Reply #272
Hi Steve.

I think the is a memory leak in status window. Memory and resources are consumed in a few seconds after I open the status window and are released only when I close Winamp.

I'm using: Windows 98 SE, Winamp v2.95 and KS v3.63.

Thank you.


Hi, it's not exactly a memory leak, it's just that it allocates resources when the panels are opened for the first time and holds onto them rather than cleaning up and reallocating things every time. If it allocated more resources every time the panel was opened, then I'd be worried.

Cheers,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #273
No. It's more than that, but I tried the same thing on WinXP and there was no problem at all.
I know that Win98 is old, but please test your plugin in Win98. Just play something in Winamp and leave the status window open for a minute. See what happens.

Here are some screen captures:

First image:
Notice the slow increase of allocated memory (dark blue histogram) and swap file (dark violet) and the decrease of unused memory (light blue).


Second image:
When resources (USER and GDI) are full, this message appears.
I closed the status window to prevent the crash.


Third image:
When I close Winamp, all resources are restored to normal. Notice the free memory and allocated memory.

Winamp 2 Kernel Streaming Output Plugin

Reply #274
That's easier said than done as I no longer have access to a Windows 98 machine, they're all XP here at home, we don't even support Windows 98 any more at work (I'm a game developer). You say the problem only occurs when the status window is open? I'll take a look at the code when I get a moment and see if there's anything obvious going on.

Steve