Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amixer unable to find simple control 'master' 0 #24

Closed
r00t8ug83 opened this issue Jan 2, 2015 · 8 comments
Closed

amixer unable to find simple control 'master' 0 #24

r00t8ug83 opened this issue Jan 2, 2015 · 8 comments

Comments

@r00t8ug83
Copy link

Unable to adjust the volume, I'm using Raspberry pi user.

@r00t8ug83
Copy link
Author

amixer get master
amixer: Unable to find simple control 'master',0

I am using analogue not HDMI

@taizilongxu
Copy link
Owner

how about this #22

@r00t8ug83
Copy link
Author

okie, for raspberry pi user douban.py inside find "Master" > "PCM" fix the bug.

@qfengnh
Copy link

qfengnh commented Jan 13, 2015

有解决办法吗?

@taizilongxu
Copy link
Owner

    def get_volume(self):
        if self.platform == 'Linux':
            volume = subprocess.check_output('amixer get Master | grep Mono: | cut -d " " -f 6', shell=True)
            return volume[1:-3]
        elif self.platform == 'Darwin':
            return subprocess.check_output('osascript -e "output volume of (get volume settings)"', shell=True)
        else:
            return

    # 调整音量大小
    def change_volume(self, increment):
        if increment == 1:
            volume = int(self.volume) + 5
        else:
            volume = int(self.volume) - 5
        if self.platform == 'Linux':
            subprocess.Popen('amixer set Master ' + str(volume) + '% >/dev/null 2>&1', shell=True)
        elif self.platform == 'Darwin':
            subprocess.Popen('osascript -e "set volume output volume ' + str(volume) + '"', shell=True)
        else:
            pass

因为声卡不一样,上面的同学是把"Master" 转换成"PCM"就可以了,你可以看看你的声卡是哪种,替换master应该就可以了

http://blog.csdn.net/juncoder/article/details/39269595 这里也有查看的方法

@qfengnh
Copy link

qfengnh commented Jan 13, 2015

多谢 大神 指点,现已搞定

@royjiang
Copy link

hi, just found this post after i posted another issue for the same symptom :)

@k9gardner
Copy link

okie, for raspberry pi user douban.py inside find "Master" > "PCM" fix the bug.

What does this statement mean? What do you mean by "inside" and "find", are these commands? Please give full syntax. I've been struggling with this for too long. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants