r/ReverseEngineering • • 6d ago

Reverse-engineering a 4K HDMI/USB microscope camera (SigmaStar SSC8836, GC8613): its "60 fps" was 30 fps with every frame repeated, so I wrote a new sensor driver and then a whole open firmware

https://github.com/apnix/openmicrocam
389 Upvotes

22 comments sorted by

5

u/Scale0 5d ago

Interesting project, I have a different 4k yizhan camera (black one). I'll attempt to dump the firmware always been curious about their claims on fps

2

u/Scale0 5d ago

Interesting things so far, the boot log does mention that this a IMX678 (which is as advertised).
But it's the exact same board as your (same date even). Telnet was closed and the card dump method also failed, it looks like the card method requires a 'sd_version.txt' to be present. But I was able to dump over serial.

2

u/Present-Calendar-978 5d ago

Judging by your description, yours is the XH3011, with a more advanced sensor. My firmware won't run with the IMX678 driver as it is, but if everything apart from the sensor matches, adapting it is quite realistic.

If you have time, share the dump and the boot log: as a link here or in an issue on GitHub. I'll take a look, and if it turns out not to be too hard, I'll write here what needs to be changed.

1

u/Scale0 5d ago

I was able to push 4k54 fps but the USB 2.0 can't handle that much data.
Been trying to get 2k60 but the IMX678 only has 2x2 binning which drops the 4k to 1080p.

And the image processor can't read the whole sensor at 60fps, so I have been looking at a 1440p 60 fps crop mode (only read the center of the sensor). You lose field of view but gain the frames.

As for temperatures as somebody asked it is stable at 70 degrees.

2

u/Present-Calendar-978 5d ago

Nice progress, thanks for sharing the details!

In my tests I got 4K up to 47 fps, after that it hits the ISP limit (the realtime sensor β†’ ISP path, about 9.5 Β΅s per 4K line). Raising the ISP clock from 432 to 480 MHz didn't change anything. Since I couldn't make the line any shorter, I added a few modes with non-standard aspect ratios, for example 3840x1600: fewer lines per frame, and that brings the frame rate up to 60.

With USB it's like this: the ceiling is around 23 MB/s (isochronous). So MJPEG 4K at 45 fps only fits up to roughly 500 KB per frame (JPEG quality ~20), anything heavier and the frame rate drops. H.264/H.265 are tiny on the wire, but there the hardware encoder itself tops out at about 36 fps in 4K.

If you actually got 54 fps out of the camera, not just set on the sensor, then either your chip is different from mine, or my 47 fps limit comes from how my sensor feeds the ISP rather than the ISP itself. Either way my 4K numbers don't fully apply to your camera because of the different sensor, and maybe a different chip too.

2

u/Scale0 4d ago

It's the same chip only the sensor differs, the sensor does have a slightly faster line speed. Increasing the ISP was needed to reach 54 fps but that's measured on device, because it won't transmit over usb 2.0 anyway. So I ended up going 4k48 which still is 50% faster then stock and the real 60 real frames is also very nice.

I forked your project in case you want to check it out: https://github.com/Scalee/openmicrocam

Thanks for upgrading my microscope πŸ‘

1

u/Scale0 5d ago

Already working on it, i'll keep you updated how it goes.

24

u/OnlineParacosm 6d ago

I needed an ironclad reason to assume that these cameras were not dog shit and I think you just gave it to me.

Do you see it makes an actual difference when you’re looking at components under the microscope? Any other benefits for your workflows?

Notice any overheating?

18

u/Present-Calendar-978 5d ago

There is a difference from the real 60 fps: the picture is nicer to look at when you inspect a board; while soldering it matters less.

But the frame rate was only one part of the work on latency, and latency was what actually got in the way on the stock firmware. 4K over USB lagged by about 385 ms, which was really annoying; now it's about 138 ms. HDMI was acceptable even on stock, but it got faster too: from 141 to 113 ms. These are glass-to-glass numbers, laptop and monitor included, so they will be different on another setup. But both were measured on the same setup, so the difference between them is the difference between the firmwares.

The second thing that got in the way on stock was the picture in motion: fine texture got smeared, and a halo of blocky noise appeared around moving objects. That's how its noise reduction is configured.

Beyond that, simultaneous output to HDMI and USB comes in handy. Probably not everyone needs it, but for me it's a frequent use case.

I haven't noticed any serious heating: the camera is warm to the touch but not hot, even after running for several days in a row.

7

u/OnlineParacosm 5d ago

Incredible work. These are major workflow improvements

2

u/raceking37 4d ago edited 4d ago

Awesome! I was actually working on exactly the same thing!! 😁. I made some progress and was able to achieve 60fps with compromises (1080p with crop). 

I'm curious what your project will be like, will check it out soon! (I was able to get doom running on it πŸ™ƒ)

1

u/Present-Calendar-978 4d ago

Oh, I think I actually saw your Doom video on YouTube! Stumbled on it back when I was digging for info on this camera. Such a fun hack πŸ˜„

1

u/raceking37 4d ago

I tried your FW, it's honestly truly amazing! It's such a big difference wtf🀯, I'm impressed! I was initially pretty disappointed by this camera purchase but with this I'm really not sure if you can find anything that is significantly better lol. It's so smooth now, and the image quality is also a lot better. The extra features like being able to also see your recordings on the SD-Card, and use the HDMI and USB at the same time are also super nice.

Thanks so much man! If there is anything you need help with, let me know! (I see you're adding translations, can help with Dutch if you need πŸ˜‰).

1

u/Present-Calendar-978 3d ago

Thanks, glad you like it! I do the translations with AI, and I'll add Dutch soon. If you could look through it and send me anything you'd translate differently, here or on GitHub, I'll fix it.

1

u/raceking37 3d ago

πŸ‘I already sent you a PR to add the Dutch translations :)

1

u/Present-Calendar-978 3d ago

Merged, thanks! Dutch is in main now.

49

u/BullableGull 6d ago

Weird timing as I was just browsing AliExpress for a cheap video out microscope lmao

14

u/NiteKore080 6d ago

me too... the algorithm is working as intended

1

u/y8llow 4d ago

I always wanted to buy one, is this actually a good microscope camera judged by price to performance ratio?

Or is there a cheaper one with near the same quality/performance, or minimal more expensive with is much better.

2

u/Present-Calendar-978 3d ago

I doubt many people have several of these cameras to compare side by side, and I only have this one πŸ˜„ But here is how the market looked when I was shopping for mine. 1080p cameras cost about a third less than this one. 4K cameras like this one are the middle tier. Cameras with the IMX678 are in the same tier, just a bit pricier. That sensor is bigger and should be better, at least on paper. Then there's a price gap, and the next tier up costs about twice as much. I didn't really look into that one.

One thing about the middle tier: listings usually say IMX415, but some, like mine, actually have the GC8613 inside, a Chinese alternative. You can tell by the sensor size in the specs: 1/2.8 means IMX415, 1/2.7 means GC8613.

And if by performance you mean magnification, that's all down to the lens, not the camera.

1

u/mih721 2d ago

I just inspected my XHU4011 firmware I got from aliexpress recently. Advertised with a Sony IMX415. firmware shows the same GalaxyCore GC8613.