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 437511 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Winamp 2 Kernel Streaming Output Plugin

Reply #225
Quote
Ah but the pinch is more in the rounding error, not the initial division.

Do you round? (1.45=1, 1.51=2) or do you just chop (1.99=1)
More advanced methods involve dithering where you spread the rounding error across the neighboring samples, but there is much debate on what the best is. Chopping is the worst by far, of course.


As it's just a simple integer calculation it will just round off, but your suggestion of upsampling to 24 bits before hand will effectively give you an 8 bit of fractional component to pass on to your DAC. It would however be relatively easy to make it round up or down correctly by adjusting the calculation as so;

v2 = (v1 * vol + 127) / 255

I'd be impressed if anyone could hear the difference though. Dithering is a whole other kettle of fish of course.

One other thing to bear in mind, I'm not entirely sure what the HQSoftProc plugin actually does to each sample. If it just multiplies the sample by 256, then this theory would be sound, as the highest possible value, 0x7fff would now be 0x7fff00. However, if it scales the sample, i.e.

v2 = v1 * 0x7fffff / 0x7fff

this will give a completely different result as 0x7fff would now be 0x7fffff. I'll have to make up some test tracks, pass them through and look at what's coming into my plugin to be sure just what it's doing. I wouldn't be surprised if it's also applying dither too.

Quote
On an unrelated note, are you open for donations? Do you have a paypal address or something? I've spent quite a few $ on my stereo over the last couple of months, Ive even invested money in speaker cables (where the best of my microelectronics knowledge - and I am an university microelectronics graduate - cannot justify this).. something as obviously helpful as your plugin would warrant at least a token gift.

No strings attached by the way, I wont start to make demands regarding updates etc


It's kind of you to offer but I'd rather not get into accepting donations for the work I've done on the plugin. I originally rewrote it for my own use as I was fed up of the original one crashing if you happened to look the wrong way at the computer, so rather than just keeping it to myself it seemed to reasonable to offer it to others, along with the source code so that anyone with suitable knowledge could adapt it as they saw fit.

Personally, I'm very happy with the plugin as it stands, in fact I was pretty happy way back on version 2.5, although I'm a lot happier with it since I rewrote it from the ground up and this probably accounts for the slowdown in development in recent months just as much as my busy life.

I now listen to all of my CD's as lossless rips from media PC instead of using my ludicrously expensive TagMcLaren DVD32FLR (which I still use for DVDs, so it's not going to waste) as I can no longer tell any difference. Without the plugin, the crimes of KMixer become glaringly obvious, so I use it for all the music I play and it never gives me any grief.

I'd still like to get to the bottom of some of the problems other people are experiencing, but without the relevant hardware it's a bit of a guessing game trying to work out what's going wrong and I've got far too many other diversions to occupy my time just at the moment.

Cheers,
Steve

 

Winamp 2 Kernel Streaming Output Plugin

Reply #226
Hello Steve

1. Crush on ENDSESSION with Live! 5.1 creative drivers:

I have just tried out_ks36 with winamp 5.24. Have same crushes on endsession while winamp playing. As i noticed, it depends on which another plugins are loaded to winamp. Sometimes i have just write assertion to address 0x10. As I understood, you have no call from winamp when windows sends winamp WM_QUERYENDSESSION message. So you can't cleanup gracefully. But if winamp have WM_CLOSE, it  normally calls EndPlayback and Quit to plugin. Is'nt it winamp or winamp plugin protocol bug? Can you tell me exactly which calls winamp makes to plugin in both cases. It is hard to debug when windows shuttig down.

2 puntloos: I can't use KX driver because it still not supoport AC3 passthough mode for my damn soundcard. I think I can buy new soundcar d

2. Superfluous log file creation:

How about this?

static void InitLogging(void)
{
    FILE *fh;
    fh = fopen(LOG_FILE, "rb");         // check if exists
    if (fh) {
        fclose(fh);
        fh = fopen(LOG_FILE, "wb");      // clear log
        if (fh) {
            fclose(fh);
        }
    }
}

2 puntloos: Yes i have compiled this feature.

Regards, Oleg

Winamp 2 Kernel Streaming Output Plugin

Reply #227
Quote
Ah but the pinch is more in the rounding error, not the initial division.

Do you round? (1.45=1, 1.51=2) or do you just chop (1.99=1)
More advanced methods involve dithering where you spread the rounding error across the neighboring samples, but there is much debate on what the best is. Chopping is the worst by far, of course.


As it's just a simple integer calculation it will just round off, but your suggestion of upsampling to 24 bits before hand will effectively give you an 8 bit of fractional component to pass on to your DAC. It would however be relatively easy to make it round up or down correctly by adjusting the calculation as so;

v2 = (v1 * vol + 127) / 255

I'd be impressed if anyone could hear the difference though. Dithering is a whole other kettle of fish of course.

From what I heard, you will start hearing this when you also heavily attenuate your audio digitally. Yes, you would be 'consciously' generating a sub-optimal situation, however it does happen!
Quote
One other thing to bear in mind, I'm not entirely sure what the HQSoftProc plugin actually does to each sample. If it just multiplies the sample by 256, then this theory would be sound, as the highest possible value, 0x7fff would now be 0x7fff00. However, if it scales the sample, i.e.

v2 = v1 * 0x7fffff / 0x7fff

this will give a completely different result as 0x7fff would now be 0x7fffff. I'll have to make up some test tracks, pass them through and look at what's coming into my plugin to be sure just what it's doing. I wouldn't be surprised if it's also applying dither too.


I've asked the maker of HQSoftProc. If you tell it to resample, it will dither, if you tell it to just upconvert from 16 to 24, it will simply add 8 zeroes at the end of the sample block.
Quote
Quote
On an unrelated note, are you open for donations? Do you have a paypal address or something? I've spent quite a few $ on my stereo over the last couple of months, Ive even invested money in speaker cables (where the best of my microelectronics knowledge - and I am an university microelectronics graduate - cannot justify this).. something as obviously helpful as your plugin would warrant at least a token gift.

No strings attached by the way, I wont start to make demands regarding updates etc


It's kind of you to offer but I'd rather not get into accepting donations for the work I've done on the plugin. I originally rewrote it for my own use as I was fed up of the original one crashing if you happened to look the wrong way at the computer, so rather than just keeping it to myself it seemed to reasonable to offer it to others, along with the source code so that anyone with suitable knowledge could adapt it as they saw fit.

That's cool, I also contribute to the 'open source' community myself, but I figured I'd offer. If you change your mind, let us know.. I guess setting up the infrastructure for donations might cost you more hassle than it will get you money (although a paypal link is made quickly). Your call. At least know I muchly appreciate your work!!

Quote
Personally, I'm very happy with the plugin as it stands, in fact I was pretty happy way back on version 2.5, although I'm a lot happier with it since I rewrote it from the ground up and this probably accounts for the slowdown in development in recent months just as much as my busy life.

I now listen to all of my CD's as lossless rips from media PC instead of using my ludicrously expensive TagMcLaren DVD32FLR (which I still use for DVDs, so it's not going to waste) as I can no longer tell any difference. Without the plugin, the crimes of KMixer become glaringly obvious, so I use it for all the music I play and it never gives me any grief.

Ditto. I can wholeheartedly reccommend loading up a PDA (with bluetooth activesync) to the program 'remoteamp'. You will be able to browse your audio directories (or artists, if you tagged your files properly), play, add to playlists, alter volume *cough* etc!

Quote
I'd still like to get to the bottom of some of the problems other people are experiencing, but without the relevant hardware it's a bit of a guessing game trying to work out what's going wrong and I've got far too many other diversions to occupy my time just at the moment.

Yeah, busy lives, way of the world.

