imx6ul 如何设置音量

使用aplay 播放wav文件

但是声音太小如何调节大音量 。

我使用的是飞凌的的控制器,外壳有个耳机插孔。

root@freescale ~$ amixer sset Headphone 101,101
Simple mixer control 'Headphone',0
  Capabilities: pvolume penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 127
  Mono:
  Front Left: Playback 101 [80%] [-20.00dB]
  Front Right: Playback 101 [80%] [-20.00dB]
root@freescale ~$ aplay /home/user/1-ybccdq.wav 
Playing WAVE '/home/user/1-ybccdq.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
root@freescale ~$ amixer sset Headphone 121,121
Simple mixer control 'Headphone',0
  Capabilities: pvolume penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 127
  Mono:
  Front Left: Playback 121 [95%] [0.00dB]
  Front Right: Playback 121 [95%] [0.00dB]

将101-设置成127步骤如上。

amixer  -help

root@freescale ~$ amixer -help
Usage: amixer <options> [command]

Available options:
  -h,--help       this help
  -c,--card N     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   show also inactive controls
  -a,--abstract L select abstraction level (none or basic)
  -s,--stdin      Read and execute commands from stdin sequentially

Available commands:
  scontrols       show all mixer simple controls
  scontents  show contents of all mixer simple controls (default command)
  sset sID P      set contents 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 cID P      set control contents for one control
  cget cID        get control contents for one control


 amixer contents
numid=55,iface=CARD,name='Headset Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=on
numid=10,iface=MIXER,name='Headphone Playback ZC Switch'
  ; type=BOOLEAN,access=rw------,values=2
  : values=off,off
numid=9,iface=MIXER,name='Headphone Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=127,step=0
  : values=101,101
  | dBscale-min=-121.00dB,step=1.00dB,mute=1
numid=15,iface=MIXER,name='PCM Playback -6dB Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=39,iface=MIXER,name='Mono Output Mixer Left Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=40,iface=MIXER,name='Mono Output Mixer Right Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=17,iface=MIXER,name='ADC High Pass Filter Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off

比如我们的是headphone

root@freescale ~$ amixer cget numid=9,iface=MIXER,name='Headphone Playback Volum
e'
numid=9,iface=MIXER,name='Headphone Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=127,step=0
  : values=121,121
  | dBscale-min=-121.00dB,step=1.00dB,mute=1


或者通过这个来设置音量

root@freescale ~$ amixer cset numid=9,iface=MIXER,name='Headphone Playback Volum
e'  100 100
numid=9,iface=MIXER,name='Headphone Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=127,step=0
  : values=100,100
  | dBscale-min=-121.00dB,step=1.00dB,mute=1


总而言之,amixer sset Headphone 101,101 amixer cset numid=9,iface=MIXER,name='Headphone Playback Volum
e'  100 100 是一样的

sitemap