Mpd not starting and no terminal output

Hi
I installed mpd-full on my Linkit Smart 7688 with working wm8960 i2c sound chip (verified with alsa-test).
Then configured the /etc/mpd.conf file like this:

root@OpenWrt:~/mpd# cat /etc/mpd.conf 
bind_to_address		"127.0.0.1"
port			"6600"

music_directory       "/root/audio/music"
playlist_directory    "/root/audio/playlists"
db_file               "/root/mpd/database"
log_file              "/root/mpd/log"
log_level             "verbose"
pid_file              "/root/pid"
state_file            "/root/mpd/state"
user                  "root"
group                 "root"

input {
	plugin "curl"
}

audio_output {
        type          "alsa"
        name          "i2s-wm8960"
        device        "hw:0,0"
        mixer_control "PCM"
}
root@OpenWrt:~/mpd# ls -la
drwxrwxrwx    3 root     root          4096 Dec  6 21:35 .
drwxr-xr-x    1 root     root          4096 Dec  6 14:57 ..
drwxrwxrwx    4 root     root          4096 Dec  6 21:36 audio
root@OpenWrt:~/mpd# service mpd restart
root@OpenWrt:~/mpd# ls -la
drwxrwxrwx    3 root     root          4096 Dec  6 21:35 .
drwxr-xr-x    1 root     root          4096 Dec  6 14:57 ..
drwxrwxrwx    4 root     root          4096 Dec  6 21:36 audio
root@OpenWrt:~/mpd# mpd
root@OpenWrt:~/mpd# ls -la
drwxrwxrwx    3 root     root          4096 Dec  6 21:35 .
drwxr-xr-x    1 root     root          4096 Dec  6 14:57 ..
drwxrwxrwx    4 root     root          4096 Dec  6 21:36 audio

during many steps and adding sequentially more and more like with this search (and more on the inet) here: Link

Without success.
Any idea why giving in terminal mpd does not lead to an error or even any output while the folder stays empty, as you can see above?

Seams like it does not pick up my config but I also rebooted and checked if the config stay what it does. Its still there but no log file, no db nothing...

You did not say explicitly, but you would need to create the playlist_directory, db_file, log_file, pid_file and state_file. Typically, these go in /var/mpd/.

You can test you configuration by manually starting mpd followed by the path you your mpd.conf:

#mpd /etc/mpd.conf

Thanks for the input.
I created those files with "#touch database" ...
Still even if I do #mpd /etc/mpd.conf I do not get any output in console nor in log file I created and have in my mpd.conf.
Even LuCI Process List does not show a mpd active.
How can I debug a program that does not start, not log and not prompt any error in terminal?

I run mpd on my workstation and do not have any experience setting it up on an OpenWrt router.
Some suggestions:

  1. bind_to_address/port - do these exist and do you have a route to them? From a security standpoint, I could see OpenWrt defaults closing most ports, is 6600 available? Look at using a unix socket for bind_to_address - this does not use a network port
    https://www.google.com/search?q=mpd%20unix%20socket
  1. Check the permissions on the /bin/mpd file. You may need to create a mpd users group and be a member of it. You also need your /root/audio/music files (*.mp3), and the chain to them to be executable.

  2. Reach out to the port maintainer.

  3. If you are successful, consider writing a wiki on setting it up. The only mpd entries in the OpenWrt documentation my search found were about building mpd.

Thanks for that hints. I tried to groupadd mpd that failed because openwrt does not have the package per default, so I thought that might make mpd to fail and installed opkg install shadow-useradd then removed mpd opkg remove mpd-full and installed again. Now i at least get a ton of errors if i do #mpd. Which is great. libpulse.so is missing.
After that I uninstalled pulseaudio-daemon and mpd-full, then reinstalled mpd-full because it has depends on pulseaudio-daemon and then read that useradd pulse needs a logout/login so i did that and voila! Now it works.

To report that, I think I need to know what the desired way is to add a usergroup during a packet installation.

Pulse audio is a "layer" on top of alsa and the kernel sound drivers. If you use the mpd.conf in your first post, you should not have any errors. Likely opkg installed a default mpd.conf that uses pulse as the audio output. See the different audio outputs starting at line 192
https://github.com/andrewrk/mpd/blob/master/doc/mpdconf.example

You can make it use alsa but you have to find the default mpd.conf, usually in /etc, and edit it.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.