Skip to content

Commit 8952838

Browse files
committed
audio: simplify alt settings management
Signed-off-by: HiFiPhile <[email protected]>
1 parent 152d25e commit 8952838

File tree

10 files changed

+38
-143
lines changed

10 files changed

+38
-143
lines changed

examples/device/audio_4_channel_mic/src/tusb_config.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ extern "C" {
107107

108108
#define CFG_TUD_AUDIO_FUNC_1_DESC_LEN TUD_AUDIO_MIC_FOUR_CH_DESC_LEN
109109

110-
#define CFG_TUD_AUDIO_FUNC_1_N_AS_INT 1
111110
#define CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ 64
112111

113112
#define CFG_TUD_AUDIO_ENABLE_EP_IN 1

examples/device/audio_4_channel_mic_freertos/src/tusb_config.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ extern "C" {
113113

114114
#define CFG_TUD_AUDIO_FUNC_1_DESC_LEN TUD_AUDIO_MIC_FOUR_CH_DESC_LEN
115115

116-
#define CFG_TUD_AUDIO_FUNC_1_N_AS_INT 1
117116
#define CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ 64
118117

119118
#define CFG_TUD_AUDIO_ENABLE_EP_IN 1

examples/device/audio_test/src/tusb_config.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ extern "C" {
109109
#define CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE 48000
110110

111111
#define CFG_TUD_AUDIO_FUNC_1_DESC_LEN TUD_AUDIO_MIC_ONE_CH_DESC_LEN
112-
#define CFG_TUD_AUDIO_FUNC_1_N_AS_INT 1 // Number of Standard AS Interface Descriptors (4.9.1) defined per audio function - this is required to be able to remember the current alternate settings of these interfaces - We restrict us here to have a constant number for all audio functions (which means this has to be the maximum number of AS interfaces an audio function has and a second audio function with less AS interfaces just wastes a few bytes)
113112
#define CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ 64 // Size of control request buffer
114113

115114
#define CFG_TUD_AUDIO_ENABLE_EP_IN 1

examples/device/audio_test_freertos/src/tusb_config.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ extern "C" {
115115
#define CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE 48000
116116

117117
#define CFG_TUD_AUDIO_FUNC_1_DESC_LEN TUD_AUDIO_MIC_ONE_CH_DESC_LEN
118-
#define CFG_TUD_AUDIO_FUNC_1_N_AS_INT 1 // Number of Standard AS Interface Descriptors (4.9.1) defined per audio function - this is required to be able to remember the current alternate settings of these interfaces - We restrict us here to have a constant number for all audio functions (which means this has to be the maximum number of AS interfaces an audio function has and a second audio function with less AS interfaces just wastes a few bytes)
119118
#define CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ 64 // Size of control request buffer
120119

121120
#define CFG_TUD_AUDIO_ENABLE_EP_IN 1

examples/device/audio_test_multi_rate/src/tusb_config.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ extern "C" {
123123
// Have a look into audio_device.h for all configurations
124124

125125
#define CFG_TUD_AUDIO_FUNC_1_DESC_LEN TUD_AUDIO_MIC_ONE_CH_2_FORMAT_DESC_LEN
126-
#define CFG_TUD_AUDIO_FUNC_1_N_AS_INT 1 // Number of Standard AS Interface Descriptors (4.9.1) defined per audio function - this is required to be able to remember the current alternate settings of these interfaces - We restrict us here to have a constant number for all audio functions (which means this has to be the maximum number of AS interfaces an audio function has and a second audio function with less AS interfaces just wastes a few bytes)
127126
#define CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ 64 // Size of control request buffer
128127

129128
#define CFG_TUD_AUDIO_ENABLE_EP_IN 1

examples/device/cdc_uac2/src/tusb_config.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ extern "C" {
157157
#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX TU_MAX(CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_OUT, CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_OUT) // Maximum EP IN size for all AS alternate settings used
158158
#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ (TUD_OPT_HIGH_SPEED ? 32 : 4) * CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX // Example read FIFO every 1ms, so it should be 8 times larger for HS device
159159

160-
// Number of Standard AS Interface Descriptors (4.9.1) defined per audio function - this is required to be able to remember the current alternate settings of these interfaces - We restrict us here to have a constant number for all audio functions (which means this has to be the maximum number of AS interfaces an audio function has and a second audio function with less AS interfaces just wastes a few bytes)
161-
#define CFG_TUD_AUDIO_FUNC_1_N_AS_INT 2
162-
163160
// Size of control request buffer
164161
#define CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ 64
165162

examples/device/uac2_headset/src/tusb_config.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,6 @@ extern "C" {
158158
#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX TU_MAX(CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_OUT, CFG_TUD_AUDIO_FUNC_1_FORMAT_2_EP_SZ_OUT) // Maximum EP IN size for all AS alternate settings used
159159
#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ (TUD_OPT_HIGH_SPEED ? 32 : 4) * CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX // Example read FIFO every 1ms, so it should be 8 times larger for HS device
160160

161-
// Number of Standard AS Interface Descriptors (4.9.1) defined per audio function - this is required to be able to remember the current alternate settings of these interfaces - We restrict us here to have a constant number for all audio functions (which means this has to be the maximum number of AS interfaces an audio function has and a second audio function with less AS interfaces just wastes a few bytes)
162-
#define CFG_TUD_AUDIO_FUNC_1_N_AS_INT 2
163-
164161
// Size of control request buffer
165162
#define CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ 64
166163

examples/device/uac2_speaker_fb/src/tusb_config.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ extern "C" {
130130

131131
#define CFG_TUD_AUDIO_FUNC_1_DESC_LEN TUD_AUDIO_SPEAKER_STEREO_FB_DESC_LEN
132132

133-
// Enable if Full-Speed on OSX, also set feedback EP size to 3
133+
// Can be enabled with Full-Speed device on OSX, which forces feedback EP size to 3, in this case CFG_QUIRK_OS_GUESSING can be disabled
134134
#define CFG_TUD_AUDIO_ENABLE_FEEDBACK_FORMAT_CORRECTION 0
135135

136136
// Audio format type I specifications
@@ -155,9 +155,6 @@ extern "C" {
155155
// Enable feedback EP
156156
#define CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP 1
157157

158-
// Number of Standard AS Interface Descriptors (4.9.1) defined per audio function - this is required to be able to remember the current alternate settings of these interfaces - We restrict us here to have a constant number for all audio functions (which means this has to be the maximum number of AS interfaces an audio function has and a second audio function with less AS interfaces just wastes a few bytes)
159-
#define CFG_TUD_AUDIO_FUNC_1_N_AS_INT 1
160-
161158
// Size of control request buffer
162159
#define CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ 64
163160

0 commit comments

Comments
 (0)