[Audio] Linux ALSA Mixer
来源:互联网 发布:mac dns被劫持怎么办 编辑:程序博客网 时间:2024/05/29 11:08
先从kernel/sound/soc/codecs/wcd9310.c中的一行代码开始
static const struct snd_kcontrol_new tabla_snd_controls[] = { SOC_SINGLE_TLV("LINEOUT1 Volume", TABLA_A_RX_LINE_1_GAIN, 0, 12, 1, line_gain),看一下snd_kcontrol_new这个结构体
struct snd_kcontrol_new { snd_ctl_elem_iface_t iface; /* interface identifier */ unsigned int device; /* device/client number */ unsigned int subdevice; /* subdevice (substream) number */ unsigned char *name; /* ASCII name of item */ unsigned int index; /* index of item */ unsigned int access; /* access rights */ unsigned int count; /* count of same elements */ snd_kcontrol_info_t *info; snd_kcontrol_get_t *get; snd_kcontrol_put_t *put; union { snd_kcontrol_tlv_rw_t *c; const unsigned int *p; } tlv; unsigned long private_value;};再看一下SOC_SINGLE_TLV宏定义
#define SOC_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ SNDRV_CTL_ELEM_ACCESS_READWRITE,\ .tlv.p = (tlv_array), \ .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ .put = snd_soc_put_volsw, \ .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
这里最主要的是tlv.p(line_gain)和private_value(保存着寄存器相关的信息)。
tlv.p在kernel/sound/core/control.c中被snd_ctl_tlv_ioctl()<-snd_ctl_ioctl()调用,alsa lib中的alsa_mixer.c通过ioctl去调用。
另外tlv.p在kernel/sound/core/control.c中被snd_ctl_new1()调用。参考:snd_kcontrol的分析
private_value在wcd9311.c中被使用。
- [Audio] Linux ALSA Mixer
- Linux Audio Stack & ALSA
- Linux Audio Stack & ALSA
- Linux Audio Stack & ALSA
- alsa mixer编程
- android audio/linux alsa音频-框架
- audio asterisk video other mixer
- Audio codec linux driver 之 ALSA 架构的 DAPM 学习
- linux audio(alsa) 驱动注册的简明流程.
- linux audio(alsa) 驱动注册的简明流程.
- Audio codec linux driver 之 ALSA 架构的 DAPM 学习
- android audio/linux alsa音频-应用与驱动的接口
- Linux Audio ALSA Technical specification(Linux 音频ALSA技术说明)
- Alsa-Audio 二
- ALSA Audio API手册
- ALSA audio 术语
- Alsa SoC Audio(part 1)
- Alsa SoC Audio(part 2)
- firefox downLoad url
- 指针作为函数参数的问题
- This application has requested the Runtime to terminate it in an unusual way
- get different locale application label
- 美化代码的15个代码语法高亮工具
- [Audio] Linux ALSA Mixer
- VDI接口工作方式及具体实现
- RSS协议中,时间字段格式要求
- 主线程和子线程之间的一些东西
- 关于VS2008设计aspx的使用问题和解决办法
- wamp环境下php调试模式
- 擅长排列的小明
- AIX 6.1&7.1 打bos.mp64 patch
- Stack.Peek 与 stack.pop 的区别