Skip to content

i2s任务问题 (AUD-6763) #1536

@wjstan

Description

@wjstan

我在代码里创建一个i2s reader, 一个i2s writer,
i2s_stream_cfg_t i2s_w_cfg = I2S_STREAM_CFG_DEFAULT_WITH_TYLE_AND_CH(I2S_NUM_0, I2S_SAMPLE_RATE, I2S_BITS, AUDIO_STREAM_WRITER, 1);
i2s_w_cfg.task_stack = 8 * 1024;//should not be -1 while using pipeling
//i2s_w_cfg.need_expand = (16 != I2S_BITS);
i2s_w_cfg.uninstall_drv = false;
i2s_w_cfg.stack_in_ext = true;
i2s_w_cfg.task_prio = 21;
i2s_w_cfg.task_core = 1;
i2s_w_cfg.chan_cfg.dma_desc_num = 16;
i2s_w_cfg.chan_cfg.dma_frame_num = 512;
i2s_w_cfg.out_rb_size = 16 * 1024;
i2s_w_cfg.chan_cfg.auto_clear_before_cb = true;
i2s_stream_writter = i2s_stream_init(&i2s_w_cfg);

ESP_LOGI(TAG, "-- Create i2s_stream_write task_prio=21, external stack");

//i2s_stream_cfg_t i2s_r_cfg = I2S_STREAM_CFG_DEFAULT();
i2s_stream_cfg_t i2s_r_cfg = I2S_STREAM_CFG_DEFAULT_WITH_TYLE_AND_CH(I2S_NUM_0, I2S_SAMPLE_RATE, I2S_BITS, AUDIO_STREAM_READER, 1);
//i2s_r_cfg.type = AUDIO_STREAM_READER;
//int channel_format = I2S_CHANNEL_TYPE_ONLY_LEFT;
//i2s_stream_set_channel_type(&i2s_r_cfg, channel_format);
//i2s_r_cfg.std_cfg.clk_cfg.sample_rate_hz = SAMPLE_RATE;
i2s_r_cfg.chan_cfg.dma_desc_num = 16;
i2s_r_cfg.chan_cfg.dma_frame_num = 512;

i2s_r_cfg.chan_cfg.auto_clear_before_cb = true;
i2s_r_cfg.task_stack = 8 * 1024;
i2s_r_cfg.task_prio = 22;
i2s_r_cfg.task_core = 0;
i2s_r_cfg.out_rb_size = 16 * 1024;
i2s_r_cfg.uninstall_drv = false;
i2s_r_cfg.stack_in_ext = false;

i2s_stream_reader = i2s_stream_init(&i2s_r_cfg);

ESP_LOGI(TAG, "-- Create i2s_stream_reader task_prio=22, internal stack");

但是用audio_sys_get_real_time_stats()查看任务始终只有一个i2s,而不是2个,看起来是以i2s writer的配置创建出来的,

I (39665) AUDIO_SYS: | Task | Run Time | Per | Prio | HWM | State | CoreId | Stack
I (39665) AUDIO_SYS: | main | 2593 | 0% | 1 | 2272 | Running | 0 | Intr
I (39673) AUDIO_SYS: | IDLE1 | 962868 |48% | 0 | 688 | Ready | 1 | Intr
I (39683) AUDIO_SYS: | IDLE0 | 988706 |49% | 0 | 696 | Ready | 0 | Intr

I (39702) AUDIO_SYS: | tiT | 1853 | 0% | 18 | 1836 | Blocked | 7fffffff | Intr

I (39711) AUDIO_SYS: | i2s | 417 | 0% | 21 | 6068 | Blocked | 1 | Extr

I (39721) AUDIO_SYS: | _send_rtc_data | 15 | 0% | 21 | 2108 | Blocked | 0 | Extr
I (39730) AUDIO_SYS: | esp_periph | 1808 | 0% | 5 | 1612 | Blocked | 0 | Intr
I (39740) AUDIO_SYS: | sys_evt | 0 | 0% | 20 | 1204 | Blocked | 0 | Intr
I (39749) AUDIO_SYS: | opus | 0 | 0% | 23 | 28232 | Blocked | 1 | Extr
I (39759) AUDIO_SYS: | resample | 0 | 0% | 5 | 1804 | Blocked | 0 | Extr
I (39768) AUDIO_SYS: | audio_recv_proc | 0 | 0% | 10 | 4324 | Blocked | 0 | Extr

I (39787) AUDIO_SYS: | ipc1 | 0 | 0% | 24 | 528 | Suspended | 1 | Intr
I (39797) AUDIO_SYS: | esp_timer | 604 | 0% | 22 | 3032 | Suspended | 0 | Intr
I (39806) AUDIO_SYS: | wifi | 7514 | 0% | 23 | 3460 | Blocked | 0 | Intr
I (39816) AUDIO_SYS: | ipc0 | 0 | 0% | 1 | 440 | Suspended | 0 | Intr
I (39825) AUDIO_SYS: | Tmr Svc | 0 | 0% | 1 | 968 | Blocked | 7fffffff | Intr

请问这是为什么

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions