Cameras & sensorsTroubleshooting

Gain Auto Off camera disconnects: exclusive access first

Why switching Gain Auto to Off disconnects the camera viewer, why Continuous caps frame rate, and the single-client, reset-first order that fixes it.

LumaSpec Vision11 min read Share on LinkedIn

On this page 9 sections
  1. 01Why is my frame rate capped below the camera's rated maximum?
  2. 02Why does the camera disconnect when Gain Auto goes to Off?
  3. 03How do you check that only one application has the camera open?
  4. 04What does a factory reset clear, and when do you need one?
  5. 05In what order should you set Gain Auto after the reset?
  6. 06How do you keep the fixed settings after a power cycle?
  7. 07When is it firmware, and what do you report?
  8. 08What should the next station do differently?
  9. 09Questions

You configure a machine vision camera in a viewer, the frame rate sits far below the figure on the data sheet, and the moment you switch Gain Auto to Off the viewer drops the camera. This is an access-and-settings fault, not a broken sensor, and it has a short, testable decision path. This guide walks that path in the order you meet it: find what caps the frame rate, make one application own the camera, run the factory reset, set Gain Auto first, then save the result so it survives power cycles. Every check uses controls already in the viewer, and the worked numbers come from a USB3 case where a 526 fps camera would not pass 200 fps.

Why is my frame rate capped below the camera's rated maximum?

An auto function left in Continuous caps the frame rate because the camera recomputes image statistics on every frame; in one USB3 support case a 526 fps camera would not pass 200 fps until Gain Auto left Continuous.

The rated figure is a sensor-and-readout number. Auto functions — Gain Auto, the exposure auto function, the white-balance auto function on color cameras — run a statistics pass on every frame they regulate, and when the imaging pipeline cannot hide that pass, the pass becomes the ceiling. The sensor idles while the loop counts.

The second ceiling is exposure. A frame cannot end before its integration ends, so a long exposure holds the frame period open. Separate the two with frame-period arithmetic:

frame period = 1 / frame rate frame rate ceiling from exposure = 1 / exposure time time lost per frame = (1 / measured rate) - (1 / rated rate)

Worked example — a 526 fps camera stuck at 200 fps.

  • Rated frame period: 1 / 526 fps = 1.90 ms.
  • Measured frame period: 1 / 200 fps = 5.00 ms.
  • Time lost per frame: 5.00 ms - 1.90 ms = 3.10 ms.
  • Read the exposure time. At 5.00 ms, exposure alone explains the cap; set it to 1.00 ms and the exposure ceiling moves to 1 / 1.00 ms = 1000 fps, above what the sensor delivers.
  • If exposure already reads near 1.90 ms, the consumer left is the auto loop: switch Gain Auto from Continuous to Off and re-read the rate. In the case behind these numbers, only that change recovered full speed.

Change one thing, measure, change the next; two changes at once hide which one moved the number. On color cameras the loop regulates from a subset of pixels — which pixels count for auto exposure and gain covers the detail — and if you pull brightness back with the iris, auto exposure versus iris control explains which of the two the camera actually sets.

Why does the camera disconnect when Gain Auto goes to Off?

The disconnect is not the setting itself: writing Gain Auto is an exclusive control operation, and when a second application holds the camera, or a stale saved configuration answers the write, the viewer's session times out and drops.

Writing an auto-function mode is not a passive change like moving a display overlay. The write crosses the control channel, stops a loop the camera is running, and can restart the imaging pipeline mid-stream. Two conditions turn that into a lost device:

  • A second client. Another application holds the control interface, the write fails or times out, and the viewer reports the camera as gone. A USB3 device answers one process; a GigE Vision camera accepts one control channel even when several receivers watch the image stream.
  • A stale saved configuration. A user set saved in an earlier session re-applies its auto state at power-up. Camera and viewer then disagree about the current mode, and the session dies at the first conflicting write.

Work the table top to bottom — it is ordered by how often each cause shows up:

Likelihood Cause Signature Quick test Fix
First Second client holds the camera Drop occurs only on a settings write Close every client, reopen one One application at a time
Second Stale saved user set Drop returns after each power cycle Factory reset, then Gain Auto first Rebuild and re-save the user set
Third Firmware fault Drop survives both fixes on one unit Repeat on a second unit, same model Update from the maker, then report

The quieter sibling of this fault is gain settings that do not apply until auto gain is off first; here the session dies outright. And if the camera drops with no setting change at all, the fault is on the link — run the bus-level disconnect checks before touching firmware.

How do you check that only one application has the camera open?

Open the camera from one application only: the host grants a USB3 device to a single process, and a GigE Vision camera accepts one control channel at a time, so a second client is enough to break a settings write.

  1. Close every viewer, acquisition program, SDK example and robot-vision node on the host. Background services count as clients.
  2. Check the running-process list for anything that still holds a camera handle or a device provider.
  3. Power-cycle the camera — unplug and replug, or cycle the port — so the host releases any handle left behind.
  4. Open one application, connect, and switch Gain Auto to Off.

In support cases matching this pattern, the first request is exactly this: close the other applications, keep the one viewer connected. It does not always clear the fault — one reported case closed every client and the drop persisted, which moves suspicion from access to configuration and firmware. That is progress, not failure: each test that does not fix it removes a cause. The single-client rule also bites from the software side, as a camera that works in the vendor tool but not in ROS shows.

What does a factory reset clear, and when do you need one?

A factory reset returns every user-controllable feature to its shipped default, including the saved user sets, so a configuration that fights your writes disappears in one action; it is the way out when closing clients does not stop the crash.

The factory reset control sits in the camera's control tree, grouped with the user-set controls. Executing it restores gain, exposure, auto modes and trigger configuration to the defaults the camera shipped with, and clears the user sets you saved. Factory-set data such as defect-pixel tables is written at manufacture, not in a user set, so the reset leaves it alone.

The point is not the defaults; it is a known starting state. When a saved user set is what fights the write, the reset removes it cleanly and the camera comes back enumerated fresh.

  • Note the gain, exposure and trigger values you want to keep — they return to defaults.
  • Execute the factory reset control and let the camera drop off the bus and return.
  • Do not reload a saved user set. Stay in the default state and go straight to the setting order.

In what order should you set Gain Auto after the reset?

After the factory reset, change Gain Auto before anything else, then switch the other auto functions off, then write your gain and exposure values, then read every value back before saving the result to a user set.

The order exists because most cameras lock the manual gain value while the auto function runs in Continuous; off first, values second, is the only order in which your numbers survive.

  1. Connect with one application and let the camera stream.
  2. Set Gain Auto to Off — the first change you make, ahead of gain, exposure, trigger and any user set.
  3. Set the exposure auto function to Off, and the white-balance auto function on a color camera.
  4. Write your gain value, then your exposure time.
  5. Read every value back from the camera; what the camera reports is what it holds. Camera startup frame rate: verify saved settings and readback builds that habit into code.
  6. Run at your target frame rate and confirm the cap is gone.
  7. Save the state to the camera's startup user set.

A write that comes back refused usually has a mode above it in the tree — setting the feature mode before the attribute covers that pattern.

How do you keep the fixed settings after a power cycle?

Save the working state into the camera's startup user set and read the values back at every open: a camera that boots with the auto functions off never spends its boot renegotiating them, and the frame rate cap cannot return unnoticed.

Two habits complete the fix:

With both habits in place, a power cycle returns the station to the state you commissioned, at the frame rate you measured.

When is it firmware, and what do you report?

Treat it as firmware when the crash survives the single-client test, the factory reset and the ordered pass on one camera, but not on a second unit of the same model — that comparison isolates the camera's own software from everything around it.

Firmware is the last explanation because the first two causes cover nearly every case. The comparison costs you nothing: same viewer, same host, second unit. If the second unit takes the setting without dropping, the first camera's firmware is the difference; update it with files for the exact model, from the manufacturer only.

