From 804e54f9e59dc2b6442844d1194581e2b39c35b1 Mon Sep 17 00:00:00 2001 From: HiFiPHile Date: Wed, 26 Aug 2026 11:33:46 +0200 Subject: audio: preserve descriptor sample-rate entries Retain every valid discrete rate in descriptor order, including duplicate public tuples. Alternate settings remain independently selectable without disruptive validation or deduplication during enumeration. Signed-off-by: HiFiPHile --- src/class/audio/audio_host.c | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'src') diff --git a/src/class/audio/audio_host.c b/src/class/audio/audio_host.c index 8caecf3d2..a28cad156 100644 --- a/src/class/audio/audio_host.c +++ b/src/class/audio/audio_host.c @@ -994,29 +994,6 @@ static const uint8_t *audioh_parse_as(audioh_interface_t *p_audio, const tusb_de itf_num, alt, ep->ep_size); continue; } - // Skip duplicate configurations already retained from another AS or from - // an earlier frequency entry in this descriptor. - bool duplicate = false; - for (uint8_t as_idx = 0; as_idx < stream->as_count && !duplicate; as_idx++) { - const audioh_as_config_t *existing = &stream->as[as_idx]; - if (existing->format == (uint8_t)format && existing->channels == num_channels) { - for (uint8_t rate_idx = 0; rate_idx < existing->sample_rate_count; rate_idx++) { - if (existing->sample_rate[rate_idx] == sample_rate) { - duplicate = true; - break; - } - } - } - } - for (uint8_t rate_idx = 0; rate_idx < as_config.sample_rate_count && !duplicate; rate_idx++) { - if (as_config.sample_rate[rate_idx] == sample_rate) { - duplicate = true; - } - } - if (duplicate) { - continue; - } - as_config.sample_rate[as_config.sample_rate_count++] = sample_rate; } -- cgit v1.3.1