Arducam ToF SDK only accesses /dev/i2c-1, fails with IMX500 on CM4

Hey everyone, I’m trying to get two cameras working simultaneously on a Raspberry Pi Compute Module 4 and I’m hitting a wall.

Setup:

  • Raspberry Pi CM4
  • Camera 1: IMX500 camera over CSI, using /dev/i2c-1
  • Camera 2: Arducam ToF CSI camera, which shows up on /dev/i2c-10

The problem is the Arducam ToF SDK seems hardcoded to look for /dev/i2c-1. When I run the example app, I get this:

I2C bus name doesn't match any bus present!
Failed to find i2c bus(1.1)

I checked dmesg and confirmed the ToF camera is definitely on i2c-10. The IMX500 is sitting on i2c-1 already, so the ToF can’t grab it. Is there any way to tell the SDK to use a different I2C bus? I didn’t see any command-line flags or config files for this.

That’s a tricky situation. The Arducam ToF SDK is distributed as a closed-source .so library, and unfortunately the I2C bus path is baked in — it always targets /dev/i2c-1 internally. There’s no argument, environment variable, or config mechanism to override it at the moment.

Before diving deeper — can you confirm the ToF camera actually responds correctly when addressed directly on /dev/i2c-10? Just want to rule out any detection issues on that bus before we go further.

Yeah, I ran some basic i2c probing on bus 10 and the ToF camera responds fine. It’s definitely alive and functional on /dev/i2c-10. The hardware itself is solid.

Out of desperation I tried a quick symlink hack:

sudo ln -sf /dev/i2c-10 /dev/i2c-1

And surprisingly the ToF SDK works after that — it finds the bus and the camera streams. But obviously this completely breaks the IMX500 because now /dev/i2c-1 points to the wrong bus. So both cameras can’t run at the same time, which defeats the whole purpose.

It really seems like the only real fix would be for the SDK to support specifying an I2C bus index (like 10) or a full device path (like /dev/i2c-10). Maybe through an environment variable? Has anyone managed to patch around this or get both cameras coexisting?

Yeah, the symlink approach is a dead end for simultaneous use — you’ve already seen why. Don’t go down that route.

So here’s the thing: simultaneous operation of the IMX500 and the Arducam ToF CSI camera isn’t something that’s officially guaranteed, but I’ve gotten them to coexist on my own CM4 test setup. The key isn’t messing with I2C at all — it’s about selecting the right video device and camera port at the application level.

First, let’s figure out which video nodes map to which camera. Run:

v4l2-ctl --list-devices

That’ll show you the device topology. On my setup, the Arducam ToF lands on one video node and the IMX500 on another.

For the ToF SDK example, you can specify the video device index with the -d flag. Try:

./build/example/cpp/example -d 2

(Adjust the number based on what v4l2-ctl --list-devices shows — you want the device index that corresponds to the ToF camera’s video node.)

For the IMX500 side, libcamera lets you pick the camera port directly:

libcamera-still -t 0 --camera 1

On my CM4, the IMX500 is on cam 1 and the Arducam ToF is on cam 0, but your numbering might differ. The --camera flag is what you use to select the right port.

Give that a shot and let us know what v4l2-ctl --list-devices spits out — that’ll help narrow down the right device indices.

Thanks for the detailed response. The -d flag and --camera flag make sense for the video/application layer, and I’ll try that out.

But I want to clarify — doesn’t the ToF SDK still need to talk over I2C for the actual ToF sensor control and configuration? The video device selection (-d) handles the CSI stream side, but the SDK initialization is what’s failing with that “Failed to find i2c bus(1.1)” error, and that happens way before any video streaming starts. The library is trying to open /dev/i2c-1 for sensor register access, and since my ToF is on i2c-10, it can’t.

Am I missing something? Or does the -d flag somehow also redirect the I2C path internally? Because from what I can tell, the I2C bus path is completely hardcoded in the .so and the example app doesn’t expose any way to change it.

You raise a fair point — let me clarify what’s happening under the hood.

The -d flag selects the video device node for the CSI stream, you’re right about that. The I2C communication for sensor control is a separate path. On the CM4, the I2C bus assignment depends on which CSI port the camera is physically connected to and how the device tree enumerates things.

In the setups where I’ve seen this work, the Arducam ToF camera ends up on /dev/i2c-1 naturally because of the physical CSI port it’s plugged into, and the IMX500 is on the other port routed to a different I2C bus. Your situation is the reverse — the IMX500 grabbed i2c-1 and the ToF got pushed to i2c-10.

So the practical workaround right now is to physically swap which CSI port each camera is connected to, so the ToF lands on i2c-1 and the IMX500 gets the other bus. Then use --camera with libcamera to select the right port for the IMX500. Not elegant, but it gets both cameras running.

As for the SDK enhancement — you’re absolutely right that this should be configurable. I’ve flagged this with the team as a feature request: the ability to override the I2C bus index or full device path, ideally through an environment variable like ARDUCAM_I2C_BUS=10 or ARDUCAM_I2C_DEV=/dev/i2c-10. No timeline on that unfortunately, but it’s been noted.

Ah, I see — so the camera port on the board determines the I2C bus assignment at the device tree level, and swapping the physical connections would flip which camera gets i2c-1. That makes sense as a workaround, even if it’s a bit of a hassle.

I’ll give the port swap a try and report back. And yeah, please push for that environment variable feature — having the I2C path hardcoded in a closed-source library with no override is really limiting, especially on platforms like the CM4 where you might have multiple CSI cameras and the bus numbering isn’t something you can easily control from userspace.

For anyone else hitting this: the takeaway seems to be that the Arducam ToF SDK currently requires the ToF camera to be on /dev/i2c-1, period. If another camera has claimed that bus, your options are either the symlink hack (which breaks coexistence), physically swapping CSI ports, or waiting for an SDK update.

That’s a good summary of where things stand. Just to recap for anyone finding this thread later:

The core issue: Arducam ToF SDK is hardcoded to /dev/i2c-1 with no override mechanism. On a multi-camera CM4 setup, this causes a conflict if another CSI camera occupies that I2C bus.

Current workaround: Physically connect the Arducam ToF camera to the CSI port that enumerates as /dev/i2c-1, and connect the other camera (IMX500 in this case) to the remaining port. Then use:

  • -d <index> with the ToF SDK example to select the correct video device
  • --camera <port> with libcamera apps to select the correct port for the other camera

What doesn’t work: Symlinking /dev/i2c-10 to /dev/i2c-1 — the ToF will work but the other camera gets cut off.

Feature request: An environment variable (e.g., ARDUCAM_I2C_BUS or ARDUCAM_I2C_DEV) to let users specify the I2C bus index or full device path in the SDK. This is with the team but there’s no ETA.

@op — definitely let us know how the port swap goes, and whether you run into any device index quirks with v4l2-ctl. Always useful to have another data point.