Cannot set external trigger mode on Arducam UC-844 OV9281 via UVC on Raspberry Pi

Hey everyone, I’m trying to get the external trigger mode working on my Arducam UC-844 (OV9281 sensor) connected to a Raspberry Pi 4B running Ubuntu 18.04.6 LTS over USB via UVC. I wrote a small C function to send the UVC extension unit control to set the trigger mode:

int set_ov9281_trigger_mode( int mode )
{
    struct uvc_xu_control_query xquery;

    memset( &xquery, 0, sizeof( xquery ) );
    xquery.unit = 0x03;
    xquery.selector = 0x0B;
    xquery.query = UVC_SET_CUR;
    xquery.size = 1;
    unsigned char data = mode;
    xquery.data = &data;

    if( ioctl( camera_fd, UVCIOC_CTRL_QUERY, &xquery ) < 0 )
    {
        printf( "Failed to set trigger mode %d\n", mode );
        return -1;
    }

    printf( "OV9281 trigger mode set to: %d\n", mode );
    return 0;
}

But when I call set_ov9281_trigger_mode(2), the ioctl fails. I’m not sure if I’m targeting the right unit and selector, or if there’s something else I’m missing. Has anyone gotten the external trigger working on this camera?

Welcome to the forum. That code looks structurally correct as far as the UVC XU control query goes. Can you share the exact errno value you’re getting when the ioctl fails? That’ll help narrow things down. Also, just to confirm — you said the ioctl is targeting unit 0x03, selector 0x0B — where did you source those values from? Are they from the camera’s UVC descriptor or documentation?

Thanks for the quick reply. The ioctl returns -1 and errno is set to 2, which is ENOENT — “No such file or directory.” I tried both mode 2 and mode 1, same exact result for both. The unit 0x03 and selector 0x0B values came from the Arducam documentation for the OV9281 external trigger XU control. I double-checked them. The camera itself is detected fine over UVC, I can stream video without any issues, it’s just this particular control that won’t take.

That errno is actually very telling. ENOENT from UVCIOC_CTRL_QUERY means the control node you’re requesting — unit 0x03, selector 0x0B — simply doesn’t exist in the firmware currently running on the camera. Your userspace code is fine; the ioctl is being formed correctly and the kernel is passing it through to the UVC driver. The problem is the camera’s firmware doesn’t expose that extension unit at all.

This isn’t unusual. The external trigger functionality via XU control is an advanced feature that requires a dedicated firmware build. The standard off-the-shelf firmware that ships with the UC-844 doesn’t include the external trigger Extension Unit — hence the ENOENT when the driver tries to locate it. You’re essentially knocking on a door that hasn’t been built yet.

What does lsusb -v show for this device? Specifically, can you look at the UVC interface descriptors and see if there’s any Extension Unit listed with ID 0x03?

That makes a lot of sense. I ran lsusb -v and checked the output — there’s no Extension Unit with bUnitID 0x03 in the descriptor chain at all. So the firmware just doesn’t have it. I guess that explains why streaming works but the trigger control is completely absent.

So what’s the path forward here? Is there a custom firmware I can flash to enable this, or do I need to go through a different channel?

Exactly — you’ve confirmed it. The absence of unit 0x03 in the descriptors means the firmware on your camera was never built with the external trigger XU included. No amount of tweaking the ioctl call on your side will make a difference.

Unfortunately, this isn’t something that can be resolved through the standard public firmware releases. Enabling the XU Control for external trigger mode requires a custom engineering engagement. The official path forward is to reach out to the Arducam sales team at [email protected]. You’ll want to provide:

  • Full details of your project and what you’re trying to achieve with the external trigger
  • The camera model (UC-844 / OV9281)
  • A reference to this forum thread for context

The sales team will coordinate with the engineering side to evaluate your project and, if appropriate, provide the custom firmware and driver support package that includes the external trigger Extension Unit. It’s not a simple firmware flash you can do yourself — it needs a tailored build.

Short version: your code is correct, your setup is correct, the camera just needs firmware with the feature baked in, and that goes through the sales/engineering pipeline.