「Music Player Daemon/トラブルシューティング」の版間の差分
(ページの作成:「Category:プレイヤー en:Music Player Daemon/Troubleshooting メインの記事は Music Player Daemon。 == トラブルシューティング == === Auto...」) |
|||
21行目: | 21行目: | ||
# chsh -s /bin/true mpd |
# chsh -s /bin/true mpd |
||
− | === MPD |
+ | === 最初の起動時に MPD がフリーズする === |
+ | mp3 タグが壊れているときによく起こるエラーです。以下にこの問題を解決する実験的な方法を記述します。必要なのは: |
||
− | This is a common error that's caused by corrupt mp3 tags. |
||
− | Here is an experimental way to solve this issue. |
||
− | Requirements: |
||
* kid3 |
* kid3 |
||
* easytag |
* easytag |
||
+ | この方法は非常に長い時間がかかります (特にデータベースが巨大な場合)。大体、16GB のデータベースを修復するのに 2.5 時間くらいかかります。 |
||
− | This method is very tedious, especially with a huge database. Just as a baseline it took 2.5h to fix a 16GB database. |
||
==== Easy Tag ==== |
==== Easy Tag ==== |
||
41行目: | 39行目: | ||
=== Cannot connect to mpd: host "localhost" not found: Temporary failure in name resolution === |
=== Cannot connect to mpd: host "localhost" not found: Temporary failure in name resolution === |
||
+ | ネットワークから切断されていると、(ncmpcpp を使って) MPD に接続することはできません。解決方法は [[IPv6#IPv6 の無効化|IPv6]] を無効化するか以下の行を {{ic|/etc/hosts}} に追加することです: |
||
− | Cannot connect to MPD (with ncmpcpp), if you are disconnected from network. Solution is [[IPv6 - Disabling the Module|disable IPv6]] or add line to /etc/hosts |
||
::1 localhost.localdomain localhost |
::1 localhost.localdomain localhost |
||
73行目: | 71行目: | ||
=== Binding to IPV6 before IPV4 === |
=== Binding to IPV6 before IPV4 === |
||
+ | 起動時に、mpd が以下のメッセージを表示する場合: |
||
− | If on startup, mpd displays the following message: |
||
listen: bind to '0.0.0.0:6600' failed: Address already in use (continuing anyway, because binding to '[::]:6600' succeeded) |
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: |
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: |
||
87行目: | 85行目: | ||
To solve the issue, simply start mpd as root. |
To solve the issue, simply start mpd as root. |
||
{{bc|# systemctl start mpd}} |
{{bc|# systemctl start mpd}} |
||
− | |||
=== daemon: fatal_error: Failed to set group NN: Operation not permitted === |
=== daemon: fatal_error: Failed to set group NN: Operation not permitted === |
||
129行目: | 126行目: | ||
To make the changes have effect, restart mpd (e.g. {{ic|systemctl restart mpd}}, if it is a global configuration). |
To make the changes have effect, restart mpd (e.g. {{ic|systemctl restart mpd}}, if it is a global configuration). |
||
− | ==== |
+ | ====ALSA で CPU の使用量が高くなる==== |
+ | ALSA で MPD を使用しているとき、MPD が CPU を大量に消費する場合があります (20-30%)。これはほとんどのサウンドカードがサポートしているのが 48kHz なのに対してほとんどの音楽は 44.1kHz であるために、MPD がリサンプリングを行ってしまうのが原因です。リサンプリングには CPU サイクルが大量に必要で、結果として使用量が高くなります。 |
||
− | When using MPD with ALSA, users may experience MPD taking up lots of CPU (around 20-30%). This is caused by most sound cards supporting 48kHz and most music being 44.1kHz, thus forcing MPD to resample it. This operation takes lots of CPU cycles and results into high usage. |
||
+ | {{ic|/etc/mpd.conf}} の audio_output に {{ic|auto_resample "no"}} を追加して MPD にリサンプリングを使わないようにすれば大抵は問題が解決します。 |
||
− | For most users the problem should be solved by telling MPD not to use resampling by adding {{ic|auto_resample "no"}} into audio_output-part of {{ic|/etc/mpd.conf}}. |
||
{{hc|mpd.conf|2= |
{{hc|mpd.conf|2= |
2015年2月27日 (金) 12:44時点における版
メインの記事は Music Player Daemon。
目次
- 1 トラブルシューティング
- 1.1 Autodetection failed
- 1.2 最初の起動時に MPD がフリーズする
- 1.3 Cannot connect to mpd: host "localhost" not found: Temporary failure in name resolution
- 1.4 Other issues when attempting to connect to mpd with a client
- 1.5 Binding to IPV6 before IPV4
- 1.6 daemon: cannot setgid for user "mpd": Operation not permitted
- 1.7 daemon: fatal_error: Failed to set group NN: Operation not permitted
- 1.8 MPD & ALSA
トラブルシューティング
Autodetection failed
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 /etc/mpd.conf
over from /etc/mpd.conf.example
as mentioned above, you can simply uncomment:
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.
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
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.
To solve the issue, simply start mpd as 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" }