This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

I2S多路复用重采样的问题



需求: 我们的应用是l通过I2S获取16路音频, 通过FPGA使左右声道各输出8路,然后同过ALSA取下来后再解复用.

问题: 通过捕获锯齿发现有重采样的现象请问何解?

下面我再详细描述一下:

1. 首先是当前配置:
[file: davinci-pcm.c]
static struct snd_pcm_hardware pcm_hardware_capture = {
        ...
        .channels_min = 2,
        .channels_max = 16,                                                                                                                                                   
        .buffer_bytes_max = 128 * 1024,                                                                                                                 
        .period_bytes_min = 32,
        .period_bytes_max = 64 * 1024,                                                                                                           
        .periods_min = 2,
        .periods_max = 2048,                                                                                                                                     
        .fifo_size = 0,
};

2. 下面是应用层的调用参数:
frames = 1024;
snd_pcm_hw_params_set_period_size_near(alsa_handle, hw_params, &frames, 0);
buffersize = 4096; // <= .buffer_bytes_max
snd_pcm_hw_params_set_buffer_size_near(alsa_handle, hw_params, &buffersize);

3. 下面`@'处就是 1/16 路重复的地方, 重复了4096个采样点. 于是 4096(点) * 16(通道) * 2B = 128K =  .buffer_bytes_max
也就是整个DMA-buffer全部重复了一次.
          
                      /|            /|        /|
                    /  |   @   /  |      /  |
                  /    |    /|  /    |    /    |
                /      |  /  |/      |  /      |
              /        |/            |/        |