alsa sound修改--period-size上限配置

RCar-H3 platform修改

kernel-rcar/sound/soc/sh/rcar/core.c

/*
 *  Hardware (lowlevel) section
 */
struct snd_pcm_hardware {
unsigned int info;/* SNDRV_PCM_INFO_* */
u64 formats;/* SNDRV_PCM_FMTBIT_* */
unsigned int rates;/* SNDRV_PCM_RATE_* */
unsigned int rate_min;/* min rate */
unsigned int rate_max;/* max rate */
unsigned int channels_min;/* min channels */
unsigned int channels_max;/* max channels */
size_t buffer_bytes_max;/* max buffer size */
size_t period_bytes_min;/* min period size */
size_t period_bytes_max;/* max period size */
unsigned int periods_min;/* min # of periods */
unsigned int periods_max;/* max # of periods */
size_t fifo_size;/* fifo size in bytes */
};

修改这个结构体

static const struct snd_pcm_hardware rsnd_pcm_hardware = {
.info =SNDRV_PCM_INFO_INTERLEAVED|
SNDRV_PCM_INFO_MMAP|
SNDRV_PCM_INFO_MMAP_VALID,
.buffer_bytes_max= 64 * 1024,
.period_bytes_min= 32,
.period_bytes_max= 16 * 1024,
.periods_min= 1,
.periods_max= 32,
.fifo_size= 256,
};

修改buffer-size 同时要修改该文件的宏定义

/*
 *        snd_soc_platform
 */

#define PREALLOC_BUFFER        (64 * 1024)
#define PREALLOC_BUFFER_MAX    (64 * 1024)

你可能感兴趣的:(linux驱动分析,linux学习笔记,alsa-sound,--period-size,--buffer-size)