MPD issues

597 views
Skip to first unread message

noneofmyseeds

unread,
Jan 18, 2015, 4:46:36 PM1/18/15
to al...@googlegroups.com
Hello

I installed MPD, which by the way is a great addition. And I also
installed, as a client/player, Theremin (it seems the best client out
there for OSX by the way) Alt-F release notes some other port for MPD
than 6600, which Theremin picked up and which is in the configuration
file for MPD. So I did not change that but pointed the music directory
correctly. In Theremin, I went to Preferences, created a profile,
added the server port and eft port 6600 on. And then set the profile I
created as default. Then I went to File and selected the Profile I
created and got "Not playing" in Theremin.

In Alt-F, I went to view the log of MPD and found "Jan 15 21:44 :
inotify: Failed to open directory /mnt/sdc2/server tests music and
pictures/music: Permission denied" And also got this: "inotify:
inotify_add_watch() has failed: Permission denied." Good news: the
music player was "successfully established" on the server, which means
the avhai service is working great.

Thanks in advance for your help!

João Cardoso

unread,
Jan 20, 2015, 11:24:36 AM1/20/15
to al...@googlegroups.com, noneof...@gmx.de


On Sunday, January 18, 2015 at 9:46:36 PM UTC, noneofmyseeds wrote:
Hello

I installed MPD, which by the way is a great addition. And I also
installed, as a client/player, Theremin (it seems the best client out
there for OSX by the way) Alt-F release notes some other port for MPD
than 6600, which Theremin picked up and which is in the configuration
file for MPD. So I did not change that but pointed the music directory
correctly. In Theremin, I went to Preferences, created a profile,
added the server port and eft port 6600 on. And then set the profile I
created as default. Then I went to File and selected the Profile I
created and got "Not playing" in Theremin.

In Alt-F, I went to view the log of MPD and found "Jan 15 21:44 :
inotify: Failed to open directory /mnt/sdc2/server tests music and
pictures/music: Permission denied" And also got this: "inotify:
inotify_add_watch() has failed: Permission denied."

mpd runs as the 'mpd' user and 'multimedia' group.This means that files and folders/sub-folders that it scans must be accessible to it.

The 'Permission denied' "issue" has been covered several times in this forum, search if and read the online help (the (?) icon near the page title) on the Setup->Folders. Permissions webUI.

noneofmyseeds

unread,
Jan 20, 2015, 3:48:59 PM1/20/15
to al...@googlegroups.com
I have gone to and know how to use the Setup>Folders permission. I know
how to use it to ensure that users have access to folders. But in the
pull-down, you can either select one of the several options, such as
"users", "multimedia,", etc. You can't select "users" and "multimedia"
at the same time. And in the groups you have "users" and "multimedia",
as found under Setup>Users. So, it is possible to make "users" part of
the "multimedia" or vice-versa? It is possible that my understanding is
limited on this.

Thanks a lot.

João Cardoso

unread,
Jan 21, 2015, 12:58:35 PM1/21/15
to al...@googlegroups.com, noneof...@gmx.de


On Tuesday, January 20, 2015 at 8:48:59 PM UTC, noneofmyseeds wrote:
I have gone to and know how to use the Setup>Folders permission. I know
how to use it to ensure that users have access to folders. But in the
pull-down, you can either select one of the several options, such as
"users", "multimedia,", etc. You can't select "users" and "multimedia"
at the same time.

No, that's a linux characteristic of the basic files/folders permissions structure. For more advanced usage, ACL (Access Control Lists) has to be used. But that's overkill for most.
 
And in the groups you have "users" and "multimedia",
as found under Setup>Users. So, it is possible to make "users" part of
the "multimedia" or vice-versa?

No.

What you can do is to add users to the multimedia group (users that you want to have direct access to the files/folders owned by the multimedia group).
That works that way already for the other servers such as minidlna, fuppes, daapd, forked-daapd, ushare, etc, so each one of them runs as its own user, but they all belong to the multimedia group; that way you can have them to serve the save files using different protocols for different clients -- the only requirement is that users belonging to the multimedia group can read files and read/browse folders.

So if joe, besides belonging to the users group, also belongs to group multimedia and folder Music is owned by group multimedia with read/browse permissions, then joe is allowed to read and browse the folder (not necessarily sub-folders), but not to write/delete/create files on it.

In general, the multimedia servers only need to read and browse files/folders, so all files/folders/sub-folders only need to have read/browse permissions for the group.

For new files/folder to inherit permissions of the base folder, which is advisable, you also have to check  the corresponding checkbox. And eventually also check the recursive and apply to files checkboxes.

Eilesh Gondalia

unread,
Apr 6, 2020, 11:29:28 AM4/6/20
to al...@googlegroups.com
Sorry to bring up an old thread, has anyone got MPD to work on a DNS-323 I keep getting "failed to bind 6600 Failed to create socket" when I run "mpd"
- Tried to set bind to either 127.0.0.1 and 0.0.0.0 still same issue

Also got missing dir errors so created the below dir:
/var/lib/mpd/database
/var/lib/mpd/playlists

Am I supposed to run some kind of script to configure this, also I dont see a DB file created? 

Any help would be appreciated, I am newlish to Linux btw :)

p.s. - I install "mpd 0.17.6" via packages there no UI to configure just the mpd.conf right?


On Sunday, January 18, 2015 at 9:46:36 PM UTC, noneofmyseeds wrote:

Joao Cardoso

unread,
Apr 6, 2020, 8:30:49 PM4/6/20
to Alt-F


On Monday, April 6, 2020 at 4:29:28 PM UTC+1, Eilesh Gondalia wrote:
Sorry to bring up an old thread, has anyone got MPD to work on a DNS-323 I keep getting "failed to bind 6600 Failed to create socket" when I run "mpd"
- Tried to set bind to either 127.0.0.1 and 0.0.0.0 still same issue

Also got missing dir errors so created the below dir:
/var/lib/mpd/database
/var/lib/mpd/playlists

Am I supposed to run some kind of script to configure this,

yes, "rcmpd start" (or stop or status). Under Services->User a start/stop button should be available.
rc<service> exists for most tested services, is a link to /etc/init.d/S??<service>, and (most) appears under Services->...

Eilesh Gondalia

unread,
Apr 7, 2020, 1:50:36 PM4/7/20
to al...@googlegroups.com
Thanks for update Joao, I ran the script but got:

"Fail: You have to configure MPD first"

unsure what I need to do before running, do I only need to add the DIR location of my music files in the mpd.conf, or are there other settings I need?   appreciate all help, thanks.

I found this but failed to configure it https://linuxaria.com/recensioni/play-your-music-on-linux-with-music-player-daemon


On Tuesday, April 7, 2020 at 1:30:49 AM UTC+1, Joao Cardoso wrote:


On Monday, April 6, 2020 at 4:29:28 PM UTC+1, Eilesh Gondalia wrote:
Sorry to bring up an old thread, has anyone got MPD to work on a DNS-323 I keep getting "failed to bind 6600 Failed to create socket" when I run "mpd"
- Tried to set bind to either 127.0.0.1 and 0.0.0.0 still same issue

Also got missing dir errors so created the below dir:
/var/lib/mpd/database
/var/lib/mpd/playlists

Am I supposed to run some kind of script to configure this,

yes, "rcmpd start" (or stop or status). Under Services->User a start/stop button should be available.
 
rc<service> exists for most tested services, is a link to /etc/init.d/S??<service>, and (most) appears under Services->...

João Cardoso

unread,
Apr 7, 2020, 2:13:32 PM4/7/20
to Alt-F


On Tuesday, 7 April 2020 18:50:36 UTC+1, Eilesh Gondalia wrote:
Thanks for update Joao, I ran the script but got:

"Fail: You have to configure MPD first"

You have to edit /etc/mpd.conf and change the music directory from /Public to your real music folder, such as /mnt/md0/MyMusic

music_directory         "/Public"

No more changes to the config should be needed.

I have tested it years ago, don't remember the details or clients that I have tested with, I used probably linux clients.

Notice that at start the init script changes the music directory  group ownership to allow group member to access it. This is to allow mpd to access your files

I think that you have to make yourself (and by consequence your files, the music directory and files belongs to you, right?) member of the multimedia group, use Setup->Users for that.

I'm afraid that I can't help much more.


unsure what I need to do before running, do I only need to add the DIR location of my music files in the mpd.conf, or are there other settings I need?   appreciate all help, thanks.

Eilesh Gondalia

unread,
Apr 8, 2020, 4:07:11 AM4/8/20
to al...@googlegroups.com
So I got little further and services start but still get a error :

"Failed to load database: Database corrupted"
So I tried  mpd --create-db
** (mpd:4036): CRITICAL **: option parsing failed: Unknown option --create-db

And now looks like above command is depreciated in newer mpd versions and points to a command called "mpc update" but I don't have this package installed or can find it.
https://forums.gentoo.org/viewtopic-t-786380-start-0.html
https://bbs.archlinux.org/viewtopic.php?id=81362
https://bbs.archlinux.org/viewtopic.php?id=110273


I also have these files in /var/lib/mpd   (had to manually create database file and playlists dir as not present but unsure about any groups/user permissions, instead I ran 

[root@Squarebox]# chmod 0777 -R /var/lib/mpd/

[root@Squarebox]# ls -Al

-rwxrwxrwx    1 root     root               database
drwxrwxrwx    2 root    multimed       playlists  (DIR)
-rwxrwxrwx    1 root     root               state
-rwxrwxrwx    1 mpd    multimed       sticker.sql



If I run mpd --no-daemon --stdout --verbose" it start to get all my MUSIC but still give the DB Corrupt message (cut down as quite big)

[root@Squarebox]# mpd --verbose --no-daemon --stdout
config: loading file /etc/mpd.conf
path: path_set_fs_charset: fs charset is: UTF-8
Failed to load database: Database corrupted
daemon: opening pid file
daemon: writing pid file
avahi: Initializing interface
avahi: Client changed to state 2
avahi: Client is RUNNING
avahi: Registering service _mpd._tcp/Music Player on Squarebox
avahi: Service group changed to state 0
avahi: Service group is UNCOMMITED
update: spawned thread for update job id 1
state_file: Loading state file /var/lib/mpd/state
state_file: Unrecognized line in state file:
update: starting
inotify: initializing inotify

inotify: watching music directory
config: option 'quality' on line 270 was not recognized
avahi: Service group changed to state 1
avahi: Service group is REGISTERING
avahi: Service group changed to state 2
avahi: Service 'Music Player on Squarebox' successfully established.
reading /Eagles_Hotel_California_Best_Version__CBR_192k.mp3
added /Eagles_Hotel_California_Best_Version__CBR_192k.mp3d
reading oldskool slow/Ralph Tresvant - Do What I Gotta Do.mp3
added oldskool slow/Ralph Tresvant - Do What I Gotta Do.mp3
reading oldskool slow/Slow_jams_featuring_Monica_Usher_CBR_192k.mp3
added oldskool slow/Slow_jams_featuring_Monica_Usher_CBR_192k.mp3
...................................LOTS MORE MUSIC FILES IN THIS LIST...........................
Segmentation fault

SERVICE SEEMS TO BE RUNNING
[root@Squarebox]# ps aux | grep mpd
  423 root     grep mpd
 3880 mpd      mpd
 3881 mpd      mpd
 3882 mpd      mpd
[root@Squarebox]#

other info (optional pid state files)

p.s. - I tried to run the "rcmpd start"  under services>User but it never started so I manually run the script which worked ok to give required permissions for the /mnt/sda2/Public/RW/MusicMP3 directory

I would really appreciate if someone could point me in the right direction here, would really appreciate any help, I think i am almost there but unsure :)


On Tuesday, April 7, 2020 at 7:13:32 PM UTC+1, João Cardoso wrote:

You have to edit /etc/mpd.conf and change the music directory from /Public to your real music folder, such as /mnt/md0/MyMusic

music_directory         "/Public"

No more changes to the config should be needed.

I have tested it years ago, don't remember the details or clients that I have tested with, I used probably linux clients.

