NX Xavier Leetop carrier board IMX477: 16:9 crop instead of 4:3 aspect ratio

Hey folks, could use a hand with an aspect ratio problem on an IMX477.

On my old setup I was getting a 4:3 image out of the sensor. Now on a new setup I get 16:9 and it’s cropping the picture — I lose the top and bottom of the frame, which is a real problem for us since we need the full field of view.

Old config: AGX Xavier + Nvidia carrier board + Arducam IMX477
New config: Xavier NX (not AGX) + Leetop carrier board + same Arducam IMX477

Same sensor, same resolution and framerate as far as I know, only the module and the carrier board changed. I’m wondering if this is because we’re on a “Leetop” carrier board and not Nvidia’s dev-kit board.

L4T version: # R32 (release), REVISION: 7.1, GCID: 29818004, BOARD: t186ref, EABI: aarch64, DATE: Sat Feb 19 17:07:00 UTC 2022

I’ve been poking at the sensor-mode=? option in gst-launch-1.0 nvarguscamerasrc but haven’t gotten anywhere. I also pulled cat /etc/nv_tegra_release, v4l2-ctl --list-formats-ext, uname -r and cat /etc/os-release.

What actually decides the aspect ratio here? Any pointers appreciated.

Hi, thanks for the detailed writeup. Couple of things to sort out first.

The aspect ratio isn’t something nvarguscamerasrc decides on the fly — it comes from the mode the driver exposes, i.e. the mode table in the imx477 driver, which is selected/adapted according to the carrier board’s device tree. So sensor-mode=? only gets you whatever modes the installed driver already lists.

Can you paste the raw output of these?

v4l2-ctl --list-formats-ext
uname -r
cat /etc/os-release
cat /etc/nv_tegra_release

The list-formats-ext output shows which discrete modes the driver currently exposes and which one you’re actually grabbing. Also helpful: your exact gst-launch-1.0 line, and if you can, one still frame in 4:3 and one in 16:9 so we can see the crop with our own eyes.

One thing to keep in mind: our drivers are adapted for the official carrier boards. If you’re on a third-party carrier board, the device tree is different and the modes you get may not match what you expect.

Here’s what I get:

$ v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘RG10’
Name : 10-bit Bayer RGRG/GBGB
Size: Discrete 4032x3040
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 3840x2160
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)

$ uname -r
4.9.253-tegra

$ cat /etc/os-release
NAME=“Ubuntu”
VERSION=“18.04.6 LTS (Bionic Beaver)”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=“Ubuntu 18.04.6 LTS”
VERSION_ID=“18.04”

$ cat /etc/nv_tegra_release

R32 (release), REVISION: 7.1, GCID: 29818004, BOARD: t186ref, EABI: aarch64, DATE: Sat Feb 19 17:07:00 UTC 2022

So the driver does list a 4032x3040 mode, but I keep ending up on 3840x2160, which is the cropped one. My pipeline is basically:

gst-launch-1.0 nvarguscamerasrc sensor-mode=0 ! ‘video/x-raw(memory:NVMM),width=4032,height=3040’ ! …

and it still comes out cropped. Am I reading this wrong?

(Also asking one of our dev guys to jump in here, he owns the capture side.)

That output is actually pretty informative, thanks.

You’re right that 4032x3040 is in the list, but what the driver is exposing is the standard IMX477 mode table — 4032x3040, 3840x2160, 1920x1080. 3840x2160 is a 16:9 sensor crop, so once the pipeline negotiates down to it you lose the top/bottom of the frame. Exactly what you’re seeing.

The key point: the aspect ratio is determined by the driver, and the driver is selected/adapted according to the carrier board’s device tree. The default imx477 driver we ship is adapted for the official Nvidia carrier boards. When you move to a third-party carrier board like the Leetop, the device tree changes and the mode/CSI setup no longer matches what we adapted — so you get whatever modes that combination ends up exposing, and the scale you’re after isn’t guaranteed.

That’s also why sensor-mode=? isn’t helping: it just indexes whatever modes the installed driver has. It can’t invent a mode that isn’t in the table.

First thing worth ruling out — if versions haven’t changed and you’re on the same resolution and framerate as before, make sure our drivers are the ones actually installed and loaded, and not something left over. I’ve sent you the driver package through private message; please check it and try the update, then re-run v4l2-ctl --list-formats-ext and post the new mode list.

If you need an aspect ratio other than what’s exposed, we can do it — but it means modifying the driver for your carrier board’s device tree. That’s a custom adaptation, not a runtime config flag.

Okay, that makes sense. Two follow-ups:

  1. When you say official carrier boards — does that mean Nvidia’s boards only, or does it include boards from Nvidia’s partners too? Where does a Leetop board land in that picture?

  2. If this needs a driver adaptation to get 4:3 (or whatever scale we want), what does the adaptation cost and how long does it take? I’d like to know what we’d be signing up for before going down that path.

Confirming the environment once more: NX Xavier core board (not AGX) + Leetop carrier board + Arducam IMX477, on R32.7.1 per cat /etc/nv_tegra_release. The camera streams fine, it’s only the framing/scale that’s wrong.

Let me summarize where we’ve landed so the thread is complete for anyone reading along.

Confirmed hardware: Xavier NX core board (not AGX) + Leetop third-party carrier board + Arducam IMX477, L4T R32.7.1 (see the nv_tegra_release string above).

Root cause: the aspect ratio is determined by the IMX477 driver, and which driver/adaptation you get is decided by the carrier board’s device tree. We only make adaptations for the official carrier boards, so a third-party board like the Leetop is outside that coverage. The camera itself works — it’s the scale you’re not happy with, because you’re being handed the 3840x2160 16:9 sensor crop instead of the full 4:3 frame.

What we can do: yes, we can produce any aspect ratio/scale you need, but it’s a custom requirement — it means modifying the imx477 driver to match your Leetop device tree. There’s no sensor-mode=? or pipeline setting that will do it.

Next steps: keep our driver installed and confirm the mode list after the update (v4l2-ctl --list-formats-ext), and if you want to proceed with a custom scale, treat it as a custom adaptation request. I’ve had our team contact you privately about the details rather than posting commercial stuff here.

So: nothing unresolved hardware-wise, but no runtime fix for 4:3 on a third-party carrier board either — it’s a driver/device-tree adaptation. Post the post-update format list back in this thread and we’ll take it from there.