[Intro]
OS: Raspbian Jessie; Device: Raspberry pi 3
I wrote a python-script, that plays audio files via vlc (python vlc bindings). Next, I wrote a bash script, that runs python-script. Next, I added the bash-script to autorun, using crontab.
Everything was working, everything was playing.
[main part]
Next, I decided to test external audio card.
Everything was working out of the box. When I pulled out the sound card and connected to the headphone jack on the raspberry - the problems started. Now. when I run bash script, catch next errors:
cannot open ALSA device "default": No such file or directory
BUT if I perform the exactly same actions (as in bash script) manually, everything works as it should.
mystic!
bash script looks like:
cd /app/path
sudo python2 app.py
cd /
python script:
import vlc
a = vlc.MediaPplayer(file)
a.play()