Moode Audio Player for Raspberry Pi

Hi,

I'm not able to repro this in my test environment but one way to possibly work around the issue would be to move the music collections under a single root folder on the NAS and then share this folder out.

You would end up making a single source mount in Moode.

Regards,
Tim

Thanks for all your work Tim. Right now I think that I'll stick with my version of a work around until I learn more about the problem.
 
jpeg4, did you by chance have this issue using Moode 2.3? Or is 2.4 your first Moode install.

Tim, this behavior is along the lines of what I described to you via email. 2.4 drops the PCM stream/lock completely once a track/album has finished or is paused. 2.3 did not exhibit this behavior and maintained a lock even if the PCM stream has stopped. I guess that this loss of lock is causing jpeg4's DAC to enter stand-by mode whereas 2.3 would have kept it 'awake'?

wj

Hi,

I investigated this a bit tonight and I'm seeing that when DAC is unplugged then plugged back in, ALSA configures it correctly but MPD shows "error: failed to open audio output" when trying to play.

This can probably be fixed but I'm not sure whether it is permission issue, configuration issue or what?

Regards,
Tim
 
Hi,

Here is some additional diagnostic info from MPD verbose logging. This is after DAC unplugged then plugged back in then press Moode play button.

ALSA lib pcm_hw.c:1667: (_snd_pcm_hw_open) Invalid value for card
Nov 12 21:58 : alsa_output: Failed to open "Output" [alsa]: Failed to open ALSA device "hw:0,0": No such file or directory
Nov 12 21:58 : output: Failed to open audio output
Nov 12 21:58 : player: problems opening audio device while playing "http://uwstream2.somafm.com:3000"


Regards,
Tim
 
Hi,

Here is some additional diagnostic info from MPD verbose logging. This is after DAC unplugged then plugged back in then press Moode play button.

ALSA lib pcm_hw.c:1667: (_snd_pcm_hw_open) Invalid value for card
Nov 12 21:58 : alsa_output: Failed to open "Output" [alsa]: Failed to open ALSA device "hw:0,0": No such file or directory
Nov 12 21:58 : output: Failed to open audio output
Nov 12 21:58 : player: problems opening audio device while playing "http://uwstream2.somafm.com:3000"


Regards,
Tim
Tim
thanks for investigating. I don't have any expertise to offer but if MPD is the issue then is my comment on Volumio a clue? Would it handle MPD differently?
 
Sound card index is not fixed in alsa - it may change at every boot/unplug cycle.

You may want to use the card name instead which is stable for each different soundcard. Using card index in the alsa device identifier string is not recommended for the above reason.

e.g.
https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture#Alternative_method

Hi,

Yes this is root cause. Thanks so much :)

There are two cases to deal with (1) boot/reboot and (2) hotplug.

Currently at boot/reboot the configuration always yields hw:0. When hotplug it changes to hw:1. This can be verified by editing /etc/mpd.conf after hotplug and changing hw:0 to hw:1, then music plays.

I'll add this to my to-do list for fixing :)

Regards,
Tim
 
Hi,

Yes this is root cause. Thanks so much :)

There are two cases to deal with (1) boot/reboot and (2) hotplug.

Currently at boot/reboot the configuration always yields hw:0. When hotplug it changes to hw:1. This can be verified by editing /etc/mpd.conf after hotplug and changing hw:0 to hw:1, then music plays.

I'll add this to my to-do list for fixing :)

Regards,
Tim
Thanks Tim and phofman, good to know there is a solution.
 
Sound card index is not fixed in alsa - it may change at every boot/unplug cycle.

You may want to use the card name instead which is stable for each different soundcard. Using card index in the alsa device identifier string is not recommended for the above reason.

e.g.
https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture#Alternative_method

Hi,

Yes this is root cause. Thanks so much :)

There are two cases to deal with (1) boot/reboot and (2) hotplug.

Currently at boot/reboot the configuration always yields hw:0. When hotplug it changes to hw:1. This can be verified by editing /etc/mpd.conf after hotplug and changing hw:0 to hw:1, then music plays.

I'll add this to my to-do list for fixing :)

Regards,
Tim

Hi,

Of course hw:1 is just the on-board audio device on the Pi and not the DAC so my result is not valid. I should remember to leave the audio cable plugged into the DAC :)

Whats interesting is that all the command output indicates DAC is assigned to card 0 (hw:0) after hotplug, yet MPD cannot open hw:0.

Regards,
Tim
 
The log message

Code:
Failed to open ALSA device "hw:0,0": No such file or directory

clearly suggests the soundcard has been renumbered. aplay -l gives the card name, e.g. my analog output card would be hw:pCH,0 since aplay says:

Code:
pavel@probook ~ $ LANG=C aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC3227 Analog [ALC3227 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
 
The log message

Code:
Failed to open ALSA device "hw:0,0": No such file or directory

clearly suggests the soundcard has been renumbered. aplay -l gives the card name, e.g. my analog output card would be hw:pCH,0 since aplay says:

Code:
pavel@probook ~ $ LANG=C aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC3227 Analog [ALC3227 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Hi,

Checking a few things I noticed that ps -A did not list udevd running. This is why nothing is making sense.

Its killed off in an "audio optimization" script from the original code that runs during Player load. Here is what gets nuked:

killall -9 exim4
killall -9 ntpd
killall -9 thd
killall -9 cron
killall -9 atd
killall -9 startpar
killall -9 udevd

After # out udevd line, hotplugging DAC seems to work.

Progress :) but more testing needed.

Regards,
Tim
 
Hi,

Checking a few things I noticed that ps -A did not list udevd running. This is why nothing is making sense.

Its killed off in an "audio optimization" script from the original code that runs during Player load. Here is what gets nuked:

killall -9 exim4
killall -9 ntpd
killall -9 thd
killall -9 cron
killall -9 atd
killall -9 startpar
killall -9 udevd

After # out udevd line, hotplugging DAC seems to work.

Progress :) but more testing needed.

Regards,
Tim

Many thanks Tim. This seems to work. I tracked down this code in the file called
/var/www/command/orion_optimize.sh
and put # in front of the killall -9 udevd line like you did.
Rebooted and now I can switch of the DAC/Amp (Moode pauses which is good) and switch it back on again and resume playing no problem. Also working well with MPaD app as a controller.
Off to play with some other functions now.
 
Many thanks Tim. This seems to work. I tracked down this code in the file called
/var/www/command/orion_optimize.sh
and put # in front of the killall -9 udevd line like you did.
Rebooted and now I can switch of the DAC/Amp (Moode pauses which is good) and switch it back on again and resume playing no problem. Also working well with MPaD app as a controller.
Off to play with some other functions now.

Hi,

Glad its working :)

In your config, what setting do you use for MPD volume control: disabled, Hardware or Software?

Regards,
Tim
 
Hi Tim, i had to reboot the Pi today and set everything up again and i have found a little bug i thought you should know (was the same the last time). for some reason when you set the I2S audio device (iqaudio dac+) i have to do it twice or the hardware device does not come up on the playback device so i cant set the volume.

to get round this i have to set the I2S device then reboot then go back and set the device back to none then reboot then go back in and again set the device. after this everything works perfect.
 
At the moment it's on Software. Haven't tried changing this yet.

Hi,

Does the DAC have on-board hardware volume controller?
- if it does, alsamixer will show a volume slider for the device

Prelim tests indicate that hot plugging breaks MPD coupling to ALSA hardware mixer. For example if DAC has h/w volume controller and MPD volume control set to "Hardware" then hotplug causes MPD volume control to become non-functional.

When testing be sure to check alsamixer after hotplug in case it is at 100!

Regards,
Tim
 
Hi Tim, i had to reboot the Pi today and set everything up again and i have found a little bug i thought you should know (was the same the last time). for some reason when you set the I2S audio device (iqaudio dac+) i have to do it twice or the hardware device does not come up on the playback device so i cant set the volume.

to get round this i have to set the I2S device then reboot then go back and set the device back to none then reboot then go back in and again set the device. after this everything works perfect.

Hi,

Very odd.

After reboot what is not working in the Player?

Regards,
Tim
 
the volume device is not showing up as iqaudio dac+ so cant set the volume.

Hi,

I'm still having a hard time visualizing the issue you are having, but I just tested configuring from scratch an IQaudIO Pi-DAC+ on fresh Moode 2.4 image and no problems whatsoever. Music was playing after a single reboot :)

Steps I followed are:

(1) System config, I2S audio device, select IQaudIO PI-DAC+, press SET
(2) Wait for completion message
(3) Reboot
(4) MPD config, Volume control, select Hardware, press APPLY
(5) Wait for completion message and wait a bit more for MPD to restart
(6) Customize
- Volume warning limit, enter 85
- Logarithmic curve, select Yes, press UPDATE
(7) Toggle volume knob from 0 to 10 and back for initial MPD/ALSA volume sync
(8) Start SUB.FM playing, set volume knob to 85 :)

Regards,
Tim