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 436718 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Winamp 2 Kernel Streaming Output Plugin

Reply #100
Quote
Quote
Edit: Just noticed something quite strange.  When playback ends (for me the end of the playlist), Winamp's CPU usage jumps to a constant 50% (on a hyperthreaded machine) and when examining this in process explorer it appears that out_ks3.dll is the one using the full 50%.  The process does terminate fine when shutting down winamp so at least that is good.  Hope this helps.
[a href="index.php?act=findpost&pid=354272"][{POST_SNAPBACK}][/a]

Steve, I don't know if you saw the edit to my post a while back before you replied or not, but the issue is still there in the current 3.0 release.  It seems to occur any time playback is stopped, similar to what you described in a post:
Quote
Secondly, my player thread, if starved of data will sit running in a tight loop wasting CPU time until something comes along - I'll have to see about sending it to sleep when nothing is being fed to it.

I don't know if you tried to resolve this or not in the 3.0 release, but it is still an issue for me.
[a href="index.php?act=findpost&pid=354545"][{POST_SNAPBACK}][/a]


Ouch! Yes, that's exactly what I was on about. I didn't get chance to sort it out for the "release" last night, I will have a look over the next couple of days.

Cheers,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #101
Okay, I've updated the plugin to fix the heavy CPU usage when the player is stopped as reported by Gabes Dad. This can be found at the same place as before here (V3.1).

Now, when playback stops, the CPU load will rise dramatically for about two seconds then it should fall off to nothing as the player thread gets put to sleep.

Hope that solves the issue.

Cheers,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #102
When i try to load a new song during playback using out_ks31  the CPU usage goes up to 100%. Even the time it takes for the fileselection-box to appear takes ~extremely~ long. Since that makes the v3.x plugin currently unusable for me i'm using out_ks25 which works fine for me.

Though there is one odd behaviour which is true both for v2.5 and v3.1. When i try to play a module (mod, xm, s3m etc.) using in_mod i get disturbed soundoutput . I found out that if i play a midi file using in_midi once the  disturbances with in_mod are gone. Maybe the reason for this is that in_midi initializes the Direct Music-Port on its usage which affects winamps output pipeline in some manner? Again, after i played a midi file through in_midi once the problems are gone, even if i quit winamp and reopen it to play another module file immediately.

Specs (you might need to know):
WinXP Pro, Winamp 5.12 (in_midi + in_mod from Winamp v5.12 package)
MB nForce2, CPU Athlon 2.6GHz, 512Mb RAM, Terratec Aureon Space

Last but not least, many thanks to you for this fine plugin. It's much appreciated (damn KMixer).


Regards,
deus-ex

Winamp 2 Kernel Streaming Output Plugin

Reply #103
Quote
When i try to load a new song during playback using out_ks31 the CPU usage goes up to 100%.

How are you loading songs to get this effect? I normally use the media library, but I've tried using the "Add" button at the bottom of the playlist and cannot recreate this. If you can let me know what you're doing to get this effect I'll take a look.

Quote
When i try to play a module (mod, xm, s3m etc.) using in_mod i get disturbed soundoutput

I suspect this is probably the same thing as the problem with "Winamp Music" mentioned earlier. I need to investigate this further.

Regards,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #104
Quote
How are you loading songs to get this effect?
I was refering to the "Open file(s)" button to the right of the position-slider in the main screen of Winamp. I did'nt used the playlist to load a song at any time so i can't tell if the playlist has similar issues or not.

Quote
I suspect this is probably the same thing as the problem with "Winamp Music" mentioned earlier. I need to investigate this further.
Beside this issue there is one input-plugin which does'nt produce any soundoutput at all using out_ks25/out_ks32. It's the D00/D01-file player Ganbatte! (in_d00.dll) which can be downloaded at http://www.oplx.com/code/. Examplemodules are available on the same page. I tried every configuration option that "in_d00" has to offer (e.g. diff. samplerate settings) without success.


Regards,
deus-ex

Winamp 2 Kernel Streaming Output Plugin

Reply #105
I've finally fixed the problem with "Winamp Music" which also fixes deus-ex's problem with .mod files. A new version (3.2) can be found here which contains this fix.

Regarding deus_ex's other problems;

Quote
When i try to load a new song during playback using out_ks31 the CPU usage goes up to 100%. Even the time it takes for the fileselection-box to appear takes ~extremely~ long. Since that makes the v3.x plugin currently unusable for me i'm using out_ks25 which works fine for me.


I can't recreate this exactly, but, I've removed the 2 second delay before sending the player thread to sleep when it becomes idle, so this may solve your problem. If anybody now starts getting instances of the player freezing up when changing tracks, pausing or general messing around, could you please let me know.

Quote
Beside this issue there is one input-plugin which does'nt produce any soundoutput at all using out_ks25/out_ks32. It's the D00/D01-file player Ganbatte! (in_d00.dll) which can be downloaded at http://www.oplx.com/code/. Examplemodules are available on the same page. I tried every configuration option that "in_d00" has to offer (e.g. diff. samplerate settings) without success.


Now this one is weird. When I try to play these d00/d01 files everything gets set up as normal but my Write function never gets called (this is how Winamp should pass sample data to me). It interrogates if it can write by calling my CanWrite function (and I tell it that it can), but it never attempts to pass any data onto me and I'm not sure why. I may try mailing the author to see if he can suggest any obvious reason for this as it clearly works with other output plugins such as WaveOut.

Anyway, as always, please let me know if any new problems have been created with this build or indeed if any existing ones that I think I've fixed are still there.

Regards,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #106
Quote
I've finally fixed the problem with "Winamp Music" which also fixes deus-ex's problem with .mod files.
Thanks for comming up with a solution immediately. Going to test the new version this evening (or night that is  ).

Quote
...I've removed the 2 second delay before sending the player thread to sleep when it becomes idle, so this may solve your problem.
I'll report back on this soon. Btw., would'nt it make sense to allow setting the buffers to zero so v3.x can behave as v2.5 if desired?

Quote
I may try mailing the author to see if he can suggest any obvious reason for this as it clearly works with other output plugins such as WaveOut.
You should definetly do that, i'm in constant contcat with him myself regarding a plugin for foobar2000.

Regards,
deus-ex

Winamp 2 Kernel Streaming Output Plugin

Reply #107
Quote
Thanks for comming up with a solution immediately. Going to test the new version this evening (or night that is  ).


Great, I hope it sorts out the problems you were having.

Quote
I'll report back on this soon. Btw., would'nt it make sense to allow setting the buffers to zero so v3.x can behave as v2.5 if desired?


That's not as easy as you might think because the v3.x variant works in a very different manner to the pre v3.0 versions. The v3.x versions were written from scratch and use a separate thread to manage the playback and communication with the Kernel Streaming interface, because of this it needs a buffer to sit between this thread and Winamp otherwise it just stutters like crazy. The original plugin (pre v.3.0) simply handed off any data packets received from Winamp directly to the Kernel Streaming interface, the problem with this approach is that Winamp can pass through some very small packets (when playing .wv files, I get packets of just 556 samples in length) which, when passed on to KS, don't leave very much time before another packet has to be sent to avoid audible breakup, this means that it was very succeptible to CPU loading as was reported earlier in the thread.

Quote
You should definetly do that, i'm in constant contcat with him myself regarding a plugin for foobar2000.


Well, I've mailed him, hopefully he'll be able to help.

Winamp 2 Kernel Streaming Output Plugin

Reply #108
Quote
Great, I hope it sorts out the problems you were having.
All right, the 100% CPU usage issue when trying to load another file via 'Open File' button in mainscreen is fixed since your removed the 2 second delay. I did'nt wittness any problems regarding to this change.

Regarding the "in_mod" issue:
When setting the output buffer of "out_ks32" to 16k or 32k the replay is fine though at the cost of delayed visual feedback of course. And of course using "out_ks25" does'nt come with this ~price~ so currently its my prefered solution. When using "out_ks32" with its default settings the "in_mod" soundproblems still persists and again only when using "in_midi" once the stuttering disappears. Maybe "in_midi" is altering the size of winamps outputbuffer (or soundprocessing buffer) which then remains unchanged for the other in-/output plugins too?

I hope a solution can be found which then can be incorporated in both versions of your out_ks plugin.

Quote
That's not as easy as you might think because the v3.x variant works in a very different manner to the pre v3.0 versions.
I know, i followed this whole thread and also read your plugin documentation (which btw. explains kernel streaming in a very well understandable way). I just thought it can't hurt to ask, maybe you have'nt spend a thought on it yet.

Quote
Well, I've mailed him, hopefully he'll be able to help.
I hope so too, since there's a similar winamp plugin named "in_adlib" which also reproduces fm-sound which does'nt have these output problems in combination with out_ks. Currently OPLx ("in_d00" author) is in the finishing stages for a foobar compatible version of his plugin.


Regards,
deus-ex

Winamp 2 Kernel Streaming Output Plugin

Reply #109
Thanks for getting back to me so quickly. Taking each point in turn;

Quote
All right, the 100% CPU usage issue when trying to load another file via 'Open File' button in mainscreen is fixed since your removed the 2 second delay. I did'nt wittness any problems regarding to this change..


Great. That's one down, looks like I was being a bit overcautious with the sleep delay thing.


Quote
When setting the output buffer of "out_ks32" to 16k or 32k the replay is fine


Sounds like it's not feeding my plugin fast enough for some reason, however I've not been able to recreate this issue with .mod files since 3.2, if you can point me at a problematic .mod file, I'll take another look at it.

Quote
I know, i followed this whole thread and also read your plugin documentation (which btw. explains kernel streaming in a very well understandable way). I just thought it can't hurt to ask, maybe you have'nt spend a thought on it yet.


Thanks for your comments, it's nice to know the docs have been useful. It's certainly possible to weld both versions together, just not something I've seriously considered doing - I'd basically have to write a whole new back end that works the same way as 2.5 but fits it in with the structure of 3.x. I may look into this at some point in the future.

Quote
I hope so too, since there's a similar winamp plugin named "in_adlib" which also reproduces fm-sound which does'nt have these output problems in combination with out_ks. Currently OPLx ("in_d00" author) is in the finishing stages for a foobar compatible version of his plugin.


Impressively, he's already got back to me and has fixed the plugin at his end. He says he will probably release the update in a few days. Now that I know what the problem was, I'll fix it at my end too (in my next release) just in case there's any other input plugins out there with the same issue.


