Quick Sign In:  

Forum: VirtualDJ 8.0 Technical Support

Topic: reproducible lockup using FPS effect and midi interface

This topic is old and might contain outdated or incorrect information.

I was having some problems with threading issues when TellyVisuals was selected and activated via a controller. There are certain windows that needed to be in place for communication with the IMU SMS receiving application etc. This was only a problem when selecting with a controller. It was not a problem when selecting with a mouse or keyboard. So the way a plugin is loaded up with a mouse versus being loaded up by a controller is different thread wise. Why? I have asked before about this and no answers. I have corrected the problem for TV.

There has been nothing I have been able to report about this previously except I asked a few questions on it. Now I think I have something that can reproduce a problem that you can see and you have the source code for it.

During testing I noticed I would get a lockup on occasion when trying to shut VDJ down. So I am thinking well this is me somehow so I removed all my effects and just had strobe auto, FPS, slideshow and a few others listed. Since I do not have a controller, I am using Bome's Mouse Keyboard and LoopBe Internal MIDI to simulate commands from a controller.

For Bome's keyboard I have it set like this:

0-BUTTON0 - deck master video_fx_select +1
0-BUTTON2 - video_fx
0-BUTTON4 - deck master video_fx_select -1

Ok so now I started out with strobe auto selected in the master when VDJ8 started up.

1) I click BUTTON0 on the Bome's keyboard which in my case would bring up the FPS effect.

2) Now I click BUTTON2 which is video_fx - first thing you notice is the video window comes up but FPS is not activated. Every other time except the first time, video_fx will activate whatever is selected. This happens for any effect and seems like another bug to me.

3) Click BUTTON2 again to activate FPS. You will noticed that it is only updating the frames per second and nothing else. It is already not completely functioning.

4) Click either BUTTON0 or BUTTON4 to remove the FPS effect. In this case it will either be stobe auto or slideshow for me.

5) Hit the X button on VDJ to shut it down. It is now locked up for me and will not shut down. Happens every time for me using the above steps.

This is not about FPS per say but it shows you a problem and it is not good for FPS to be in the list because of this. It also will help you to determine if there is some kind of MIDI interface problem. FPS functions just fine if you select and activate using the mouse or keyboard. Just not when using MIDI. The same thing I was seeing with TellyVisuals.

I am using XP VDJ build 1949.796 but has been a problem forever as far as I know. You should be able to reproduce this using a controller. It doesn't have anything to do with strobe auto or slideshow as far as I can tell. Just something odd about MIDI selection and activation. Most likely it can be corrected in a plugin but this can lead to insanity :) It should not be this way as it can cause problems for anyone trying to create a plugin for VDJ8 including you.

 

Posted Mon 08 Sep 14 @ 8:57 am
I did not notice this before but to get the lock up, I see I need to have the FPS effect selected on a deck on startup.

On startup I now have FPS selected on deck 2, strobe auto on master. Then follow the above steps for lockup.

That fact that FPS does not function completely when selecting via MIDI does not matter if it is selected on any deck. Just seems it matters for the lockup.
 

Posted Mon 08 Sep 14 @ 10:06 am
djdadPRO InfinityDevelopment ManagerMember since 2005
2 things i can add here for now... will try to do more tests later...
1. It should be .. deck master video_fx
2. Have you tried without TellyVisuals installed ? Reason is beacause i had some issues on a laptop when i tried to install and use it, actually i had some error messages on exit if the TellyVisual was selected.. but will try to gather more info and let u know.
 

Posted Mon 08 Sep 14 @ 5:38 pm
Yes TellyVisuals had some problems too and that is how I ran into this. I kept getting this hang thinking it was me. So I removed TellyVisuals as I mentioned above and tracked it down to FPS. FPS is just the best way for me to point you to a problem with this since it is yours and you have the source code for it. I can't say what other effect might show itself as a problem in the future with this. It is very easy to create a problem of sorts in different flavors the way it is now. I don't have a controller and the reason I was not aware of this. Now I have this simulated controller/midi access to reproduce the problem.

Don Moir wrote :
During testing I noticed I would get a lockup on occasion when trying to shut VDJ down. So I am thinking well this is me somehow so I removed all my effects and just had strobe auto, FPS, slideshow and a few others listed. Since I do not have a controller, I am using Bome's Mouse Keyboard and LoopBe Internal MIDI to simulate commands from a controller.


This I think is a bigger problem then any single effect though. I have already fixed it for TellyVisuals version 1.1 (not up yet) but it's insanity. Anyone creating a more complex effect is likely to run into it. Even a simple effect like FPS is having problems. Again every thing works completely fine when selecting, activating, etc with mouse or keyboard including FPS and TellyVisuals 1.0. I even sent commands very rapid under program control. It all comes to a head with problems with MIDI. Most effects are so basic they don't run into the problem.

