Skip to content

Commit

Permalink
LZ4 Compression (#79)
Browse files Browse the repository at this point in the history
Add a new configuration option, "compress_osd", to the air side process.

If this is set to "true", then the entire "frame buffer" will be sent using LZ4 compression at the rate defined in osd_update_rate_hz, instead of sending raw MSP messages over the air.

This should fix INAV delta update related issues as well as provide better link stability.
  • Loading branch information
bri3d authored Oct 13, 2022
1 parent 46be8d9 commit 6c8903a
Show file tree
Hide file tree
Showing 16 changed files with 3,859 additions and 33 deletions.
4 changes: 4 additions & 0 deletions Makefile.dji
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ all: jni/*
install: all
install -d ipk/goggle/build/data/opt/fonts/
install fonts/*.bin ipk/goggle/build/data/opt/fonts/
install -d ipk/goggle/build/data/opt/mspdictionaries/
install dictionaries/*.bin ipk/goggle/build/data/opt/mspdictionaries/
install -d ipk/goggle/build/data/opt/etc/preload.d/
install libs/armeabi-v7a/libdisplayport_osd_shim.so ipk/goggle/build/data/opt/etc/preload.d/
install -d ipk/airunit/build/data/opt/bin/
install libs/armeabi-v7a/msp_displayport_mux ipk/airunit/build/data/opt/bin/
install -d ipk/airunit/build/data/opt/mspdictionaries/
install dictionaries/*.bin ipk/airunit/build/data/opt/mspdictionaries/
install -d ipk/airunit/build/data/opt/etc/package-config/msp-osd/
install config/airunit/* ipk/airunit/build/data/opt/etc/package-config/msp-osd/
install -d ipk/goggle/build/data/opt/etc/package-config/msp-osd/
Expand Down
4 changes: 3 additions & 1 deletion config/airunit/config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"fast_serial": false,
"cache_serial": false
"cache_serial": false,
"osd_update_rate_hz": 10,
"compress_osd": false
}
11 changes: 11 additions & 0 deletions config/airunit/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
"cache_serial": {
"name": "Cache Responses",
"widget": "checkbox"
},
"compress_osd": {
"name": "Compress OSD",
"widget": "checkbox"
},
"osd_update_rate_hz": {
"name": "OSD update rate",
"widget": "range",
"min": 2,
"max": 20,
"step":1
}
},
"units": [
Expand Down
18 changes: 17 additions & 1 deletion config/airunit/schemaV2.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@
true,
false
]
}
},
"compress_osd": {
"title": "Compress OSD",
"type": "boolean",
"description": "Send full frames of compressed data instead of sending MSP to the goggles.",
"enum": [
true,
false
]
},
"osd_update_rate_hz": {
"name": "OSD update rate (for Compressed OSD)",
"type": "number",
"description": "OSD update rate, used only for compressed OSD.",
"minimum": 1,
"maximum": 20
}
}
}
Binary file added dictionaries/dictionary_1.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion ipk/airunit/control/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: msp-osd
Version: 0.6.11
Version: 0.7.0
Maintainer: bri3d
Description: MSP OSD service for the DJI HD FPV airunit.
Architecture: pigeon-airside
Expand Down
2 changes: 1 addition & 1 deletion ipk/goggle/control/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: msp-osd
Version: 0.6.12
Version: 0.7.0
Maintainer: bri3d
Description: MSP OSD service for the DJI HD FPV goggles.
Architecture: pigeon-glasses
Expand Down
7 changes: 5 additions & 2 deletions jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ LOCAL_SRC_FILES := \
rec/rec_shim.c \
rec/rec.c \
util/fs_util.c \
toast/toast.c
toast/toast.c \
lz4/lz4.c
include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)
Expand All @@ -39,9 +40,11 @@ LOCAL_SRC_FILES:= \
json/parson.c \
msp_displayport_mux.c \
msp/msp.c \
msp/msp_displayport.c \
net/network.c \
net/serial.c \
util/fs_util.c
util/fs_util.c \
lz4/lz4.c
LOCAL_MODULE := msp_displayport_mux
include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
Loading

0 comments on commit 6c8903a

Please sign in to comment.