ひさびさに録画してみたい気分になったので RHEL9系の rockylinux9 で作ってみた.
chardev 向けのみで dvb版は作ってないです
非常に古いマシンです
i7-4771(3.5GHz[3.9GHz, 0.8GHz], 4c/8c), 32GB mem, 120GB SSD[system], 3TB HDD[home]
pt2を2枚積んでます
[root@pt ~]# cat /etc/redhat-release
Rocky Linux release 9.7 (Blue Onyx)
[root@pt ~]# uname -r
5.14.0-611.24.1.el9_7.x86_64
[root@pt ~]# lspci
:
05:00.0 Multimedia controller: Xilinx Corporation Device 222a (rev 01)
05:01.0 Multimedia controller: Xilinx Corporation Device 222a (rev 01)
:
[root@pt ~]#NTTコミュニケーションズさんの SCR3310-NTTCom をもっており、これをUSBに差し込むlsusbを実行して確認
ただこの SCR3310-NTTCom は終板でもう売っていない。
[root@pt ~]# dnf install usbutils
[root@pt ~]# lsusb
:
Bus 002 Device 002: ID 04e6:511a SCM Microsystems, Inc. SCR3310-NTTCom USB SmartCard Reader
:
[root@pt ~]#カードリーダーツール「pcsc-tools」を入れます.
「pcsc-tools」と直接には関係ないかもだけど、後ほど作る「libarib25」の作成にはpcscの開発環境パッケージ「pcsc-lite-devel」が必要です。
けど RHEL9系 rockylinux9 の リポジトリには入ってないようなので pcsc-tools を rpmbuild で作り「pcsc-lite-devel」を得ます.
っで「pcsc-tools」のインストールの前にこの作った「pcsc-lite」「pcsc-lite-devel」らをインストールします
[root@pt ~]# dnf --enablerepo=crb install doxygen polkit-devel python3-devel systemd-devel
[root@pt ~]# rpm -Uvh https://dl.rockylinux.org/pub/rocky/9/BaseOS/source/tree/Packages/p/pcsc-lite-1.9.4-2.el9.src.rpm
[root@pt ~]# rpmbuild -bb rpmbuild/SPECS/pcsc-lite.spec
[root@pt ~]# dnf localinstall \
./rpmbuild/RPMS/x86_64/pcsc-lite-1.9.4-2.el9.x86_64.rpm \
./rpmbuild/RPMS/x86_64/pcsc-lite-devel-1.9.4-2.el9.x86_64.rpm \
./rpmbuild/RPMS/x86_64/pcsc-lite-libs-1.9.4-2.el9.x86_64.rpm
(BaseOSから pcsc-lite-ccid が依存で入ります)
[root@pt ~]#このように pcsc-liteを入れてから pcsc-tools をインストールします
[root@pt ~]# dnf install pcsc-tools
[root@pt ~]# systemctl status pcscd
○ pcscd.service - PC/SC Smart Card Daemon
Loaded: loaded (/usr/lib/systemd/system/pcscd.service; indirect; preset: disabled)
Active: inactive (dead)
TriggeredBy: ● pcscd.socket
Docs: man:pcscd(8)
[root@pt ~]#PC/SCカードリーダーにB-CASカードを入れたままで
[root@pt ~]# pcsc_scan
PC/SC device scanner
V 1.6.2 (c) 2001-2022, Ludovic Rousseau <ludovic.rousseau@free.fr>
Using reader plug'n play mechanism
Scanning present readers...
0: NTT Communications Corp. SCR3310-NTTCom USB SmartCard Reader [Vendor Interface] 00 00
Fri Feb 6 00:24:03 2026
Reader 0: NTT Communications Corp. SCR3310-NTTCom USB SmartCard Reader [Vendor Interface] 00 00
Event number: 0
Card state: Card inserted,
ATR: 3B F0 12 00 FF 91 81 B1 7C 45 1F 03 99
:
:
Japanese Chijou Digital B-CAS Card (pay TV)
:と表示されれば、OK。[Ctrl-C]でpcsc_scanを停止。
ありがたい著作権保護機能の仕様を理解する為のツール libarib25 を入れます.
今ではgithubで公開しているみたい https://github.com/stz2012/libarib25
ただこれをコンパイルしてインストールするには先にrpmbuildで作った 「pcsc-lite-devel」パッケージ に含まれる「/usr/include/PCSC/wintypes.h」が必要です
[root@pt ~]# cd /apps/src/
[root@pt src]# git clone https://github.com/stz2012/libarib25
[root@pt src]# cd libarib25/
[root@pt libarib25]# ls -l
total 64
-rw-r--r--. 1 root root 6462 Feb 6 00:46 CMakeLists.txt
-rw-r--r--. 1 root root 1446 Feb 6 00:46 CMakeSettings.json
-rw-r--r--. 1 root root 11373 Feb 6 00:46 LICENSE
-rw-r--r--. 1 root root 497 Feb 6 00:46 NOTICE
-rw-r--r--. 1 root root 14708 Feb 6 00:46 README.md
-rw-r--r--. 1 root root 15432 Feb 6 00:46 README.org
drwxr-xr-x. 2 root root 124 Feb 6 00:46 cmake
drwxr-xr-x. 2 root root 4096 Feb 6 00:46 src
[root@pt libarib25]#
[root@pt libarib25]# mkdir build && cd build
[root@pt build]# cmake .. -DCMAKE_INSTALL_PREFIX=/apps/libarib25 -DPCSC_LIBRARIES=/usr/lib64
[root@pt build]# make
[root@pt build]# make install
[root@pt build]# ls -l /apps/libarib25/
total 0
drwxr-xr-x. 2 root root 17 Feb 6 01:27 bin
drwxr-xr-x. 3 root root 20 Feb 6 01:27 include
drwxr-xr-x. 3 root root 110 Feb 6 01:27 lib64
[root@pt build]#
[root@pt build]# ls -l /apps/libarib25/lib64/
total 100
-rw-r--r--. 1 root root 48722 Feb 6 01:27 libarib25.a
lrwxrwxrwx. 1 root root 14 Feb 6 01:27 libarib25.so -> libarib25.so.0
lrwxrwxrwx. 1 root root 18 Feb 6 01:27 libarib25.so.0 -> libarib25.so.0.2.5
-rwxr-xr-x. 1 root root 49752 Feb 6 01:27 libarib25.so.0.2.5
drwxr-xr-x. 2 root root 26 Feb 6 01:27 pkgconfig
[root@pt build]#
[root@pt build]# ls -l /apps/libarib25/bin/
total 40
-rwxr-xr-x. 1 root root 22984 Feb 6 01:27 b25
[root@pt build]#これで「/apps/libarib25/lib64/libarib25.so」を得ました。
これをldconfigに登録しておきます
[root@pt ~]# echo "/apps/libarib25/lib64" > /etc/ld.so.conf.d/libarib25.conf
[root@pt ~]# ldconfig
[root@pt ~]# ldconfig -v | less
:
/apps/libarib25/lib64: (from /etc/ld.so.conf.d/libarib25.conf:1)
libarib25.so.0 -> libarib25.so.0.2.5
:
[root@pt ~]#以前は pt2 のデバイスドライバとして kernelに組み込まれていた earth-pt1 があったよなぁって思ったが「/lib/modules/$(uname -r)/config」を探してもPT1はなかった.. あとで詳しく調べる
なのでもう一つのpt2デバイスドライバ chardev を作ってみる.
[root@pt ~]# cd /apps/src/
[root@pt src]# wget http://hg.honeyplanet.jp/pt1/archive/tip.tar.bz2
[root@pt src]# tar xf tip.tar.bz2
[root@pt src]# cd pt1-17b4f7b5dccb/driver
[root@pt driver]#ここで「pt1_pci.c」を修正します
|
その上で
[root@pt driver]# make
[root@pt driver]# make install
[root@pt driver]# ls -l /lib/modules/`uname -r`/kernel/drivers/video
total 708
drwxr-xr-x. 2 root root 94 Feb 5 23:54 backlight
-rw-r--r--. 1 root root 722704 Feb 6 01:43 pt1_drv.ko
[root@pt driver]#とデバイスドライバ「pt1_drv.ko」が用意されました
このデバイスドライバを読み込むと、デバイスが認識される.
[root@pt ~]# modprobe pt1_drv
[root@pt ~]# ls -l /dev/pt1video*
crw-rw-rw-. 1 root video 239, 0 Feb 6 01:45 /dev/pt1video0
crw-rw-rw-. 1 root video 239, 1 Feb 6 01:45 /dev/pt1video1
crw-rw-rw-. 1 root video 239, 2 Feb 6 01:45 /dev/pt1video2
crw-rw-rw-. 1 root video 239, 3 Feb 6 01:45 /dev/pt1video3
crw-rw-rw-. 1 root video 238, 0 Feb 6 01:45 /dev/pt1video4
crw-rw-rw-. 1 root video 238, 1 Feb 6 01:45 /dev/pt1video5
crw-rw-rw-. 1 root video 238, 2 Feb 6 01:45 /dev/pt1video6
crw-rw-rw-. 1 root video 238, 3 Feb 6 01:45 /dev/pt1video7
[root@pt ~]#2枚分の8つが見えました
次に実際に録画するプログラムを用意します
同じ「tip.tar.bz2」ファイルに同封されている模様
[root@pt ~]# cd /apps/src/pt1-17b4f7b5dccb/recpt1/
[root@pt recpt1]# ./autogen.sh
Generating configure script and Makefiles for recpt1.
Running aclocal ...
Running autoheader ...
Running autoconf ...
[root@pt recpt1]# LDFLAGS=-L/apps/libarib25/lib64 CPPFLAGS=-I/apps/libarib25/include ./configure --enable-b25 --prefix=/apps/recpt1
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for create_arib_std_b25 in -larib25... yes
checking for log10 in -lm... yes
checking for pthread_kill in -lpthread... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
[root@pt recpt1]#LDFLAGSとかCPPFLAGSがMakefileに反映されないので、直接Makefileを弄ります
|
その上で
[root@pt recpt1]# make
gcc -O2 -g -pthread -I../driver -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/apps/libarib25/include -c -o recpt1.o recpt1.c
recpt1.c: In function ‘reader_func’:
recpt1.c:270:25: warning: variable ‘addr’ set but not used [-Wunused-but-set-variable]
270 | struct sockaddr_in *addr = NULL;
| ^~~~
gcc -O2 -g -pthread -I../driver -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/apps/libarib25/include -c -o decoder.o decoder.c
gcc -O2 -g -pthread -I../driver -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/apps/libarib25/include -c -o mkpath.o mkpath.c
gcc -O2 -g -pthread -I../driver -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/apps/libarib25/include -c -o tssplitter_lite.o tssplitter_lite.c
gcc -O2 -g -pthread -I../driver -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/apps/libarib25/include -c -o recpt1core.o recpt1core.c
gcc -L/apps/libarib25/lib64 -o recpt1 recpt1.o decoder.o mkpath.o tssplitter_lite.o recpt1core.o -lpthread -lm -larib25
gcc -O2 -g -pthread -I../driver -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/apps/libarib25/include -c -o recpt1ctl.o recpt1ctl.c
gcc -L/apps/libarib25/lib64 -o recpt1ctl recpt1ctl.o recpt1core.o -lm
gcc -O2 -g -pthread -I../driver -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/apps/libarib25/include -c -o checksignal.o checksignal.c
gcc -L/apps/libarib25/lib64 -o checksignal checksignal.o recpt1core.o -lpthread -lm
[root@pt recpt1]#
[root@pt recpt1]# mkdir -p /apps/recpt1/bin
[root@pt recpt1]# make install
install -m 755 recpt1 recpt1ctl checksignal /apps/recpt1/bin
[root@pt recpt1]#
[root@pt recpt1]# ls -l /apps/recpt1/bin/
total 240
-rwxr-xr-x. 1 root root 61560 Feb 6 02:03 checksignal
-rwxr-xr-x. 1 root root 121632 Feb 6 02:03 recpt1
-rwxr-xr-x. 1 root root 56376 Feb 6 02:03 recpt1ctl
[root@pt recpt1]#
[root@pt recpt1]# ldd /apps/recpt1/bin/recpt1
linux-vdso.so.1 (0x00007ffc8a5d6000)
libm.so.6 => /lib64/libm.so.6 (0x00007fed7a015000)
libarib25.so.0 => /apps/libarib25/lib64/libarib25.so.0 (0x00007fed7a009000)
libc.so.6 => /lib64/libc.so.6 (0x00007fed79e00000)
/lib64/ld-linux-x86-64.so.2 (0x00007fed7a101000)
libpcsclite.so.1 => /lib64/libpcsclite.so.1 (0x00007fed79df3000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fed79a00000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fed79dd4000)
[root@pt recpt1]#これで完了かな
recpt1 --b25 --strip --device /dev/pt1video2 --sid 1024 27 60 /share/1.ts
recpt1 --b25 --strip --device /dev/pt1video2 --sid 1040 25 60 /share/4.ts
recpt1 --b25 --strip --device /dev/pt1video2 --sid 1064 24 60 /share/5.ts
recpt1 --b25 --strip --device /dev/pt1video2 --sid 1048 22 60 /share/6.ts
recpt1 --b25 --strip --device /dev/pt1video2 --sid 1072 23 60 /share/7.ts
recpt1 --b25 --strip --device /dev/pt1video2 --sid 1056 21 60 /share/8.ts
recpt1 --b25 --strip --device /dev/pt1video2 --sid 1024 16 60 /share/9.tsとかで。
「at」デーモンを有効にして
echo "recpt1 --b25 --strip --device /dev/pt1video2 --sid 1024 27 14400 /share/1.ts" | at "19:55 2026-02-08"
*2026/02/08の19:55から4時間実行させる 4(時間)*60(分)*60(秒)=14400(秒)とかでしょうかね
EPGStation、Mirakurun、raspirecらのツールは分からないので扱わないです。まぁーrecpt1で十分かなぁっと