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.