Again I will ask why is it different thread wise between mouse and midi access?

Completely fine with mouse access and can be completely broken with MIDI access unless very simple or very very careful. Too many variables and unusual behavior to make it a useable API in my opinion for general development. Could be a simple fix for you though.
 

Posted Mon 08 Sep 14 @ 8:13 pm
PachNPRO InfinityMember since 2009
FYI, the FPS source code is available in the downloads...
 

Posted Tue 09 Sep 14 @ 2:50 am
It is not necessary an FPS problem but it's a VDJ effect and they have the source code. So an example of at least one way things can go wrong here that they can take a look at.

 

Posted Tue 09 Sep 14 @ 6:26 am
AdionPRO InfinityCTOMember since 2006
FPS is not a built-in or bundled effect though.

I didn't have time to check it yet, but one thing that comes to mind is that the plugin might be called directly from the midi callback when activated from a controller.
This means that you may want to check if all the functions you use are thread-safe, and that you cannot use Multimedia Functions (although I wouldn't expect this to be the case)
 

Posted Tue 09 Sep 14 @ 11:02 am
Adion wrote :
FPS is not a built-in or bundled effect though.


Good enough to reproduce a problem though that you can look at. Right now it is not good to have FPS in your list at all. Again not so much about FPS but maybe something you can deal with better higher up.

Adion wrote :
I didn't have time to check it yet, but one thing that comes to mind is that the plugin might be called directly from the midi callback when activated from a controller.


Right. Can this be rerouted to something more sane?

Adion wrote :
This means that you may want to check if all the functions you use are thread-safe, and that you cannot use Multimedia Functions (although I wouldn't expect this to be the case)


The problem was with UI components for me. I had to spin off another thread to get all to work right. While I have it all working for me, this is going to be a constant pain for you unless you reroute to something with more sanity. This is going to catch more if anyone does more complex plugins. I think FPS has some 3rd party code in it that is failing but not sure. Just to show how easy it can be to fail. I have to wonder now about some other hangs I have heard of.

 

Posted Tue 09 Sep 14 @ 1:35 pm
o - with this bug report I pointed you to an effect that you have the source code for so that you can reproduce a problem

o - I told you that video_fx does not work the first time when you select with a controller. This happens for any effect. The very first time after running VDJ it displays the video window but not the effect. After this first time it works every time.

Here is the response from you so far.

Adion wrote :
FPS is not a built-in or bundled effect though.


This is something we already knew. If it was me I would be looking at the source code and problem that someone gave me and not trying to side track the issue. When you can respond to this issue properly I will show you how to cause a crash every time with one of the effects that is a built-in.

Adion wrote :
I didn't have time to check it yet, but one thing that comes to mind is that the plugin might be called directly from the midi callback when activated from a controller.


Have you time to check it yet? I would have done this before trying to guess.

Adion wrote :
This means that you may want to check if all the functions you use are thread-safe, and that you cannot use Multimedia Functions (although I wouldn't expect this to be the case)


This post is not about me. I told you that I had removed TM and TV I think 3 times now. The problems exist whether they are in list or not.

djdad wrote :
It should be .. deck master video_fx


It doesn't matter. Once you have selected with a controller it doesn't matter how you try to activate it. It will only show the video window but does not actually activate the effect. This is very easy for you to check. It does not happen when you select by mouse or keyboard.

To Repeat: ( there is more than one problem here - one is so simple you can find anyone walking down to street to test it :)

With TM and TV I worked around the problem. FPS still has a problem. Every effect has a problem when selected with a controller on the very first video_fx. It shows the video window but does not activate the effect. This last one I am not able to work around with something that makes sense.

The above should be enough info for anyone to determine the cause of one or more problems with controller select, midi callback, or whatever. One problem is sometimes you silently fix something and don't update the original bug report. This is not fixed though. Other times there is not much in the way of meaningful response.

 

Posted Thu 18 Sep 14 @ 9:26 am
Looks like to me that since the effect is being loaded by a controller and in another thread, that SendCommand does not work first time with effect_activate, video_fx, or any variation of.
 

Posted Thu 18 Sep 14 @ 1:12 pm
AdionPRO InfinityCTOMember since 2006
Don Moir wrote :
Right. Can this be rerouted to something more sane?

Is it not sane in this era of multi-core cpu's that plugin functions may not be called from the main thread?
It should indeed be mentioned that this is the case in the SDK.

Don Moir wrote :
o - I told you that video_fx does not work the first time when you select with a controller. This happens for any effect. The very first time after running VDJ it displays the video window but not the effect. After this first time it works every time.

This is confirmed and will be fixed.

Here is the response from you so far.

Quote :

Adion wrote :
FPS is not a built-in or bundled effect though.

This is something we already knew. If it was me I would be looking at the source code and problem that someone gave me and not trying to side track the issue. When you can respond to this issue properly I will show you how to cause a crash every time with one of the effects that is a built-in.

It is not side-tracking, I don't have the source code here.

Quote :
Have you time to check it yet? I would have done this before trying to guess.

Yes, I can confirm that there is a problem with the FPS plugin, but cannot say what yet until I have the source.
 

Posted Thu 18 Sep 14 @ 1:15 pm
Since the FPS source was given out to me long ago as a developer as sample VDJ8 code from djcel who works for Atomix, I could only assume that you had it or it is easily available to you.

Is this a sample of what not to do :) It's really should not be FPS that is a problem though. It is probably better for you to take care of this up above since this can created insanity for anyone. Keep in mind FPS works perfectly fine when selected via mouse or keyboard. I had to jump thru hoops to get this good with TM and TV. Thankfully for you most of the effects are so basic it does not effect them but this could crop up at anytime no matter what information you put in the SDK. I am assuming this is bad design on your part for a plugin API. The fact that SendCommand does not always work was also driving me nuts. It actually does go thru because it brings up the video window. But it seems to be lost after that.
 

Posted Thu 18 Sep 14 @ 1:30 pm
Since I have to create another thread for my stuff and communicate back to the vdj load thread so that SendCommand will work first time everytime, right now I am creating a communication window in the load thread so I can communicate SendCommand request back thru that. I don't like doing that and to me the whole thing is fragile. But you could do the same thing from the midi_callback so that request are in the proper thread. I don't know your setup so just a suggestion for something that might be better then what it is now.

Now everything works for me including first video_fx for my own stuff. Still of course video_fx is not going to work for first video_fx from controller but you already confirmed that. Like I said though this is flaky and I don't know what the life of the midi_callback thread is. I am only assuming at the moment it is safe for me to create this com window in the load and then destroy at release. The com window seems to work ok but not knowing about the internals of VDJ it is not a very warm feeling.

I was able to reproduce the video_fx not working right on first call with my own threads, so that is just another confirmation of the problem that is in your hands now.
 

Posted Thu 18 Sep 14 @ 3:25 pm
djcelPRO InfinityModeratorMember since 2004
Don,

I really don't see the link with VirtualDJ8. Your question should have been asked in the plugins area of this forum. If there is a bug in my plugin, I will have a look.

Charles
 

Posted Thu 18 Sep 14 @ 5:58 pm
Charlies, it's not a bug in your plugin as far as I am concerned. It works perfect with mouse or keyboard. It was really the only way for me to point to the fact that the midi callback is broken in VDJ8 or at least it is a bad implementation.

I said it several times that I did not think FPS was at fault. My point here is that anyone trying to do anything a bit more complex is going to run into problems with this. Even after posting about FPS I doubt it has gotten very far. How far do you think it would get if I had nothing to prove it? Just using FPS as an example to show how it easy it is to create a problem with this situation and you guys or at least someone there has the source code for it.

Is this the way it is suppose to go?

1) give out a line of crap and maybe they well go away

2) be silent and maybe they well go away

