Skip to content

Commit af9f243

Browse files
committed
Merge branch 'fix/fix_uac_device_mic' into 'master'
fix(uac_device): update mic descriptor Closes AEGHB-1146 See merge request ae_group/esp-iot-solution!1333
2 parents 44e0f7f + ece2761 commit af9f243

File tree

5 files changed

+26
-1
lines changed

5 files changed

+26
-1
lines changed

components/usb/usb_device_uac/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# ChangeLog
22

3+
## v1.2.1 (2025-8-4)
4+
5+
* Fix build issue and audio path for MIC-only configuration.
6+
37
## v1.2.0 (2025-3-31)
48

59
* Supports integration into other TinyUSB projects.

components/usb/usb_device_uac/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.2.0"
1+
version: "1.2.1"
22
targets:
33
- esp32s2
44
- esp32s3
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
2+
CONFIG_FREERTOS_HZ=1000
3+
CONFIG_ESP_TASK_WDT_EN=n

components/usb/usb_device_uac/tusb_uac/uac_descriptors.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ enum {
4747

4848
// Unit numbers are arbitrary selected
4949
#define UAC2_ENTITY_CLOCK 0x04
50+
51+
#if SPEAK_CHANNEL_NUM && MIC_CHANNEL_NUM
5052
// Speaker path
5153
#define UAC2_ENTITY_SPK_INPUT_TERMINAL 0x01
5254
#define UAC2_ENTITY_SPK_FEATURE_UNIT 0x02
@@ -55,11 +57,23 @@ enum {
5557
#define UAC2_ENTITY_MIC_INPUT_TERMINAL 0x11
5658
#define UAC2_ENTITY_MIC_FEATURE_TERMINAL 0x12
5759
#define UAC2_ENTITY_MIC_OUTPUT_TERMINAL 0x13
60+
#else
61+
// Speaker path
62+
#define UAC2_ENTITY_SPK_INPUT_TERMINAL 0x01
63+
#define UAC2_ENTITY_SPK_FEATURE_UNIT 0x02
64+
#define UAC2_ENTITY_SPK_OUTPUT_TERMINAL 0x03
65+
// Microphone path
66+
#define UAC2_ENTITY_MIC_INPUT_TERMINAL 0x01
67+
#define UAC2_ENTITY_MIC_FEATURE_TERMINAL 0x02
68+
#define UAC2_ENTITY_MIC_OUTPUT_TERMINAL 0x03
69+
#endif
5870

5971
#if SPEAK_CHANNEL_NUM && MIC_CHANNEL_NUM
6072
#define NUM_INTERFACES 3
6173
#elif SPEAK_CHANNEL_NUM || MIC_CHANNEL_NUM
6274
#define NUM_INTERFACES 2
75+
#else
76+
#error "SPEAK_CHANNEL_NUM and MIC_CHANNEL_NUM cannot both be 0"
6377
#endif
6478

6579
#if SPEAK_CHANNEL_NUM && MIC_CHANNEL_NUM

components/usb/usb_device_uac/usb_device_uac.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,12 @@ esp_err_t uac_device_init(uac_device_config_t *config)
509509
s_uac_device->spk_itf_num = config->spk_itf_num;
510510
s_uac_device->mic_itf_num = config->mic_itf_num;
511511
#else
512+
#if SPEAK_CHANNEL_NUM
512513
s_uac_device->spk_itf_num = ITF_NUM_AUDIO_STREAMING_SPK;
514+
#endif
515+
#if MIC_CHANNEL_NUM
513516
s_uac_device->mic_itf_num = ITF_NUM_AUDIO_STREAMING_MIC;
517+
#endif
514518
#endif
515519

516520
BaseType_t ret_val;

0 commit comments

Comments
 (0)