pythonsystemdsupervisordalsaliquidsoap

Supervisor service doesn't have access to audio device ("Error while setting open_pcm: No such file or directory")


I'm using Supervisor to demonize a Python / Liquidsoap application. When I start the application from the command line, things are working fine.

When I run the same application using supervisorctl the Liquidsoap implementation fails when trying to access the audio device:

[lineout:3] Using ALSA 1.1.8.
[clock.wallclock_alsa:2] Error when starting output lineout: Failure("Error while setting open_pcm: No such file or directory")!

The USB Audio Interface is accessed via ALSA. The Supervisor Configuration has the correct user set and the service is started with this very user:

[program:aura-engine]
user = engineuser
directory = /opt/aura/engine
command = /opt/aura/engine/run.sh engine

priority = 666
autostart = true
autorestart = true
stopsignal = TERM

redirect_stderr = true
stdout_logfile = /var/log/aura/engine-core-stdout.log
stderr_logfile = /var/log/aura/engine-core-error.log

Any ideas if there are any additional hardware permission issues involved when using Supervisord?


Solution

  • It turned out, that starting the application with root (root user in Supervisor config, but also starting supervisord as root, plus starting the service with sudo supervisorctl start...) successfully grants access to the audio hardware. But running the app as root is not an option. This also issues a warning by Supervisor.

    Then I returned the configuration to the desired engineuser, and did reload the configuration with sudo:

    sudo supervisorctl reload
    

    Now, suddenly I'm able to start the app without root/sudo and have full access to the audio hardware:

    supervisorctl start aura-engine