DriverHeaven.net

 
Looking for the skin chooser?
 
 
  • Home

  • Reviews

  • Articles

  • News

  • Tools

  • GamingHeaven

  • Forums

  • Network

 

Go Back   DriverHeaven.net > Forums > Hardware and Related Topics > kX Project Audio Driver Support Forum > Effects and the DSP


Reply
 
LinkBack Thread Tools
Old Aug 27, 2008, 07:45 PM   #1
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 36
Maddogg6 has a spectacular aura aboutMaddogg6 has a spectacular aura about

Loudness Compensator test request

Ok - I was screwing around... and upon loading this plugin - kX Mixer crashed...
And would crash when I try restarting kX Mixer... so, to avoid re-installing everything kX... I tracked down the kxfxloudness.kxl file in windows system32... and renamed the plugin to get kX mixer to stop crashing - and it worked.

So, to retest this, I renamed he kxl file back (all I really did was add '.old' to the file name - so I would avoid making a mistake in renamimg it...

Restart kX Mixer - and it says - 'error - would you like to un-register this plugin' or to that affect... anyways... now I wonder if I hosed my kX installation.

Bottom line is I was hoping someone with 3545a could test that out for me and report back. I would just like to hear comfirmation that I hosed up my install be for I un-install / re-install everything (all them da plugins Ive collected)

Thanks in advance.
Maddogg6 is offline   Reply With Quote


Old Aug 27, 2008, 09:24 PM   #2
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

I doubt that you hosed anything...

There seems to be a problem with that plugin in 3545b too ((crashes if you try to restart kxmixer with it loaded)).

Double check the file name: kxfxloudness.kxl, or just unregister it (IIRC, even though kX asks if you want to unregister a plugin, it does not do so).

.reg file to unregister that plugin:
Code:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\kX\Plugins]
"3e1bdfb8-b4c5-41ff-8b0c-82d9c529c079"=-
"3e1bdfb8-b4c5-41ff-8b0c-82d9c529c079.name"=-

[-HKEY_CURRENT_USER\Software\kX\Plugins\3e1bdfb8-b4c5-41ff-8b0c-82d9c529c079]
Russ is offline   Reply With Quote
Old Aug 27, 2008, 09:28 PM   #3
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 36
Maddogg6 has a spectacular aura aboutMaddogg6 has a spectacular aura about

thanks Russ... yeah I meant 3545b...

*be gone cursed plugin *
Maddogg6 is offline   Reply With Quote
Old Aug 27, 2008, 09:37 PM   #4
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

Hehe

You should probably let Eugene know (or maybe townkat) so that it can be fixed (or whatever).
Russ is offline   Reply With Quote
Old Aug 27, 2008, 10:31 PM   #5
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,412
Rep Power: 47
Max M. will become famous soon enough

I've taken a look in its sources - it seems to crash with division by zero -
most likely when set_all_params(default_params) is called
(params[SETVOL_ID] is the one being ZERO (when it should not) and it is the last parameter being set to actual default value)
__________________
Max M. is offline   Reply With Quote
Old Aug 27, 2008, 10:41 PM   #6
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

[COLOR=Gray](Out of curiosity)[/COLOR] Any idea why that would only happen when restarting kxmixer (i.e. it does not crash on me when loading the plugin or clicking the reset button)?
Russ is offline   Reply With Quote
Old Aug 27, 2008, 10:48 PM   #7
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,412
Rep Power: 47
Max M. will become famous soon enough

I think it happens just randomly - when plugin is loaded the memory of the "params" array is not initialized - so params[SETVOL_ID] can or cannot be 0 by occasion.
__________________
Max M. is offline   Reply With Quote
Old Aug 27, 2008, 10:57 PM   #8
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

Thanks for the explanation, I think I know what you mean. I did not see the sources anywhere, so I have not looked at them, but I have seen where this type of thing might occur in other plugins (when one parameter uses another parameter as part of it's calculations, before the other parameter has been initialized (maybe not same thing here, but same idea)).
Russ is offline   Reply With Quote
Old Aug 27, 2008, 11:05 PM   #9
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,412
Rep Power: 47
Max M. will become famous soon enough

sources: KX Plugins

>when one parameter uses another parameter as part of it's calculations, before the other parameter has been initialized

In general - it's OK - (in context of "lazy" set_all_params() implemented like there) - as in the last iteration we get all the parameters initialized. But of course only if invalid parameter values (in earlier iterations) do not cause crash (like that div-by-zero)
__________________
Max M. is offline   Reply With Quote
Old Aug 27, 2008, 11:13 PM   #10
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

Thanks for the link. Yup I see it... So the fix would be to memcpy the default_params into the _params array before set_all_params is callled within set_defaults (or probably better to copy the values in set_all_params)

Last edited by Russ; Aug 27, 2008 at 11:19 PM.
Russ is offline   Reply With Quote
Old Aug 27, 2008, 11:19 PM   #11
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,412
Rep Power: 47
Max M. will become famous soon enough

Yeah, i thought exactly of the same fix. Also after all - i would just put
Code:
if (params[SETVOL_ID] == 0)
    params[SETVOL_ID] = !0;
right at the beggining of the set_param() - to be sure that it never ever ever can be zero

edit: oops...
__________________

Last edited by Max M.; Aug 28, 2008 at 03:29 AM.
Max M. is offline   Reply With Quote
Old Aug 27, 2008, 11:29 PM   #12
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

Yeah, that is a good idea...

Last edited by Russ; Aug 27, 2008 at 11:44 PM.
Russ is offline   Reply With Quote
Old Aug 29, 2008, 02:27 PM   #13
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

I am not sure if townkat still comes around here, so I added the suggested code changes (set_all_params).
Here is the modified source (includes .kxl compiled for 3545b).

Last edited by Russ; Sep 2, 2008 at 03:51 PM.
Russ is offline   Reply With Quote
Old Aug 29, 2008, 03:07 PM   #14
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 36
Maddogg6 has a spectacular aura aboutMaddogg6 has a spectacular aura about

awesome Russ... thank you...
Maddogg6 is offline   Reply With Quote
Old Aug 31, 2008, 03:42 PM   #15
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

<edit>
Nevermind, I decided to leave it with just the memcpy in set_all_params.

Last edited by Russ; Sep 2, 2008 at 03:56 PM.
Russ is offline   Reply With Quote
Old Aug 31, 2008, 10:44 PM   #16
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,412
Rep Power: 47
Max M. will become famous soon enough

[color=gray]mm, doesn't it have sync(ndx) after each set_param already?
(e.g. it is already synched after set_all_params w/o additional calls)[/color]
__________________
Max M. is offline   Reply With Quote
Old Sep 1, 2008, 04:38 AM   #17
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,883
Rep Power: 48
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Quote:
Originally Posted by Russ View Post
So the fix would be to memcpy the default_params into the _params array before set_all_params is callled within set_defaults (or probably better to copy the values in set_all_params)
I would simply use init() or even request_microcode()
for the _params array initialization?
Those are only called once and prior to all the set_param stuff.
Lex Nahumury is offline   Reply With Quote
Old Sep 1, 2008, 04:49 AM   #18
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,412
Rep Power: 47
Max M. will become famous soon enough

[color=gray]Well, if we are about "perfectization" i would rewrote the whole set_param there at all (first of all, i'd get off of copy-pastes and secondly removed division - to fix the problem itself and not fixing the symptoms )
And finally i'd renamed it from the "Timbre"! But who cares - whatever fix does the trick - who cares of how exactly. (IMHO) Too much attention to this one little plugin. [/color]
__________________

Last edited by Max M.; Sep 1, 2008 at 06:21 AM.
Max M. is offline   Reply With Quote
Old Sep 1, 2008, 06:21 AM   #19
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,883
Rep Power: 48
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Quote:
Originally Posted by Max M. View Post
[color=gray]Too much attention to this one little plugin. [/color]
True, but what else is there to talk about?
Lex Nahumury is offline   Reply With Quote
Old Sep 1, 2008, 06:25 AM   #20
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,412
Rep Power: 47
Max M. will become famous soon enough

catcha!
__________________
Max M. is offline   Reply With Quote
Old Sep 1, 2008, 07:44 AM   #21
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

Quote:
Originally Posted by Lex Nahumury View Post
I would simply use init() or even request_microcode()
for the _params array initialization?
Those are only called once and prior to all the set_param stuff.
The problem was that parameters where being used before there values where valid (the divide by zero error was just a consequence of this). Initializing the whole array in set_all_params (for defaults and presets, etc) ensures that all the values are valid before they are used.

Quote:
Originally Posted by Max M. View Post
[COLOR=gray](IMHO) Too much attention to this one little plugin. [/COLOR]
Well, if townkat does pop his head in here, I would like him to know the reason for the changes, etc.

BTW: I did rename most of the files, etc, as if Eugene ends up using this code, I didn't think leaving it called timbre would be good (but other than that, I did try to leave most of the code intact).

Last edited by Russ; Sep 2, 2008 at 03:38 PM.
Russ is offline   Reply With Quote
Old Sep 1, 2008, 08:02 AM   #22
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,883
Rep Power: 48
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Quote:
Originally Posted by Russ View Post
The problem was that parameters where being used before there values where valid (the divide by zero error was a consequence of this).
LOL. Yes I understood that the first time.
Quote:
Originally Posted by Russ View Post
Initializing the whole array in set_all_params (for defaults and presets, etc) ensures that all the values are valid before they are used.
Yes and I added that I would initialize that array in init() and *not* in set_all_params().
Lex Nahumury is offline   Reply With Quote
Old Sep 1, 2008, 08:15 AM   #23
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

Quote:
Originally Posted by Lex Nahumury View Post
LOL. Yes I understood that the first time.
Yes and I added that I would initialize that array in init() and *not* in set_all_params().
Sorry, you are not understanding what I mean.

When you set defaults or load a preset, you get a whole new set of values. set_all_params() calls set_param() for each parameter one at a time (as you know). The problem is that each parameter uses other parameters before their values would have been updated, thus they are using old (thus invalid) values (or in the case of the divide by zero error, uninitialized data) for their calculations, resulting in the calculations being invalid.

Last edited by Russ; Sep 1, 2008 at 09:57 AM.
Russ is offline   Reply With Quote
Old Sep 1, 2008, 09:29 AM   #24
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,883
Rep Power: 48
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Quote:
Originally Posted by Russ View Post
Sorry, you are not understanding what I mean.
Ah yes, I see now. (weird coding)
Sorry, I stand correct!

edit:
And thus Max was right afterall; best to re-write the content of set_param().

Last edited by Lex Nahumury; Sep 1, 2008 at 02:25 PM.
Lex Nahumury is offline   Reply With Quote
Reply

Bookmarks

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
10K2 kX Synth test request.. Maddogg6 SoundFonts and MIDI 8 Feb 13, 2008 04:29 PM
Another one of my ideas... Equal loudness contour Chester01 Effects and the DSP 11 Sep 25, 2006 09:07 PM
Question about the loudness of front and back sounds. mtbaird General Discussion 5 May 13, 2004 05:20 PM
Little request :) Daijoubu Effects and the DSP 1 May 4, 2004 02:25 AM