Adjusting auto exposure and gain settings arducam imx462

Dear Arducam,

On the imx462 on a raspberry pi, where are the settings configured that it uses to set exposure and gain levels? for the official rasp v2 cam it is possible to adjust imx219.json and then it works in libcamera-vid.

I tried creating arducam-pivariety.json in /usr/share/libcamera/ipa/raspberrypi (same folder as imx219.json) but whatever settings i put in it it seems like it is ignored. The logging on libcamera-vid does stop the Error line about arducam-pivariety.json not existing, so the file is detected but looks like content ignored.

So please help me

@breefie

libcamera can be specified with the –tuning-file parameter

like:

libcamera-still -t 0 --tuning-file arducam-pivariety.json

@Edward Unless I’m missing something stupid, this does not seem to be working for me. I’ve tried the same, I copied imx219.json to its own file (imx462.json) and gave it to the tuning-file parameter.

The output I get is:

[49:20:32.864990921] [6758]  INFO Camera camera_manager.cpp:299 libcamera v0.0.0+4225-74d023d8
[49:20:32.915076024] [6769]  WARN RPiController controller.cpp:70 Failed to open tuning file 'imx462.json'
[49:20:32.915216695] [6769] ERROR IPARPI raspberrypi.cpp:268 Failed to load tuning data file imx462.json
[49:20:32.915294087] [6769] ERROR RPI raspberrypi.cpp:1352 Failed to load a suitable IPA library
[49:20:32.915520484] [6769] ERROR RPI raspberrypi.cpp:1277 Failed to register camera imx290 10-001a: -22
ERROR: *** no cameras available ***

My actual goal is to modify whatever default tuning file it’s using. Not sure if imx219.json is the right file. I have no idea what it uses for its default tuning file for the imx462, as imx462.json does not exist.

@Oxu

Can you tell me the sku number of the camera?
or take a picture for me

@Edward
It is B0423.

@Oxu

sudo vi /boot/config.txt

Add dtoverlay=imx290 in the last line

I replaced ‘dtoverlay=imx462’ with ‘dtoverlay=imx290’ in my config.txt, rebooted it and it does not seem to have made any difference. The camera still works as normal with default settings. But trying to get it to load the .json tuning file results in the same error.

Is there a way to figure out what default tuning file it is using, so I can copy that instead and modify it to what I need?

I just managed to answer my own questions!

For the command line command, I had to supply the full path, instead of the filename, eg:
libcamera-still -t 100 -o test.jpg --tuning-file /usr/share/libcamera/ipa/raspberrypi/imx290.json

And secondly, I figured out that for the imx462 it appears that the imx290.json file is the one that gets used by default. So I can copy that one and modify it as I wish and it works without any problems.

Changing the config.txt was not needed.

@Oxu

Sorry, I thought you were using a file you tweaked yourself. This does require an exact path if you don’t have a json file in your current directory.

Yes, for official cameras, just make sure camera_auto_detect is turned on.

It seems like you have solved every problem yourself. Amazing.