Skip to content

refactor(audio): pack double audio data into a packet#227

Merged
awalol merged 10 commits into
masterfrom
refactor/audio-stream-path
Jul 8, 2026
Merged

refactor(audio): pack double audio data into a packet#227
awalol merged 10 commits into
masterfrom
refactor/audio-stream-path

Conversation

@awalol

@awalol awalol commented Jul 8, 2026

Copy link
Copy Markdown
Owner

更改了什么

总体更改

特别感谢 @Nielk1研究报告和分享的抓包片段让我更深入了解了 DS5 的数据包
这次变动将音频发送周期变为约 20ms,减缓蓝牙压力。
在 48 缓冲区的测试中,感觉和之前的方案得到的效果没有区别。
这次修改的优点是移除了 StateMgr,可避免因 StateMgr 造成的普通震动、自适应扳机工作不正常现象的发生。
极限测试,在 2ms 周期的 SetState 音频没有卡顿,1ms 就不行了

细节更改

将 crc32_lookup_table 移动到内存中存储
将 l2cap_request_can_send_now_event 移动到内存中运行
为 haptics 增加过滤器,避免 3000hz 以上的音频造成的声音干扰

未完成的工作

  • 0x80/0x81 测试命令失效(在之后统一做个管理器进行存储)

What Changed

Overall Changes

Special thanks to @Nielk1 for their research report and shared packet samples, which helped me gain a deeper understanding of DS5 packets.

This change adjusts the audio transmission interval to approximately 20 ms, reducing Bluetooth pressure.

In tests with a 48-buffer setup, the result felt no different from the previous approach.

The advantage of this change is that it removes StateMgr, which avoids issues caused by StateMgr where normal vibration and adaptive triggers may not work correctly.

Detailed Changes

Moved crc32_lookup_table into memory storage.

Moved l2cap_request_can_send_now_event to run from memory.

Added a filter for haptics to prevent audio above 3000 Hz from causing noise interference.

Unfinished Work

  • 0x80/0x81 test commands are broken. These will be stored through a unified manager in the future.

@awalol
awalol marked this pull request as ready for review July 8, 2026 07:51
@awalol
awalol merged commit 1229345 into master Jul 8, 2026
6 checks passed
@awalol
awalol deleted the refactor/audio-stream-path branch July 10, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant