「Music Player Daemon/トラブルシューティング」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
5行目: 5行目:
 
== トラブルシューティング ==
 
== トラブルシューティング ==
 
=== Autodetection failed ===
 
=== Autodetection failed ===
  +
MPD を起動すると、セットアップが自動検出されて、アウトプットやボリュームコントロールが設定されます。大抵はこれで上手くいきますが、システムによっては上手く行かないことがあります。アウトプットやミキサーコントロールを MPD に手動で指定することが可能です。{{ic|/etc/mpd.conf.example}} から {{ic|/etc/mpd.conf}} をコピーした場合、以下をアンコメントしてください:
During the start of MPD, it tries to autodetect your set-up and configure output and volume control accordingly. Though this mostly goes well, it will fail for some systems. It may help to tell MPD specifically what to use as output and mixer control. If you copied {{ic|/etc/mpd.conf}} over from {{ic|/etc/mpd.conf.example}} as mentioned above, you can simply uncomment:
 
   
 
Example for alsa output type and alsa mixer:
 
Example for alsa output type and alsa mixer:
83行目: 83行目:
 
The error is stating that the user starting the process does not have permissions to become another user (mpd) which the configuration has told the process to run as.
 
The error is stating that the user starting the process does not have permissions to become another user (mpd) which the configuration has told the process to run as.
   
  +
この問題を解決するには、mpd を root で起動してください:
To solve the issue, simply start mpd as root.
 
 
{{bc|# systemctl start mpd}}
 
{{bc|# systemctl start mpd}}
   

2015年7月8日 (水) 11:49時点における版

メインの記事は Music Player Daemon

トラブルシューティング

Autodetection failed

MPD を起動すると、セットアップが自動検出されて、アウトプットやボリュームコントロールが設定されます。大抵はこれで上手くいきますが、システムによっては上手く行かないことがあります。アウトプットやミキサーコントロールを MPD に手動で指定することが可能です。/etc/mpd.conf.example から /etc/mpd.conf をコピーした場合、以下をアンコメントしてください:

Example for alsa output type and alsa mixer:

audio_output {
	type			"alsa"
	name			"My ALSA Device"
	device			"hw:0,0"	# optional
	format			"44100:16:2"	# optional
	mixer_type		"hardware"
	mixer_device		"default"
	mixer_control		"PCM"
}

Note: in case of permission problems when using ESD with MPD run this as root:

# chsh -s /bin/true mpd

最初の起動時に MPD がフリーズする

mp3 タグが壊れているときによく起こるエラーです。以下にこの問題を解決する実験的な方法を記述します。必要なのは:

  • kid3
  • easytag

この方法は非常に長い時間がかかります (特にデータベースが巨大な場合)。大体、16GB のデータベースを修復するのに 2.5 時間くらいかかります。

Easy Tag

The purpose of easytag here is that easytag detects the error in the tags, but like MPD it hangs and dies. The trick here is that easy tags actually tells you what file is causing the problem on the status bar. Before starting easytag make sure to have a terminal close to be ready to kill easy tag to avoid a hang. Once you are ready, on the tree view select the directory where all your music is located. By default easytag starts to search all subdirectories for mp3 files. Once you notice that easytag stopped scanning for songs, make note of the culprit and kill easytag.

ノート: This task can also be achieved by editing mpd's config file and setting "log_level" from "default" to "verbose". restart mpd and look up the last entry in mpd's log file after mpd hangs. It is recommended to set "log_level" back to "default" after debugging, since the log file grows fast.

Kid3

Here's where kid3 comes in handy. With kid3 go to the offending song and rewrite one of the tags. then save the file. This should force kid3 to rewrite the whole tag again fixing the problem with MPD and easy tag hanging.

Repeat this procedure until your music library is done.

Cannot connect to mpd: host "localhost" not found: Temporary failure in name resolution

ネットワークから切断されていると、(ncmpcpp を使って) MPD に接続することはできません。解決方法は IPv6 を無効化するか以下の行を /etc/hosts に追加することです:

::1 localhost.localdomain localhost

Other issues when attempting to connect to mpd with a client

Some have reported being unable to access mpd with various clients, for example seeing errors like these:

$ ncmpcpp
Cannot connect to mpd: Connection closed by the server
$ sonata
2011-02-13 18:33:05  Connection lost while reading MPD hello
2011-02-13 18:33:05  Not connected
2011-02-13 18:33:05  Not connected

Please see posts on ncmpcpp on the Arch Forums HERE and HERE. Also see FS#22071.

First fix

Check mpd.conf for a line like mpd.error and remove it. The mpd error file is deprecated and has been removed.

Second fix

ノート: I'm not so sure this is a good idea. There is a warning about changing the address to bind to in the default mpd.conf. If this does not help, you might want to comment out the changes.

If that doesn't help, add the following to mpd.conf:

 bind_to_address "127.0.0.1"
 port "6600"

Afterwards, instruct your client to connect via 127.0.0.1. For example, add the following to the ncmpcpp config file:

 mpd_host "127.0.0.1"
 mpd_port "6600"

Binding to IPV6 before IPV4

起動時に、mpd が以下のメッセージを表示する場合:

listen: bind to '0.0.0.0:6600' failed: Address already in use (continuing anyway, because binding to '[::]:6600' succeeded)

MPD is attempting to bind to the ipv6 interface before binding to ipv4. If you want to use your ipv4 interface, hardcode it in mpd.conf, like so:

bind_to_address "127.0.0.1"

Several binds can also be specified, for example, to have MPD listen on localhost and the external IP of your network card:

bind_to_address "127.0.0.1"
bind_to_address "192.168.1.13"

daemon: cannot setgid for user "mpd": Operation not permitted

The error is stating that the user starting the process does not have permissions to become another user (mpd) which the configuration has told the process to run as.

この問題を解決するには、mpd を root で起動してください:

# systemctl start mpd

daemon: fatal_error: Failed to set group NN: Operation not permitted

The error is stating that mpd can't set the group. This is if you have set any other group in /etc/mpd.conf than the default: mpd. This is because of the default mpd.service file. It starts mpd as user mpd (and if no group specified with the default group of this user as stated in your /etc/passwd) and therefore mpd does not have any rights to change his group.

First fix

In /etc/mpd.conf comment out the group= part or change it to group=mpd

Second fix

Create a custom mpd.service file in /etc/systemd/system/ and add your desired group. E. g. run mpd with the group "audio":

/etc/systemd/system/mpd.service
.include /usr/lib/systemd/system/mpd.service
    [Service]
    Group=audio

Third fix

Change the default group of the user mpd in your /etc/passwd.

MPD & ALSA

Sometimes, when using other audio outputs, e.g: some web pages containing Flash applets, MPD is rendered unable to play (until it is restarted). The error comes up in mpd's log:

Error opening alsa device "hw:0,0": Device or resource busy

Reasons for this may be:

  • The sound card does not support hardware mixing (uses dmix plugin)
  • An application does not work with ALSA's default settings

For a detailed description, it is recommended to take a look at this link.

This problem may be solved by adding the following lines to mpd.conf:

mpd.conf
audio_output {
        type                    "alsa"
        name                    "Sound Card"
        options                 "dev=dmixer"
        device                  "plug:dmix"

To make the changes have effect, restart mpd (e.g. systemctl restart mpd, if it is a global configuration).

ALSA で CPU の使用量が高くなる

ALSA で MPD を使用しているとき、MPD が CPU を大量に消費する場合があります (20-30%)。これはほとんどのサウンドカードがサポートしているのが 48kHz なのに対してほとんどの音楽は 44.1kHz であるために、MPD がリサンプリングを行ってしまうのが原因です。リサンプリングには CPU サイクルが大量に必要で、結果として使用量が高くなります。

/etc/mpd.conf の audio_output に auto_resample "no" を追加して MPD にリサンプリングを使わないようにすれば大抵は問題が解決します。

mpd.conf
audio_output {
   type			"alsa"
   name			"My ALSA Device"
   auto_resample	"no"
}

Although it may not give as drastic a speedup, enabling mmap may still speed things up:

mpd.conf
audio_output {
   type			"alsa"
   name			"My ALSA Device"
   use_mmap		"yes"
}

Some users might also want to tell dmix to use 44kHz as well. More info about tuning performance of your MPD can be found on the MPD wiki

Playing audio files with different rate (works for EMU 0202/0204/0404)

To play audio files of different rate with automatic card rate change install pulseaudio and pulseaudio-alsa and keep using ALSA as output:

mpd.conf
audio_output {
    type          "alsa"
    name          "Emu 0202 USB"
    device        "hw:2,0"
}