@geastack/targets 0.1.89 → 0.1.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -92,6 +92,13 @@ open/capture methods in both modes, checks clock conflicts, and verifies that
92
92
  a blocked RX read permits TX progress only in the opted-in mode. Its executable
93
93
  uses the board's existing ignored `build/` directory.
94
94
 
95
+ With `GEA_AUDIO_ECHO_CANCELLATION=1`, applications can scale the board's calibrated
96
+ post-AEC gain with `GEA_AUDIO_AEC_OUTPUT_GAIN_SCALE`. Its default is `1.0f`;
97
+ `0.501187234f` reduces gain by 6 dB. Scaling happens before int16 clipping,
98
+ without changing ADC gain or the echo reference. Valid scales are 0 through 64.
99
+ `node targets/esp32/test/audio-aec-output-gain.test.mjs` verifies both AMOLED
100
+ calibrations and rejects invalid scales without creating build artifacts.
101
+
95
102
  ## License
96
103
 
97
104
  This repo is the GeaStack **embedded board support** (ESP32, RP2350) and is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geastack/targets",
3
- "version": "0.1.89",
3
+ "version": "0.1.91",
4
4
  "description": "Native embedded build targets (ESP32-IDF, RP2350) for geastack apps: board sources, target catalog, and CMake glue driven by the gea CLI.",
5
5
  "license": "GPL-3.0-only",
6
6
  "repository": {
@@ -43,7 +43,7 @@
43
43
  "@geastack/engine": "^0.1.9",
44
44
  "@geastack/geaos": "^0.1.3",
45
45
  "@geastack/geatsc-plugin-gea": "^0.1.15",
46
- "@geastack/host": "^0.1.13"
46
+ "@geastack/host": "^0.1.14"
47
47
  },
48
48
  "scripts": {
49
49
  "test": "for f in $(git ls-files | grep -E '(^|/)(test[-_][^/]*|[^/]*\\.test)\\.mjs$'); do echo \"==> $f\"; node \"$f\" || exit 1; done"
@@ -116,7 +116,15 @@ constexpr float aecOutputGainOf(const AudioConfig &audio) {
116
116
  return 1.0f;
117
117
  }
118
118
  constexpr float kAecMicGain = aecMicGainOf(gea::platform::board::audio);
119
- constexpr float kAecOutputGain = aecOutputGainOf(gea::platform::board::audio);
119
+ #ifndef GEA_AUDIO_AEC_OUTPUT_GAIN_SCALE
120
+ #define GEA_AUDIO_AEC_OUTPUT_GAIN_SCALE 1.0f
121
+ #endif
122
+ static_assert(GEA_AUDIO_AEC_OUTPUT_GAIN_SCALE >= 0.0f && GEA_AUDIO_AEC_OUTPUT_GAIN_SCALE <= 64.0f,
123
+ "AEC output gain scale must be between 0 and 64");
124
+ // Apply before the AEC output is clamped to int16. Scaling the published
125
+ // microphone packets afterward cannot recover samples already clipped here.
126
+ constexpr float kAecOutputGain = aecOutputGainOf(gea::platform::board::audio) *
127
+ GEA_AUDIO_AEC_OUTPUT_GAIN_SCALE;
120
128
  template <typename AudioConfig>
121
129
  constexpr bool aecAggressiveNlpOf(const AudioConfig &audio) {
122
130
  if constexpr (requires { audio.aecAggressiveNlp; }) return audio.aecAggressiveNlp;
@@ -84,3 +84,5 @@ void audio::AudioSystem::setVolume(int value)
84
84
  bool audio::AudioSystem::playFile(const std::string &) { return false; }
85
85
  bool audio::AudioSystem::playPcm(const std::int16_t *, std::size_t, int, int) { return false; }
86
86
  void audio::AudioSystem::stopPlayback() {}
87
+ // Audio is compiled out here, so nothing is ever queued to flush.
88
+ void audio::AudioSystem::flushPlayback() {}
@@ -504,6 +504,21 @@ if(TARGET idf::fatfs)
504
504
  "SHELL:-include ${CMAKE_CURRENT_LIST_DIR}/fatfs_ffconf.h")
505
505
  endif()
506
506
 
507
+ # Board id as a C string for app native sources (e.g. the diagnostics
508
+ # deviceInfo facade keys its capability catalog off deviceId()). Without this
509
+ # the facade's #ifndef fallback returns "unknown" and every subsystem shows up
510
+ # absent/N/A. gea_framework.cmake already defines GEA_EMBEDDED_CPP_BOARD bare
511
+ # for the whole build (the runtime's board pool layout tests only that it is
512
+ # defined), so the id REPLACES that build-wide define rather than adding a
513
+ # second, conflicting one beside it: every component still agrees on the pool
514
+ # layout, and the framework sources stop failing with "redefined" -Werror.
515
+ if(COMMAND idf_build_get_property)
516
+ idf_build_get_property(_GEA_BUILD_DEFINES COMPILE_DEFINITIONS)
517
+ list(REMOVE_ITEM _GEA_BUILD_DEFINES "GEA_EMBEDDED_CPP_BOARD")
518
+ list(APPEND _GEA_BUILD_DEFINES "GEA_EMBEDDED_CPP_BOARD=\"${GEA_EMBEDDED_CPP_BOARD}\"")
519
+ idf_build_set_property(COMPILE_DEFINITIONS "${_GEA_BUILD_DEFINES}")
520
+ endif()
521
+
507
522
  set(GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG_VALUE 0)
508
523
  if(DEFINED ENV{GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG})
509
524
  set(GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG_VALUE "$ENV{GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG}")
@@ -519,11 +534,6 @@ target_compile_definitions(${COMPONENT_LIB} PRIVATE
519
534
  # 1-bit panels (epaper family default): stylesheets can theme via
520
535
  # `@media (monochrome)`. Color boards reusing this definition set 0.
521
536
  GEA_EMBEDDED_DISPLAY_MONOCHROME=${GEA_EMBEDDED_TARGET_DISPLAY_MONOCHROME}
522
- # Board id as a C string for app native sources (e.g. the diagnostics
523
- # deviceInfo facade keys its capability catalog off deviceId()). Without this
524
- # the facade's #ifndef fallback returns "unknown" and every subsystem shows
525
- # up absent/N/A.
526
- GEA_EMBEDDED_CPP_BOARD=\"${GEA_EMBEDDED_CPP_BOARD}\"
527
537
  GEA_CPP_ENABLE_REGEX=0
528
538
  GEA_CPP_USE_TO_CHARS_DOUBLE=0
529
539
  GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG=${GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG_VALUE}
@@ -2550,4 +2550,7 @@ void AudioSystem::setVolume(int) {}
2550
2550
  bool AudioSystem::playFile(const std::string &) { return false; }
2551
2551
  bool AudioSystem::playPcm(const std::int16_t *, std::size_t, int, int) { return false; }
2552
2552
  void AudioSystem::stopPlayback() {}
2553
+ // No PCM stream output is queued by this backend (only the ESP32 runtime
2554
+ // streams PCM), so a flush has nothing to discard.
2555
+ void AudioSystem::flushPlayback() {}
2553
2556
  } // namespace gea::platform::audio