版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、使用 alsa-utils 调试 ALSA 驱动使用 alsa-utils 调试 ALSA 驱动分类: linuxdriver2011-06-24 14:19 2263 人阅读 评论 (0) 收藏 举报2011-06-24 17:35:58 android 下面的 alsa utils 提供三个工具,分别是:alsa_amixer配置alsa_aplay :播放 录制alsa_ctl:store/restore 配置文件,与 asound.conf 有关可 以通过 alsa_XXX -help 查看详细参数+ +alsa_amixer】 / $ alsa_amixer -help Usage:
2、 amixer <options>command Available options: -h,-help this help -c,-cardN select the card -D,-device N select the device, default 'default' -d,-debug debug mode -n,-nocheck do not perform range checking -v,-version print version of this program -q,-quiet be quiet -i,-inactive sh
3、ow also inactive controls -a,-abstract L select abstraction level (none or basic) -s,-stdinRead and execute commands from stdin sequentially Availablecommands: /我们主要使用后面四个scontrols show all mixer simple controls scontents show contents of all mixer simple controls (default command) sset sID P set co
4、ntents for one mixer simple control sget sID get contents for one mixer simple control controls show all controls for given card contents show contents of all controls for given card cset cIDP set control contents for one control cget cID get control contents for one control 【使用方法】 alsa_amixer contr
5、ols : 列出 alsa 驱动里面注册的所有控制接口。这些 controls 是在驱动里面通过 struct snd_kcontrol_new twl4030_snd_controls 定义,函数 static int twl4030_add_controls(struct snd_soc_codec *codec) 来添加的 接口。格式如下:numid=19,iface=MIXER,name='Analog CaptureVolume'alsa_amixer contents : 列出以上接口的详细内容, 格式如下:numid=19,iface=MIXER,name=
6、9;Analog Capture V olume' type=INTEGER,access=rw-R-,values=2,min=0,max=5,step=: values=5,5 | dBscale-min=0.00dB,step=6.00dB,mute=0 以上, numid 是在 注册的时候顺序分配的,其他信息查看驱动里面的数据结构 来了解。我们可以通过两个命令来读取和设置相关参数:cset cID P set control contents for one control cget cID get control contents for one control例如:alsa
7、_amixer cget numid=19,iface=MIXER,name='AnalogCapture Volume' alsa_amixer cset numid=19,iface=MIXER,name='AnalogCapture Volume' 5其实,如果通过 alsa_amixer controls 获取到这些 controls 的numid 后,可以直接使用 numid 来操作,结果一样:/ $ alsa_amixer cget numid=19 numid=19,iface=MIXER,name='Analog Capture V ol
8、ume' type=INTEGER,access=rw-R-,values=2,min=0,max=5,step=: values=5,5 | dBscale-min=0.00dB,step=6.00dB,mute=0/ $ alsa_amixer cset numid=19 4 #reg_0x48 =TWL4030_REG_ANAMIC_GAIN : 0x24 numid=19,iface=MIXER,name='Analog Capture V olume' type=INTEGER,access=rw-R-,values=2,min=0,max=5,step= :
9、 values=4,4 | dBscale-min=0.00dB,step=6.00dB,mute=0 + +alsa_aplay】/ $ alsa_aplay -help Usage: aplay OPTION. FILE.-h,-help help -version print current version-l, -list-devices list all soundcards and digital audio devices -L, -list-pcms list-q,device names -D, -device=NAME select PCM by name -quiet q
10、uiet mode -t, -file-type TYPE file type (voc, wav, raw or au) -c, -channels=# channels -f, -format=FORMAT sample format (case insensitive) -r, -rate=# sample rate -d, -duration=# interrupt after # seconds -M, -mmap mmapstream -N, -nonblock nonblocking mode-F, -period-time=# distance between interrup
11、ts is # microseconds -B, -buffer-time=# buffer duration is # microseconds -period-size=# distance between interrupts is # frames -buffer-size=# buffer duration is # frames -A, -avail-min=# min available space for wakeup is # microseconds -R, -start-delay=# delay for automatic PCM start is # microsec
12、onds(relative to buffer size if <= 0)-T, -stop-delay=# delay forautomatic PCM stop is # microseconds from xrun -v,-verbose show PCM structure and setup (accumulative) -V,-vumeter=TYPE enable VU meter (TYPE: mono or stereo)-I,-separate-channels one file for each channel-disable-resample disabl
13、e automatic rate resample-disable-channels disable automatic channel conversions-disable-format disable automatic format conversions-disable-softvol disable software volume control (softvol)-test-position test ring buffer positionRecognized sampleformats are: S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE
14、S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BEFLOAT_LE FLOAT_BE FLOAT64_LE FLOAT64_BEIEC958_SUBFRAME_LE IEC958_SUBFRAME_BEMU_LAW A_LAW IMA_ADPCM MPEG GSM SPECIALS24_3LE S24_3BE U24_3LE U24_3BE S20_3LES20_3BEU20_3LE U20_3BE S18_3LE S18_3BE U18_3LESome ofthese may not be available on selected hardwa
15、reTheavailabled format shortcuts are: -f cd (16 bit little endian,44100, stereo) -f cdr (16 bit big endian, 44100, stereo) -f dat(16 bit little endian, 48000, stereo)录音参数 S8 U8 S16_LES16_BE U16_LE U16_B 的详细解释:S 是有符号 U 是无符号BE 是大端LE 是小端这都是 PCM 的一种表示范围的方法,所以表示方法中最小值等价,最大值等价,中间的数据级别就是对应的进度了,可以都映射到 -11 范
16、围。-128127S8: signed 8 bits,有符号字符=char, 表示范围U8: unsigned 8 bits,无符号字符 =unsigned char,表示范围 0255S16_LE: little endian signed 16 bits ,小端有符号字 = short,表示范围 -3276832767S16_BE: big endian signed 16 bits ,大端有符号字 = short 倒序(PPC),表示范围-3276832767U16_LE: little endian unsigned 16 bits ,小端无符号字unsigned short,表示范围
17、 065535U16_BE: big endian unsigned signed 16 bits ,大端无符号字unsigned short倒序(PPC),表示范围 065535还有S24_LE,S32_LE 等,都可以表示数字的方法, PCM 都可以用 这些表示。面这些值中,所有最小值 -128, 0, -32768, -32768, 0, 0 对应PCM 描叙来说都是一个值, 表示最小值, 可以量化到浮点 -1。所有最大值也是一个值,可以量化到浮点 1,其他值可以等比例转换。 example: alsa_aplay -C -t wav -c 2 -r 44100 -f S16_LE -d
18、 10 -v record.wav alsa_aplay record.wav -C: record -t, -file-type TYPE file type (voc, wav, raw or au) -c, -channels=# channels -f, -format=FORMAT sample format (case insensitive) -r, -rate=# sample rate -d, -duration=# interrupt after # seconds -v, -verbose show PCM structure and setup (accumulativ
19、e) + +alsa_ctl】 / $ alsa_ctl -help Usage: alsactl <options> commandAvailable global options: -h,-help this help -d,-debug debug mode -v,-version print version of this programAvailable state options: -f,-file # configuration file (default /etc/asound.state) -F,-force try to restore the
20、matching controls as much as possible (default mode) -g,-ignore ignore 'No soundcards found' error -P,-pedantic do not restoremismatching controls (old default) -I,-no-init-fallbackdon'tinitialize even if restore fails-r,-runstate # save restore and init state to this file (only errors) default settings is 'no file set' -R,-remove remove runstate file at first, otherwise appenderrors Available init options:-E,-env #=# set environment variable for init phase (NAME=V ALUE) -i,-initfile # main configuation file for init phase (default
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 三年级英语单元一交友教案
- 小学五年级语文《漂亮的玻璃翠》核心素养导向教学设计
- 初中八年级道德与法治教学设计:营造清朗网络空间的公民实践
- 初中生物七年级发生在肺内的气体交换教学设计
- 高三生物一轮复习第六讲 水跨膜运输原理教学设计
- 雨课堂学堂在线学堂云《财务管理(西南民族大学)》单元测试考核答案
- 河北省邯郸市七年级道德与法治下册 第三单元 在集体中成长 第七课 共奏和谐乐章 第2框 节奏与旋律教案 新人教版
- 人教版9总复习教案设计
- 人教部编版(2024)八年级下册我一生中的重要抉择教学设计
- 小学语文人教部编版(五四制)一年级下册课文310端午粽一等奖教学设计
- 人类的飞天梦课件
- DZ/T 0222-2006地质灾害防治工程监理规范
- 团体标准解读及临床应用-成人经鼻高流量湿化氧疗技术规范2025
- 成都文理就业协议书
- 惠尔顿网络安全审计系统使用手册V0
- 10千伏环网柜(箱)标准化设计方案 (2023 版)
- 《国际资本流动理论》课件
- 《贴片工艺培训》课件
- 康熙字典-繁体字笔画五行1-30
- 山东省汽车维修工时定额(T-SDAMTIA 0001-2023)
- 水资源与流域经济协同发展
评论
0/150
提交评论