Skip to main content
HelpCamera not found and other errors

This page lists the messages people meet when a computer controls a camera over USB, with the cause and the fix for each, and what Darkgrade does about it. Find the words you see. The first six are about the connection itself and apply to any software that speaks PTP, the camera's protocol; the rest are Darkgrade's own messages, by product.

Most of them come down to one rule: only one program can hold a camera's USB connection at a time.

Could not claim the USB device

Another program already holds the camera, so yours cannot open it. On a Mac that program is almost always macOS itself.

The messages. Could not claim the USB device is how gphoto2 words it. Its whole message on Linux, wrapped here to fit, is:

An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Device or resource busy).
Make sure no other program (gvfs-gphoto2-volume-monitor) or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.

On a Mac the program it names is MacOS PTPCamera service. With Darkgrade's CLI and Slate the same failure is an access or busy error from the USB library, which names LIBUSB_ERROR_ACCESS or LIBUSB_ERROR_BUSY. In Studio the camera pill stays at No camera.

The cause on a Mac. macOS starts its own camera service the moment a camera is plugged in: ptpcamerad on current versions, PTPCamera on older ones, and mscamerad for a camera in mass-storage mode. The service claims the camera's USB interface before any other program can. Photos and Image Capture use that service, so either of them opening by itself when you plug in is the same cause. macOS restarts the service whenever it is stopped, so stopping it once is not enough for a program that keeps the camera.

The cause on any computer. A second program has the camera: the maker's own utility (Canon's EOS Utility, Nikon's NX Tether, Sony's Imaging Edge), another tethering app, a sync app that imports photos, or a second Darkgrade product. Quit it, then unplug the camera and plug it back in.

The fix, by product:

You useWhat to do
StudioNothing. Studio stops the Mac's camera service for as long as it is open. If Photos or Image Capture opened, quit it and replug the camera. See macOS takes the camera.
MCPServed by Studio or by darkgrade mcp: nothing, both stop the service while they hold the camera. Served by your own server: do as for Slate.
CLIThe darkgrade camera commands do not stop the service. Stop it, then run your command straight away. See If a ready camera will not open.
SlateStop the service from your code about once a second with killMacCameraDaemons() for as long as you use the camera. See Prepare your computer.

For the CLI or a one-off script on a Mac, this is the whole fix:

killall -9 ptpcamerad PTPCamera mscamerad 2> /dev/null
npx darkgrade camera get-info

The cause on Linux

gphoto2's message names both Linux causes: another program is using the device, or you lack read/write access to it.

  • The desktop's volume monitor holds the camera. GNOME and other desktops that use GVfs open a camera when it is plugged in so that it shows in the file manager. The programs are gvfs-gphoto2-volume-monitor and gvfsd-gphoto2, and for a camera in MTP mode gvfs-mtp-volume-monitor and gvfsd-mtp. Unmount the camera in the file manager (its eject button), or stop those programs, then unplug the camera and plug it back in. Darkgrade does not stop them for you on Linux: killMacCameraDaemons() and the products that call it act on a Mac only.
  • Your user may not open the camera's USB device. A udev rule for the camera maker's USB vendor ID grants it: see Linux: USB permission.

With Darkgrade's CLI and Slate, either case is an access or busy error from the USB library.

PTP Timeout and PTP I/O Error

PTP Timeout and PTP I/O Error are gphoto2's words for a camera that did not answer in time and for a USB transfer that failed. They are about the link, not about a setting: check the cable, that the camera is on and awake and in the right USB mode, and that no other program has it. Sony camera not detected and Canon or Nikon camera not detected list the causes by brand.

PTP Device Busy (0x2019)

The camera answered DeviceBusy, response code 0x2019: it received the command, did not carry it out, and wants it sent again later. Nothing is wrong with the cable or the connection.

The cause. The camera is in the middle of something else, such as writing to its card, and cannot take the command yet.

What Darkgrade does. Slate sends the command again by itself: up to 6 more times, waiting 50 ms and then twice as long each time, for at most 2 seconds in all. Studio, MCP and the CLI inherit this. You see the error only when the camera is still busy after that.

The fix. Wait a moment for the camera to finish, then repeat the command. A busy answer means the command was not carried out, so repeating it is safe. In Slate, transactionPolicy sets how many times and for how long a busy camera is tried again.

Session already open (0x201E)

The camera answered SessionAlreadyOpen, response code 0x201E, to a request to open a session. A camera serves one controller at a time, and it still has a session open.

The cause. Usually an earlier program crashed or was killed without closing its session, and the camera has not noticed. Less often, another program is really using the camera.

What Darkgrade does. When connect() meets this answer, Slate closes the stale session and opens a new one, so in Studio, MCP, the CLI and Slate you normally never see it. If the camera refuses the close as well, the error reads CloseSession failed with the camera's code.

The fix. Quit any other program that uses the camera. If none is running, switch the camera off and on, or unplug it and plug it back in: both end every session. From code, recover() tries a fresh session, then a device reset, then a USB port reset. Sessions explains what a session is.

Sony: authentication failed (0xA101)

A Sony camera answered AuthenticationFailed, response code 0xA101, during the handshake that turns on remote control. Sony describes the code this way: the host announced a major protocol version lower than the camera's, or authentication failed for another reason.

The cause. A Sony does not accept settings or the shutter straight after the session opens. The computer first runs Sony's handshake, SDIO_Connect in three phases, and announces the protocol version it speaks. A camera that does not accept that version answers 0xA101.

