فهرست منبع

update(demo): add comment for uac

Signed-off-by: sakumisu <1203593632@qq.com>
sakumisu 1 ماه پیش
والد
کامیت
9efc8af07b

+ 2 - 0
demo/audio_v1_mic_multichan_template.c

@@ -301,6 +301,8 @@ struct audio_entity_info audio_entity_table[] = {
       .ep = AUDIO_IN_EP },
 };
 
+// In windows, audio driver cannot remove auto, so when you modify any descriptor information, please modify string descriptors too.
+
 void audio_v1_init(uint8_t busid, uintptr_t reg_base)
 {
 #ifdef CONFIG_USBDEV_ADVANCE_DESC

+ 2 - 0
demo/audio_v1_mic_speaker_multichan_template.c

@@ -393,6 +393,8 @@ struct audio_entity_info audio_entity_table[] = {
       .ep = AUDIO_OUT_EP },
 };
 
+// In windows, audio driver cannot remove auto, so when you modify any descriptor information, please modify string descriptors too.
+
 void audio_v1_init(uint8_t busid, uintptr_t reg_base)
 {
 #ifdef CONFIG_USBDEV_ADVANCE_DESC

+ 17 - 3
demo/audio_v2_mic_multichan_template.c

@@ -22,7 +22,7 @@
 #define AUDIO_IN_CLOCK_ID 0x01
 #define AUDIO_IN_FU_ID    0x03
 
-#define AUDIO_IN_MAX_FREQ 16000
+#define AUDIO_IN_MAX_FREQ 96000
 #define HALF_WORD_BYTES   2  //2 half word (one channel)
 #define SAMPLE_BITS       16 //16 bit per channel
 
@@ -225,10 +225,22 @@ const uint8_t audio_v2_descriptor[] = {
 #endif
 
 static const uint8_t mic_default_sampling_freq_table[] = {
-    AUDIO_SAMPLE_FREQ_NUM(1),
+    AUDIO_SAMPLE_FREQ_NUM(5),
+    AUDIO_SAMPLE_FREQ_4B(8000),
+    AUDIO_SAMPLE_FREQ_4B(8000),
+    AUDIO_SAMPLE_FREQ_4B(0x00),
     AUDIO_SAMPLE_FREQ_4B(16000),
     AUDIO_SAMPLE_FREQ_4B(16000),
-    AUDIO_SAMPLE_FREQ_4B(0x00)
+    AUDIO_SAMPLE_FREQ_4B(0x00),
+    AUDIO_SAMPLE_FREQ_4B(32000),
+    AUDIO_SAMPLE_FREQ_4B(32000),
+    AUDIO_SAMPLE_FREQ_4B(0x00),
+    AUDIO_SAMPLE_FREQ_4B(48000),
+    AUDIO_SAMPLE_FREQ_4B(48000),
+    AUDIO_SAMPLE_FREQ_4B(0x00),
+    AUDIO_SAMPLE_FREQ_4B(96000),
+    AUDIO_SAMPLE_FREQ_4B(96000),
+    AUDIO_SAMPLE_FREQ_4B(0x00),
 };
 
 USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX uint8_t write_buffer[AUDIO_IN_PACKET];
@@ -323,6 +335,8 @@ struct audio_entity_info audio_entity_table[] = {
       .ep = AUDIO_IN_EP },
 };
 
+// In windows, audio driver cannot remove auto, so when you modify any descriptor information, please modify string descriptors too.
+
 void audio_v2_init(uint8_t busid, uintptr_t reg_base)
 {
 #ifdef CONFIG_USBDEV_ADVANCE_DESC

+ 16 - 2
demo/audio_v2_mic_speaker_multichan_template.c

@@ -31,7 +31,7 @@
 #define AUDIO_IN_FU_ID     0x07
 
 #define AUDIO_OUT_MAX_FREQ 96000
-#define AUDIO_IN_MAX_FREQ  16000
+#define AUDIO_IN_MAX_FREQ  96000
 
 #define HALF_WORD_BYTES 2  //2 half word (one channel)
 #define SAMPLE_BITS     16 //16 bit per channel
@@ -330,9 +330,21 @@ static const uint8_t speaker_default_sampling_freq_table[] = {
 };
 
 static const uint8_t mic_default_sampling_freq_table[] = {
-    AUDIO_SAMPLE_FREQ_NUM(1),
+    AUDIO_SAMPLE_FREQ_NUM(5),
+    AUDIO_SAMPLE_FREQ_4B(8000),
+    AUDIO_SAMPLE_FREQ_4B(8000),
+    AUDIO_SAMPLE_FREQ_4B(0x00),
     AUDIO_SAMPLE_FREQ_4B(16000),
     AUDIO_SAMPLE_FREQ_4B(16000),
+    AUDIO_SAMPLE_FREQ_4B(0x00),
+    AUDIO_SAMPLE_FREQ_4B(32000),
+    AUDIO_SAMPLE_FREQ_4B(32000),
+    AUDIO_SAMPLE_FREQ_4B(0x00),
+    AUDIO_SAMPLE_FREQ_4B(48000),
+    AUDIO_SAMPLE_FREQ_4B(48000),
+    AUDIO_SAMPLE_FREQ_4B(0x00),
+    AUDIO_SAMPLE_FREQ_4B(96000),
+    AUDIO_SAMPLE_FREQ_4B(96000),
     AUDIO_SAMPLE_FREQ_4B(0x00)
 };
 
@@ -501,6 +513,8 @@ struct audio_entity_info audio_entity_table[] = {
       .ep = AUDIO_IN_EP },
 };
 
+// In windows, audio driver cannot remove auto, so when you modify any descriptor information, please modify string descriptors too.
+
 void audio_v2_init(uint8_t busid, uintptr_t reg_base)
 {
 #ifdef CONFIG_USBDEV_ADVANCE_DESC

+ 2 - 0
demo/audio_v2_speaker_multichan_template.c

@@ -397,6 +397,8 @@ struct audio_entity_info audio_entity_table[] = {
       .ep = AUDIO_OUT_EP },
 };
 
+// In windows, audio driver cannot remove auto, so when you modify any descriptor information, please modify string descriptors too.
+
 void audio_v2_init(uint8_t busid, uintptr_t reg_base)
 {
 #ifdef CONFIG_USBDEV_ADVANCE_DESC