LoginSignup
2
0

More than 1 year has passed since last update.

Ubuntuを搭載したラズベリーパイへのカメラ認識設定

Posted at

概要

ラズパイとラズパイカメラを使って、映像配信を実施しようとしたところ、ラズパイカメラが認識されなかったので対処法を自分用のメモとしてまとめます。

  • 使用環境
    • OS: Ubuntu18.04LTS
    • RaspberryPi4
    • Raspberry Pi カメラモジュール【Raspberry Pi Camera V2】

手順

  1. v4l2、v4l-utilsのインストール
    $ sudo apt install libv4-dev
    $ sudo apt install v4l-utils
    
  2. カメラ有効化の設定
 $ sudo vim /boot/firmware/config.txt
# Please DO NOT modify this file; if you need to modify the boot config, the
# "usercfg.txt" file is the place to include user changes. Please refer to
# the README file for a description of the various configuration files on
# the boot partition.

# The unusual ordering below is deliberate; older firmwares (in particular the
# version initially shipped with bionic) don't understand the conditional
# [sections] below and simply ignore them. The Pi4 doesn't boot at all with
# firmwares this old so it's safe to place at the top. Of the Pi2 and Pi3, the
# Pi3 uboot happens to work happily on the Pi2, so it needs to go at the bottom
# to support old firmwares.

[pi4]
kernel=uboot_rpi_4.bin
max_framebuffers=2

[pi2]
kernel=uboot_rpi_2.bin

[pi3]
kernel=uboot_rpi_3.bin

[all]
arm_64bit=1
device_tree_address=0x03000000

# The following settings are "defaults" expected to be overridden by the
# included configuration. The only reason they are included is, again, to
# support old firmwares which don't understand the "include" command.

enable_uart=1
cmdline=nobtcmd.txt

include syscfg.txt
include usercfg.txt

上記を[all]のところにstart_x=1gpu_mem=128を追記する。
3. v4l-utilsで接続が認識されているカメラ一覧を表示。
/dev/video0が表示されていればカメラ認識に成功している。

$ v4l2-ctl --list-devices
bcm2835-codec-decode (platform:bcm2835-codec):
        /dev/video10
        /dev/video11
        /dev/video12

bcm2835-isp (platform:bcm2835-isp):
        /dev/video13
        /dev/video14
        /dev/video15
        /dev/video16

mmal service 16.1 (platform:bcm2835-v4l2):
        /dev/video0

以上がUbuntuへのカメラ認識作業です。
以下に参考にさせていただいたページのリンクを掲載します。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0