fix(diag): mic_diag.sh — strip kernel-prepended report ID byte
bt-trace was reading kernel-prepended 0xFD as the low byte of bt_31 counter (and shifting all subsequent fields by 1), producing nonsensical rates like 200000/s and frame lengths of 20224 bytes. Slicing buf[1:] before decoding gives the firmware-supplied payload bytes aligned to the documented 0xFD layout. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
0429bd6703
commit
e0a86a8983
+2
-1
@@ -173,7 +173,8 @@ def query():
|
||||
buf = bytearray(32); buf[0] = 0xFD
|
||||
ioctl_num_32 = (3 << 30) | (32 << 16) | (ord('H') << 8) | 0x07
|
||||
fcntl.ioctl(f, ioctl_num_32, buf)
|
||||
return bytes(buf)
|
||||
# Kernel prepends the report ID at byte 0; firmware payload starts at byte 1.
|
||||
return bytes(buf[1:])
|
||||
|
||||
def decode(b):
|
||||
bt31 = struct.unpack('<I', b[0:4])[0]
|
||||
|
||||
Reference in New Issue
Block a user