MPD安装使用小记

JACK posted @ 2009年7月01日 10:55 in linux with tags mpd ape sonata mpc install , 8221 阅读

由于拜服于mpd的轻巧和简单,决心安装这个linux下最好用的音乐播放器。

(现在已经可以支持ape了)

在ubuntu安装很简单:

 

sudo apt-get install mpd mpc sonata

 

 

sonata是一个同样简洁的前端,配合mpd使用

但是使用过程中却遇到了一些麻烦,首先是

 

更改了端口一样没有效果,烦躁中卸载了mpd打算重新编译,

但发现源码编译还要自己安装库如libcue等,于是放弃。

重新安装是出现:

 

正在设置 mpd (0.14.2-3ubuntu2) ...
 * Starting Music Player Daemon mpd                                             problem opening log file "/home/jack/音乐/mpd/mpd.log" (config line 11) for writing
Aborted
                                                                         [fail]
invoke-rc.d: initscript mpd, action "start" failed.
dpkg:处理 mpd (--configure)时出错:
 子进程 post-installation script 返回了错误号 134
正在处理用于 libc6 的触发器...
ldconfig deferred processing now taking place
在处理时有错误发生:
 mpd
E: Sub-process /usr/bin/dpkg returned an error code (1)

 


 

解决办法是:

sudo rm /var/lib/dpkg/info/mpd.postinst
sudo apt-get --reinstall install mpd

 

 

回到上面的端口占用问题,解决办法是编辑/etc/hosts文件,

去掉里面的ipv6支持如下:

 

# The following lines are desirable for IPv6 capable hosts
#::1     localhost ip6-localhost ip6-loopback
#fe00::0 ip6-localnet
#ff00::0 ip6-mcastprefix
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
#ff02::3 ip6-allhosts

这样就可以修改~/.mpdconf文件来配置mpd了,我的.mpdconf部分如下:

 


######################## REQUIRED PATHS ########################
# You can put symlinks in here, if you like. Make sure that
# the user that mpd runs as (see the 'user' config parameter)
# can read the files in this directory.
music_directory  "/home/jack/音乐"
playlist_directory      "/home/jack/音乐/mpd/playlists"
db_file   "/home/jack/音乐/mpd/tag_cache"
log_file                "/home/jack/音乐/mpd/mpd.log"
error_file            "/home/jack/音乐/mpd/errors.log"
################################################################


######################## OPTIONAL PATHS ########################
#
# If you wish to use mpd --kill to stop MPD, then you must
# specify a file here in which to store MPD's process ID.
#
pid_file                "/home/jack/音乐/mpd/pid"
#
# If specified, MPD will save its current state (playlist,
# current song, playing/paused, etc.) at exit.  This will be
# used to restore the session the next time it is run.
#
state_file            "/home/jack/音乐/mpd/state"
#
################################################################


######################## DAEMON OPTIONS ########################
#
# If started as root, MPD will drop root privileges and run as
# this user instead.  Otherwise, MPD will run as the user it was
# started by.  If left unspecified, MPD will not drop root
# privileges at all (not recommended).
#
user                            "mpd"
#
# The address and port to listen on.
#
#bind_to_address                 "127.0.0.1"
bind_to_address                 "localhost"
port                            "6600"
#
# If the address is a path, then a UNIX domain socket will be
# created instead of listening on a TCP port.
#
#bind_to_address                 "/var/run/mpd/sock"
#
# Controls the amount of information that is logged.  Can be
# "default", "secure", or "verbose".
#
#log_level                       "default"
#
################################################################

########################## AUDIO OUTPUT ########################
#
audio_output {
        type       "pulse"
        name       "My MPD PulseAudio Output"
}

################################################################

###################### CHARACTER ENCODINGS #####################
#
# If file or directory names do not display correctly, then you
# may need to change this.  In most cases it should be either
# "ISO-8859-1" or "UTF-8".  You must recreate your database
# after changing this (use mpd --create-db).
#
filesystem_charset              "UTF-8"
#
# The encoding that ID3v1 tags should be converted from.
#
id3v1_encoding                  "GBK"
#
################################################################


 

 

 

接下来就可以使用

 

sduo mpd --create-db

 

来更新数据库了,还是有问题

 

Can't open db file "/home/jack/音乐/mpd/tag_cache" for reading/writing: Permission denied

 

 

去掉sudo出现

 

cannot setgid for user "mpd" at line 39: Operation not permitted
忽略
 

 

 

应该是权限问题,解决方法;

 

sudo chmod 0777 -R /home/jack/音乐/

 ps:后来发现有些目录无法加载,也同样是权限问题,解决方法同上

 

接下来更新数据库没问题了

 

sudo mpd

 

 

 

打开sonata或gmpc好好享受听歌的乐趣吧,其余的乱码及歌词支持接下来在解决。

 

Avatar_small
Sunday 说:
Jul 01, 2009 04:25:30 PM

乱码问题太麻烦了,如果解决真的太好了。

Avatar_small
JACK 说:
Jul 05, 2009 06:58:15 AM

@Sunday: 其实我现在主要收藏的ape和flac,基本没乱码了

Avatar_small
deep cleaning abu dh 说:
Sep 19, 2019 10:11:07 PM

Even while an uninsured maintaining service may present you with the same a better standard of cleaning, with a powerful insured house maid service you now have the guarantee which will, if all sorts of things happens, you do not be performed accountable.

Avatar_small
full time maids in d 说:
Jul 01, 2020 04:16:36 PM

When you've decided to continue for high quality cleaners, make sure you also check out cost factor additionally. A wonderful maid service plan may wish for a good amount in return for those work this girl does. Eventhough, it is constantly less expensive to try the cleaning without hiring somebody, but to continue for all the maid service is wise when it arrives to cleaning your residence perfectly. For that reason, it is most effective to transform the budget a small amount of and aim for professional cleaning regardly also ..

Avatar_small
shopping-batalha 说:
Mar 23, 2021 12:10:07 AM

Purchasing doesn't offer any area for dullness. Going about for shopping can be expected or unforeseen. But, you need to be apparent about specific things once you shop. If you are out regarding shopping, you should first determine the price range. Secondly, you should shop goods that would be helpful to suit your needs and those people who are with an individual, so the budget could be sufficient to fulfill the calls for. Purchase goods according to their utilize, if it really is for momentary use usually do not spend significantly. But, if you need a product which usually lasts long you should purchase branded items.

Avatar_small
maid cleaning compan 说:
Jun 14, 2021 09:43:14 PM

Regarding twice monthly, we are capable of doing a total house, deep cleaning to suit your needs. Hire our own Professional Strong cleaning companies in Dubai and also Sharjah and allow you to living attributes more clear and attractive. Get Low-cost Deep washing services coming from Cit Help a reliable Cleaning business in Dubai


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter