You are not logged in.
Hello everyone,
I've started using mpd, it runs on a home server. And it works great, except that it never creates a database file.
In my /etc/mpd.conf I have:
db_file "/home/mpd/mpd.db"
This file is never created. Even when I create it, it is never filled with any data. This means that on restart of mpd, the database is empty again (so it gets lost after closing mpd). What am I doing wrong?
Last edited by Natanji (2011-08-28 18:39:26)
Offline
You have to update the database from the client you are using. Previous mpd versions had a --create-database commandline parameter, but this was deprecated and removed.
ᶘ ᵒᴥᵒᶅ
Offline
That's exactly what I am doing. I use ario as a client, connect and tell the mpd server that it should update the database. This takes a while and after restarting ario and reconnecting, I see all the music.
However, when I stop mpd on the server, the database is not saved. So when I reboot the server for instance, I have to re-scan the whole database. The database is only saved in memory apparently, while mpd is running - but not saved to the hard drive. And I would like to know why.
Offline
Possibly the user which you are running MPD under has no write permission for the location of the database?
ᶘ ᵒᴥᵒᶅ
Offline
I also wondered about that, but it can't be. In my config I also have:
state_file "/home/mpd/mpdstate"
The state file is successfully created. Same goes for the PID file that resides in the same directory. So unless mpd creates the database with a different user than it creates the state and PID files (which wouldn't make any sense), the error you suggest is impossible.
Offline
*bump* Anyone?
Can someone at least tell me when the database file is created for them - at startup of mpd, or when shutting down the daemon, or when first running update? If it's working for you, trying this out for me would be greatly appreciated.
Offline
I think database is created during first update. You may also try this: https://bbs.archlinux.org/viewtopic.php?id=79542 especially #2
Offline
Like someone said, database is create automatically or by the client you are using. Really check the path where is being saved and if you have permissions. Also use full paths for it. I recommend saving all the files on your home (no permission problems).
If you still have problems on creating the database, delete all files create by mpd. Start ario (you mention you were using it) and create the database with it and check if you still have the same problem.
edit: And as far as I know mpd updates automatically the database when some file is changed.
Last edited by ilusi0n (2011-08-27 11:24:55)
Offline
Also important: the file is NOT created, before the initial scan is completed. Its first dumped to RAM and then written to disk, when finished.
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
Thanks for the replies. Could it be that if something goes wrong during initial scan, that this prevents the database from being saved? I notice that not all of my music is added to mpd although it is on the hard drive. I can't find any errors in the log file though, and the files and directories are all readable (and in the case of directories, executable) by the group that my mpd user is in.
Offline
Thanks for the replies. Could it be that if something goes wrong during initial scan, that this prevents the database from being saved? I notice that not all of my music is added to mpd although it is on the hard drive. I can't find any errors in the log file though, and the files and directories are all readable (and in the case of directories, executable) by the group that my mpd user is in.
start mpd with "mpd --verbose --stdout --no-daemon" to see files that fail to be added (and other errors)
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
Natanji wrote:Thanks for the replies. Could it be that if something goes wrong during initial scan, that this prevents the database from being saved? I notice that not all of my music is added to mpd although it is on the hard drive. I can't find any errors in the log file though, and the files and directories are all readable (and in the case of directories, executable) by the group that my mpd user is in.
start mpd with "mpd --verbose --stdout --no-daemon" to see files that fail to be added (and other errors)
This is what needs to be done. MPD was broken for a while and quitely had segfaults. When it did segfault, the database creation or updating function was not working properly anymore.
Offline
Thanks, that helped a lot! In one folder I had a video .mp4 file that mpd considered being an audio file, tried to scan it and apparently got stuck with it.
Offline