Skip to content

Commit 6eae3a2

Browse files
committed
chore: optimize latency and serial stability
1 parent 214de4b commit 6eae3a2

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

components/acoustics-porting/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
88

99
set(ACOUSTICS_SDK_VERSION_MAJOR 1)
1010
set(ACOUSTICS_SDK_VERSION_MINOR 9)
11-
set(ACOUSTICS_SDK_VERSION_PATCH 11)
11+
set(ACOUSTICS_SDK_VERSION_PATCH 22)
1212

1313
set(ACOUSTICS_PORTING_INCLUDES_DIR
1414
${CMAKE_CURRENT_LIST_DIR}/porting

components/acoustics-porting/porting/transport/uart_console.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class TransportUARTConsole final: public hal::Transport
160160

161161
inline int flush() noexcept override
162162
{
163-
return fsync(fileno(stdout));
163+
return usb_serial_jtag_wait_tx_done(portMAX_DELAY);
164164
}
165165

166166
protected:
@@ -199,7 +199,7 @@ class TransportUARTConsole final: public hal::Transport
199199

200200
private:
201201
usb_serial_jtag_driver_config_t _config = {
202-
.tx_buffer_size = 8192,
202+
.tx_buffer_size = 32 * 1024,
203203
.rx_buffer_size = 4096,
204204
};
205205

components/acoustics/api/v1/task_sc.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ namespace shared {
5252
inline std::chrono::steady_clock::time_point buffer_base_ts = std::chrono::steady_clock::now();
5353

5454
inline constexpr const size_t sample_chunk_ms = 100;
55-
inline constexpr const size_t invoke_pull_ms = 20;
55+
inline constexpr const size_t invoke_pull_ms = 10;
5656

5757
inline constexpr const float overlap_ratio_min = 0.f;
58-
inline constexpr const float overlap_ratio_max = 0.6f;
58+
inline constexpr const float overlap_ratio_max = 0.75f;
5959
inline std::atomic<float> overlap_ratio = 0.5f;
6060

6161
} // namespace shared
@@ -324,7 +324,7 @@ struct TaskSC final
324324
{
325325
return 0;
326326
}
327-
return (_fs - current_available) * 1000 / _sr;
327+
return (_fs - current_available) * 1000 / (_sr + 1);
328328
}
329329

330330
hal::Sensor *_sensor;

0 commit comments

Comments
 (0)