I’ve installed Volumio on my Raspberry Pi and connected my DAC to it.
I can play music on the Volumio via AirPlay, but it has frequent noises.
I am trying to get it to play some music with mpd, having no success so far.
The DAC is NAD D 3020, and it is detected automatically by ALSA and registered as card #0.
I couldn’t get the web UI to play so I am running mpc directly from the terminal.
volumio@volumio:/tmp$ mpc play
Katy Perry - Dark Horse (feat. Juicy J)
[paused] #3/4 0:00/3:36 (0%)
volume: n/a repeat: off random: off single: off consume: off
ERROR: problems opening audio device
/var/log/mpd/mpd.log:
Mar 02 10:01 : client: [120] opened from 127.0.0.1:33339
Mar 02 10:01 : client: [120] process command "play"
ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card
Mar 02 10:01 : output: Failed to open "Output" [alsa]: Failed to open ALSA device "hw:0,0": No such file or directory
Mar 02 10:01 : client: [120] command returned 0
Mar 02 10:01 : client: [120] process command list
Mar 02 10:01 : client: command_process_list: process command "status"
Mar 02 10:01 : client: command_process_list: command returned 0
Mar 02 10:01 : client: command_process_list: process command "currentsong"
Mar 02 10:01 : client: command_process_list: command returned 0
Mar 02 10:01 : client: [120] process command list returned 0
Mar 02 10:01 : client: [120] closed
I am able to play music using aplay when running using “sudo aplay” as the root user.
I am unable, however, to play using aplay from the “pi” user, even though it is in the “audio” group.
Running “aplay -l” shows that while root can see the DAC card, the pi user cannot.
I have the same problem with my usb dac but I’m afraid your solution does not solve it completely : the new rule you added seems to be only executed after you restart udev. After that if you reboot volumio and unplug / plug the dac the rule is somhow not run and the permission stay on root:root
There also another rule, in /lib/udev/rules.d/91-permissions.rules, that also set the correct permission.
When I test the rules with udevadm, I clearly see both should be applied :
udevadm test $(udevadm info -q path -n /dev/snd/controlC0) 2>&1
I definitely do not understand why these rules are not applied after a reboot, I’m looking at udev documentation right now but I haven’t found any lead yet …
some progress here (but no solution yet ) : after boot, udev is simply not running
pi@volumio:~$ ps aux | grep udevd
pi 2810 0.0 0.1 3628 736 pts/0 S+ 23:22 0:00 grep udevd
The trick in previous post works because when actually start udev. No extra rule is necessary, I just now need to understand why udevd is not running after a clean boot. It is started in rcS.d but seems to quit shortly afterwards.
@naqua : many many thanks for that, I’ve already spend two full evenings trying to understand why udev was not running after a clean boot . I never thought it was actually killed explicitely somewhere !!
It would be nice to remove the kill in the standard volumio distribution ihmo, do you know why it was done ? is there any good reason not to keep it running ?
@michelangelo : I’m using a Cambridge dacmagc (first generation) but I’m pretty sure it happens with any other usb dac.
Actually as udev is not running after boot, I would even expect other weird behavior with any device that you can hot plug and are usually managed by udev like for example usb drive (persistent naming is udev based).