2 puntloos: I can't use KX driver because it still not supoport AC3 passthough mode for my damn soundcard. I think I can buy new soundcar d

Perhaps a worthy idea 
Quote
2. Superfluous log file creation:

How about this?

static void InitLogging(void)
{
    FILE *fh;
    fh = fopen(LOG_FILE, "rb");         // check if exists
    if (fh) {
        fclose(fh);
        fh = fopen(LOG_FILE, "wb");      // clear log
        if (fh) {
            fclose(fh);
        }
    }
}

2 puntloos: Yes i have compiled this feature.


So, share the source, share the DLL

Winamp 2 Kernel Streaming Output Plugin

Reply #228
out_ks 3.6 + Superfluous log file creation fix, source + dll
http://rapidshare.de/files/32972612/out_ks36.oleg.rar.html

NOTE:
this is unofficial build on older msvc .NET version, hope Steve to include this in 3.7

Winamp 2 Kernel Streaming Output Plugin

Reply #229
Code: [Select]
End(force=1)
EndInternal() - mode=0 force=1
Attempting to close player thread
Gapless mode buffer underrun - Player Thread is stopping KS player
End(force=1)
EndInternal() - mode=0 force=1
Player Thread - closing
Player thread has closed
Destructed KSCore
input buffer configured to 16384 bytes
output buffer configured to 8192 bytes per packet
Enumerated Filter:
  Friendly Name:
  Sound Blaster Audigy
  Filter Type = 1


Enumerated Filter:
  Friendly Name:
  Creative Sound Blaster PCI
  Filter Type = 1


Enumerated Filter:
  Friendly Name:
  M-Audio Audiophile USB Line
  Filter Type = 1


Enumerated Filter:
  Friendly Name:
  M-Audio Audiophile USB SPDIF
  Filter Type = 1


Constructed KSCore (Input Size:16384) (Output Size 8192) (Output Cnt 8)
OpenOutput - Current Settings:
Chosen Filter:       M-Audio Audiophile USB Line
Input Buffer Size:   16384
Output Buffer Size   8192
Output Buffer Count: 8


Attempting to CreateRenderPin with the following WaveFormatExtensible (first attempt):
Format.nChannels            = 2
Format.nSamplesPerSec       = 44100
Format.wBitsPerSample       = 16
Format.nBlockAlign          = 4
Format.nAvgBytesPerSec      = 176400
Format.cbSize               = 22
Samples.wValidBitsPerSample = 16
dwChannelMask               = 00000003


Failed to create pin on first attempt!

Attempting to CreateRenderPin with the following WaveFormat (2nd attempt):
Format.nChannels            = 2
Format.nSamplesPerSec       = 44100
Format.wBitsPerSample       = 16
Format.nBlockAlign          = 4
Format.nAvgBytesPerSec      = 176400
Format.cbSize               = 0
Samples.wValidBitsPerSample = 0
dwChannelMask               = 00000000


OpenOutput - Current Settings:
Chosen Filter:       M-Audio Audiophile USB Line
Input Buffer Size:   16384
Output Buffer Size   8192
Output Buffer Count: 8


Attempting to CreateRenderPin with the following WaveFormatExtensible (first attempt):
Format.nChannels            = 2
Format.nSamplesPerSec       = 44100
Format.wBitsPerSample       = 16
Format.nBlockAlign          = 4
Format.nAvgBytesPerSec      = 176400
Format.cbSize               = 22
Samples.wValidBitsPerSample = 16
dwChannelMask               = 00000003


Failed to create pin on first attempt!

Attempting to CreateRenderPin with the following WaveFormat (2nd attempt):
Format.nChannels            = 2
Format.nSamplesPerSec       = 44100
Format.wBitsPerSample       = 16
Format.nBlockAlign          = 4
Format.nAvgBytesPerSec      = 176400
Format.cbSize               = 0
Samples.wValidBitsPerSample = 0
dwChannelMask               = 00000000


