Kernel Oops while capturing video from camera

Open
#3,437 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, linux

Research direction

Start with the reproduction commands and the attached raspinfo.txt, especially the dmesg output around the ARM kernel oops. Reproduce video capture with the Pi Zero W and camera, then use the resulting kernel logs to identify the failing subsystem; done means FFmpeg captures video without a kernel crash.

Written by the indexing model from the issue text.

Description

Waiting for external input

Describe the bug
Sometimes when capturing video from Pi Camera, I get a kernel oops. It's not always the same oops number.

To reproduce

pi@pizero:~ $ v4l2-ctl -p 30
Frame rate set to 30.000 fps
pi@pizero:~ $ ffmpeg -f h264 -i /dev/video0 -c:v copy -an out.mp4 -loglevel debug
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (Raspbian 8.3.0-6+rpi1)
  configuration: --prefix=/usr/local --enable-omx-rpi --enable-nonfree --enable-gpl --enable-mmal --enable-libx264 --disable-filters
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Splitting the commandline.
Reading option '-f' ... matched as option 'f' (force format) with argument 'h264'.
Reading option '-i' ... matched as input url with argument '/dev/video0'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-an' ... matched as option 'an' (disable audio) with argument '1'.
Reading option 'out.mp4' ... matched as output url.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url /dev/video0.
Applying option f (force format) with argument h264.
Successfully parsed a group of options.
Opening an input file: /dev/video0.
[h264 @ 0x1584370] Opening '/dev/video0' for reading
[file @ 0x1584b50] Setting default whitelist 'file,crypto'
[h264 @ 0x1584370] Before avformat_find_stream_info() pos: 0 bytes read:29 seeks:0 nb_streams:1
[AVBSFContext @ 0x15ae2c0] nal_unit_type: 7(SPS), nal_ref_idc: 1
[AVBSFContext @ 0x15ae2c0] nal_unit_type: 8(PPS), nal_ref_idc: 1
[AVBSFContext @ 0x15ae2c0] nal_unit_type: 5(IDR), nal_ref_idc: 1
[h264 @ 0x1585510] nal_unit_type: 7(SPS), nal_ref_idc: 1
[h264 @ 0x1585510] nal_unit_type: 8(PPS), nal_ref_idc: 1
[h264 @ 0x1585510] nal_unit_type: 5(IDR), nal_ref_idc: 1
[h264 @ 0x1585510] Format yuv420p chosen by get_format().
[h264 @ 0x1585510] Reinit context to 1920x1088, pix_fmt: yuv420p
[h264 @ 0x1585510] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 1
    Last message repeated 5 times
Message from syslogd@pizero at Jan 29 01:45:02 ...
 kernel:[  183.693275] Internal error: Oops: 80f [#1] ARM

Expected behaviour
FFmpeg should capture a video

Actual behaviour
FFmpeg crashes and I see lots of kernel errors on screen

System

  • PiZeroW with NoIR camera v2

Logs
dmesg included in raspinfo.txt
raspinfo.txt

Dominant language
C
Stars
13.2k
Forks
5.5k
Avg merge
2d 21h
Merged PRs (30d)
21

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/linux

All issues in raspberrypi/linux

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.