RPI Zero 1.3 + 16mpx IMX519 -> illegal operation

@jhud @spm @LoKau

I have fixed the problem, please reinstall our libcamera.

wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh
chmod +x ./install_pivariety_pkgs.sh
./install_pivariety_pkgs.sh -p libcamera
./install_pivariety_pkgs.sh -p libcamera_apps

then try again

@Edward

Unless I’ve done something wrong running the instructions (done twice, second time with sudo), no change for me ;(

$ libcamera-hello
Preview window unavailable
[0:00:54.936916000] [503]  INFO Camera camera_manager.cpp:299 libcamera v0.0.0+4225-74d023d8
Illegal instruction

Not sure if the bellow warning was there before and has any impact:

Preparing to unpack .../libcamera-apps_0.git20230309+4def288-1_armhf.deb ...
Unpacking libcamera-apps (0~git20230309+4def288-1) over (0~git20230309+4def288-1) ...
Setting up libcamera-apps (0~git20230309+4def288-1) ...
Processing triggers for libc-bin (2.31-13+rpt2+rpi1+deb11u5) ...
W: Repository is broken: libcamera-apps:armhf (= 0~git20230309+4def288-1) has no Size information

Same error after reinstalling libcamera as instructed:

$ libcamera-hello
Preview window unavailable
[0:01:53.094988730] [939]  INFO Camera camera_manager.cpp:299 libcamera v0.0.0+4225-74d023d8
Illegal instruction
$ libcamera-hello --list-cameras
Illegal instruction

Also had the Repository is broken warning on install.

Hello.

I just got the 16MP camera with adapter cable and pi zero W.
This is the cable - I also think its correctly connected - all pins always show towards the board.

I do not know exactly which version of the pi zero, but I am experiencing similar problems:

[0:45:05.988382216] [10512] INFO Camera camera_manager.cpp:299 libcamera v0.0.0+4225-74d023d8
Illegal instruction

I tried the installation instructions:
https://docs.arducam.com/Raspberry-Pi-Camera/Native-camera/Quick-Start-Guide/#software-guide_1

These are my config.txt settings:

dtparam=audio=on
camera_auto_detect=1
display_auto_detect=1
dtoverlay=vc4-kms-v3d,cma-128
max_framebuffers=2
disable_overscan=1
[cm4]
otg_mode=1
[all]
[pi4]
arm_boost=1
[all]
dtoverlay=imx519

On headless, with GUI, with the original 5.xxxx version of the os and also with full updated 6.1.21 and later.

I have this error, but somewhere else it is said that this is not a problem:
W: Repository is broken: libcamera-apps:armhf (= 0~git20230309+4def288-1) has no Size information

Is there a comprehensive guide how to solve this on the pi zeros W ?
Does the camera has some sort of small light to confirm that it is correctly connected?

I did one more attempt, with info from this forum:

  1. Download image from:
    https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-02-22/2023-02-21-raspios-bullseye-armhf-lite.img.xz

  2. Installed Arducam software:

wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh
chmod +x install_pivariety_pkgs.sh
./install_pivariety_pkgs.sh -p libcamera_dev
./install_pivariety_pkgs.sh -p libcamera_apps
./install_pivariety_pkgs.sh -p imx519_kernel_driver_low_speed

  1. Modified config.txt:
    dtparam=audio=on
    camera_auto_detect=1
    display_auto_detect=1
    dtoverlay=vc4-kms-v3d,cma-96
    max_framebuffers=2
    disable_overscan=1
    [cm4]
    otg_mode=1
    [all]
    [pi4]
    arm_boost=1
    [all]
    dtoverlay=imx519

  2. activated Glamor graphic acceleration via rspi-config

NO rpi-update
uname -a shows: Linux camera 5.15.84+
reboot

=> illegal operation

I can see on this video that it should work.

This is frustrating. No idea what I am doing wrong.

@jonasrejman @LoKau @jhud @spm

okay.


I tested again and nothing seems to be wrong I can support you guys remotely.

kernel must higher than 5.15.84(include 5.15.84) and Bullseye
I want to update the description, and the best way to reinstall is to first remove the libcamera

sudo apt remove libcamera0
./install_pivariety_pkgs.sh -l
./install_pivariety_pkgs.sh -p libcamera
./install_pivariety_pkgs.sh -p libcamera_apps

@Edward

I ran your commands above again, still the same problem.

I’ve noticed from your screenshot you have libcamera v0.0.0...3d8-dirty while I have:

 $ libcamera-still -t 0
Preview window unavailable
[0:08:30.897453096] [1111]  INFO Camera camera_manager.cpp:299 libcamera v0.0.0+4225-74d023d8
Illegal instruction
$ uname -a
Linux raspberrypi 6.1.19+ #1637 Tue Mar 14 11:01:56 GMT 2023 armv6l GNU/Linux
 $ cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 797.66
Features        : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2835
Revision        : 900093
Serial          : 00000000b07fb00b
Model           : Raspberry Pi Zero Rev 1.3

@jhud

okay.

I can arrange for you remotely.

pls contact me ([email protected])

Thanks for the response. I did the above commands - still getting illegal operation.
It seems I have the 1.1 revision. I wrote you an email regarding remote support. I appreciate it very much.

uname -a
Linux camera 6.1.23+ #1643 Tue Apr 11 20:18:11 BST 2023 armv6l GNU/Linux

cat /proc/cpuinfo
processor : 0
model name : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 697.95
Features : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7
Hardware : BCM2835
Revision : 9000c1
Serial : 0000000091a8b3d5
Model : Raspberry Pi Zero W Rev 1.1

libcamera-still -t 0
Made DRM preview window
[0:18:23.162555085] [6480] INFO Camera camera_manager.cpp:299 libcamera v0.0.0+4225-74d023d8
Illegal instruction

→ it seems that the lib camera version you are using is the “dirty one” 3d8-dirty wheres we are getting the clean one. So we need to get dirty … :laughing:

@jonasrejman

I’ve set up remove access for 7:00 UTC time tomorrow (18/4). If you have an earlier one, pls let me know so we don’t waste too much time.

I also emailed you about an remote assistance request.
Thank you!

Thanks for the reply Edward!

It might be good if you provide a step-by-step guide how you arrived at this state,
starting with which os image you downloaded. This way we can follow your progress and hopefully get it to work. If you can get it to work from scratch - so should we.

Thanks!

Thanks @Edward & team for getting libcamera-still --list-cameras working for me remotely. Unfortunately, it isn’t over yet.

$libcamera-still -t 1 -o test.jpg
[0:38:22.575732372] [1895]  INFO Camera camera_manager.cpp:299 libcamera v0.0.4+22-923f5d70
[0:38:22.771366309] [1896]  INFO RPI raspberrypi.cpp:1476 Registered camera /base/soc/i2c0mux/i2c@1/imx519@1a to Unicam device /dev/media3 and ISP device /dev/media0
[0:38:22.776053284] [1895]  INFO Camera camera.cpp:1028 configuring streams: (0) 2328x1748-YUV420
[0:38:22.778886268] [1896]  INFO RPI raspberrypi.cpp:851 Sensor: /base/soc/i2c0mux/i2c@1/imx519@1a - Selected sensor format: 2328x1748-SRGGB10_1X10 - Selected unicam format: 2328x1748-pRAA
[0:38:23.379641993] [1895]  INFO Camera camera.cpp:1028 configuring streams: (0) 4656x3496-YUV420 (1) 4656x3496-SRGGB10_CSI2P
[0:38:23.388523945] [1896]  INFO RPI raspberrypi.cpp:851 Sensor: /base/soc/i2c0mux/i2c@1/imx519@1a - Selected sensor format: 4656x3496-SRGGB10_1X10 - Selected unicam format: 4656x3496-pRAA
[0:38:23.573505935] [1896] ERROR V4L2 v4l2_videodevice.cpp:1241 /dev/video14[16:cap]: Unable to request 1 buffers: Cannot allocate memory
[0:38:23.574682929] [1896] ERROR RPI raspberrypi.cpp:1133 Failed to allocate buffers

UPDATE: Well, I guess it’s just the low memory on RPI Zero. Running libcamera-still -t 1 -o test.jpg --width 1920 WORKS!

@jhud

It dawned on me that 16mp resolution is too large for pizero.

You can do something try:

sudo vi /boot/config.txt

add find line "dtoverlay=vc4-kms-v3d"then add “,cma-128”

like “dtoverlay=vc4-kms-v3d,cma-128”

Yep, that I have already in. In fact, this is what I have:

dtoverlay=vc4-kms-v3d,cma-128
max_framebuffers=2
gpu_mem=128

That doesn’t work for the full resolution. I actually don’t need the full resolution, lower is good enough I just want to keep the same field of view - i.e. don’t crop but resize.

@jhud

You cant access this.
16mp is 4:3 ,1080p is 16:9.

if you want to use it in full resolution(include the full field of view),you can try pizero2w. They are also small and convenient.

Hello, I was wondering if you could explain how you were able to get the camera to work. I haven’t been able to try anything Edward suggested yet since I’m only in the lab at the end of the week. If you could give a step by step guide that would be greatly appreciated. Thank you!

Any tips or steps to get past the “Illegal instruction” error above yet?

@jhud : what did @Edward and team do to get libcamera working?

@spm @corkyskier - Arducam will fix their installation script, as the issue is there, hopefully soon so it’ll just start to work after you reinstall. We should hear about it here, in this thread.

The issue is in imx519.json tuning file which lives somewhere in /usr/lib/… (I’m out of reach of my RPI now so this is from the top of my head). That file needs to be replaced by a different version. I’m now not sure where they got the right version from - probably from one of their custom libcamera packages that we install as per their standard installation instruction. They haven’t downloaded anything different to my RPI.

Got it, I really appreciate it. Is there anything that can be done in the meantime or do we have to wait for them to fix their script?