Skip to content

fix(pa01): Intermitten trim sounds#7414

Open
richardclli wants to merge 1 commit into
2.11from
richardclli/fix-pa01-trim-sound-2.11
Open

fix(pa01): Intermitten trim sounds#7414
richardclli wants to merge 1 commit into
2.11from
richardclli/fix-pa01-trim-sound-2.11

Conversation

@richardclli
Copy link
Copy Markdown
Member

@richardclli richardclli commented May 31, 2026

Sometimes the trim tone cannot play properly. Problem discovered by opencode + deepseek v4, and seems works better.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for additional radio models: Flysky PA01, PL18U, ST16, and HelloRadioSky V14
    • Added Korean language support to Companion
    • Added "Log Once Per Day" option to general settings
  • Chores

    • Updated build infrastructure and dependencies to stable versions
    • Enhanced release automation workflows

…fer on mute restart

Root cause: When 'Mute if no sound' is enabled and the DMA engine
restarts after a mute cycle, only half 0 of the circular double buffer
was filled (audio_update_dma_buffer(0)). Half 1 retained stale tone
data from the previous playback session, causing up to 10ms of replayed
audio that sounded like trim tones 'looping'.

Fix:
  1. Move audioUnmute() before buffer-filling calls so the 100ms
     RTOS_WAIT_MS doesn't block after consuming a FIFO buffer.
  2. Add audio_update_dma_buffer(1) to initialize both halves of
     the double buffer before starting circular DMA.
@richardclli richardclli added this to the 2.11.7 milestone May 31, 2026
@richardclli richardclli self-assigned this May 31, 2026
@richardclli richardclli marked this pull request as draft May 31, 2026 23:54
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 31, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f10aeff-285b-4899-a293-be707f779ab1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR introduces EdgeTX 2.11 "Jolly Mon" with comprehensive changes: new FlySky boards (PA01, PL18U, ST16) and HelloRadioSky V14 support; refactored data model reference handling and storage serialization; modernized build system with new bootloader wiring and bitmap generation; and improved simulator cross-platform launching, UI organization, and navigation state management.

Changes

EdgeTX 2.11 Release: Board expansion, data model refactoring, and build modernization

Layer / File(s) Summary
Infrastructure pinning and version updates
.devcontainer/devcontainer.json, .gitpod.yml, CMakeLists.txt, README.md, CI container image pins
Version bumped to 2.11 with codename "Jolly Mon"; all Docker images and development containers pinned to v2.11 tag.
Release automation with git-cliff changelog
.github/workflows/release-drafter.yml, cliff.toml
New release-drafter workflow extracts version/codename from CMakeLists.txt, generates changelog via git-cliff, collects artifacts, and creates draft releases with conditional pre-release warnings based on tag suffix.
Companion build workflow refactoring
.github/workflows/companion.yml, linux_cpn.yml, macosx_cpn.yml, win_cpn-64.yml, win_cpn-32.yml
Reusable workflow architecture for Linux/macOS/Windows companion builds; removed 32-bit Windows build; pinned images; upgraded macOS to 15-intel with Xcode 16.0, Python 3.12, Qt action v5.
Board type definitions and predicates
companion/src/firmwares/boards.h
Added enum values for BOARD_FLYSKY_PA01, BOARD_FLYSKY_PL18U, BOARD_FLYSKY_ST16, BOARD_HELLORADIOSKY_V14 and corresponding inline predicates; extended family checks (T12, PL18, HORUS_OR_T16, STM32, new STM32H7).
Board-specific logic
companion/src/firmwares/boards.cpp, boards.h, opentxinterface.cpp, opentxinterface.h
FourCC mappings, EEPROM/flash sizing, display capabilities (LCD height/width), analog mappings, board naming, default internal modules, battery ranges, firmware registrations (pa01, pl18u, st16, v14), sensor limits (75 for STM32H7), Korean language support.
Data model size and capability constants
companion/src/constants.h, customisation_data.h, radio/src/FreeRTOSConfig.h
Sensors increased 60→75; widget name 12→20; widget options 5→10; script filename/name constants added; script inputs reduced 10→6; FreeRTOS timer queue 10→20 and stack depth 512→1024.
Expo and Mix data model reference updates
companion/src/firmwares/input_data.cpp, mixdata.cpp
Virtual input subcomponent indexing changed to chn+1; carry trim indexing uses abs(carryTrim) instead of abs(carryTrim)-1; mix source channel uses destCh instead of destCh-1; weight/offset fields updated via new updateSourceNumRef() instead of updateAdjustRef().
ModelData sorting and reference helpers
companion/src/firmwares/modeldata.cpp, modeldata.h
New sortInputs() method reorders expoData by channel; new updateSourceNumRef() helper for source-aware reference updates; ScriptData buffers use CPN_LEN_SCRIPT_FILENAME and CPN_LEN_SCRIPT_NAME sizing.
RawSource range and display conversion
companion/src/firmwares/rawsource.cpp, rawsource.h
Refactored GVAR range using RANGE_DELTA_FUNCTION and RANGE_ABS_FUNCTION; SOURCE_TYPE_SPECIAL uses abs(index) for symmetric negative index support; new toDisplay(), toRaw(), validateDisplay(), validateRaw() conversion API.
YAML encoding/decoding
companion/src/firmwares/edgetx/yaml_generalsettings.cpp, yaml_modeldata.cpp
Added oneLogPerDay field serialization; conditional input flexType initialization respects configurability; flight mode trim map uses per-trim temporaries; RGB LED color components validated before decoding.
Storage interface and format abstraction
companion/src/storage/storage.h, storage.cpp, etx.h, etx.cpp, sdcard.h, sdcard.cpp, yaml.h, labeled.h, minizinterface.h
Modified StorageFormat and Storage to accept non-const RadioData&; added load(GeneralSettings&) virtual; introduced getStorageFormat() and fileExists() helpers; wrapped miniz.h with GCC diagnostic suppression.
Labeled storage with calibration preservation
companion/src/storage/labeled.cpp, labeled.h
Case-insensitive model regex matching; new loadRadioSettings() helper; write-time preservation of TX calibration and per-input calibration from existing RADIO/radio.yml.
Simulator process launch and settings
companion/src/helpers.cpp, simulator.cpp, simulator.h
Cross-platform simulator startup via QProcess::execute with temporary directory persistence, command-line --flags/-f support, reordered startup initialization, macOS lifecycle callback refactoring; bumped SIMULATOR_OPTIONS_VERSION to 4.
GeneralSettings and UI enhancements
companion/src/firmwares/generalsettings.h, generalsettings.cpp, generaledit/generalsetup.cpp, generalsetup.h, opentxinterface.h
Added oneLogPerDay boolean and switchConfigClear() method; PL18U Bluetooth naming; Korean language support (ko); calibration panel removed from GeneralEdit tabs.
Major UI restructuring
companion/src/generaledit/generalsetup.ui
Reorganized grid layout with haptic/jack mode controls, battery warning and power-delay settings, beeper modes (Quiet/Only Alarms variants), GPS/USB display widget repositioning, MAVLink baud controls, start-sound checkbox, updated tooltips/help text.
Custom functions panel refactoring
companion/src/modeledit/customfunctions.cpp, customfunctions.h
Separated RGB LED scripts (scriptsSetRGB) from play scripts; renamed modified parameter to changed for selective widget updates; added GVar min/max clamping with emission of modified(); conditional parameter write-back.
Logical switches unified duration/delay
companion/src/modeledit/logicalswitches.cpp, logicalswitches.h
Unconditional Duration/Delay widget creation; refactored handlers using LogicalSwitchData& reference; VOFS raw value computation via RawSourceRange::toRaw(); removed lsCapabilityExt field.
Input swapping and source filtering
companion/src/modeledit/inputs.cpp, inputs.h, mixerdialog.cpp
Simplified input swap using direct channel exchange with sortInputs() call; changed pragma once header guard; updated mixer dialog to exclude ScriptsGroup for EditorSource model.
Flight modes and expo dialog
companion/src/modeledit/flightmodes.cpp, expodialog.cpp, modelprinter.cpp
GVar own-value clamping to min/max bounds; expo dialog title offset by +1; VOFS value formatting with fixed-point precision.
Navigation state refresh signaling
companion/src/mdichild.h, mdichild.cpp, mainwindow.cpp
New navigationUpdated() signal emitted after updateNavigation(); signal connected to MainWindow::updateMenus() for menu/toolbar synchronization.
Miscellaneous UI and helper updates
companion/src/audio.cpp, audio.h, simulation/simulateduiwidget.cpp, radiointerface.cpp, translations.cpp, wizarddata.cpp, colorcustomscreens.cpp
Removed LIBOPENUI include; audio buffer count selection via AUDIO_SPI/STORAGE_USE_SPI_FLASH; improved mass storage path discovery; added EDGETX_APP_TRANSLATIONS_PATH support; wizard mix uses fixed switches and translation-aware names; increased button sizing.
Bootloader and firmware link refactoring
radio/src/CMakeLists.txt
Changed bootloader inclusion from targets-specific path to top-level add_subdirectory(bootloader); made --specs=nano.specs conditional on NANO flag; added POWER_LED_BLUE option (ON for X7/LR3PRO, else OFF).
CMake build system modernization
cmake/GenericDefinitions.cmake, radio/src/CMakeLists.txt
Enabled CMake policy CMP0020 NEW; removed CMP0023 OLD; refactored RTL translation into single -DTRANSLATION_IS_RTL definition; narrowed Segger RTT condition; adjusted PCB_TYPES and language lists; wired st16 and pa01 targets.
Bitmap generation refactoring
radio/src/bitmaps/320x240/CMakeLists.txt, 480x272/CMakeLists.txt, 800x480/CMakeLists.txt
New or refactored bitmap build configurations with fixed target names (bm320_*, bm480_*, bm800_*), unified LZ4 arguments, aggregate custom targets, removed PCB-dependent prefixing.
Dependency updates and metadata
cmake/FetchMaxLibQt.cmake, FetchMiniz.cmake, FetchYamlCpp.cmake, fw.json, .gitignore
Updated CMake dependency pins (maxLibQt, miniz with warning suppression, yaml-cpp); updated fw.json targets (pa01, pl18ev, pl18u); added ys_Doc to gitignore.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch richardclli/fix-pa01-trim-sound-2.11

@richardclli richardclli changed the base branch from main to 2.11 May 31, 2026 23:55
@richardclli richardclli marked this pull request as ready for review June 1, 2026 03:03
@richardclli
Copy link
Copy Markdown
Member Author

Checked with PA01 and PL18U, seems better trim tones with mute and unmute

@pfeerick pfeerick added backport/2.11 To be backported to a 2.11 release also. backport/2.12 To be backported to a 2.12 release also. labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/2.11 To be backported to a 2.11 release also. backport/2.12 To be backported to a 2.12 release also.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants