Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions .github/scripts/ci-matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@
"hi3516ev300_dev": "variant 'dev', not a standard matrix variant",
"hi3516ev300_glibc": "variant 'glibc', not a standard matrix variant",
"t31glibc_lite": "glibc toolchain variant of t31_lite",
# The waybeam image is a real, buildable variant, but it is a streamer
# flavor (Majestic replaced by waybeam) rather than one of the standard
# lite/ultimate/neo matrix variants, so it is not built here.
"hi3516cv6xx_waybeam": "variant 'waybeam', not a standard matrix variant",

# Real, and built locally. The other Anyka boards build every driver from
# source; this one's ISP, encoder, Ethernet and SD drivers are the
Expand Down Expand Up @@ -290,18 +294,19 @@
# builder's apfpv devices set it directly for their own S99msposd. Still a
# package that left the matrix, not one that left the tree.
#
# waybeam is unbuildable by construction here rather than merely unselected: it
# depends on !BR2_PACKAGE_MAJESTIC, and every sigmastar defconfig in ALL_BOARDS
# sets BR2_PACKAGE_MAJESTIC=y, because both drive the same sensor and encoder.
# The same exclusion holds downstream, so it is selected nowhere at all: every
# OpenIPC/builder defconfig that selects wifibroadcast-ng also sets
# BR2_PACKAGE_MAJESTIC=y, and no defconfig in either tree sets
# BR2_PACKAGE_WAYBEAM=y. The symbol appears only where it is defined, in
# general/package/waybeam/Config.in, and in this comment. The line this replaces
# claimed builder's FPV variants selected it, which sent a contributor debugging
# an FPV OSD fault (#2395) after a waybeam log file that no shipped image
# writes. A defconfig with Majestic off, mainline or downstream, would take it
# off this list.
# waybeam stays unbuilt by the matrix rather than merely unselected: it depends
# on !BR2_PACKAGE_MAJESTIC, and every sigmastar defconfig in ALL_BOARDS sets
# BR2_PACKAGE_MAJESTIC=y, because both drive the same sensor and encoder. The
# exclusion holds downstream too -- every OpenIPC/builder defconfig that selects
# wifibroadcast-ng also sets BR2_PACKAGE_MAJESTIC=y -- so no ALL_BOARDS board
# selects it. The one defconfig here that does is hi3516cv6xx_waybeam, which is
# in UNBUILT_BOARDS below as a non-standard variant; that entry, not this one,
# is the reason the image is still not built by CI. The line this replaces
# claimed builder's FPV variants selected waybeam, which sent a contributor
# debugging an FPV OSD fault (#2395) after a log file that no shipped image
# writes. A node in ALL_BOARDS with Majestic off would take the package off this
# list; a board in UNBUILT_BOARDS that selects it does not, because the matrix
# never builds that board.
#
# usb-dual-role is here for the ordinary reason: it needs a device tree that
# wires dwc3 as dual-role and a kernel built with CONFIG_USB_DWC3_DUAL_ROLE,
Expand Down
80 changes: 80 additions & 0 deletions br-ext-chip-hisilicon/configs/hi3516cv6xx_waybeam_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# OpenIPC
BR2_OPENIPC_SOC_VENDOR="hisilicon"
BR2_OPENIPC_SOC_MODEL="hi3516cv6xx"
BR2_OPENIPC_SOC_FAMILY="hi3516cv6xx"
# One cv6xx image serves dies that report distinct ids (hi3516cv610,
# hi3516cv608) via fw_printenv/ipcinfo. Upgrade identity comes from
# BUILD_PLATFORM=hi3516cv6xx_waybeam; these aliases are a defensive route
# for any image/camera that still surfaces the per-die id.
BR2_OPENIPC_SOC_ALIASES="hi3516cv610 hi3516cv608"
# "waybeam" is deliberately its own variant so this image carries its own
# upgrade identity and does not collide with the published majestic
# hi3516cv6xx_ultimate channel.
BR2_OPENIPC_VARIANT="waybeam"
BR2_OPENIPC_FLASH_SIZE="16"

# Architecture
BR2_arm=y
BR2_cortex_a7=y
BR2_ARM_EABI=y
BR2_ARM_FPU_NEON_VFPV4=y
BR2_ARM_INSTRUCTIONS_THUMB2=y