Regards,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #110
Quote
... if you can point me at a problematic .mod file, I'll take another look at it.
I made sure its not just a few particular modules rasing the problem, it happens with every module i try and i have quite a big collection. Maybe my soundcard drivers are to blame for beeing to slow, who nows? I allways have the latest (beta) driver version installed. I also tried setting the Winamp process priority to realtime (yeah that's nuts) but that did'nt do anything good.

Quote
It's certainly possible to weld both versions together, just not something I've seriously considered doing - I'd basically have to write a whole new back end that works the same way as 2.5 but fits it in with the structure of 3.x. I may look into this at some point in the future.
The idea behind my request simply is that new user may ignore "out_ks25" thinking its outdated and when one experience similar problems like me using "out_ks32" he/she would'nt think of trying out the v2.5 version.

Quote
Impressively, he's already got back to me and has fixed the plugin at his end.
Yes, OPLx is one great pal, always open for comments and a very nice and helpfull person.


Regards,
deus-ex

Winamp 2 Kernel Streaming Output Plugin

Reply #111
I've posted a new version (v3.3) here (same place as other v3.x versions) the source is here.

This versions contains the following changes;

1. a fix for the problem when playing back .d00 / .d01 files. Note that as these are presented in mono, they only play back on one channel on my system (I suspect this may be normal behaviour for other cards too). I will at some point in the future make the plugin treat a mono feed as stereo and duplicate it on both channels.

2. Increased selection of buffer sizes - the Input buffer can be 16,32,64 or 128K while the Output buffer can be 4,8,16 or 32K. Note, that the input buffer must be larger than the output buffer, this is to prevent buffer underruns which cause a rather nasty audible breakup.

3. I've added an optional status window, this can be useful when adjusting buffers.

Full details can be found in the readme.txt along with an overview of how the threads and buffering are set up and how best to adjust them.

As always, please let me know how you get on with this plugin, all feedback is appreciated (good or bad). I'll try to fix any reported bugs when I can although I'm back at work tomorrow, so I'll not be able to spend as much time on this as I have over the last couple of weeks.

Cheers,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #112
Steve,
Thanks so much for all of your effort.  I had tried the original kernel streaming plugin a long time ago, but it was basically unusable.  By random chance I was on the forums and noticed this thread was bumped, I took a look and tried out your new and VERY improved plugin and was very impressed.  This plugin plays much smoother under load than the ASIO plugin I have been using for over a year. 

So pretty much what I want to say is this plugin kicks ass, keep up the hard work!  So far in versions 3.2 and 3.3 I have experienced no issues except of course lag on pause/stop and lag on the visual display, but these are things that don't bother me.


Mike

Winamp 2 Kernel Streaming Output Plugin

Reply #113
Quote
2. Increased selection of buffer sizes
Installed out_ks33, fired up Winamp and chose lowest buffer size available (found out later that you suggest the very same in the readme.). Now playback of MOD-files works like a charm. Though i'd like to know if im able to use even smaller buffer sizes (e.g. in 8k, out 2k). How about incorporating the buffer sizeselection as sliders with a given scale?


Quote
1. a fix for the problem when playing back .d00 / .d01 files.
Confirmed! Requires latest version of Ganbatte! (in_d00).


Quote
3. I've added an optional status window, this can be useful when adjusting buffers.
Great addition to the plugin which helps to verify chosen settings.


Quote
Full details can be found in the readme.txt along with an overview of how the threads and buffering are set up and how best to adjust them.
Regarding the readme i overhauled the formating, removed a few spelling errors (added some new?  ) and removed the obsolete section about the "Release Audio Device When Stopped" option.

Edit: Link removed, readme.txt send via PM.


Thank you very much for your great support and for providing updates that fast. You (your plugin) make(s) Winamp a lot more worthwhile for me now.


Best regards,
deus-ex

Winamp 2 Kernel Streaming Output Plugin

Reply #114
Quote
Installed out_ks33, fired up Winamp and chose lowest buffer size available (found out later that you suggest the very same in the readme.). Now playback of MOD-files works like a charm. Though i'd like to know if im able to use even smaller buffer sizes (e.g. in 8k, out 2k). How about incorporating the buffer sizeselection as sliders with a given scale?


Actually, you can easily try out any sizes you like by editing winamp.ini. Search for;

[Kernel Streaming]

This shouldl be followed by two lines similar to the ones below;

input_buffer_size=16384
output_buffer_size=4096

Just edit the buffer sizes, save the file, then start Winamp. You can check that they've been picked up correctly by opening the status window. Any size should be fine, although the input buffer should always be at least 8192, possibly a little more (I would say that 16384 is the minimum safe value). Also you should really stick to powers of two (e.g. 1024,2048,4096 and so on). I may change the interface at some point, I just used radio buttons as they were easy to implement.

Quote
Confirmed! Requires latest version of Ganbatte! (in_d00).


Out of interest, did they just play out through the left hand channel or did you get the same thing out of the left and right?

Quote
Regarding the readme i overhauled the formating, removed a few spelling errors (added some new?  ) and removed the obsolete section about the "Release Audio Device When Stopped" option. You can download it here.


Spelling errors? Well, it was late and I was tired, at least, that's my excuse  I was rambling on a bit too wasn't I? Anyway, I'd like to download it but the hosting thingy wont work through my router, if you could PM it to me that would be great, as I'm keen to take a look.

BTW, formatting has two 't's  (sorry, I couldn't resist)

Quote
Thank you very much for your great support and for providing updates that fast. You (your plugin) make(s) Winamp a lot more worthwhile for me now.


You're welcome, I'm glad it's been useful to you and to others and it's nice to know the works been appreciated, it makes the effort worthwhile. It's also been quite interesting to see the rather varied range of requirements people had from the plugin (it was doing everything I needed when I posted 2.0!), some were quite unexpected (I'd never even heard of .d00 files before this!).

Thank you all for letting me know how you've got on with it and for the various suggestions about how it can be improved.

Best regards,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #115
Quote
Actually, you can easily try out any sizes you like by editing winamp.ini.
Great, i thought it was hardcoded. I was able to lower the size of the input buffer to 8192k and output buffer to 2048k though it does'nt run smooth when starting/running a visual plugin (stuttering). Went back to the 16384/4096k setting which runs perfect on my machine.


Quote
Out of interest, did they just play out through the left hand channel or did you get the same thing out of the left and right?
Left and right. I'd demand my money back if not.


Quote
Anyway, I'd like to download it but the hosting thingy wont work through my router, if you could PM it to me that would be great, as I'm keen to take a look.
Bombs away, sir.


Quote
BTW, formatting has two 't's   (sorry, I couldn't resist)
Hah, this was just a minor test i placed on purpose of course.


Quote
I'd never even heard of .d00 files before this!).
You should pay Modland a visit, an Eldorado for almost every existing music format you can imagine. Here's a link that leads to the D00-module directory on Modland for example:
ftp://ftp.modland.com/pub/modules/ad%20lib/jch-d00


Quote
Thank you all for letting me know how you've got on with it and for the various suggestions about how it can be improved.
Just out of curiousity, could out_ks25 be enhanced with the fixes for in_mod/in_d00 too?


Best regards,
deus-ex

Edit:4096 to 2048 in first section.

Winamp 2 Kernel Streaming Output Plugin

Reply #116
A suggestion, the plugin should have thread priority setting like what out_asio have as the thread cannot pass data if other process used up all CPU resources.
Sorry for my English.

Winamp 2 Kernel Streaming Output Plugin

Reply #117
Quote
A suggestion, the plugin should have thread priority setting like what out_asio have as the thread cannot pass data if other process used up all CPU resources.
[a href="index.php?act=findpost&pid=356221"][{POST_SNAPBACK}][/a]


A good suggestion, but, to be honest, now that the thread sleeps whenever it's idle (i.e. most of the time), I should be able to just bump the thread priority up quite a bit without adversly affecting anything else. I'll check this out at the weekend and, if it doesn't cause any issues I'll post a new version.

Regards,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #118
Quote
I'll check this out at the weekend and, if it doesn't cause any issues I'll post a new version.

Did you yet find the time to check this out? Also i'd like you to answer my question from my previous post. What's your opinion on the overhauled 'readme.txt' i send you some time ago?


Regards,
deus-ex

Winamp 2 Kernel Streaming Output Plugin

Reply #119
Quote
Quote
I'll check this out at the weekend and, if it doesn't cause any issues I'll post a new version.

Did you yet find the time to check this out? Also i'd like you to answer my question from my previous post. What's your opinion on the overhauled 'readme.txt' i send you some time ago?


Regards,
deus-ex
[a href="index.php?act=findpost&pid=358725"][{POST_SNAPBACK}][/a]


Hi, sorry for not getting back sooner, I've been rather busy now that I'm back at work.

I did try increasing the thread priority to Time Critical and it appears to have had no adverse side-effects. I haven't posted a new version as there are several other things I'm toying with doing, these include;

Reducing the number of output buffers or making it adjustable

I've had an idea for gapless playback that requires some further experimentation

changing the buffer size options to either sliders or combo boxes


Once I've had a look at these things, I'll post a new version.

As far as fixing KS_25 for the in_mod issue goes, yeah, it would be possible, but I'd need to increase the buffer sizes (the problem was caused by the in_mod plugin waiting until the output plugin reported the availability of a certain output buffer size, the 8K buffer as reported by the original plugin just wasn't big enough, so in_mod just sat there waiting forever). However, as I understand it OPLx was going to fix it from his end too, so, if he's posted a new plugin, that should work with KS_25 as is.

As for the readme, comparing the two, I'm rather surprised just how much obsolete stuff I'd left in. When I get round to it, I'll probably rework the readme to combine elements of both versions. Interesting point about SB's XiFi series, I wasn't aware of that.

Cheers,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #120
This is really nice to have this being developed!  , looking forward to whenever you are comfortable with releasing the next version, thanks again Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #121
Quote
However, as I understand it OPLx was going to fix it from his end too, so, if he's posted a new plugin, that should work with KS_25 as is.
That is true for in_d00 (Ganbatte!). The in_mod plugin is'nt by OPLx though, it was made by former Winamp developers who (to my knowledge) all have left Nullsoft. I'm uncertain if anybody of the new (and very good) developer team is putting hands on the sourcecode of this plugin at all.


Regards,
deus-ex

Winamp 2 Kernel Streaming Output Plugin

Reply #122
Hi,
I've (finally) uploaded a new version of the plugin (v3.4) with the following enhancements;

1. I've increased thread priority to time critical (the highest it will go). I've been using this on several computers for the last couple of weeks while simultaneously running various demanding tasks with no noticable negative side effects.

2. I've added an option to change the number of output buffers. You can now select between 2 and 8 (8 being the previous fixed amount). Reducing the number of buffers will significantly reduce latency, so, with an 8K output buffer you can now get it down to a minimum of 92mS with CD material.

3. I've added a Gapless mode. This basically leaves the Kernel Streaming output running after WinAmp tells me to stop it, so, if WinAmp then starts writing a new track out before the buffer has emptied the new track will be appended seamlessly onto the previous one. If the buffer underruns playback will stop. Note that Winamp does not accurately capture the start and end of tracks taken from CD so you will still get disruption with music captured by Winamp. For best results use a separate capture program such as EAC.

4. The config screen has had an overhaul and now uses sliders for the buffer sizes.

5. The readme has been rewritten as an html document to make it a bit more readable and accessible.

6. Not exactly an enhancement, but I found that the drivers for my sound card (M-Audio Audiophile 2496) crashed Windows if paused with an output buffer size less than 8KB, so I've increased the minimum output size from 4KB to 8KB. If you really need a smaller buffer size you can still circumvent this by editing the Winamp.ini file as mentioned in an earlier post, however, with the option for fewer output buffers this may not be such an issue.

The plugin and its source code can be downloaded from the same places as previous versions. These are;

Plugin: here
Source: here

As usual, all feedback is welcome.

Regards,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #123
work fine.
thanks, Steve!
It's My Life,
It's Now Or Never,
I Ain't Gonna Live Forever,
I Just Want To Live While I'm Alive.

Winamp 2 Kernel Streaming Output Plugin

Reply #124
Thanks for the update, Steve.

One thing that I noticed right away with gapless playback enabled: when music is playing, and you hit next, an error message is produced and WinAmp crashes.

"Unable to create output pin"

Other than that it seems great so far! Keep up the good work.