[SOLVED] RPi camera broken in latest kernel?

Raspberry Pi 2

[SOLVED] RPi camera broken in latest kernel?

Postby Malvineous » Sun Jul 04, 2021 10:35 am

Hi all,

Is anyone successfully using the Raspberry Pi camera with the latest updates for Arch Linux ARM applied?

I'm setting up some new devices (too many dead SD cards so network booting them now) but I can't get the camera module to work. I've tried an RPi 3B, 3B+ and 4 (all booting the same ARMv7 distro listed on the Arch Linux ARM download page for the RPi 3) and as soon as I run ffmpeg to open /dev/video0, the whole system crashes:

$this->bbcode_second_pass_code('', '
bcm2835_mmal_vchiq: timed out waiting for sync completion
bcm2835-v4l2-0: Failed to enable encode tunnel - error -62
------------[ cut here ]------------
WARNING: CPU: 0 PID: 358 at drivers/media/common/videobuf2/videobuf2-core.c:1548 vb2_start_streaming+0xd8/0x16c [videobuf2_common]
Modules linked in: rpcsec_gss_krb5 snd_soc_hdmi_codec bcm2835_v4l2(C) bcm2835_codec(C) vc4 cec btsdio bcm2835_isp(C) drm_kms_helper snd_soc_corel
CPU: 0 PID: 358 Comm: ffmpeg Tainted: G C 5.10.46-1-ARCH #1
Hardware name: BCM2835
[<8010efec>] (unwind_backtrace) from [<8010ae48>] (show_stack+0x10/0x14)
[<8010ae48>] (show_stack) from [<80d15400>] (dump_stack+0xd0/0xf8)
[<80d15400>] (dump_stack) from [<8012bdd8>] (__warn+0xd4/0x140)
[<8012bdd8>] (__warn) from [<80d0ce20>] (warn_slowpath_fmt+0x74/0xa8)
[<80d0ce20>] (warn_slowpath_fmt) from [<7f3a2b0c>] (vb2_start_streaming+0xd8/0x16c [videobuf2_common])
[<7f3a2b0c>] (vb2_start_streaming [videobuf2_common]) from [<7f3a2c1c>] (vb2_core_streamon+0x7c/0x160 [videobuf2_common])
[<7f3a2c1c>] (vb2_core_streamon [videobuf2_common]) from [<7f3a518c>] (__vb2_init_fileio+0x250/0x2dc [videobuf2_common])
[<7f3a518c>] (__vb2_init_fileio [videobuf2_common]) from [<7f3a59b0>] (__vb2_perform_fileio+0x4b0/0x668 [videobuf2_common])
[<7f3a59b0>] (__vb2_perform_fileio [videobuf2_common]) from [<7f3a5b84>] (vb2_read+0x1c/0x24 [videobuf2_common])
[<7f3a5b84>] (vb2_read [videobuf2_common]) from [<7f2e1e04>] (vb2_fop_read+0xa4/0xf4 [videobuf2_v4l2])
[<7f2e1e04>] (vb2_fop_read [videobuf2_v4l2]) from [<7f26f350>] (v4l2_read+0x64/0xa4 [videodev])
[<7f26f350>] (v4l2_read [videodev]) from [<80326d54>] (vfs_read+0xa8/0x328)
[<80326d54>] (vfs_read) from [<80327480>] (ksys_read+0x60/0xe8)
[<80327480>] (ksys_read) from [<80100234>] (__sys_trace_return+0x0/0x2c)
Exception stack(0x832e7fa8 to 0x832e7ff0)
7fa0: 01b3c260 00010000 00000003 01b3c3a0 00010000 00000000
7fc0: 01b3c260 00010000 01b3c1f0 00000003 6fdb0550 00000005 00000000 01b3c1d0
7fe0: 76bc5748 7ea5e390 76a0d1e8 754f11a4
---[ end trace ffefb37a8badf070 ]---
')
Earlier in the boot process I see this:

$this->bbcode_second_pass_code('', '
bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
bcm2835_isp: module is from the staging directory, the quality is unknown, you have been warned.
bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.
')
Which makes me wonder whether some beta drivers have made it into the repos somehow? Is there a way to keep everything up to date but use the stable version of these drivers instead?

Here is my config.txt:

$this->bbcode_second_pass_code('', '
# These options are required when using the camera.
start_x=1
#gpu_mem=128
gpu_mem=256
disable_camera_led=1

[pi2]
# This defaults to on for Pi 3 and newer.
dtparam=watchdog=on

[pi3+]
# Serial console doesn't work on a 3B+ if Bluetooth is enabled.
dtoverlay=disable-bt

[all]
# Camera crash testing, doesn't seem to make any difference.
cma_lwm=
cma_hwm=
cma_offline_start=

dtoverlay=vc4-kms-v3d
initramfs initramfs-linux.img followkernel
')
If anyone else has done a full update and is running the ARMv7 distro and is able to use the camera, please let me know!

The command I am running to trigger the kernel oops is:
$this->bbcode_second_pass_code('', '
v4l2-ctl -v "width=1296,height=972,pixelformat=H264" && ffmpeg -f h264 -probesize 32 -r 30 -i /dev/video0 -vcodec copy -an -f rtp_mpegts "udp://224.0.1.1:5004"
')
Last edited by Malvineous on Sun Aug 15, 2021 9:02 am, edited 1 time in total.
Malvineous
 
Posts: 40
Joined: Sat Mar 11, 2017 1:45 pm

Re: RPi camera broken in latest kernel?

Postby Malvineous » Sun Aug 15, 2021 9:02 am

FYI this was a kernel bug. It has been fixed in linux-raspberrypi 5.10.52-8 (the -8 one has the fix, -2 didn't work, somewhere in between -2 and -8 it was fixed.) Each dash revision pulls from a different upstream commit.
Malvineous
 
Posts: 40
Joined: Sat Mar 11, 2017 1:45 pm

Re: [SOLVED] RPi camera broken in latest kernel?

Postby graysky » Sun Aug 15, 2021 10:00 am

More descriptive to look at upstream's log: https://github.com/raspberrypi/linux/commits/rpi-5.10.y
graysky
Developer
 
Posts: 1728
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000


Return to Broadcom

Who is online

Users browsing this forum: No registered users and 6 guests