From f996e21ca547b7e9d385eb4571488723dbc5b38e Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 14 Aug 2024 21:18:05 -0500 Subject: [PATCH 1/9] update espp and esp-protocols submodules --- components/esp-protocols | 2 +- components/espp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/esp-protocols b/components/esp-protocols index 25d8423..5964ead 160000 --- a/components/esp-protocols +++ b/components/esp-protocols @@ -1 +1 @@ -Subproject commit 25d8423e6dd9031d4bd5a3afe815810137d4532b +Subproject commit 5964eadbf5591e8c12ffa5c724c7ace083423239 diff --git a/components/espp b/components/espp index 691753d..19a92a2 160000 --- a/components/espp +++ b/components/espp @@ -1 +1 @@ -Subproject commit 691753decb2a990a306ebb997f949710eb34dbe2 +Subproject commit 19a92a2ba1946f4f9040254974767a844e75b6b6 From c2dd52fbc171ac29cf91826dde79d923a5613ba1 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 14 Aug 2024 21:18:24 -0500 Subject: [PATCH 2/9] remove older jpegdec --- .gitmodules | 3 --- components/jpegdec | 1 - 2 files changed, 4 deletions(-) delete mode 160000 components/jpegdec diff --git a/.gitmodules b/.gitmodules index e5f1956..90d9f6c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,6 @@ [submodule "components/espp"] path = components/espp url = git@github.com:esp-cpp/espp -[submodule "components/jpegdec"] - path = components/jpegdec - url = git@github.com:bitbank2/JPEGDEC [submodule "components/esp-protocols"] path = components/esp-protocols url = git@github.com:espressif/esp-protocols diff --git a/components/jpegdec b/components/jpegdec deleted file mode 160000 index 99c8a61..0000000 --- a/components/jpegdec +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 99c8a61abc40f81665f2ff78460d84f32e4f2ca1 From eb1a68d4b12add19012107363a15a07c060241fc Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 14 Aug 2024 21:18:45 -0500 Subject: [PATCH 3/9] add esp-cpp/jpegdec --- .gitmodules | 3 +++ components/jpegdec | 1 + 2 files changed, 4 insertions(+) create mode 160000 components/jpegdec diff --git a/.gitmodules b/.gitmodules index 90d9f6c..027ea58 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "components/esp-protocols"] path = components/esp-protocols url = git@github.com:espressif/esp-protocols +[submodule "components/jpegdec"] + path = components/jpegdec + url = https://github.com/esp-cpp/jpegdec diff --git a/components/jpegdec b/components/jpegdec new file mode 160000 index 0000000..9ce05f4 --- /dev/null +++ b/components/jpegdec @@ -0,0 +1 @@ +Subproject commit 9ce05f474f5a712ccb277c27355325ca4fe5371a From 3bbeee6817a94d7c4fa6867bd5e4b1a5766b89bc Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 14 Aug 2024 21:23:23 -0500 Subject: [PATCH 4/9] simplify config and enable some optimizations / speedup --- CMakeLists.txt | 3 +++ sdkconfig.defaults | 37 +++---------------------------------- 2 files changed, 6 insertions(+), 34 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1657c45..a4f1824 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,9 @@ set(EXTRA_COMPONENT_DIRS "components/esp-protocols/components" ) +# add compile definition ARDUINO_ARCH_ESP32, enabling jpegdec simd support +add_compile_definitions(ARDUINO_ARCH_ESP32) + add_compile_definitions(BOARD_HAS_PSRAM) set( diff --git a/sdkconfig.defaults b/sdkconfig.defaults index 7e51ada..020cef3 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -9,7 +9,9 @@ CONFIG_ESP_TASK_WDT_EN=n CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y CONFIG_ESPTOOLPY_FLASHSIZE="16MB" -CONFIG_ESPTOOLPY_FLASHMODE_QIO=y # over twice as fast as DIO +# over twice as fast as DIO +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y CONFIG_FREERTOS_HZ=1000 @@ -48,36 +50,3 @@ CONFIG_FATFS_LFN_HEAP=y # CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240 - -# -# LVGL configuration - # Monitoring -# -# CONFIG_LV_USE_PERF_MONITOR=y -# CONFIG_LV_USE_MEM_MONITOR=y - -# -# LVGL configuration - # Color settings -# -# CONFIG_LV_COLOR_DEPTH_32 is not set -CONFIG_LV_COLOR_DEPTH_16=y -# CONFIG_LV_COLOR_DEPTH_8 is not set -# CONFIG_LV_COLOR_DEPTH_1 is not set -CONFIG_LV_COLOR_DEPTH=16 -CONFIG_LV_COLOR_16_SWAP=y -CONFIG_LV_COLOR_MIX_ROUND_OFS=128 -CONFIG_LV_COLOR_CHROMA_KEY_HEX=0x00FF00 - -# -# LVGL configuration - # Themes -# -CONFIG_LV_USE_THEME_DEFAULT=y -CONFIG_LV_THEME_DEFAULT_DARK=y -CONFIG_LV_THEME_DEFAULT_GROW=y -CONFIG_LV_THEME_DEFAULT_TRANSITION_TIME=80 - -# LVGL Configuration - 3rd party libraries -CONFIG_LV_USE_FS_POSIX=y -# configure the lv drive letter to be 'L' (76) for use as "L:/..." -CONFIG_LV_FS_POSIX_LETTER=76 -CONFIG_LV_USE_SJPG=y -CONFIG_LV_USE_QRCODE=y From d42a0e809d571fe0a84f343cec83a3f80545abf2 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 14 Aug 2024 21:52:20 -0500 Subject: [PATCH 5/9] remove touch / lvgl since they are not needed --- main/main.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index f0dcb61..8da24ea 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -65,15 +65,6 @@ extern "C" void app_main(void) { logger.error("Could not initialize LCD"); return; } - static constexpr size_t pixel_buffer_size = hal::lcd_width() * 50; - if (!hw.initialize_display(pixel_buffer_size)) { - logger.error("Could not initialize display"); - return; - } - if (!hw.initialize_touch()) { - logger.error("Could not initialize touch"); - return; - } std::error_code ec; From 6e6a61be80130ebb0c7460d0a6256539cb647c7c Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 14 Aug 2024 22:43:58 -0500 Subject: [PATCH 6/9] minor update --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56d68bf..831415e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: with: submodules: 'recursive' - - name: Build Examples + - name: Build Main uses: espressif/esp-idf-ci-action@v1 with: esp_idf_version: v5.2.2 From 5e439419a86f7bd6e151ba0c9f41ac7ad46e3933 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Thu, 15 Aug 2024 09:43:27 -0500 Subject: [PATCH 7/9] update --- components/espp | 2 +- main/main.cpp | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/components/espp b/components/espp index 19a92a2..dffe2ca 160000 --- a/components/espp +++ b/components/espp @@ -1 +1 @@ -Subproject commit 19a92a2ba1946f4f9040254974767a844e75b6b6 +Subproject commit dffe2cac2f098c7ba10532510f3f8eb81025dc24 diff --git a/main/main.cpp b/main/main.cpp index 8da24ea..7b87389 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -65,6 +65,15 @@ extern "C" void app_main(void) { logger.error("Could not initialize LCD"); return; } + static constexpr size_t pixel_buffer_size = hw.lcd_width() * 20; + if (!hw.initialize_display(pixel_buffer_size)) { + logger.error("Could not initialize LCD"); + return; + } + if (!hw.initialize_touch()) { + logger.error("Could not initialize touch"); + return; + } std::error_code ec; @@ -172,12 +181,12 @@ extern "C" void app_main(void) { auto display_task = espp::Task::make_unique({ .name = "Display Task", .callback = display_task_fn, - .stack_size_bytes = 10 * 1024, + .stack_size_bytes = 5 * 1024, }); display_task->start(); // make the rtsp client - logger.info("Starting server task"); + logger.info("Starting RTSP client"); std::atomic num_frames_received{0}; espp::RtspClient rtsp_client({ .server_address = mdns_service_address, From b69bb6d6ade569174ea8610da76e09ebf5b2c666 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Thu, 15 Aug 2024 09:44:35 -0500 Subject: [PATCH 8/9] fix log --- main/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/main.cpp b/main/main.cpp index 7b87389..f6dd370 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -67,7 +67,7 @@ extern "C" void app_main(void) { } static constexpr size_t pixel_buffer_size = hw.lcd_width() * 20; if (!hw.initialize_display(pixel_buffer_size)) { - logger.error("Could not initialize LCD"); + logger.error("Could not initialize display"); return; } if (!hw.initialize_touch()) { From 271291735bb1ae22f99c56e3f62a29e18deef14b Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Thu, 15 Aug 2024 09:51:00 -0500 Subject: [PATCH 9/9] decrease lvgl memory since it is not used so we can have larger framebuffers if we want --- main/main.cpp | 2 +- sdkconfig.defaults | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/main/main.cpp b/main/main.cpp index f6dd370..d68a6e7 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -65,7 +65,7 @@ extern "C" void app_main(void) { logger.error("Could not initialize LCD"); return; } - static constexpr size_t pixel_buffer_size = hw.lcd_width() * 20; + static constexpr size_t pixel_buffer_size = hw.lcd_width() * 50; if (!hw.initialize_display(pixel_buffer_size)) { logger.error("Could not initialize display"); return; diff --git a/sdkconfig.defaults b/sdkconfig.defaults index 020cef3..f54e38c 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -50,3 +50,5 @@ CONFIG_FATFS_LFN_HEAP=y # CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240 + +CONFIG_LV_MEM_SIZE_KILOBYTES=10