2024/06 現在の最新である bookworm 64bit で、raspirec が動作するかの検証を行う。
条件
項目 | 値 |
---|---|
SBC | Raspberry Pi 3B+ |
OS | Raspberry Pi OS Lite (64-bit bookworm ) |
チューナー | PX-Q3U4 |
ドライバー | px4_drv |
録画ソフト | raspirec Ver1.4.4 |
実施日 | 2024/06/26 |
OS のインストールは、 公式ページ から インストーラーをdownload して普通に行う。
OS のアップデート
$ sudo apt update
$ sudo apt -y upgrade
録画サーバーなので、IPアドレスを固定とする。
自アドレス | 192.168.1.7/24 |
gateway | 192.168.1.1 |
DNS | 192.168.1.64,8.8.8.8 |
$ nmcli connection show
$ sudo nmcli connection modify "Wired connection 1" ipv4.addresses 192.168.1.7/24
$ sudo nmcli connection modify "Wired connection 1" ipv4.gateway 192.168.1.1
$ sudo nmcli connection modify "Wired connection 1" ipv4.dns 192.168.1.64,8.8.8.8
$ sudo nmcli connection modify "Wired connection 1" ipv4.method manual
$ sudo nmcli connection modify "Wired connection 1" ipv6.method disabled
$ sudo nmcli connection up "Wired connection 1"
mail の設定 (smtpサーバーに投げるだけ)
$ sudo apt install -y msmtp-mta msmtp
の後 ~/.msmtprc を適宜設定
ntp(chrony) の設定
$ sudo apt -y install chrony
の後 /etc/chrony/chrony.conf を適宜設定
ロケールの設定
$ sudo raspi-config
1. 5 Localisation Options
1. L1 Locale Configure language and regional settings
で ja_JP.UTF-8
に設定する。
オリジナルの nns779/px4_drv は 最新のカーネルに対応していない為、有志によりメンテナスされている tsukumijima/px4_drv をインストールする。 (詳細はそちらのドキュメントを参照のこと)
$ wget https://github.com/tsukumijima/px4_drv/releases/download/v0.4.4/px4-drv-dkms_0.4.4_all.deb
$ sudo apt install -y ./px4-drv-dkms_0.4.4_all.deb
$ sudo modprobe px4_drv
$ lsmod | grep px4
この時下記のエラーメッセージが出るが、無視する。
N: Download is performed unsandboxed as root as file ‘/home/pi/px4-drv-dkms_0.4.4_all.deb’ couldn’t be accessed by user ‘_apt’. - pkgAcquire::Run (13: Permission denied)
デバイスファイルの確認をして出来ていれば OK
pi:~ $ ls -l /dev/px4video*
crw-rw-r-- 1 root video 236, 0 Jun 26 10:10 /dev/px4video0
crw-rw-r-- 1 root video 236, 1 Jun 26 10:10 /dev/px4video1
crw-rw-r-- 1 root video 236, 2 Jun 26 10:10 /dev/px4video2
crw-rw-r-- 1 root video 236, 3 Jun 26 10:10 /dev/px4video3
crw-rw-r-- 1 root video 236, 4 Jun 26 10:10 /dev/px4video4
crw-rw-r-- 1 root video 236, 5 Jun 26 10:10 /dev/px4video5
crw-rw-r-- 1 root video 236, 6 Jun 26 10:10 /dev/px4video6
crw-rw-r-- 1 root video 236, 7 Jun 26 10:10 /dev/px4video7
raspirec をdockerを使わずに現環境にインストールする方法 を使って、raspirec 及び必要なソフトウエアをインストールするスクリプトを実行する。
$ sudo apt -y install git
後は、インストール手順に従ってインストールする。
systemd で不要なサービスを停止させ、軽量化を図る。
systemctl disable avahi-daemon.service
systemctl disable bluetooth.service
systemctl disable cups.service
systemctl disable dhcpcd.service
systemctl disable hciuart.service
systemctl disable triggerhappy.service
systemctl disable wifi-country.service
systemctl disable wpa_supplicant.service
systemctl disable ModemManager.service
systemctl list-units -t service
/boot/firmware/config.txt を修正する
#dtparam=audio=on # コメントアウト
#camera_auto_detect=1 # コメントアウト
#dtoverlay=vc4-kms-v3d # コメントアウト
#max_framebuffers=2 # コメントアウト
#disable_overscan=1 # コメントアウト
dtoverlay=disable-bt # 追記
dtoverlay=disable-wifi # 追記
/etc/modprobe.d/raspi-blacklist.conf に下記を設定
blacklist bcm2835_codec
blacklist bcm2835_isp
blacklist bcm2835_v4l2
blacklist ip_tables
blacklist ipv6
blacklist raspberrypi_gpiomem
blacklist sg
blacklist snd
blacklist snd_bcm2835
blacklist snd_timer
blacklist vc_sm_cma
blacklist videobuf2_memops
blacklist videodev
/boot/firmware/cmdline.txt にパラメータ追加
sudo sed -i 's/$/ coherent_pool=4M dwc_otg.host_rx_fifo_size=768 ipv6.disable=1/'/boot/firmware/cmdline.txt
注: 以前は dwc_otg.host_rx_fifo_size=2048 だったが、最大値が 768 になったよう。
/etc/modprobe.d/px4_drv.conf に下記を設定
options px4_drv xfer_packets=51 urb_max_packets=816 max_urbs=6
最後に reboot
項目 | 結果 |
---|---|
recpt1 | OK |
tspacketchk | OK |
raspirec 起動 | OK |
raspirec EPG取得 | OK |
raspirec 録画 | OK |
raspirec scp転送 | NG -> OK (Ver1.4.5) |
録画した TSファイルを tspacketchk でチェックして drop が 1桁ならば OK とする。
#!/bin/sh
TIME=1800
OPT="--b25"
MAX=6
n=1
rm -f *.ts *.log
for CH in 26 BS15_0 28 BS13_0 18 BS1_1 14 BS1_2
do
recpt1 $OPT $CH $TIME ${CH}.ts &
sleep 1
n=`expr $n + 1`
if [ $n -gt $MAX ]
then
break
fi
done
date
ls -1 *.ts | wc -l
wait
for fname in *.ts
do
echo $fname
tspacketchk $fname > ${fname}.log
done
grep drop+ *.log
同時録画本数 | –b25 付き | –b25 無し |
---|---|---|
8 本 | NG | NG |
7 本 | NG | NG |
6 本 | NG | NG |
5 本 | OK | OK |
4 本 | OK | OK |