alsa音频驱动,overrun,underrun
telechips 8803. linux 2.6.35.7
在小系统下用arecord,aplay录放音测试,设置采样率在44100以上的单声道双声道录放都正常,但是在这个采样率一下的录音会提示overrun。调整了结构体snd_pcm_hardware的设置,有改变,但不是很清楚这个结构体的赋值是怎么计算出来的。
请问,如何调整驱动对采样率的支持?还有就是snd_pcm_hardware这个结构的怎么赋值?谢谢
当前设置如下
#define __play_buf_size 4096#define __play_buf_cnt 16#define __cap_buf_size 4096#define __cap_buf_cnt 16static const struct snd_pcm_hardware tcc_pcm_hardware_play = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME), .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE), .rates = SNDRV_PCM_RATE_8000_96000, .rate_min = 8000, .rate_max = 96000, .channels_min = 2, .channels_max = 2, .period_bytes_min = 1024, .period_bytes_max = __play_buf_size, .periods_min = 2, .periods_max = __play_buf_cnt , .buffer_bytes_max = __play_buf_cnt * __play_buf_size , .fifo_size = 16, //ignored};static const struct snd_pcm_hardware tcc_pcm_hardware_capture = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME), .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE, .rates = SNDRV_PCM_RATE_8000_96000, .rate_min = 8000, .rate_max = 96000, .channels_min = 2, .channels_max = 2, .period_bytes_min = 1024, .period_bytes_max = __cap_buf_size , .periods_min = 2, .periods_max = __cap_buf_cnt, .buffer_bytes_max = __cap_buf_cnt * __cap_buf_size, .fifo_size = 16, //ignored};