update(demo): add comment for uac

Signed-off-by: sakumisu <1203593632@qq.com>
This commit is contained in:
sakumisu
2025-12-01 12:28:27 +08:00
parent 3e28c528a4
commit 9efc8af07b
5 changed files with 39 additions and 5 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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