kensniper / ispyconnect

Automatically exported from code.google.com/p/ispyconnect
0 stars 0 forks source link

Random frequent app crashes with reference to a null value exception #85

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Running the app alone causes the problems. No specifics as to 
cause-action-result

What version of the product are you using? On what operating system?
running 4.7.7 downloaded from website. Main app box that I would like to run 
this on a Windows 2008 Server x32, however, the same problems exists on a Win7 
box.

Please provide any additional information below.
I am a software dev by profession, so I downloaded the source and have built a 
local debug flavor of the app so I can try to catch the source of the null 
value exception and will update you on that. However, the source seems to be 
missing a few things (perhaps they did not get added to the svn repo?): 
1) downloader.cs file was missing, and I had to therefore comment out all code 
referencing that class. 
2) It also had a strong name build problem when referencing the 
Video.FFMPEG.dll. To that end, I changed the post build command on the 
Video.FFMPEG project to the path of SN on my machine as well as using VS Macros 
in the command string ("c:\my machine path to \sn.exe" -R 
"$(TargetDir)AForge.Video.FFMPEG.dll" "$(ProjectDir)AForge.Video.FFMPEG.snk"
3) Video.FFMPEG was not getting built with any version info. Added version 
resource file and resource.h to resolve.
4) Had to change the post build command on iSpyApplication to "rem call 
"$(SolutionDir)signing\iSpyApplication.bat"" because the signing folder was 
absent in the downloaded svn source.

As a side note: I discovered this project after I had build my own app using 
the AForge projects, and was looking around for some way to "serve" the video 
in a way to view it over the internet when away from home. Given that this 
project is way beyond what I was doing, I decided to give it a whirl. I had 
just a few DLink IP cams, but after a recent breakin, I decided to get a few 
more. The D-ViewCam software is okay for the DLink cams, but I have since 
purchased some outdoor HooToo cams that the D-ViewCam software will not use, so 
need something that is all inclusive. This looks like it will be more than 
sufficient, if I can just solve the app crashes for the null values.

Thanks for the great project and will let you know what I find.

Original issue reported on code.google.com by wade.ano...@gmail.com on 2 Jan 2013 at 5:43

GoogleCodeExporter commented 9 years ago
This is what I have found so far: 
On a camera source (mjpeg) I have added a mic source VLC, if the camera/mic is 
added, then later (either by closing iSpy, and reopening; or by just 
disconnecting the hardware manually - thus simulating a device dc), then the 
following occurs:
An unhandled exception of type 'System.NullReferenceException' occurred in 
Unknown Module. It is occurring somewhere in the vlc libs and debugger cannot 
trace except via assembly.

However, if I "Switch OFF" the source via the iSpy UI before iSpy has a chance 
to add the mic, then the crashes never occur.

To further verify I added to the VolumnLevel.cs in the Enable method the 
following code just to exclude the camera (10.0.1.25) that is no longer 
connected:
    case 2: //VLC listener
            if (!Micobject.settings.sourcename.Contains("10.0.1.25"))
               AudioSource = new VLCStream(Micobject.settings.sourcename) { RecordingFormat = new WaveFormat(sampleRate, bitsPerSample, channels), Arguments = Micobject.settings.vlcargs};
            break;
This again resulted in no crashes occurring.
So, at this point, I think I will add a check into the above to make sure that 
it can actually connect to that ip/port prior to it attempting to create the 
VLCStream. The problem isn't in the VLCStream creation, as you can trace thru 
all of VLCStream and even through all of the Enable method and you don't get an 
error. More likely is somewhere in all of the events that are added. Given that 
the events really don't need to fire if the source isn't valid, no point in 
adding them, thus no point in creating the stream.
Also, given the source of the crash, it very well may be the source of 
previously noted issues describing random crashes. Given that most audio 
sources will be the vlc audio feeds, and you set up "reconnect" refreshes for 
vlc sources, I can see that every once in a while that something would cause a 
problem connecting and therefore resulting in the app crashing (via the null 
reference exception in a vlc lib).

Original comment by wade.ano...@gmail.com on 2 Jan 2013 at 11:01

GoogleCodeExporter commented 9 years ago
Crashes occurring due to System.NullReferenceException are still manifesting. 
They are not as frequent, still in an "unknown" module. No further info is 
avail at this time. Suspect I need to make similar changes to the iSpyServer 
code, but don't know if an error in that process would cause the iSpy process 
to crash.

FYI, the opacity settings on the notification bar are nice, but perhaps it 
should be a submenu selection ie) Set Opacity -> 10%|30%|50%|70%|90%|100% that 
way there are some more options besides 10,30, and 100 In addition, setting the 
Opacity only effects the main window and not the PTZ window, which it should. 
Would also like to see the PTZ window become a dockable window and not 
something outside the main window.

Original comment by wade.ano...@gmail.com on 3 Jan 2013 at 4:08

GoogleCodeExporter commented 9 years ago
Decided to add the connection check directly to the VLCStream classes (audio 
and video) and implement the check in the class's Start() method. This should 
hopefully catch any possibility that would arise and not just that which I knew 
of originating from the VolumeLevel class being enabled. Don't know enough 
about the code yet to say if this could be a performance issue though if the 
hamster keeps trying to turn the wheel and "start" the VLCStream repeatedly 
because it is not started. I would tend to think that this "repeat start" 
scenario would only occur in those instances where you have defined a camera, 
and it is intentionally left offline, but not put into a state of "switched 
off" in the UI. Will let this run throughout the day and see if any further 
NullReferenceExceptions are thrown.

Original comment by wade.ano...@gmail.com on 3 Jan 2013 at 5:27

GoogleCodeExporter commented 9 years ago
After moving the connection test to the VLCStream class as stated above, there 
have been zero (0) crashes in the last 24yrs of continuous running.

Original comment by wade.ano...@gmail.com on 4 Jan 2013 at 2:55

GoogleCodeExporter commented 9 years ago
1) Added Opacity settings for 50,70,& 90, changing opacity now changes opacity 
of the ptztool form. 
2) Added Preset buttons to the PTZTool, these buttons are dynamically added 
based upon the presets available in the controls the same as they are added to 
the dropdown combo box. The ptztool form is then resized according to the 
number of rows of buttons added.

The only thing left that is bothering my slightly is the command buttons at the 
bottom of the iSpy main form should be all the same size so that when the sizer 
is moved, the rows are uniform and the buttons align. Color scheme of the 
buttons are a little wrong too, grey/black buttons on a grey background, with 
black text...just too darkish.

Original comment by wade.ano...@gmail.com on 4 Jan 2013 at 8:14

GoogleCodeExporter commented 9 years ago
Hey Wade, sorry for the delay in responding - could you share your code changes?

Original comment by ad...@developerinabox.com on 14 Feb 2013 at 1:27