I’m running Mopidy as a service on Diet Pi with pHAT DAC.
I can access the web interface but I cannot get sound. The error I’m seeing in
WARNING [1211:MainThread] mopidy.audio.gst: GStreamer warning: gst-resource-error-quark: Could not open audio device for playback. (6)
The service is running as user mopidy, I’ve checked this like so
$ ps -aux | grep mopidy mopidy 1211 19.5 10.9 282556 53904 ? Ssl 17:19 0:22 /usr/bin/python /usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf
The mopidy user belongs to the following groups
$ groups mopidy mopidy : audio spi i2c gpio dietpi
The audio section of
/etc/mopidy/mopidy.conf is as follows
[audio] output = autoaudiosink
I have tested that
autoaudiosink works using the following command (as root), I heard the beep.
gst-launch-1.0 audiotestsrc ! audioresample ! autoaudiosink
Now the weird part… if I start mopidy with the following command instead of as the service, it works fine, I can hear sound. Also works fine without the debugging.
sudo -u mopidy GST_DEBUG=3 mopidy -v
I’m running out of ideas now, except maybe
sudo -u mopidy is actually running with root credentials and that’s why it’s OK?
I wondered if the audio device is not in the audio group, is that even possible?
$ find /dev -group audio /dev/snd/pcmC0D0p /dev/snd/controlC0 /dev/snd/seq /dev/snd/timer