Commit Graph
34 Commits
Author SHA1 Message Date
MarcelineVPQandClaude Opus 4.7 8217d3a414 rebase: Phase E — VU peaks, frame counters, Audio Auto Haptics
Build now compiles. audio.cpp on top of upstream's state_mgr-based
audio_loop adds three additive pieces:

1. VU peak meters for ch0/1 (spk_max) and ch2/3 (hap_max) tracked
   per-sample in the existing loop; written back to g_peak_spk /
   g_peak_hap after. Accessors decay 12.5% per read so the OLED
   VU bars fall back naturally over a few frames.

2. Monotonic byte-flow counters: g_usb_frames++ after tud_audio_read
   (the OLED Diagnostics screen + web emulator compute USB-aud/s
   and BT-0x32/s as delta over time). g_bt_packets++ after each
   0x36 bt_write.

3. Audio Auto Haptics DSP — 1-pole LP + envelope follower +
   modulation + soft-clip per loteran/DS5Dongle 5d6bc2f, with our
   added 4th "Fallback" mode that fires only after the game's
   native haptic path has been silent for ~1 s (NATIVE_SILENT_TIMEOUT
   = 100 audio_loop calls). Preserves native HD haptics (Spider-Man
   Remastered) while filling in for games that send no haptic data
   (Ghost of Tsushima). Modes: 0=Off, 1=Fallback (default), 2=Mix,
   3=Replace.

Crucially the state_mgr-based state_set(pkt+13, 63) call is left
untouched — that's upstream's correct replacement for our prior
state_data restore hack, and it's load-bearing for speaker output.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 07:59:58 -06:00
awalol b3085456f5 add comment 2026-05-16 14:10:09 +08:00
awalol 508a84115e fix: DISABLE_SPEAKER_PROC option 2026-05-16 14:09:06 +08:00
awalol 7bbe37ba1c refactor: unified controller state by state_mgr 2026-05-15 20:07:12 +08:00
Antti Pohjola 9cf52a0665 bugfix: Pico W build. 2026-05-13 14:04:56 +03:00
Antti Pohjola 5e7da1779e feat: add DISABLE_SPEAKER_PROC build flag 2026-05-13 13:15:09 +03:00
awalol 3a31bd75af refactor: add SetStateData and audio send priority 2026-05-13 16:19:08 +08:00
awalol ec2b1dbc12 clarify SetStateData func 2026-05-09 14:29:35 +08:00
awalol c45ceea535 optimize high frequency 0x02 SetStateData 2026-05-09 14:21:21 +08:00
awalol c323c14f19 rename haptics buf_len to audio buf_len 2026-05-09 13:20:46 +08:00
awalol 5d32bb6de9 haptics gain before resample 2026-05-08 23:57:11 +08:00
awalol 8bb0c816df 使用ds5原始的音量调节范围 2026-05-07 22:28:29 +08:00
awalol b736cc91d7 fix: usbaudio set_cur cmd set volume 2026-05-07 19:11:42 +08:00
awalol 767e7437f7 refactor: remove opus queue 2026-05-06 17:58:06 +08:00
awalol a89618f463 cmd: set haptics buffer length 2026-05-05 11:45:23 +08:00
awalol fb8624b61b feat: config manager 2026-05-05 01:17:15 +08:00
awalol 55c0d42998 rename opus_element variable for clarity 2026-04-30 15:40:04 +08:00
awalol 5b04cbda80 fix: audio resampler_out buffer overflow. static queue element 2026-04-30 14:44:25 +08:00
awalol 2413b009cd revert 64f0216c 2026-04-29 21:46:44 +08:00
awalol 64f0216c3b enable haptics wdlresample filtercnt 2026-04-29 18:49:33 +08:00
awalol 3300e084bc clean std:: 2026-04-28 13:17:55 +08:00
awalol 6394f264e0 optimize queue remove 2026-04-27 22:52:45 +08:00
awalol 8af6dd6389 typo 2026-04-27 13:11:22 +08:00
awalol f497472127 increase the voltage 2026-04-26 23:06:43 +08:00
awalol c5805dcc8c feat: headset auto switch 2026-04-26 15:14:26 +08:00
awalol fe1c1cd6a5 fix: speaker noise. Thanks Junhoo (@1220951120) 2026-04-26 14:07:05 +08:00
awalol 2fb3c2f90b speaker work 2026-04-26 11:34:34 +08:00
awalol 4ee1aa0b64 full device name. lower buffer length 2026-03-26 18:41:57 +08:00
awalol 845656aedd feat:adjust gain in speaker volume. add led and auto-disconnect toggle in mute. 2026-03-22 00:33:30 +08:00
awalol 8c8af7b97c set buffer length 2026-03-21 11:01:52 +08:00
awalol 94530dd9a4 将音量调节的范围设为 -100 到 0 (当前无作用), 明确增益的位置 2026-03-17 16:52:38 +08:00
awalol 51157ce997 我也不知道改了什么 2026-03-14 21:37:47 +08:00
awalol 0fd9c2bdd3 fix reconnect 2026-03-10 16:14:05 +08:00
awalol 9a929530d9 First Commit 2026-03-05 16:21:25 +08:00