OpenOutput - Current Settings:
Chosen Filter:       M-Audio Audiophile USB Line
Input Buffer Size:   16384
Output Buffer Size   8192
Output Buffer Count: 8


Attempting to CreateRenderPin with the following WaveFormatExtensible (first attempt):
Format.nChannels            = 2
Format.nSamplesPerSec       = 44100
Format.wBitsPerSample       = 16
Format.nBlockAlign          = 4
Format.nAvgBytesPerSec      = 176400
Format.cbSize               = 22
Samples.wValidBitsPerSample = 16
dwChannelMask               = 00000003


Failed to create pin on first attempt!

Attempting to CreateRenderPin with the following WaveFormat (2nd attempt):
Format.nChannels            = 2
Format.nSamplesPerSec       = 44100
Format.wBitsPerSample       = 16
Format.nBlockAlign          = 4
Format.nAvgBytesPerSec      = 176400
Format.cbSize               = 0
Samples.wValidBitsPerSample = 0
dwChannelMask               = 00000000


My soundcard are set to 48khz 24bit i can't change the khz lower than 48khz.. i can only up it work when i open some port or close. like spdif out or in on the khz get 48khz. and if i close some get up like 96khz... and when i try to use kernel streaming its this log i get when i change some song for playing and nothing play. hehe

Winamp 2 Kernel Streaming Output Plugin

Reply #230
more about ENDSESSION crush on Live! 5.1

winamp 5.24 used

I have traced Initialise, Quit, StartPlayback,   EndPlayback methods with winamp 5.24

At first i have detected a non-critical bug in Adrian Paul's HQSoftProc software resampling plugin. It calls Initialise two times. I've put flag to skip superfluous Initialise call but no behaviour changes were detected.

When winamp have WM_CLOSE it calls EndPlayBack and Quit.
When session finishing I have crush and no EndPlayback and Quit calls at all.

I have commented out all the code to make fake output plugin that does nothing, but pretends to winamp to be playing. Crush has gone but still no calls to EndPlayBack and Quit when session finished.

So winamp not allows any output plugin to cleanup gracefully on endsession.

Winamp 2 Kernel Streaming Output Plugin

Reply #231
Latest official Creative Live 5.1 driver (LiveDrvPack.exe, LiveDrvPack_Patch.exe) is really unstable with kernel streaming
Crash has gone since I have installed latest audigy driver (SBAX_WBUP2_LB_2_09_0016.EXE) on my Live! 5.1

Add folloving lines to Support.Cab\Common\WebDrv.ini to install
[Hardware.Map16]
ID = 00801061, 00801062, 00801064, 00801069, 0080106A, 0080106B, 0080106C, 00801065, 00801066, 00801067, 00110001, 0010000A
ProductName = Sound Blaster Live!
DefAppPath = \Creative\SBLive

Winamp 2 Kernel Streaming Output Plugin

Reply #232
Hi, where can I find the source code of version 2.5? Thanks in advance.

Winamp 2 Kernel Streaming Output Plugin

Reply #233
Hi, where can I find the source code of version 2.5? Thanks in advance.


Hi, I've added the source code to 2.5 and 2.4 at the bottom of my download page which may be found here.

The 2.4 download is a zip of the code I released along with the 2.4 plugin. I was unable to find an original zip of the 2.5 code, so I've zipped up the last code from my old working repository (I started a new repository for 3.x) and posted it as 2.5. However, this may not actually be the exact 2.5 code as I may have altered it before beginning 3.x, I don't think I did, but it's difficult to tell.

Do you need it for anything in particular?

Regards,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #234
Thank you very much. Since the old the version has fewer features, and I am new to directks, it will be easier for me to learn directks. BTW, do you try directks in audio capture? I have problems in audio capture. As I set the state to KSSTATE_RUN, the system crushed, and the computer restarted by itself. The program died at SetState(run)->DeviceIoControl(...). I do not know much about driver. Do you have suggestions? Thank you.

Winamp 2 Kernel Streaming Output Plugin

Reply #235
Hi,

the site from Steve Monks seems to be out of order,
could anyone upload or give a working link to the the latest version please?

EDIT: Nevermind, works now!

Winamp 2 Kernel Streaming Output Plugin

Reply #236
I'm currently using a Chaintech AV 710 card with the kernel streaming output because it has (24) bit-perfect output.

With all the Via drivers which I tried, 3.10A being the most stable, I noticed that Winamp's time/song position is wrong. A song which should play for 2 minutes for example, goes on to about 2:40, while still sounding fine.

Foobar KS and Winamp with DS work fine; is this a bug in the kernel streaming module?

Winamp 2 Kernel Streaming Output Plugin

Reply #237
I'm currently using a Chaintech AV 710 card with the kernel streaming output because it has (24) bit-perfect output.

With all the Via drivers which I tried, 3.10A being the most stable, I noticed that Winamp's time/song position is wrong. A song which should play for 2 minutes for example, goes on to about 2:40, while still sounding fine.

Foobar KS and Winamp with DS work fine; is this a bug in the kernel streaming module?


Yep, it's a bug in the Kernel Streaming plugin, it looks like I'm using the total amount of data written to the output device along with the format of the input data to calculate the current play position - which Winamp interrogates for it's time and graphic equaliser display - when I should really be using the format of the output device in the calculation.

If I get a chance I'll fix it and post a new one. Don't hold your breath though.

Cheers,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #238
Actually, scratch that, I am using the output format in the calculation, so that does in fact look correct.

I've tried running a few tracks through the plugin using the HQSoft resampling plugin to upconvert the input data to 24 and 32 bit formats which forces the output to the same format, and the timings I'm getting are correct. Can you post a diagnostic log to give me some idea of what's going in and out of the plugin? Also, can you let me know about any other plugins you are using at the same time?

Cheers,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #239
Hi,
I've a feeling it differs with the sound card and drivers. On my Prodigy 192 the visualisation were lagging FAR behind, so I modified the code to help bring them back. When Winamp wanted to know the current output time, the plug-in was reporting written time to the KS interface ignoring the output lag, and when Winamp wanted to know the written time from the input plug-in, it wasn't taking into account the data in the input buffer. This mean that when Winamp wanted written time it was reporting a time in the past, and for output time it was giving a time in the future. These changes bring the time delay down a lot but still not quite perfect.

Code: [Select]
int KSCore::GetKSTime(void)
{
    unsigned int bytes_per_sec, t;
    bytes_per_sec = wfx_cur.Format.nAvgBytesPerSec;

    t =  written_data / bytes_per_sec * 1000; // time to nearest second in mS
    t += (written_data % bytes_per_sec) * 1000 / bytes_per_sec;    // add in fractional component

    return t;
}

int KSCore::GetOutputTime(void)
{
    float packet_lat, out_lat = 0.0;
    unsigned int bytes_per_sec;
    int t;
    bytes_per_sec = wfx_cur.Format.nAvgBytesPerSec;
    packet_lat = (float)packet_size * 1000.0 / (float)bytes_per_sec;
    for (int n = 0; n < num_packets; n++)
    {
        if (WaitForSingleObject(events[n+EV_KSPACKET], 0) != WAIT_OBJECT_0)
        {
            out_lat += packet_lat;
        }
    }

    t = GetKSTime(); // get time written to KS interface
    t -= (int)(out_lat); // apply output latency

    return t;
}

int KSCore::GetWrittenTime(void)
{
    float in_lat;
    unsigned int bytes_per_sec;
    int t;
    bytes_per_sec = wfx_cur.Format.nAvgBytesPerSec;

    in_lat = (float)input_buffer_len * 1000.0 / (float)bytes_per_sec;
    t = GetKSTime(); // get time written to KS interface
    t += (int)(in_lat); // apply input latency

    return t;
}


The above helps the Prodigy 192, but makes things worse for the Nvidia onboard sound. Also, with the prodigy I had to properly pad the data to 32bit when using 24bit.

Thanks for making this excellent plug-in! 

Craig

Winamp 2 Kernel Streaming Output Plugin

Reply #240
Cheers, it's nice to see people modifying the code to suit their own purposes.

I never bothered trying to account for latency because, as you've found out, different cards seem to handle consumption of the output buffers in a variety of ways.

However, the buffer latency wouldn't account for a difference of 40 seconds on the duration of a two minute song as wdekler is seeing, so I'm still a bit curious as to why that's happening.

Regards,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #241
Hi Steve,


I've just measured a song to get a bit more exact data:

A song of 3:10 ends up at 4:14 in Winamp.

24 bit or 16 bit output doesn't matter.

Here's the logfile:

Kernel Streaming Plugin v3.6 (x86) Diagnostic log

input buffer configured to 65536 bytes
output buffer configured to 8192 bytes per packet
Enumerated Filter:
  Friendly Name:
  Envy24 Family Audio (WDM)
  Filter Type = 1


Constructed KSCore (Input Size:65536) (Output Size 8192) (Output Cnt 8)

(shouldn't it contain more detail when playing a song?)

The plugin is running at the default + logging and there are no other "special" plugins installed...

I also noticed that the analogue output doesn't work with Winamp KS and Foobar KS. Probably a driver issue...

There seem to be several hardware versions around with this popular soundchip. It's possible to flash a Chaintech card to a Prodigy card, see: http://www.head-fi.org/forums/showthread.p...2155&page=2

There are various crystal speeds but they seem to be for getting the 48khz and derived rates. So that couldn't explain the difference between the Prodigy and the Chaintech cards for playing at 44.1 as there's a dedicated crystal for that on all VIA Envy cards.

Flashing to the Prodigy isn't an option for me as you'll lose the analogue output which I still sometimes use with DS applications.

Regards and thanks for looking into it!

Winamp 2 Kernel Streaming Output Plugin

Reply #242
What could also be a quick and dirty solution is to add an extra configuration option where a time correction can be given. For example:

A song that is 3:10 and plays for up to 4:14 can be corrected with: 190/254=0.748 as it probably is the same for all my other songs as well with this card & driver...?

Not a perfect solution by far, but maybe it is fairly easy to implement?


Winamp 2 Kernel Streaming Output Plugin

Reply #243
What could also be a quick and dirty solution is to add an extra configuration option where a time correction can be given. For example:

A song that is 3:10 and plays for up to 4:14 can be corrected with: 190/254=0.748 as it probably is the same for all my other songs as well with this card & driver...?

Not a perfect solution by far, but maybe it is fairly easy to implement?



Somehow, I don't think I'll be doing that 

Also, there's something wrong with your log as it's missing the important information, namely stuff like this;

Quote
Attempting to CreateRenderPin with the following WaveFormatExtensible (first attempt):
Format.nChannels            = 2
Format.nSamplesPerSec      = 44100
Format.wBitsPerSample      = 16
Format.nBlockAlign          = 4
Format.nAvgBytesPerSec      = 176400
Format.cbSize              = 22
Samples.wValidBitsPerSample = 16
dwChannelMask              = 00000003


OpenOutput: Successfully Created Pin, Format - BPS: 16 FREQ: 44100 NCHANNELS: 2 VALIDBPS: 16


which is the kind of information I needed. This is only written into the file once playback has started.

I've posted a new version (3.61) which fixes the issue where log files could be created in different places depending on how Winamp had been launched, this may have caused the information mentioned above to have ended up in a different logfile created somewhere else, so you may like to grab this version and resend me the logfile you get when you play a track. As always the plugin may be found here.

Cheers,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #244
Thanks for the updated version Steve! The logging works fine now.

Although I thought otherwise, the problem must be related be related to a specific plugin. 

I'm still using this FLAC plugin because it can force output to 24bit which can be a good thing when using replaygain: http://www.facquet.com/en/projects-4/winam...ownload-78.html

During the previous tests, I used the Winamp playback option to allow for 24bit or not, now I changed the option in this flac decoder and it shows that 24bit is still used when the "allow 24bit" option is unchecked:

OpenOutput - Current Settings:
Chosen Filter:      Envy24 Family Audio (WDM)
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      = 44100
Format.wBitsPerSample      = 32
Format.nBlockAlign          = 8
Format.nAvgBytesPerSec      = 264600
Format.cbSize              = 22
Samples.wValidBitsPerSample = 24
dwChannelMask              = 00000003


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


I think that this debug information possibly explans what's going wrong: the format is 32bits per sample, and the samples are 24bits. In an earlier post I noticed that the time was incorrect by a factor of 0,748 which is almost 24/32 ...? Is the padding to 32bit the culprit here?

I'm not sure why I previously thought that the problem also happened without FLAC, maybe the non 3.10A drivers were also interfering just as with the Prodigy drivers?

Thanks! :cheers:

Winamp 2 Kernel Streaming Output Plugin

Reply #245
Hi all. I've posted a new version (3.62) here which fixes this timing problem with 24 bit data.

I worked out what the problem was quite quickly, but couldn't reproduce it when testing, even though, according to the information I was getting back from the debugger it should have been going wrong.

In the end, it turns out that the input plugin is responsible for reporting back to Winamp where playback is currently up to and the Wavpack input plugin (which almost all of my music is encoded for) just calculates this on it's own, ignoring any timing information coming from the output plugin (i.e. Kernel Streaming) therefore masking the problem. Switching over to a plain WAV file for testing immediately highlighted the problem.

This also means that any attempts to fix timing errors due to latency in the Kernel Streaming plugin will be rather hit and miss depending what (if anything) the input plugin does with the information passed back to it.

Cheers,
Steve

Winamp 2 Kernel Streaming Output Plugin

Reply #246
Cheers for that fix, I've applied the changes I made (and a minor bug fix - in config.cpp it doesn't read output_buffer_cnt from config file) and it looks like the latency problem on both sound cards has gone completely.

The in_mad input plug-in uses its own internal timer and takes account of the latency from the output plug-in (GetOutputTime - GetWrittenTime). The input plug-in is entirely responsible for controlling the output chain. This is one of the reasons why I'm patching out_ks, as it makes debugging the in_mad plug-in a little bit easier

Would you be interested in applying my changes to fix the timing and improve the latency to your code base?

Winamp 2 Kernel Streaming Output Plugin

Reply #247
Steve, the Winamp timer works fine now with the first couple of files I tried. Great work, thanks!


Winamp 2 Kernel Streaming Output Plugin

Reply #248
Hi Steve,

Doesn't work on my win vista

this have compatibility with new OS Vista?

thanks.

Winamp 2 Kernel Streaming Output Plugin

Reply #249
Hi Steve,

Doesn't work on my win vista

this have compatibility with new OS Vista?

thanks.


Hi Cleiton, I couldn't say for sure as I don't have a Vista installation to test it on, however I seem to recall someone earlier in this thread saying it worked fine on Vista for him, but like I said, I can't personally test it in a Vista environment and the plugin contains no Vista specific code.

The documentation that accompanies the Microsoft Kernel Streaming SDK does suggest that the Kernel Streaming interface may not be compatible with future versions of Windows as they may contain some alternative but incompatible low level interface. Personally, I don't know if this is the case or not.

Sorry I can't be more helpful.

Regards,
Steve

p.s. I've recently posted a slightly newer version (V3.63) here that fixes an occasional timing related crash that occurred (for me) when I tried to play WAV files. As it was timing related, it may affect other filetypes on different setups, to be honest, I'm not sure how this bug managed to stay in the code for so long without me or anyone else falling foul of it. Give this version a go and let me know if it fixes your problem.