When you escalate, send six things: the camera model, the firmware version, the viewer version, the feature you changed, its value before and after, and the error text at the moment of the drop. That is the list support teams ask for, and one complete ticket closes in one pass. If the camera came from us, the contact page starts it with our applications team on the other end.

What should the next station do differently?

Lock the station to one client, one saved user set and the auto functions off: that combination removes both the disconnect and the frame rate cap, and it takes about ten minutes on the bench before deployment.

  • One client from day one: the acquisition program is the only thing that opens the camera, and the viewer comes out only when the line is down.
  • Auto functions off at commissioning, before any frame is judged.
  • Manual gain and exposure written after the auto modes, then read back.
  • The working state saved to the camera's startup user set, so a power cycle restores it without the host.
  • Frame rate measured against the rated figure with the frame-period arithmetic above.
  • Firmware version recorded in the station log, updated only from the manufacturer.

The decision, in one line: one client, autos off, reset when a saved set fights you, firmware only when a second unit stays stable. The controls sit in the same tree on every GenICam camera in area scan cameras — the ordered pass is identical on a USB3 workhorse and on its GigE sibling. For a station built from scratch, start among these:

Area scan camerasHikrobot MV-CT0MU0060/R/NN/NN 6 MP Area Scan Camera, 3rd Gen., USB3.0, Mono, BASEMV-CT0MU0060/R/NN/NN
Sensor format
1/1.8"
Lens mount
C-mount
$969.00View part
Area scan cameras12 MP USB3 area scan camera, IMX226, 1/1.7" rolling shutter, 30 fps, 4000 × 3000 resolution (LS-CMR-0166)LS-CMR-0166
Sensor format
1/1.7"
Interface
USB3
$560.00View part
Area scan camerasHikrobot MV-CT0MG0060/R/NN/NN 6 MP Area Scan Camera, 3rd Gen., GigE, Mono, BASEMV-CT0MG0060/R/NN/NN
Sensor format
1/1.8"
Lens mount
C-mount
$909.00View part

Filter the camera finder by interface, resolution and shutter for your station, or start the camera step of the system configurator to pick camera, lens, light and controller end to end. More camera set-up pieces sit under the cameras topic.

Build the whole station

The configurator matches a camera, lens, light, light controller and cables to each other, step by step, and lists only parts that fit what you already picked.

Start with the camera

Questions

Does switching Gain Auto to Off change the gain value too?

No. Off stops the automatic adjustment; the last value the loop computed stays in place until you write a new one. Write your target gain immediately after the switch, because a value settled by the loop can sit far from where your application needs it, then read the value back to confirm the camera accepted it.

Can two applications share one camera if only one writes settings?

Not over USB3: the host grants the whole device to a single process, so a second application cannot even watch. On GigE Vision the control channel has one owner at a time, although the image stream can be multicast to several receivers. A viewer left open next to the acquisition program is the classic cause of a settings write ending in a dropped camera.

Does a factory reset delete the sensor defect correction?

No. A factory reset restores user-controllable features — gain, exposure, auto modes, trigger configuration — to their shipped defaults and clears the user sets you saved. Factory-set data such as defect-pixel correction is written at manufacture, not in a user setting, so it survives the reset. Note your own values first; you will re-enter them in the ordered pass.

Why did the frame rate cap disappear on a different host?

Because the cap had two possible owners. A cap that follows the camera to every host is internal — auto-statistics processing or exposure time — and the setting change fixes it. A cap that appears on one host only points at the link: a USB3 port that negotiated a slower mode, or a driver conflict on that machine. Swap the camera between two hosts once, and the owner becomes obvious.

Is the run-once auto mode a good compromise?

Often, yes. The middle mode runs the loop until the gain settles, then stops; after settling the camera runs at full speed and the value stays put. Use it at commissioning to find a sane starting gain under real lighting, then switch to Off, write the settled value as a fixed number, and save it in the startup user set.