3) tell them to go somewhere else

4) goto step 1)

All I got initially were guesses because no one took the time to look at it yet, then it was my fault even after saying TM and TV had nothing to do with it, then silence, then I had to waste more time trying to get a proper response. Why is that?
 

Posted Thu 18 Sep 14 @ 6:05 pm
I hope you know that some of the statements made come from frustration. This issue as it relates to TM and TV, goes back months for me. At first I had no idea why it was a problem since I do not have a controller, so it kind of hung around while I was trying to reproduce the issue but could not until I got setup with a midi interface to VDJ. Then I tried some variations of work arounds. These worked but then I see activate does not work on first call to SendCommand and I do not know why. So back to seeing why that is the case and more and more time is adding up. So finally I get confirmation that the activate problem is a bug and will be addressed. I am able to work around this activate problem for my own interface but not happy with it and I see I can relax on the activate issue since it is going to be fixed.

If you add up the time for the 2 problems mentioned above, it has taken me more time then it did to do the initial conversion to VDJ8. Both Charles and myself have been doing this awhile as you may know and I pity the poor soul that comes along and runs into this later on if it stays the way it is. You have said the activate problem will be fixed but that is far less of an issue ( now that I know about it :). The 2 problems are tied together though by way of the midi interface.

The fact that I misspelled 'will' as 'well' above ticks me off, so you can imagine what effect these other issues have on me :)
 

Posted Sat 20 Sep 14 @ 7:28 am


(Old topics and forums are automatically closed)