Notice that at start the init script changes the music directory  group ownership to allow group member to access it. This is to allow mpd to access your files

I think that you have to make yourself (and by consequence your files, the music directory and files belongs to you, right?) member of the multimedia group, use Setup->Users for that.


On Tuesday, April 7, 2020 at 1:30:49 AM UTC+1, Joao Cardoso wrote:

Also got missing dir errors so created the below dir:
/var/lib/mpd/database
/var/lib/mpd/playlists



yes, "rcmpd start" (or stop or status). Under Services->User a start/stop button should be available.

Joao Cardoso

unread,
Apr 8, 2020, 8:22:04 PM4/8/20
to Alt-F
I can only give you a few words of advise:

-start fresh
-start with the default config, only changing the music directory to a small sub set of music folder
-start using the rcmpd script, as starting mpd from the command line might fail setting some variables, and *don't* start other needed services, such as avahi
-examine the log a few lines above the end to determine where it crashed -- it might be some particular music, or music folder, or file size limit?
-Don't create the database. If it is corrupted, delete it. mpd will rescan and recreate it. Perhaps the 'state' file stores some info? better delete it also (see my log)

You have a seg fault.  Bad sign. Look at your log and try to eliminate the last music folder. mpd uses some other programs and either mpd or those auxiliary program or libraries didn't like some your music and crashed. Or it might be that you have just too many files? Or the box has not enough memory to hold your songs? Can't tell, see bellow my experience, luck.

-start fresh:
rcmpd stop # stop mpd...
ipkg  remove mpd # will  not remove user created files
rm -rf /var/lib/mpd /etc/mpd.conf # remove user created files
ipkg install mpd # it also creates mpd user and runs 'rcmpd status', which creates needed folders


edit /etc/mpd.conf and change *only* the music dir so it points to a *small* music folder (without sub-folders)
edit /etc/init.d/S81mpd and set the OPTS variable so it contains more options, such as
OPTS="--no-daemon --verbose"

rcmpd start # starts mpd, log is in /var/log/mpd/mpd.log
pstree -p # nice processes listing, you should see avahi-daemon and dbus-daemon running, besides several mpd instances
less /var/log/mpd/mpd.log # examine the log, <space> to next page, <ESC> '>' to the end, 'q' to quit, '/searchstring', 'n' next search occurence, 'N' previous, etc

I tested it with a small 1700 music files on  220 folders without problem. The database is only 360KB:

ls -l /var/lib/mpd

-rw-r--r--    1 mpd      multimed    360204 Apr  9 00:13 database
-rw-r--r--    1 mpd      multimed       188 Apr  9 00:18 state
-rw-r--r--    1 mpd      multimed      3072 Apr  9 00:13 sticker.sql

my log:

Apr 09 00:13 : avahi: Initializing interface
Apr 09 00:13 : avahi: Client changed to state 2
Apr 09 00:13 : avahi: Client is RUNNING
Apr 09 00:13 : avahi: Registering service _mpd._tcp/Music Player on DNS-320L
Apr 09 00:13 : avahi: Service group changed to state 0
Apr 09 00:13 : avahi: Service group is UNCOMMITED
Apr 09 00:13 : update: spawned thread for update job id 1
Apr 09 00:13 : state_file: Loading state file /var/lib/mpd/state
Apr 09 00:13 : state_file: failed to open /var/lib/mpd/state: No such file or directory # as expected, first run!
Apr 09 00:13 : inotify: initializing inotify
Apr 09 00:13 : update: starting
Apr 09 00:13 : reading John Lee Hooker/Various/1-15 Don_t Trust Nobody.mp3

Apr 09 00:13 : added John Lee Hooker/Various/1-15 Don_t Trust Nobody.mp3

... cut to the end

Apr 09 00:13 : added Astor Piazzola/Grandes Sucessos de Astor Piazzola/Fracanapa.mp3
Apr 09 00:13 : removing empty directories from DB
Apr 09 00:13 : sorting DB
Apr 09 00:13 : writing DB
Apr 09 00:13 : update: finished
Apr 09 00:18 : state_file: Saving state file /var/lib/mpd/state

pstree -p
init(1)-+-avahi-daemon(979)
       |-dbus-daemon(974)
       |-mpd(987)---mpd(990)-+-mpd(991)
       |                     |-mpd(992)
       |                     |-mpd(994)
       |                     `-mpd(995)

rcmpd stop

Eilesh Gondalia

unread,
Apr 9, 2020, 4:40:09 AM4/9/20
to al...@googlegroups.com
If run  ipkg install mpd  I get 
Installing mpd (0.17.6) to /Alt-F...
Configuring mpd
Fail: you have to configure MPD first.
Successfully terminated.

I continued to follow your steps adding smaller DIR for music, then edited/ran the SCRIPT
[root@Squarebox]# rcmpd start
Starting mpd: OK.

I checked log and was able to see my Music files are added OK no obvious errors
 
BUT in my  ls -l /var/lib/mpd   (I only see 1 file)  missing the other two files
-rw-r--r--    1 mpd      multimed      3072 Apr  9 08:27 sticker.sql

Also ran below :
[root@Squarebox]# . /etc/init.d/S81mpd start
Starting dbus-uuidgen: OK.
Starting dbus-daemon: OK.
Starting avahi-daemon: OK.
Starting mpd: OK.

But if I run mpd I get error below:
[root@Squarebox]# mpd
Failed to stat directory "/var/lib/mpd/playlists": No such file or directory
Failed to load database: Failed to open database file "/var/lib/mpd/database": No such file or directory

I created below manually (not sure I should of):
# mkdir /var/lib/mpd/playlists
# touch /var/lib/mpd/database

ran mpd only :
# mpd
Failed to load database: Database corrupted
Can't open db file "/var/lib/mpd/database" for reading/writing: Permission denied

I added below to get around this permission error and started again:
chmod 0777 -R /var/lib/mpd/

Q1: Should I create the DIR/FILE manually and if so how I create DB without corruption.  Again really appreciate help on this, thanks in advance.

>>>>>QUICK UPDATE -- I started mpd and got Android APP MPDroid connected for a few sec, saw a quick song list displayed but then it got disconnected, when I look on the DNS-323 the mpd service had stopped running, no obvious reason, could it be because of the corrupt db file.  

So I started 
[root@Squarebox]# rcmpd start
Starting mpd: OK.

Saw the service running
[root@Squarebox]# ps aux | grep mpd
 2743 mpd      mpd --no-daemon --verbose
 2750 mpd      mpd --no-daemon --verbose
 2751 mpd      mpd --no-daemon --verbose
 2752 mpd      mpd --no-daemon --verbose
 2753 mpd      mpd --no-daemon --verbose
 2754 mpd      mpd --no-daemon --verbose
 2755 mpd      mpd --no-daemon --verbose
 2757 root     grep mpd
[root@Squarebox]#

Connected via my Andriod MPDriod app again, saw quick song list, then the mpd service stopped again on DNS-323

[root@Squarebox]# ps aux | grep mpd
 2916 root     grep mpd
[root@Squarebox]#


Regards
Eilz

Eilesh Gondalia

unread,
Apr 9, 2020, 8:56:16 AM4/9/20
to al...@googlegroups.com
Update 2 > I got much further and have MPD working now, was a case of re-install a few time and permissions I think.  

I tried MPDroid app, now lists all songs ok but wont play sound correctly on phone, made relevant changes for output device/8000 but there's a real delay in sound connect/playing to the phone, I tried vorbis and lame option still same.  Funny thing is it seems to play sound ok as soon as I go to stop the mpd service, weird right, oh well I thought it would perform better, unless anyone has any ideas I also tried DROID MPD app still same issue so think its most likely config or maybe CPU too low to cope not sure, anyone?



I have reverted to use MXPlayer over SMB2 now which works but just not a great music player (tried bsplayer, and vlc and few others but as a music player non are great).  Guess I'm stuck with MXPlayer for now (other apps don't seem to support SMB2 or above either)

Thanks Joao for all help - (its been a great learning curve for me :)


Reply all
Reply to author
Forward
0 new messages