Total Crash when using Camera - 'Simulator' v2.4 and v2.5

Hello all,
Have a bug to report, cant see it reported before - OR - if it may be an ASCOM only issue even.

This happens in SGP and I’ve also experienced this in late 2.4 builds. As I have my bug head on
I thought it a good Idea to get and report this.

It concerns the Camera Type - ‘Simulator’ and the ‘Show Stars’ checkbox in it’s settings. If ‘Show Stars’
is enabled/checked and you take a ‘frame and focus’ image, SGP crashes (not responding in Win 7 64bit).
All is fine if this ‘Show Stars’ option is disabled though.

Steps to reproduce:

  1. Start up SGP (either a or late 2.4 version build)

  2. In sequencer, select ‘Simulator’ in the Equipment -> Camera dropdown

  3. Click the ‘Device Settings’ icon and check the box for ‘Show Stars’

  4. Connect the Camera

  5. In the ‘Frame and Focus’ module - Click the button ‘Take One’

SGP takes the exposure and goes to the download stage as indicated in the status bar. Also note
that SGP never gets to the end of the Download stage, it just downloads forever. If you then click
the same button, now marked ‘Stop’, the Stop button changes to ‘Aborting’ and gets greyed out, the
status bars message changes to ‘Aborting Image, Please Wait’ and clicking anywhere in the interface
reports SGP as Not Responding and a Task Manager forced stop is the only way out.

Attaching Log for Frame and Focus test:

sg_logfile_20160113162926.txt (20.8 KB)

‘Almost’ the same happens if you run a Simulated sequence using the Simulator camera with ‘Show Stars’ enabled, the EQMOD ASCOM simulator for the mount, a simulator Guide profile in PHD2 using ‘Simulator’ for the camera and ‘On-Camera’.

The difference here though is when the infinite ‘Downloading’ loop happens, clicking ‘Pause Sequence’ in
the Sequence module and selecting ‘Abort’ and run end of sequence actions, SGP changes the pause
button to ‘Aborting’ (greyed out), the status bar continues to show ‘Downloading’ and PHD2 continues to
guide. Not an all out crash here but SGP remains in this semi aborted state permanently.

Here is the log for a simulated Sequence Run:

sg_logfile_20160113163144.txt (100.4 KB)

The two situations above may only be related due to an issue with the ‘Show Stars’ option in the Camera
Simulator but just in case they are actually separate SGP issues I have included both scenario’s and their
logs in this thread, hope you don’t mind guy’s.


I’ve just tried this with SGP and don’t see a problem. I’m using the simulator, with stars enabled, and it is fine.

It may be worth trying the Camera V2 Simulator.

Your log shows a FileNotFound error from the camera simulator:

[13/01/2016 16:42:46] [DEBUG] [Camera Thread] ASCOM Camera : CheckDotNetExceptions CCDSimulator.Camera ImageArray Get System.IO.FileNotFoundException: File not found: unuran-0.6.0.dll (See Inner Exception for details) (System.IO.FileNotFoundException: File not found: unuran-0.6.0.dll)

That file is in the Camera folder “C:\Program Files (x86)\Common Files\ASCOM\Camera”, it has a readme saying that it is used to generate the random numbers when show stars is enabled.

I don’t know why that file is missing, it should be installed as part of the ASCOM platform. A repair or reinstall may help.

It shouldn’t cause other camera drivers to fail.


Cheers Chris for a speedy reply

  1. Tried a repair of ASCOM 6.2 and the same happens with the standard ‘simulator’

  2. Uninstalled ASCOM and downloaded again from the ASCOM site and reinstalled:

Same happened again !

So I have took a snapshot of the folders you have stated so you can see for yourself if everything is in
order based on what is supposed to me in the *Common Files\ASCOM\Camera folder:

This is what is showing in the basic Camera Folder:

And this is what’s showing in the ASCOM.Simulator.Camera sub-folder within:

I see the particular file you mention ‘unuran-0.6.0.dll’ so it is there, is it in the right folder/subfolder ???

I understand I could use the V2 sim but for such a great piece of software, any freeze or crash doesn’t
look good and SGP is by far the best out there. Surely SGP should do something with this missing file
situation baring in mind it’s causing a total crash.

Edit: I copied the SAID file to the ASCOM.Simulator.Camera sub-folder but still the crash

Ow, and thanks for any help you can offer


If all looks fine to you then there is a little issue here if SGP couldn’t find the file

We do what we can, but the number of external issues that can be present at any one time is overwhelming. We can’t have possible covered all of them. Anyhow, I think 2.5 will see a complete restructure of how we handle communication with ASCOM devices. In the past 2 weeks we have seen issues with 2 drivers in which the COM function never returns and SGPro hangs. ASCOM is just a standard, it does not guarantee well behaved code. I think that, whenever we call into ASCOM, SGPro should have an active watchdog present to keep an eye out for this type of behavior. It will take some time to move to this new architecture…

