From 28a42d62e26a069a61ce5d9fb2c612fd20c15535 Mon Sep 17 00:00:00 2001 From: floppyhammer Date: Sat, 21 Mar 2026 11:06:58 +0800 Subject: [PATCH 1/2] Reduce buffer size --- src/RtlUsbAdapter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/RtlUsbAdapter.cpp b/src/RtlUsbAdapter.cpp index dce8a66..c881996 100644 --- a/src/RtlUsbAdapter.cpp +++ b/src/RtlUsbAdapter.cpp @@ -56,7 +56,8 @@ RtlUsbAdapter::RtlUsbAdapter(libusb_device_handle *dev_handle, Logger_t logger) */ std::vector RtlUsbAdapter::infinite_read() { - uint8_t buffer[65000] = {0}; + static constexpr int BUF_SIZE = 16 * 1024; + uint8_t buffer[BUF_SIZE] = {}; int actual_length = 0; int rc; From 1129fe786f2fc56d092cd8c172fee68ab62a1a1f Mon Sep 17 00:00:00 2001 From: floppyhammer Date: Sat, 21 Mar 2026 12:54:48 +0800 Subject: [PATCH 2/2] Reduce aggregation --- src/RtlUsbAdapter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/RtlUsbAdapter.cpp b/src/RtlUsbAdapter.cpp index c881996..42e0321 100644 --- a/src/RtlUsbAdapter.cpp +++ b/src/RtlUsbAdapter.cpp @@ -21,13 +21,13 @@ RtlUsbAdapter::RtlUsbAdapter(libusb_device_handle *dev_handle, Logger_t logger) if (usbSpeed > LIBUSB_SPEED_HIGH) // USB 3.0 { - rxagg_usb_size = 0x7; - rxagg_usb_timeout = 0x1a; + rxagg_usb_size = 0x3; // 16KB + rxagg_usb_timeout = 0x01; } else { - /* the setting to reduce RX FIFO overflow on USB2.0 and increase rx + /* the setting to reduce RX FIFO overflow on USB2.0 and increase rx * throughput */ - rxagg_usb_size = 0x5; - rxagg_usb_timeout = 0x20; + rxagg_usb_size = 0x1; // 8KB + rxagg_usb_timeout = 0x01; } GetChipOutEP8812();