Sharpcap freezes and hangs (occasionally) on Start Capture

Discussions, Bug Reports and Issues related to Beta versions of SharpCap
Post Reply
mfs4n
Posts: 16
Joined: Thu Mar 09, 2023 11:25 pm

Sharpcap freezes and hangs (occasionally) on Start Capture

#1

Post by mfs4n »

About 1-2% of the time, while running a sequence, the sequencer will issue a "CAPTURE XXX LIVE FRAMES" and nothing will happen. The screen, which was running in live view mode, will continue to show the last live view image acquired. Nothing will happen for the rest of the night. I can still "stop" the sequence. The top bar menus remain active, but when I issue a "close camera" Sharpcap hangs hard and windows presents the option to wait or close sharpcap. The CAPTURE command does not create a capture file at the time of issue, but an empty capture file appears when either the sequence is stopped or the close camera command is issued, I'm not sure which. The camera is an ZWO ASI432 monochrome. I've attached the log file and the sequence.

Thanks,
Mike.
Attachments
Auto432x0607.scs
(10.81 KiB) Downloaded 12 times
log.zip
(97.23 KiB) Downloaded 15 times
User avatar
admin
Site Admin
Posts: 13923
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Sharpcap freezes and hangs (occasionally) on Start Capture

#2

Post by admin »

Hi Mike,

thanks for posting the logs - helps a log ;)

From the log, I can see that at the point that the sequence stops running, you start to accumulate lots of lost frames - basically the ZWO sdk stops sending frames to SharpCap. If you look in the left hand bottom corner when this is happening, you will see the 'dropped frame' count rising. Then, when you try to close, SharpCap gets stuck asking the ZWO SDK to shutdown the camera - basically SharpCap sends the request and the ZWO SDK never finishes processing it.

Adding that all together, it sounds as though the camera/computer USB connection has failed at the time when the images stop arriving, and everything is basically 'dead man walking' from that point on. The fix for this will most likely involve either USB cabling issues (not too long, good quality, etc) or reducing the 'Turbo USB' setting of the camera to increase stability. There are more detailed steps about the things to try here : viewtopic.php?f=18&t=349&p=1556#p1556

Hope this helps,

Robin
mfs4n
Posts: 16
Joined: Thu Mar 09, 2023 11:25 pm

Re: Sharpcap freezes and hangs (occasionally) on Start Capture

#3

Post by mfs4n »

Thanks for the great advice.

One additional piece of information, on that night I closed Sharpcap (well, told windows to kill it) and then restarted Sharpcap (no reboot of the computer) and everything was fine. I would have guessed that if the USB hardware port is the issue I wouldn't have been able to find or start the camera, but that was not the case.

My TurboUSB was set to AUTO. I now have it fixed at 40, which still runs fast enough for my most rapid framerates.

Mike.
User avatar
admin
Site Admin
Posts: 13923
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Sharpcap freezes and hangs (occasionally) on Start Capture

#4

Post by admin »

Hi Mike,

yes, the thing with these cameras is that the identification of the camera and simple commands to set camera settings don't take much data, so they can run quite happily over a slightly dodgy USB link. Moving frame data that is many megabytes per frame finds all the instabilities in the USB that the other small data transfers don't notice...

Hopefully the lower turbo USB will help - 40 will be quite fine for long exposure work :)

cheers,

Robin
mfs4n
Posts: 16
Joined: Thu Mar 09, 2023 11:25 pm

Re: Sharpcap freezes and hangs (occasionally) on Start Capture

#5

Post by mfs4n »

Turns out the lower Turbo setting makes things worse, freezes happen much more frequently. Lots of testing underway. I'm trying another computer next. It could very well be that the problem is on the camera end, so it's ultimately either going to be a new camera or a new comptuer.

One curiosity, in between data collection the camera will run in live view mode, so transferring lots of megabytes, but never seems to freeze there. It's only at Start Capture that it hangs up. Also, instead of seeing incrementing dropped frames I just see 1 dropped frame, unchanging when it hangs up on Start Capture.

I'm also now getting a popup message when I try to shut down Sharpcap - An error occurred: ZWO camera failed to close down on request. Please restart SharpCap. You may have to unplug...camera. I wasn't seeing that before.



Thanks,
Mike.
User avatar
admin
Site Admin
Posts: 13923
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Sharpcap freezes and hangs (occasionally) on Start Capture

#6

Post by admin »

Hi Mike,

