Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6970

Beginners • I can't use "amixer sset Master" command from python.

$
0
0
First time posting forgive me if I'm doing it wrong.

Linux Debian GNU Linux 12 (bookwork)
Python 3.11.2 (Mar13,2023)

THE ERROR MESSAGE

Code:

amixer: Unable to find simple control 'Master',0
I am getting this apparently common error but can't find a work around.

The code for test.py

Code:

import subprocesssubprocess.run('pwd') #this works finesubprocess.run('amixer sset Master 75%', shell=True) #this is the error generator   
The return is:

Code:

/home/raspberry/my_pythonamixer: Unable to find simple control 'Master',0
Now, when I use the command:

Code:

~ $ amixer sset Master 75%
at the command line all works fine.

Also, when I use the command:

Code:

~ $ amixer scontrols
at the command line, I get the expected list:

Code:

Simple mixer control 'Master',0Simple mixer control 'Capture',0
but when i execute subprocess.run('amixer scontrols', shell=True) in test.py or through sudo python, no list is generated.

Please help... I've been working on this for three days straight and I think I'm losing my mind. :oops: :lol: :|

Statistics: Posted by doktor_g — Wed Jul 10, 2024 7:49 pm — Replies 0 — Views 30



Viewing all articles
Browse latest Browse all 6970

Trending Articles