1 Like

I don’t see why the simulator can’t find the unuran file, it’s where I would expect it to be. There’s no obvious reason why CCDSimulator.dll can’t find it - unless there’s another version of CCDSimulator.dll somewhere else which is being run. That would need a careful look in the registry to see how the COM object is registered. It might be some permissions problem.

This is an elderly VB6 component and the fix is the new V2 simulator. It will probably be removed before too long.

SGP can’t be expected to handle the missing file situation, it’s part of the driver. It would be nice if the subsequent recovery attempts worked, not sure why not.


@Ken - Hope you didn’t think me being rude with that statement, it certainly was not meant that way. A watchdog sounds like a good plan

@Chris - Ok Chris so the plot thickens, I’m running Win 7 64bit here with a brand new install of ASCOM 6.2 from your site. Just tried the V2 simulator and exactly the same happens at the download stage in SGP so obviously there is something more at play here and if im experiencing it then so can others, maybe it’s worth thrashing this out until we find the answer. Don’t get rid of the standard Simulator just yet as at least I can use it fine as long as the ‘Show Stars’ option is off.

So just for your ref this is a snapshot of the V2 sim settings I connected it on just in case you see an issue here, tried it with the 'Interface V2 checked and unchecked with the same result :

Further V2 simulator testing & crashing brings us to the ‘Type’ dropdown box as changing all other settings and checkboxes makes no difference to the outcome. As you see in the image I have it set to ‘colour’, turns out if I use any of the other options there like Monochrome etc then SGP always completes the download and displays a nice tight pic of M42 on the screen. So whatever is causing this freeze it’s related to the ‘Color’ option in that dropdown box. Incidentally,
I have changed the resolution in the settings to 800x600 now as M42 appears to fill the frame then, the settings I had in the pic above was just simulating the particulars of my QHY8L.

Any Idea’s on what could be the prob here with the ‘Color’ setting which causes exactly the same issue as before, I know SGP wont debayer anyway so a Color download isn’t really relevant but the option is there.

I’m certainly not shy of routing around in the registry or confirming permissions certain files have granted to them so I can look on my system if you can think of anything particular which could be relevant, just ask.

In a short while I’m going to run SGP using V2 sim in Monochrome, and, run the same with it set to Color which will inc the freeze and load up the SGP logs so you can see the difference…Please Wait !


Here we are again Chris,

Done a search on my C: drive for ‘CCDSimulator.dll’ to see if there is more than one instance

I am showing another instance in a root directory folder called ‘ProgramData’ showing in blue for some reason

See Pic

Could this be relevant ?



Here are the logs I said I’d do using the V2 sim cam with Monochrome and Color Types selected. It was a simple sequence
where the mount sim slews to M42, PHD2 guides and SGP takes images in both tests. Obviously the monochrome one completes successfully and the Color one doesn’t. In the Color option test I used ‘Pause Sequence’ on the Sequence module when Downloading froze and chose abort and run end of sequence actions to park the mount sim. No error messages came up but SGP user interface was almost fully functional. As you’ll see in the log I tried all sorts of things while SG was in this state inc opening an image and playing with it. The only thing that wouldn’t work was ‘Park’ in the telescope module - Forced Stop required.

Monochrome successful Log:
Monochrome_sg_logfile_20160114122530.txt (242.5 KB)

Color failed Log:
Color_sg_logfile_20160114123556.txt (89.0 KB)

Maybe some helpful info in there I don’t know.


The ASCOM specification defines a colour image as having three planes that contain the red,green and blue layers in separate planes.

An Image with a Bayer array is a one plane image with the pixels arranged in the appropriate grid.

Try setting the Image type in the simulator to RGGB or one of the other Bayer arrays. You will need to set the CCD size to 1600 x 1200 to get the full image.

The ASCOM camera specification goes into some detail about this, it is worth reading it if you are interested in the detail of how it works.

I’m not surprised that SGP doesn’t cope with a colour image, I wouldn’t expect it to. It fails in a reasonable way, by posting an error message.


PS the log shows the failure very clearly:

[14/01/2016 12:41:35] [DEBUG] [Camera Thread] ASCOM Camera : Unable to cast object of type ‘System.Int32[,]’ to type ‘System.UInt32[,]’.
at A_0, hl& A_1)

I have the same issue described here. I followed the instructions in the help file exactly but with the “Simulator” camera and “Color” selected the download never finishes. I tried in v2.4 and the 2.5 beta. v2.5 hung at some point - I think when I tried to abort the picture.
Changing to “monochrome” fixed the issue.

In the short term at least, I think it sensible to have a ‘Note’ added in SGP’s user manual stating that if one was to use the V2 simulator then the ‘Color’ Type option should not be used as it ‘MAY’ cause SGP to crash/freeze. Also a note for the standard ‘Simulator’ camera with similar advice with ref to the ‘Show Stars’ possibly causing a problem too.

As long as users are aware, new users especially, then there can be no problem.