something is not happy at all :( - I would also recommend testing with different USB cables and a minimum cable length (no extensions etc) to see if that helps. Also, try going back to original settings to see if that takes the performance back to original levels (then you have identified cause and effect most likely). If putting the Turbo USB back doesn't help then maybe the TurboUSB change is not the cause of the current, worsening problems.

The closedown message is another timeout from the ZWO software library that SharpCap uses - SharpCap sends a request to close the camera and will give you that message if the request hasn't completed within 10 seconds or so. In normal operation, the closedown is very quick, so a 10+ second delay is a sign that something is wrong.

I don't quite understand the connection between starting capture and the problem happening - in theory they shouldn't be linked. Looking back at your log in the first post, I can see the first logging of ZWO timeouts being 8 frames lost at ~05:39:41. Each ZWO frame will timeout in 5s + 2* exposure (for short exposures), so with 0.2s exposures to get 8 timeouts would require 43.2s, meaning that the frames would probably have started timing out at about 05:38:58 or so - that's before the start capture from the sequencer at 05:39:07, meaning that the camera had probably frozen before capture started, although that's not 100% proven.

Do feel free to post more logs from futher testing.

cheers,

Robin
mfs4n
Posts: 16
Joined: Thu Mar 09, 2023 11:25 pm

Re: Sharpcap freezes and hangs (occasionally) on Start Capture

#7

Post by mfs4n »

Here's a summary of the troubleshooting so far (spoiler - I have a fix that provides reliable operation, but is kludgy). And yes, going back to larger values of Turbo USB extended the time to typical hangup.

For testing I made a number of changes, which in the end just led to the same behavior

- Updated ZWO camera driver
- Switched USB-3 cable to the one provided with the ZWO camera originally
- Tried different USB ports on the PC
- Saved data to the primary SSD on the computer (I had added a SATA SSD for space and had been saving to D: instead of C: - I was hoping that might be the smoking gun since the hangups are associated with the start of writing to disk, but no luck)

Setting USB Turbo to 40 was quite useful, because it would always only take about a dozen Start Capture sets or fewer to get a hangup, so quick diagnostics. Needless to say, none of these things made a difference.

I ran the same test sequence (which captures 20 frames about twice every minute) with the same camera on a Ryzen5 laptop I use for mobile observations and could not get it to hang up - so relief that, maybe, it's not the fault of the camera itself.

So, this all tends to point to either a problem with the USB controller on my i5-based main computer, or some weird interaction of Windows 11, the controller and potentially other processes running on the machine due to, well, Windows, on that particular hardware that might lead to some resource hang up.

Now for the band-aid. It was always the case that the hangups do not occur until several cycles of Start Capture have passed, even with Turbo USB set to 40. So I added sequencer lines to Close and then immediately Open the camera just before data collection. That seems to do the trick. I was running for more than an hour (as opposed to the 5 minutes or so to hangup) at Turbo USB of 40 and ran a full night of observations last night with no hangup.

I will likely still replace the computer, but at least I have less worry about losing a night of data because of a hangup.

I'm happy to post any associated logs, but my impression is that the all look the same.

Thanks for all of the suggestions,
Mike.
User avatar
admin
Site Admin
Posts: 13923
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Sharpcap freezes and hangs (occasionally) on Start Capture

#8

Post by admin »

Hi Mike,

good to hear that you have a workaround for now - I think you are right in concluding that something odd is going on at a level below SharpCap's knowledge and that the logs will not really reveal anything new. This seems like something that would need to be fixed by an update from ZWO either in their SDK or driver, or - as you suggest - by trying a different PC.

I did just check and I found that ZWO released a new SDK update towards the end of May that I haven't picked up yet. No change log saying what is updated in the SDK (I suspect mostly new model support). I will be adding this to the next SharpCap update next Monday, so it would be worth trying that update just in case they have resolved this issue.

cheers,

Robin
cardanoc
Posts: 12
Joined: Sat Aug 04, 2018 2:33 pm

Re: Sharpcap freezes and hangs (occasionally) on Start Capture

#9

Post by cardanoc »

Hello,

I found this happening to me. It always happens when I connect all of my equipment to a portable power supply. When I use an extension cord from my house, it NEVER happens.

It all had to do with the grounding. Portable power supplies are internally grounded. They are not truly grounded. Any interference in the cables does not go away.

Good Luck

Conrad Cardano
Dye Hill Observatory
User avatar
admin
Site Admin
Posts: 13923
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Sharpcap freezes and hangs (occasionally) on Start Capture

#10

Post by admin »

Hi,

thanks for sharing - not a solution I would have thought of myself! Still, this hobby is weird - I had a camera that showed horrible horizontal banding when running from a desktop PC, but not on a laptop running from battery - turned out to be noise in the USB supply voltage to the camera affecting the image, and the laptop had a much smoother voltage on battery than the desktop PC :)

cheers,

Robin
Post Reply