taizilongxu / douban.fm

:radio: douban.fm based on Python
MIT License
786 stars 190 forks source link

音量控制似乎有点问题: #22

Closed wgjak47 closed 9 years ago

wgjak47 commented 9 years ago

调节音量的时候('+'键)会报这个错误。然后什么命令也不能用了。Orz。

Traceback (most recent call last):
  File "/usr/local/bin/douban.fm", line 9, in <module>
    load_entry_point('douban.fm==0.2.12', 'console_scripts', 'douban.fm')()
  File "/usr/local/lib/python2.7/dist-packages/douban/douban.py", line 460, in main
    Win(douban)
  File "/usr/local/lib/python2.7/dist-packages/douban/douban.py", line 85, in __init__
    self.run()
  File "/usr/local/lib/python2.7/dist-packages/douban/douban.py", line 357, in run
    self.change_volume(1)
  File "/usr/local/lib/python2.7/dist-packages/douban/douban.py", line 154, in change_volume
    volume = int(self.volume) + 5
ValueError: invalid literal for int() with base 10: ''
amixer: Unable to find simple control 'Master',0

希望能帮忙看一下。:)

wgjak47 commented 9 years ago

补充 操作系统:ubuntu 14.04 运行amixer提示如下:

Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958',1
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958',2
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]

原因在douban.py的获取音量部分141-172部分。

wgjak47@wgjak47-M410:~$ amixer get Master
amixer: Unable to find simple control 'Master',0

我应该怎么修改?

taizilongxu commented 9 years ago

试试这个命令

amixer get IEC958
taizilongxu commented 9 years ago

http://blog.csdn.net/juncoder/article/details/39269595

再试试这个

wgjak47 commented 9 years ago

Thanks,这次正常了。话说没配置之前我系统声音很正常啊,Ubuntu真的让人搞不懂。Orz。。。