# Toolchain
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/openipc/firmware/releases/download/$(OPENIPC_TOOLCHAIN).tgz"
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="arm-openipc-linux-musleabi"
BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_10=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
BR2_GCC_VERSION_13_X=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y

# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/$(OPENIPC_KERNEL).tar.gz"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/$(BR2_OPENIPC_SOC_MODEL).generic.config"
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_GENERAL_PATH)/scripts/post-image-split.sh"
BR2_LINUX_KERNEL_UIMAGE=y
BR2_LINUX_KERNEL_XZ=y
BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x40018000"

# Filesystem
BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL)/package/busybox/busybox.config"
BR2_PACKAGE_EXFATPROGS=y
BR2_PACKAGE_UBOOT_TOOLS=y
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
BR2_PACKAGE_IPTABLES=y
BR2_PACKAGE_MOSQUITTO=y
# BR2_PACKAGE_MOSQUITTO_BROKER is not set
BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y
BR2_PACKAGE_WIREGUARD_TOOLS=y
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_SQUASHFS=y
BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y

# Packages
BR2_PACKAGE_DROPBEAR_OPENIPC=y
BR2_PACKAGE_EXFAT_OPENIPC=y
BR2_PACKAGE_HISILICON_OPENSDK=y
BR2_PACKAGE_HISILICON_OSDRV_HI3516CV6XX=y
BR2_PACKAGE_IPCTOOL=y
BR2_PACKAGE_LAME_OPENIPC=y
BR2_PACKAGE_LIBCURL_OPENIPC_CURL=y
# BR2_PACKAGE_LIBCURL_OPENIPC_PROXY_SUPPORT is not set
# BR2_PACKAGE_LIBCURL_OPENIPC_COOKIES_SUPPORT is not set
# BR2_PACKAGE_LIBCURL_OPENIPC_EXTRA_PROTOCOLS_FEATURES is not set
BR2_PACKAGE_LIBEVENT_OPENIPC=y
BR2_PACKAGE_LIBOGG_OPENIPC=y
BR2_PACKAGE_MOTORS=y
BR2_PACKAGE_OPUS_OPENIPC=y
BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y
BR2_PACKAGE_OPUS_OPENIPC_HISI_SHIM=y
BR2_PACKAGE_QUIRC_OPENIPC=y
BR2_PACKAGE_UACME_OPENIPC=y
BR2_PACKAGE_VTUND_OPENIPC=y
BR2_PACKAGE_WAYBEAM=y
BR2_PACKAGE_YAML_CLI=y
BR2_PACKAGE_ZEROTIER_ONE=y
29 changes: 21 additions & 8 deletions general/package/waybeam/Config.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
config BR2_PACKAGE_WAYBEAM
bool "waybeam"
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_PACKAGE_SIGMASTAR_OSDRV_INFINITY6E
depends on BR2_PACKAGE_SIGMASTAR_OSDRV_INFINITY6E || \
(BR2_PACKAGE_HISILICON_OSDRV_HI3516CV6XX && BR2_PACKAGE_HISILICON_OPENSDK)
depends on !BR2_PACKAGE_MAJESTIC
help
Standalone H.265 video encoder and streamer for SigmaStar
Infinity6E (SSC338Q/SSC30KQ). Provides a dual encoder
backend, sensor unlock and an HTTP configuration API.
Standalone H.265 video encoder and streamer with one backend
per SoC: SigmaStar Infinity6E (SSC338Q/SSC30KQ) and Hisilicon
Hi3516CV610 (V5). Drives the sensor and encoder directly and
exposes an HTTP configuration API.

On Hi3516CV610 the backend compiles against the public
OpenHisilicon V5 headers, links the vendor MPP userspace
libraries and drives the sensors as userspace plugins
(libsns_imx662.so / libsns_imx335.so) it builds from its own
tree. The vendor MPP kernel modules stay the ones S70vendor
loads at boot; the backend re-inits the graph around them and
never reloads them.

Infinity6C (SSC378QE) is not offered here even though the
encoder has a backend for it: waybeam's I6C backend targets
Expand All @@ -17,15 +27,18 @@ config BR2_PACKAGE_WAYBEAM

It is an alternative to the Majestic streamer and cannot be
built alongside it: both drive the same sensor and encoder
hardware, and both rely on the SigmaStar OSDRV MI libraries,
hardware, so only one of the two can own the graph. On
SigmaStar they additionally share the OSDRV MI libraries,
which OSDRV installs only when Majestic is not selected.

Installs:
- /usr/bin/waybeam
- /usr/bin/json_cli
- /etc/waybeam.json
- /etc/init.d/S95waybeam
- unlocked imx335/imx415 sensor modules, compiled here
against this board's kernel
- SigmaStar Infinity6E: /usr/bin/json_cli and unlocked
imx335/imx415 sensor modules, compiled here against this
board's kernel
- Hi3516CV610: libsns_imx662.so and libsns_imx335.so
plugins, compiled here

https://github.com/OpenIPC/waybeam
57 changes: 57 additions & 0 deletions general/package/waybeam/files/waybeam.cv610.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"system": {
"webPort": 80,
"verbose": false
},
"video0": {
"rcMode": "cbr",
"fps": 30,
"size": "1920x1080",
"bitrate": 6000,
"gopSize": 1.0,
"sliceCount": 1,
"resilience": "off",
"intraRefreshQp": 0,
"framing": "off"
},
"sensor": {
"index": -1,
"mode": -1
},
"outgoing": {
"enabled": true,
"server": "udp://192.168.1.10:5600",
"streamMode": "rtp",
"maxPayloadSize": 1400,
"connectedUdp": true,
"allowUnixEncoderStall": false,
"audioPort": 5601
},
"audio": {
"enabled": false,
"sampleRate": 48000,
"channels": 1,
"codec": "opus",
"volume": 80,
"mute": false
},
"record": {
"enabled": false,
"dir": "/mnt/mmcblk0p1",
"format": "ts",
"mode": "mirror",
"maxSeconds": 300,
"maxMB": 500
},
"snapshot": {
"enabled": true,
"quality": 80,
"channel": 7
},
"discovery": {
"enabled": true,
"serviceType": "_waybeam-venc._tcp",
"name": "",
"bareAlias": true
}
}
119 changes: 90 additions & 29 deletions general/package/waybeam/waybeam.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,61 +7,108 @@
WAYBEAM_VERSION = HEAD
WAYBEAM_SITE = https://github.com/OpenIPC/waybeam.git
WAYBEAM_SITE_METHOD = git
# The sensor drivers include SigmaStar headers that are not in the waybeam
# The SigmaStar sensor drivers include headers that are not in the waybeam
# tree itself — they come from the OpenIPC/sensors submodule at sensors-src/,
# so the checkout has to bring it along or drivers/ will not compile.
# so the checkout has to bring it along or drivers/ will not compile. The
# Hi3516CV610 backend compiles from the tree alone, but the submodule comes
# along either way.
WAYBEAM_GIT_SUBMODULES = YES
WAYBEAM_LICENSE = MIT
WAYBEAM_LICENSE_FILES = LICENSE

# The encoder ships one source tree with a backend per SoC, picked by
# SOC_BUILD. Only the Infinity6E (star6e) backend is built here. The tree also
# has a maruko backend for Infinity6C, but it targets the 2024-06-18 SigmaStar
# MI libraries while sigmastar-osdrv-infinity6c ships 2022-09-07: measured on
# an SSC378QE, the pipeline streams against those but AE never actuates and
# the frame comes out black (mean luma 2.05/255, against 153.91 on the 2024
# set). Config.in therefore does not offer I6C, and it returns here once the
# two revisions agree.
# SOC_BUILD. Two are built here, one per SoC family:
#
# star6e — SigmaStar Infinity6E (SSC338Q/SSC30KQ). Compiles its own
# imx335/imx415 kernel drivers against the board kernel and installs them
# over the stock _mipi.ko names the SigmaStar loader looks for.
#
# cv610 — Hisilicon Hi3516CV610 (V5). Compiles against the public
# OpenHisilicon V5 headers, links the vendor MPP userspace libraries and
# drives its sensors as userspace plugins (dlopened by name), not kernel
# modules.
#
# The Infinity6C (maruko) backend is deliberately not built: it targets the
# 2024-06-18 SigmaStar MI libraries while sigmastar-osdrv-infinity6c ships
# 2022-09-07. Measured on an SSC378QE, the pipeline streams against those but
# AE never actuates and the frame comes out black (mean luma 2.05/255, against
# 153.91 on the 2024 set). Config.in therefore does not offer I6C, and it
# returns here once the two revisions agree.
ifeq ($(OPENIPC_SOC_FAMILY),hi3516cv6xx)
WAYBEAM_SOC = cv610
WAYBEAM_CONFIG = files/waybeam.cv610.json
# CV610_CC points the tree's own toolchain fetch at Buildroot's compiler, so
# it does not fetch one of its own. CV610_SDK_INC is the OpenHisilicon source
# the opensdk package unpacks; CV610_SDK_LIB is where
# hisilicon-osdrv-hi3516cv6xx installs the vendor MPP .so files. CC_BIN is a
# star6e-only knob.
WAYBEAM_MAKE_OPTS = SOC_BUILD=cv610 \
CV610_CC="$(TARGET_CC)" \
CV610_SDK_INC="$(HISILICON_OPENSDK_DIR)" \
CV610_SDK_LIB="$(TARGET_DIR)/usr/lib"
# Built after the stock sensor and MPP-library packages: the tree's plugins
# replace the stock libsns_imx335.so, and the vendor .so set the backend links
# against is already in $(TARGET_DIR)/usr/lib.
WAYBEAM_DEPENDENCIES += hisilicon-opensdk hisilicon-osdrv-hi3516cv6xx
else
WAYBEAM_SOC = star6e
WAYBEAM_CONFIG = files/waybeam.json
# CC_BIN points the tree's own toolchain check at Buildroot's compiler so it
# does not fetch one of its own.
WAYBEAM_SOC = star6e
WAYBEAM_MAKE_OPTS = SOC_BUILD=star6e STAR6E_CC="$(TARGET_CC)" CC_BIN="$(TARGET_CC)"
# Built after the stock sensor and MI-library packages so the modified sensor
# modules install over the stock sensor_imx*_mipi.ko names.
WAYBEAM_DEPENDENCIES += sigmastar-osdrv-sensors sigmastar-osdrv-infinity6e

# The sensor modules are compiled here against the kernel this build just
# produced, so linux must be built first.
# produced, so linux must be built first. The CV610 branch needs no kernel of
# its own: it builds userspace plugins against the OpenHisilicon headers.
WAYBEAM_DEPENDENCIES += linux
endif

# `build` rather than the tree's `stage` target: stage exists to assemble a
# release tarball, and its extra work is unwanted here. It copies the vendor
# MI .so files into the bundle, which OSDRV already installs to /usr/lib, and
# it stages sensor modules vendored into the source tree as prebuilt
# binaries. The modules below are compiled from drivers/*.c instead.
# it stages sensor modules, the CV610 loader and the release config as
# prebuilt files. What this package ships is compiled from source instead.
ifeq ($(OPENIPC_SOC_FAMILY),hi3516cv6xx)
define WAYBEAM_BUILD_CMDS
$(MAKE) -C $(@D) build $(WAYBEAM_MAKE_OPTS)
$(MAKE) -C $(@D) sensor-cv610 $(WAYBEAM_MAKE_OPTS)
endef
else
define WAYBEAM_BUILD_CMDS
$(MAKE) -C $(@D) build json_cli $(WAYBEAM_MAKE_OPTS)
$(MAKE) -C $(@D)/drivers sensor SOC=$(WAYBEAM_SOC) \
KSRC="$(LINUX_DIR)" CROSS="$(TARGET_CROSS)"
endef
endif

