Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- name: Build
run: |
list="ak39xx fhan-v2 gm813x hisi-v1 hisi-v2 hisi-v2a hisi-v4 hisi-v4a inge-t31 rv11xx star6 star6e"
list="ak39xx fhan-v2 gm813x hisi-v1 hisi-v2 hisi-v2a hisi-v4 hisi-v4a inge-t31 rv11xx s3l star6 star6e"
for lib in $list; do
sh build.sh $lib
zip $lib divinus*
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ In spite of these design choices, Divinus boasts numerous features that cater to
| infinity6c[^18] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| mercury6[^19] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| sun8iw21p1[^20] | ↻ | ↻ | ↻ | ↻ | ↻ |
| S3L[^21] | ↻ | ✔️ | ✔️ | ✔️ | ✔️ |

_✔️ - supported, ↻ - in development, ✗ - unsupported, ⁿ/ₐ - not supported by hardware_

Expand All @@ -73,6 +74,7 @@ _* At the moment, text, RGB or bitfield bitmaps and PNG overlays are handled, mo
[^18]: SSC377\(D/DE/QE\) and SSC378\[DE/QE\]
[^19]: SSC359G
[^20]: V851S\(E\) and V853
[^21]: Ambarella S3L (S3LM), via the IAV driver; the ISP configuration and 3A (AE, AWB) run in Divinus; the on-screen display is drawn on the H.264/H.265 stream; JPEG snapshots come from the MJPEG stream (its size and quality) when it is on, otherwise from a 1 fps JPEG stream at jpeg.width/height and jpeg.qfactor (a snapshot request's own size, quality and grayscale are not applied); changing a stream's size, enabling one that was off at start, or raising its frame rate needs a restart of Divinus


### Documentation
Expand Down
8 changes: 6 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ elif [ "$1" = "fhan-v1" ]; then
elif [ "$1" = "armv6-musl" ] || [ "$1" = "fhan-v2" ]; then
PRE="openipc-linux-musleabi"
toolchain toolchain.fullhan-fh8852v200 arm
elif [ "$1" = "armhf-vfp3" ] || [ "$1" = "s3l" ]; then
# Ambarella S3L: a Cortex-A9 with VFPv3. The armhf-musl toolchain targets VFPv4 with fused
# multiply-add, which faults (SIGILL) here.
toolchain toolchain.ambarella-s3l arm
elif [ "$1" = "mips-musl" ] || [ "$1" = "inge-t31" ]; then
toolchain toolchain.ingenic-t31 mipsel
elif [ "$1" = "riscv64-musl" ] || [ "$1" = "cvitek" ]; then
Expand All @@ -68,8 +72,8 @@ elif [ "$1" = "riscv64-musl" ] || [ "$1" = "cvitek" ]; then
toolchain riscv64-lp64d--musl--stable-2024.05-1 riscv64
else
echo "Usage: $0 [arm-glibc|arm-musl3|arm-musl4|arm9-glibc|arm9-musl3|arm9-musl4|arm9-uclibc|"
echo " armhf-glibc|armhf-musl|armhf-uclibc|armv6-musl|mips-musl|riscv64-musl|ak39xx|cvitek|gm813x|"
echo " armhf-glibc|armhf-musl|armhf-uclibc|armhf-vfp3|armv6-musl|mips-musl|riscv64-musl|ak39xx|cvitek|gm813x|"
echo " hisi-v1|hisi-v2|hisi-v2a|hisi-v3|hisi-v3a|hisi-v4|hisi-v4a|fhan-v1|fhan-v2|inge-t31|rv11xx|"
echo " star6|star6e] (debug)"
echo " s3l|star6|star6e] (debug)"
rm -f .previous
fi
7 changes: 5 additions & 2 deletions doc/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This document describes the fields that can be found within a configuration file

## System section

- **sensor_config**: Path to the sensor calibration or configuration file, if applicable (e.g., `/etc/sensors/imx415.bin`).
- **sensor_config**: Path to the sensor calibration or configuration file, if applicable (e.g., `/etc/sensors/imx415.bin`). On Ambarella S3L, an ISP configuration file (S3LISP03, as OpenIPC's S3L package generates them); when it is missing, the one for the detected sensor, `/etc/sensors/<sensor>.bin` (OpenIPC's S3L package generates `ov4689.bin`), is used. One of them is required: without an ISP configuration the S3L's DSP produces no image, so Divinus stops with an error.
- **web_port**: Port number for the web server (default: `80`).
- **web_whitelist**: Array of up to 4 IP addresses or domains allowed to access the web server.
- **web_enable_auth**: Boolean to enable authentication on the API, live stream and WebUI endpoints (default: `false`).
Expand Down Expand Up @@ -35,7 +35,10 @@ This document describes the fields that can be found within a configuration file

- **mirror**: Boolean to turn on image mirroring (default: `false`).
- **flip**: Boolean to turn on image flipping (default: `false`).
- **antiflicker**: Antiflicker setting in Hz (default: `60`).
- **antiflicker**: Antiflicker setting in Hz (default: `60`); the S3L's own auto exposure honours 50 or 60 and treats anything else as off.
- **auto_exposure**: Boolean, Divinus's own auto exposure on platforms whose HAL runs its 3A itself (Ambarella S3L; default: `true`).
- **exposure_target**: Target mean luma for that auto exposure, up to 235; 0 or anything below 17 uses the platform default (55 on the S3L; default: `0`).
- **auto_white_balance**: Boolean, Divinus's own auto white balance on those platforms (default: `true`).

## mDNS section

Expand Down
13 changes: 12 additions & 1 deletion src/app_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ int app_config_save(void) {
fprintf(file, " mirror: %s\n", app_config.mirror ? "true" : "false");
fprintf(file, " flip: %s\n", app_config.flip ? "true" : "false");
fprintf(file, " antiflicker: %d\n", app_config.antiflicker);
fprintf(file, " auto_exposure: %s\n", app_config.auto_exposure ? "true" : "false");
fprintf(file, " exposure_target: %d\n", app_config.exposure_target);
fprintf(file, " auto_white_balance: %s\n", app_config.auto_white_balance ? "true" : "false");

fprintf(file, "mdns:\n");
fprintf(file, " enable: %s\n", app_config.mdns_enable ? "true" : "false");
Expand Down Expand Up @@ -156,7 +159,7 @@ int app_config_save(void) {
}

fprintf(file, "audio:\n");
fprintf(file, " enable: %s\n", app_config.audio_enable ? "true" : "false");
fprintf(file, " enable: %s\n", app_config.audio_requested ? "true" : "false");
fprintf(file, " bitrate: %d\n", app_config.audio_bitrate);
fprintf(file, " gain: %d\n", app_config.audio_gain);
fprintf(file, " srate: %d\n", app_config.audio_srate);
Expand Down Expand Up @@ -265,6 +268,7 @@ enum ConfigError app_config_parse(void) {

app_config.sensor_config[0] = 0;
app_config.audio_enable = false;
app_config.audio_requested = false;
app_config.audio_bitrate = 128;
app_config.audio_gain = 0;
app_config.jpeg_enable = false;
Expand All @@ -280,6 +284,9 @@ enum ConfigError app_config_parse(void) {
app_config.mirror = false;
app_config.flip = false;
app_config.antiflicker = 0;
app_config.auto_exposure = true;
app_config.exposure_target = 0;
app_config.auto_white_balance = true;

app_config.night_mode_enable = false;
app_config.ir_sensor_pin = 999;
Expand Down Expand Up @@ -412,6 +419,9 @@ enum ConfigError app_config_parse(void) {
if (err != CONFIG_OK)
goto RET_ERR;
parse_int(&ini, "isp", "antiflicker", -1, 60, &app_config.antiflicker);
parse_bool(&ini, "isp", "auto_exposure", &app_config.auto_exposure);
parse_int(&ini, "isp", "exposure_target", 0, 235, &app_config.exposure_target);
parse_bool(&ini, "isp", "auto_white_balance", &app_config.auto_white_balance);

parse_bool(&ini, "mdns", "enable", &app_config.mdns_enable);

Expand Down Expand Up @@ -502,6 +512,7 @@ enum ConfigError app_config_parse(void) {
}

parse_bool(&ini, "audio", "enable", &app_config.audio_enable);
app_config.audio_requested = app_config.audio_enable;
if (app_config.audio_enable) {
parse_int(&ini, "audio", "bitrate", 32, 320, &app_config.audio_bitrate);
parse_int(&ini, "audio", "gain", -60, 30, &app_config.audio_gain);
Expand Down
5 changes: 5 additions & 0 deletions src/app_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ struct AppConfig {
bool mirror;
bool flip;
int antiflicker;
bool auto_exposure;
int exposure_target;
bool auto_white_balance;

// [osd]
bool osd_enable;
Expand Down Expand Up @@ -78,6 +81,8 @@ struct AppConfig {

// [audio]
bool audio_enable;
// audio.enable as configured: audio_enable is cleared for the run on a platform without audio
bool audio_requested;
unsigned int audio_bitrate;
int audio_gain;
unsigned int audio_srate;
Expand Down
Loading