I am working on a python program that I am having some issues with. When the user presses a button a video starts playing. I need the audio to come from the analog jack. It works perfectly when I run it from the terminal or in thonny.
The problem started when I tried to autorun it. I set it up to autorun with /etc/rc.local. It starts correctly, but there is no audio from the VLC player. I am using os.system("amixer sset 'Master' 100%")
to set the volume and in my log I get the error amixer: Unable to find simple control 'Master',0
. I tried adding os.system("amixer scontrols")
to get a little more information, and I got the following: Simple mixer control 'HDMI',0
"Master" isn't mentioned there like it is when I run that command from a terminal.
So what is different here? Why is HDMI audio output my only option when starting from rc.local? I have tried starting with and without sudo and that made no difference.
rc.local
) don't automatically get to access it. That said, I don't have the solution for this (but I am sure there is one).rc.local
has been deprecated. I assume "autorun" means "start at boot"?? If so, maybe try another method for auto-starting - asystemd
unit, orcron
?