ifeq ($(OPENIPC_SOC_FAMILY),hi3516cv6xx)
define WAYBEAM_INSTALL_TARGET_CMDS
$(INSTALL) -m 0755 -D $(@D)/out/cv610/waybeam \
$(TARGET_DIR)/usr/bin/waybeam
# The backend dlopens /usr/lib/sensors/libsns_<type>.so by the configured
# sensor name. Both plugins it knows ship here; the imx335 one replaces
# the stock build hisilicon-opensdk installs, because the tree's carries
# the T6 timing and the five fixed modes.
$(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/lib/sensors
$(INSTALL) -m 0644 -D $(@D)/sensors/cv610/imx662/libsns_imx662.so \
$(TARGET_DIR)/usr/lib/sensors/libsns_imx662.so
$(INSTALL) -m 0644 -D $(@D)/sensors/cv610/imx335/libsns_imx335.so \
$(TARGET_DIR)/usr/lib/sensors/libsns_imx335.so
$(INSTALL) -m 0644 -D $(WAYBEAM_PKGDIR)/$(WAYBEAM_CONFIG) \
$(TARGET_DIR)/etc/waybeam.json
endef
else
define WAYBEAM_INSTALL_TARGET_CMDS
$(INSTALL) -m 0755 -D $(@D)/out/$(WAYBEAM_SOC)/waybeam \
$(TARGET_DIR)/usr/bin/waybeam
$(INSTALL) -m 0755 -D $(@D)/out/$(WAYBEAM_SOC)/json_cli \
$(TARGET_DIR)/usr/bin/json_cli
$(INSTALL) -m 0644 -D $(WAYBEAM_PKGDIR)/files/waybeam.json \
$(INSTALL) -m 0644 -D $(WAYBEAM_PKGDIR)/$(WAYBEAM_CONFIG) \
$(TARGET_DIR)/etc/waybeam.json
endef

# The encoder dlopens the SigmaStar MI libraries at runtime. They are
# installed to /usr/lib by sigmastar-osdrv-infinity6e, which does so only when
# Majestic is not selected; waybeam depends on !MAJESTIC, so that path always
# applies and the package ships no libraries itself. That the shipped MI
# revision is one the backend targets is a real constraint, not a formality --
# it is what rules out Infinity6C above.

# Waybeam drives its own imx335/imx415 drivers rather than the stock ones:
# they unlock higher-FPS sensor modes, up to 144 fps IMX335 / 100 fps IMX415.
# Install them over the stock _mipi.ko names the SigmaStar module loader looks
Expand All @@ -76,14 +123,28 @@ define WAYBEAM_INSTALL_SENSOR_MODULES
endef
WAYBEAM_POST_INSTALL_TARGET_HOOKS += WAYBEAM_INSTALL_SENSOR_MODULES

# No ISP tuning bins are installed. waybeam.json ships isp.sensorBin empty,
# and the encoder then resolves /etc/sensors/<sensor>.bin itself
# (src/pipeline_common.c) -- the same stock tuning Majestic loads, installed
# by sigmastar-osdrv-infinity6e and filtered on OPENIPC_SNS_MODEL. The bins
# vendored in the source tree under iq-profiles/ are not used: they were
# pulled off a running camera, which is the binary-without-source this tree
# refuses, and they are byte-identical to our own copies anyway.
# The encoder dlopens the SigmaStar MI libraries at runtime. They are
# installed to /usr/lib by sigmastar-osdrv-infinity6e, which does so only when
# Majestic is not selected; waybeam depends on !MAJESTIC, so that path always
# applies and the package ships no libraries itself. That the shipped MI
# revision is one the backend targets is a real constraint, not a formality --
# it is what rules out Infinity6C above.
endif

# On Hi3516CV610 the sensors are userspace plugins built from the waybeam
# tree (above), so the SigmaStar-only blocks -- the unlocked kernel modules and
# the /etc/sensors tuning lookup -- do not apply: the CV610 backend carries its
# own per-mode tables and reads no .ini/.bin from /etc/sensors. No ISP tuning
# bins are installed on either backend: the SigmaStar backend resolves
# /etc/sensors/<sensor>.bin itself (the stock tuning Majestic loads, installed
# by sigmastar-osdrv-infinity6e and filtered on OPENIPC_SNS_MODEL), and the
# bins vendored in the tree under iq-profiles/ are the binary-without-source
# this tree refuses.

# The init script is backend-agnostic: it starts the daemon, which re-inits the
# graph on start and tears it down on stop, and never (re)loads modules. On
# CV610 that means the vendor modules S70vendor put up stay up, which is what
# the backend runs on.
define WAYBEAM_INSTALL_INIT_SYSV
$(INSTALL) -m 0755 -D $(WAYBEAM_PKGDIR)/files/S95waybeam \
$(TARGET_DIR)/etc/init.d/S95waybeam
Expand Down
Loading