mplayer -volstep 1 这样调整音量时只能降低不能提高?

Totem,mplayer,sopcast,realplayer,bmp
回复
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

mplayer -volstep 1 这样调整音量时只能降低不能提高?

#1

帖子 科学之子 » 2017-10-02 10:58

mplayer -volstep 1 这样调整音量时只能降低不能提高?

代码: 全选

$ mplayer -v
MPlayer 1.3.0 (Debian), built with gcc-6.2.1 (C) 2000-2016 MPlayer Team
CPU vendor name: GenuineIntel  max cpuid level: 13
CPU: Pentium(R) Dual-Core  CPU      E5500  @ 2.80GHz (Family: 6, Model: 23, Stepping: 10)
extended cpuid-level: 8
extended cache-info: 134242368
Detected cache-line size is 64 bytes
Testing OS support for SSE... yes.
Tests of OS support for SSE passed.
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNowExt: 0 SSE: 1 SSE2: 1 SSE3: 1 SSSE3: 1 SSE4: 0 SSE4.2: 0 AVX: 0
Compiled with runtime CPU detection.
get_path('codecs.conf') -> '/home/user/.mplayer/codecs.conf'
Reading optional codecs config file /home/user/.mplayer/codecs.conf: No such file or directory
Reading optional codecs config file /etc/mplayer/codecs.conf: No such file or directory
Using built-in default codecs.conf.
init_freetype
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
get_path('fonts') -> '/home/user/.mplayer/fonts'
Usage:   mplayer [options] [url|path/]filename

Basic options: (complete list in the man page)
 -vo <drv>        select video output driver ('-vo help' for a list)
 -ao <drv>        select audio output driver ('-ao help' for a list)
 vcd://<trackno>  play (S)VCD (Super Video CD) track (raw device, no mount)
 dvd://<titleno>  play DVD title from device instead of plain file
 -alang/-slang    select DVD audio/subtitle language (by 2-char country code)
 -ss <position>   seek to given (seconds or hh:mm:ss) position
 -nosound         do not play sound
 -fs              fullscreen playback (or -vm, -zoom, details in the man page)
 -x <x> -y <y>    set display resolution (for use with -vm or -zoom)
 -sub <file>      specify subtitle file to use (also see -subfps, -subdelay)
 -playlist <file> specify playlist file
 -vid x -aid y    select video (x) and audio (y) stream to play
 -fps x -srate y  change video (x fps) and audio (y Hz) rate
 -pp <quality>    enable postprocessing filter (details in the man page)
 -framedrop       enable frame dropping (for slow machines)

Basic keys: (complete list in the man page, also check input.conf)
 <-  or  ->       seek backward/forward 10 seconds
 down or up       seek backward/forward  1 minute
 pgdown or pgup   seek backward/forward 10 minutes
 < or >           step backward/forward in playlist
 p or SPACE       pause movie (press any key to continue)
 q or ESC         stop playing and quit program
 + or -           adjust audio delay by +/- 0.1 second
 o                cycle OSD mode:  none / seekbar / seekbar + timer
 * or /           increase or decrease PCM volume
 x or z           adjust subtitle delay by +/- 0.1 second
 r or t           adjust subtitle position up/down, also see -vf expand

 * * * SEE THE MAN PAGE FOR DETAILS, FURTHER (ADVANCED) OPTIONS AND KEYS * * *

vo: x11 uninit called but X11 not initialized..
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: mplayer -volstep 1 这样调整音量时只能降低不能提高?

#2

帖子 poloshiao » 2017-10-02 11:05

mplayer -volstep 1 这样调整音量时只能降低不能提高?
http://manpages.ubuntu.com/manpages/xen ... yer.1.html
mplayer - movie player
AUDIO OUTPUT OPTIONS (MPLAYER ONLY)
-volstep <0-100>
Set the step size of mixer volume changes in percent of the
whole range (default: 3).
預設是 3
參數值範圍可以是 0 ~ 100
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: mplayer -volstep 1 这样调整音量时只能降低不能提高?

#3

帖子 科学之子 » 2017-10-02 18:00

poloshiao 写了:
mplayer -volstep 1 这样调整音量时只能降低不能提高?
http://manpages.ubuntu.com/manpages/xen ... yer.1.html
mplayer - movie player
AUDIO OUTPUT OPTIONS (MPLAYER ONLY)
-volstep <0-100>
Set the step size of mixer volume changes in percent of the
whole range (default: 3).
預設是 3
參數值範圍可以是 0 ~ 100
我这里的情况是下调后无法上调回去
比如下调到90,但无法调回到100
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: mplayer -volstep 1 这样调整音量时只能降低不能提高?

#4

帖子 vickycq » 2017-10-02 18:17

奇怪,再加上 -softvol 就行了。不知是不是 bug
而且只有设置成 1 的时候有这个问题。
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: mplayer -volstep 1 这样调整音量时只能降低不能提高?

#5

帖子 科学之子 » 2017-10-02 18:41

vickycq 写了:奇怪,再加上 -softvol 就行了。不知是不是 bug
而且只有设置成 1 的时候有这个问题。
进一步尝试

代码: 全选

mplayer -quiet -volstep 2 -loop 0
也并非严格按照2的精度去调整
怀疑mplayer或其它什么层做了类似alsamixer的数学转换

Mon Oct 2 19:08:49 CST 2017补充:
"apt-get source alsa-utils"下载的源码:
./alsa-utils-1.1.3/alsamixer/volume_mapping.c:

代码: 全选

/*
 * The functions in this file map the value ranges of ALSA mixer controls onto
 * the interval 0..1.
 *
 * The mapping is designed so that the position in the interval is proportional
 * to the volume as a human ear would perceive it (i.e., the position is the
 * cubic root of the linear sample multiplication factor).  For controls with
 * a small range (24 dB or less), the mapping is linear in the dB values so
 * that each step has the same size visually.  Only for controls without dB
 * information, a linear mapping of the hardware volume register values is used
 * (this is the same algorithm as used in the old alsamixer).
 *
 * When setting the volume, 'dir' is the rounding direction:
 * -1/0/1 = down/nearest/up.
 */
头像
ahwad
帖子: 1112
注册时间: 2009-05-06 0:36

Re: mplayer -volstep 1 这样调整音量时只能降低不能提高?

#6

帖子 ahwad » 2017-10-16 18:06

为什么不用鼠标控制音量呢?
~/.mplayer/input.conf
MOUSE_BTN2 pause #右键暂停
MOUSE_BTN0_DBL vo_fullscreen #左键双击全屏
MOUSE_BTN3 volume 1 #上滚音量加2
MOUSE_BTN3_DBL volume 2 #快速上滚音量加4
MOUSE_BTN4 volume -1 #下滚音量减2
MOUSE_BTN4_DBL volume -2 #快速下滚音量减4
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: mplayer -volstep 1 这样调整音量时只能降低不能提高?

#7

帖子 科学之子 » 2017-10-30 17:29

最近思考了一下如果有需求控制现有mplayer的音量该怎么办.
pactl 控制不是不可能,但是需要写程序解析list的输出,太麻烦,而且特殊情况下貌似也确实几乎不可能(比如index频繁变化的时候,貌似只有手动改tdb文件)
http://www.mplayerhq.hu/DOCS/tech/slave.txt
一个命名管道就可以搞定了
配合Window Manager热键绑定和自写脚本,应该可以实现很多方便的功能.
回复