summaryrefslogtreecommitdiff
path: root/src/class
diff options
context:
space:
mode:
authorHiFiPHile <[email protected]>2026-08-25 09:29:07 +0200
committerHiFiPHile <[email protected]>2026-08-25 09:29:07 +0200
commitb0bd26eb5f0b941da2120e8e90a27bae48f29278 (patch)
tree8f4eae5b0d3a0461f314f8051cfa2d10ed79e1bc /src/class
parent87511ce87280e986545149e4ad017ccf2392671c (diff)
fix(audio): decode full-speed isochronous bInterval
Treat isochronous bInterval as a power-of-two exponent for both full and high speed, using the appropriate frame unit. Packet sizing and fractional scheduling now use the actual service interval. Signed-off-by: HiFiPHile <[email protected]>
Diffstat (limited to 'src/class')
-rw-r--r--src/class/audio/audio_host.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/class/audio/audio_host.c b/src/class/audio/audio_host.c
index c29db658c..571680885 100644
--- a/src/class/audio/audio_host.c
+++ b/src/class/audio/audio_host.c
@@ -237,14 +237,11 @@ static bool audioh_format_from_uac1(uint8_t subframe_size, uint8_t bit_resolutio
return true;
}
-// Endpoint poll interval in microseconds: full-speed bInterval is in 1 ms
-// frames, high-speed isochronous bInterval is a power-of-2 exponent of
-// 125 us microframes
+// Isochronous bInterval is a power-of-2 exponent in 1 ms full-speed frames
+// or 125 us high-speed microframes.
static uint32_t audioh_interval_us(uint8_t ep_interval, uint8_t daddr) {
- if (tuh_speed_get(daddr) == TUSB_SPEED_HIGH) {
- return ((uint32_t)1u << (ep_interval - 1)) * 125u;
- }
- return (uint32_t)ep_interval * 1000u;
+ const uint32_t unit_us = (tuh_speed_get(daddr) == TUSB_SPEED_HIGH) ? 125u : 1000u;
+ return ((uint32_t)1u << (ep_interval - 1)) * unit_us;
}
// UAC 1.0 feature-unit control value width (0 = unsupported variable/unknown width)