HardwareHeaven.com

HardwareHeaven.com

Looking for the skin chooser?
 
 
  • Home

  • Hardware reviews

  • Articles

  • News

  • Tools

  • Gaming at HardwareHeaven

  • Forums

 

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


Reply
 
Thread Tools
Old Aug 28, 2008, 12:45 AM   #1
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 0
Maddogg6 will become famous soon enoughMaddogg6 will become famous soon enough

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 28, 2008, 02:24 AM   #2
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,561
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

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 online now   Reply With Quote
Old Aug 28, 2008, 02:28 AM Threadstarter Thread Starter   #3
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 0
Maddogg6 will become famous soon enoughMaddogg6 will become famous soon enough

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

*be gone cursed plugin *
Maddogg6 is offline   Reply With Quote
Old Aug 28, 2008, 02:37 AM   #4
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,561
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

Hehe

You should probably let Eugene know (or maybe townkat) so that it can be fixed (or whatever).
Russ is online now   Reply With Quote
Old Aug 28, 2008, 03:31 AM   #5
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

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 28, 2008, 03:41 AM   #6
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,561
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

[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 online now   Reply With Quote
Old Aug 28, 2008, 03:48 AM   #7
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

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 28, 2008, 03:57 AM   #8
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,561
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

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 online now   Reply With Quote
Old Aug 28, 2008, 04:05 AM   #9
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

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 28, 2008, 04:13 AM   #10
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,561
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

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 28, 2008 at 04:19 AM.
Russ is online now   Reply With Quote
Old Aug 28, 2008, 04:19 AM   #11
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

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 08:29 AM.
Max M. is offline   Reply With Quote
Old Aug 28, 2008, 04:29 AM   #12
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,561
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

Yeah, that is a good idea...

Last edited by Russ; Aug 28, 2008 at 04:44 AM.
Russ is online now   Reply With Quote
Old Aug 29, 2008, 07:27 PM   #13
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,561
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

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 08:51 PM.
Russ is online now   Reply With Quote
Old Aug 29, 2008, 08:07 PM Threadstarter Thread Starter   #14
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 0
Maddogg6 will become famous soon enoughMaddogg6 will become famous soon enough

awesome Russ... thank you...
Maddogg6 is offline   Reply With Quote
Old Aug 31, 2008, 08:42 PM   #15
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,561
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

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

Last edited by Russ; Sep 2, 2008 at 08:56 PM.
Russ is online now   Reply With Quote
Old Sep 1, 2008, 03:44 AM   #16
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

[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, 09:38 AM   #17
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64
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, 09:49 AM   #18
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

[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 11:21 AM.
Max M. is offline   Reply With Quote
Old Sep 1, 2008, 11:21 AM   #19
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64
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, 11:25 AM   #20
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

catcha!
__________________
Max M. is offline   Reply With Quote
Old Sep 1, 2008, 12:44 PM   #21
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,561
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

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 08:38 PM.
Russ is online now   Reply With Quote
Old Sep 1, 2008, 01:02 PM   #22
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64
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, 01:15 PM   #23
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,561
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

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 02:57 PM.
Russ is online now   Reply With Quote
Old Sep 1, 2008, 02:29 PM   #24
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64
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 07:25 PM.
Lex Nahumury is offline   Reply With Quote
Reply

Thread Tools