What Darkgrade does. Slate announces version 3.00, and if the camera refuses, runs the handshake again announcing 2.00, the version older bodies speak. Only when both are refused does connect() fail, with a message that names both versions and the camera's code for each: Sony extended device information refused initiator versions 3.00 (0xa101) and 2.00 (0xa101). A refusal in one of the three phases instead starts Sony authentication phase 1, 2 or 3, followed by returned and the camera's response.

The fix. Unplug the camera, plug it back in and connect again, so the handshake starts clean. If it fails the same way, tell us the model and its firmware version, and include the message.

Sony camera not detected: set USB to PC Remote

A Sony is plugged in and switched on, but the computer sees a card reader or nothing to control. In the CLI, darkgrade cameras and doctor show it as attached, not in PTP mode, and a camera command answers No camera found.

The cause. The camera's USB mode is Mass Storage, in which it acts as a disk: a computer can copy files but cannot control it. On some bodies smartphone control is also in the way: Sony's steps set Ctrl w/ Smartphone to Off first, and Sony says a camera connected to a smartphone cannot be controlled from a computer.

The fix. In the camera's menu, set USB Connection Mode to PC Remote (Remote Shooting on some models), then unplug the camera and plug it back in. The menu path differs by model, and older bodies use USB Connection or PC Remote Function: Where the setting is, by model quotes Sony's path for each of the 30 models. Use a USB cable that carries data, not a charge-only one. Set up the camera has every brand, and the Sony page has the rest of what a Sony needs.

Canon or Nikon camera not detected

A Canon or a Nikon usually needs no setting before it connects, so a camera that does not appear is nearly always one of these.

  • The maker's own app has it. Quit Canon's EOS Utility or Nikon's NX Tether, then replug the camera.
  • The Mac's camera service has it. See Could not claim the USB device.
  • The cable or the camera. Use a USB cable that carries data, plug it straight into the computer where you can, and check that the camera is switched on and awake.
  • A Canon DSLR with Wi-Fi on. Canon says the EOS 80D and EOS 750D cannot connect to a computer while [Wi-Fi/NFC] is set to [Enable], and the same of [Wi-Fi] on the EOS 6D. Set it to [Disable], then connect the cable.
  • A Nikon set for an iPhone, or on the wrong socket. On a body with a USB item in the network menu, such as [USB data connection] on the Z8, Nikon says to select [MTP/PTP] for a computer. A Z8 must be plugged in by its USB data connector, not its USB Power Delivery connector.

The Canon page and the Nikon page have what each brand needs.

Studio notices

Studio says what went wrong in a notice or on the camera pill. Troubleshooting Studio has the fix for each.

You seeIt means
No camera, with Plug in a cameraStudio sees no camera it can control. Camera not found
Reconnecting…Studio lost the camera and is opening it again by itself. The camera pill says Reconnecting…
The camera didn't respondThe camera refused or missed a request; the notice gives the reason. A notice says The camera didn't respond
Live view paused while the card is readStudio is listing, previewing or downloading files. Live view is paused
Recording unconfirmed — use StopThe camera did not confirm a start or a stop. Recording unconfirmed
Port 7461 is already in useAnother program has the port Studio serves AI apps on. The app can't connect

CLI errors

A failed darkgrade command prints an error: line and exits 1. Errors describes the contract, and doctor checks the setup.

You seeIt means
No camera found.No camera is attached and ready. The message lists the USB mode to set for each brand.
attached, not in PTP modeThe camera is plugged in but in a file-transfer mode. Put the camera in the right USB mode
error: No USB devices availableThe camera named with --camera is not attached. darkgrade cameras lists what is.
No matching device found in discovered devicesCameras are attached, but none is the one that was asked for.
Multiple USB cameras match; select a unique serialNumber before connectingMore than one attached camera fits the request, and Slate does not pick one for you. Leave one plugged in, or from Slate select the camera by its serialNumber.
PTP interface not foundThe camera was opened, but it offers no PTP interface in its current USB mode. Put the camera in the right USB mode
Several cameras are attached. Choose one with --camera VID:PID:More than one camera is plugged in. The message gives the exact line for each. List cameras
An access or busy error on a MacmacOS holds the camera. Could not claim the USB device
Unknown command "…". Did you mean "…"?A mistyped command. Nothing ran.

MCP tool failures

An AI app shows the sentence the failed tool returned. A tool fails explains every one.

The sentenceIt means
No camera is connectedStudio has no camera open. Plug it in and wait for it to appear in Studio.
… is not available on this camera in its current modeThe camera does not report that setting now. Often the fix is the photo / video switch or the exposure mode.
Requested … value is not advertised by the cameraThe value is not one the camera offers now. Ask for the setting's choices.
The camera refused …The camera said no and nothing changed. The rest of the sentence is its reason.
… camera did not confirm …The command was sent once and not confirmed. It is not sent again: look at the camera before you retry.

If the app cannot reach the tools at all (connection refused, 403, 404), see The app can't connect.

Slate errors

Every Camera method fails in one of three ways, and the class says whether a retry is safe. Errors and recovery shows how to handle each.

ClassIt meansRetry?
CameraUnsupportedErrorThis camera can't do it right now. Nothing was sent.After you change the mode or lens.
CameraRefusedErrorThe camera said no, or the value isn't one it offers now. Nothing changed.Yes, with an allowed value, or once the camera is no longer busy.
CameraOutcomeUnknownErrorThe command was sent but its result could not be confirmed. Slate never resends it.Only after you read the camera's state.

The protocol error behind one of these is its cause: a PTPResponseError carries the camera's response code, such as 0x2019, in code. The response codes page lists every standard code, and each brand has its own: Sony, Canon, Nikon.

Still stuck?

Get help says where to ask and what to send. Include the exact words of the message.

⌘I