Hi all,
Im currently working on a project to automatically play video using video looper on a Raspberry Pi 3a with an external audio rotary encoder (ec11) module.
I found a script that adjusts the volume using the encoder which works when run manually from the desktop. But i want it to work when video looper starts. Basically if someone wanted to adjust the volume while video looper was playing they could just use the rotary encoder.
I’ve added a boot script to the conf.d folder (/etc/supervisor/conf.d) which mentioned the python3 script to start the encoder script (same one i used manually in desktop mode). But each time i start the PI, video looper runs find but i cant get the encoder to work.
Checking the log file i can see that this error keeps appearing "ModuleNotFoundError: No module named ‘alsaaudio’
Does anyone have any ideas on how to resolve this issue?
m = alsaaudio.Mixer(‘Master’,0)
for mixername in alsaaudio.mixers():
if str(mixername) == “Master” or str(mixername) == “PCM”:
m = alsaaudio.Mixer(mixername)
@Scott253186 you might find that it is more appropriate to run your script at boot by setting up a cron job instead.
I’m not exactly sure what the behaviour of running scripts at startup from /etc/supervisor/conf.d is, but using cron seems to be safest in general - especially when it seems you’re executing the same command but a module is not found.
The good news is it should be easy enough to try:
edit the cron table with crontab -e
and append a line to run your script at reboot
@reboot python3 /[path to my script]/my_script.py &
& will run the script in the background.
(of course, remove your existing conf.d implementation first.)