Music Player Daemon (Español)

From ArchWiki
Revision as of 14:27, 2 January 2012 by Fer0 (Talk | contribs) (Actualizado desde versión en ingles)

Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Tango-preferences-desktop-locale.pngThis article or section needs to be translated.Tango-preferences-desktop-locale.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:Music Player Daemon (Español)#)

MPD (Music Player Daemon) es un reproductor de audio que maneja una arquitectura servidor-cliente. MPD se ejecuta en el fondo como un daemon, gestiona listas de reproducción y una base de datos, y hace uso de muy pocos recursos. Para hacer uso de una interfaz gráfica, es necesario un cliente adicional. Más información puede obtenerse en su página web.

Procedimiento de Instalación del Daemon

Instale con pacman:

# pacman -S mpd

Instrucciones de Configuración

Para más información de la configuración de MPD, por favor visite http://mpd.wikia.com/wiki/Configuration

Linea de Tiempo del Comportamiento Habitual de MPD

  • MPD es iniciado al cargar el sistema operativo por medio de Template:Filename, incluyéndole en el apartado DAEMONS. (O, esto puede ser hecho manualmente ejecutando /etc/rc.d/mpd start con privilegios de root).
  • Al ser iniciado MPD como root, leerá el archivo Template:Filename.
  • MPD lee la variable usuario en el archivo Template:Filename, y cambia de root a este usuario.
  • MPD continúa leyendo el contenido del archivo Template:Filename y se configura de acuerdo a este.

Recuerde que MPD cambia el usuario de root a aquel mencionado en el archivo Template:Filename. Siendo asi, el uso de "~" en el archivo de configuracion hace referencia al directorio home del usuario, y no al directorio de root. Podria ser de utilidad cambiar todos los "~" a "/home/username" para prevenir cualquier confusion sobre este aspecto del comportamineto de MPD. Si no se espeifica un usuario, cuando este se ejecute lo hara como el usuario actual.

Correcta Configuración de Sonido

Para que la salido de audio funcione, asegúrese de haber configurado la tarjeta de sonido y el mixer correctamente. Vea ALSA. No olvide activar los canales requeridos en alsamixer, incrementar el volumen y guardar los cambios con alsactl store. Vea Template:Filename si aún no funciona.

Asegúrese que su tarjeta pueda hacer mezclas por hardware (la mayoría de ellas pueden, incluidas aquellas integradas de la board), si no, esto podría traer problemas con múltiples reproducciones de sonido. Por ejemplo, Mplayer no podría reproducir sonido mientras el daemon se esté ejecutando, mostrando un mensaje de error indicando que el dispositivo se encuentra ocupado.

Configuracion General

  • Como root, verifique si Template:Filename existe y elimine el archivo en caso de que exista. Esto es hecho por seguridad.

MPD viene con un archivo de configuración de ejemplo, disponible en Template:Filename. Este archivo contiene abundante información acerca de la configuración de MPD, y contiene valores predeterminados para el mixer, que simplemente pueden ser descomentados.

# cp /usr/share/doc/mpd/mpdconf.example /etc/mpd.conf

Para editar el archivo, como root:

# SUEDITOR /etc/mpd.conf

Edite Template:Filename para que se vea de la siguiente manera.

music_directory       "/home/usuario/música"         # Su directorio de música.
playlist_directory    "/var/lib/mpd/playlists"
db_file               "/var/lib/mpd/db"
log_file              "/var/log/mpd/mpd.log"
error_file            "/var/log/mpd/mpd.error"
pid_file              "/var/run/mpd/mpd.pid"
state_file            "/var/lib/mpd/mpdstate"
# Ediciones a la dirección y el puerto causan problemas en mpd-0.14.2 es preferible dejarlos
# comentados.
# bind_to_address       "127.0.0.1"
# port                  "6600"

Las direcciones de los archivos son los que por defecto se crean al istalar MPD, pero se pueden crear en otro lugar, por ejemplo si se desea tener todos los archivos bajo una misma carpeta.

  • Ahora como root, cree los archivos especificados en {Filename|/etc/mpd.conf}}, si los directorios no existen también deben ser creados.
# touch /var/lib/mpd/db
# touch /var/lib/mpd/mpdstate
# touch /var/run/mpd/mpd.pid
# touch /var/log/mpd/mpd.log
# touch /var/log/mpd/mpd.error
  • Si su colección musical está contenida en múltiples directorios, puede crear enlaces simbólicos en /var/lib/mpd y luego dirigir la variable 'music_dir' en mpd.conf a el directorio que contiene los enlaces.
  • Crear la base de datos ahora es realizado por medio de la opción "update" del cliente, por ejemplo, si ejecuta ncmpcpp, por medio de la tecla 'U'.
    • El método anterior, crear la base de datos de MPD como root (# mpd --create-db), es obsoleto.

Configuración Por Usuario

MPD no necesita ser iniciado con permisos de root. La única razón por la cual MPD necesita ser iniciado como root (siendo llamado por medio de Template:Filename) es porque los archivos y directorios mencionados por defecto en el archivo de configuración son propiedad de root (el directorio /var). Una menos común, pero quizás mas sensible configuración, consiste en hacer que MPD trabaje con archivos y directorios que sean propiedad de un usuario normal. Ejecutar MPD como un usuario normal tiene varias ventajas:

  1. Puede manejar un solo directorio ~/.mpd (o cualquier otro directorio bajo /home/usuario) para todos los archivos de configuración de MPD
  2. No hay errores de lectura/escritura
  3. llamado más flexible a MPD haciendo uso de Template:Filename en vez de incluir MPD en la sección de DAEMONS en Template:Filename.
Los siguientes pasos indican como iniciar MPD como un usuario normal. Debe realizar todos los pasos como usuario.
Note: Este método no funcionará si múltiples usuarios desean acceder a MPD.
  • Copie el contenido del archivo de configuración por defecto de MPD, ubicado en Template:Filename a su directorio home.
cp /usr/share/doc/mpd/mpdconf.example ~/.mpdconf
  • Siga los pasos de la configuración anterior, ignorando la primer parte, que hace referencia a copiar el archivo de configuración a Template:Filename.
  • Cree todos los archivos necesarios en Template:Filename:
"~/.mpd/playlists"
"~/.mpd/db"
"~/.mpd/mpd.log"
"~/.mpd/mpd.error"
"~/.mpd/mpd.pid"
"~/.mpd/mpdstate"
Note: No se olvide de especificar el nombre de usuario y grupo
  • Haga que MPD inicie al arranque de sesión (esto depende de su entorno de escritorio para su correcta configuracion).
Note: no tiene que poner un "&" al final de la linea, dado que MPD automáticamente se daemonizará.

Finalmente, elimine MPD de la sección de DAEMONS en Template:Filename, ya que no será ejecutado como root nunca más.

Configuración Multi-MPD

Útil si desea ejecutar un servidor icecast, por ejemplo. Si desea un segundo daemon MPD (ej., con una salida icecast para compartir su música a través de una red) que haga uso de la música y listas de reproducción del primero, simplemente copie el archivo de configuración anterior y cree uno nuevo (ej., Template:Filename), y solo cambie los parámetros de log_file, error_file, pid_file, y state_file (ej., Template:Filename, Template:Filename, y demás); hacer uso de los mismos directorios de música y listas de reproducción asegurará que este segundo daemon MPD hará uso de la misma colección musical del primero (ej., crear y editar una lista de reproducción bajo el primer daemon afectará también al segundo daemon, de modo que no sea necesario crear la misma lista de nuevo para el segundo daemon). Finalmente, ejecute este segundo daemon por medio de su archivo Template:Filename. (Asegúrese de utilizar un numero de puerto diferente, para evitar conflictos con su primer daemon MPD).

Instalando Clientes para MPD

Los mas populares son:

Instálelos usando:

# pacman -S mpc
# pacman -S ncmpc
# pacman -S ncmpcpp
# pacman -S pms
# pacman -S ario
# pacman -S sonata
# pacman -S gmpc
# pacman -S qmpdclient

Extra stuff

Envío de Canciones a Last.fm

Para enviar los títulos de las canciones hacia Last.fm con MPD existen varias alternativas.

Mpdscribble

mpdscribble es otro demonio, pero sólo está disponible en AUR. Suele ser la mejor alterativa, ya que sería el scrobbler semi-oficial de MPD y, además, usa el nuevo "idle" en MPD para mejorar el scrobbling. No es necesario el acceso root para su configuración, porque no necesita realizar ningún cambio dentro del directorio /etc. Para más información, se puede visitar sitio oficial de Mpdscribble.

Para instalar mpdscribble, solo instálelo desde AUR y luego, sin ser root, haga:

username = <su nombre de usuario de last.fm>
password = <Número de verificación md5 de su password de last.fm> # Se genera ejecutándo "echo -n password | md5sum"
host = <su mpd host> # por defecto $MPD_HOST o localhost
port = <su mpd port> # por defecto $MPD_PORT o 6600
log = ~/.mpdscribble/mpdscribble.log
journal = ~/.mpdscribble/mpdscribble.cache
verbose = 2
sleep = 1
musicdir = <su directorio de música>

Sonata

La forma más sencilla, pero implica usar una interfaz gráfica, es usar Sonata. Este programa es un frontend gráfico para MPD, que incluye de serie el soporte para scrobbling hacia Last.fm dentro de sus opciones. El punto negativo, es que como Sonata no realiza cache de los temas reproducidos, se necesita tener una conección activa durante la reproducción para que el scrobble se realice.

Lastfmsubmitd

lastfmsubmitd es un demonio disponible dentro del repositorio "community". Para instalarlo, primero edite Template:Filename y luego añada lastfmsubmitd y lastmp a la sección DAEMONS dentro de su Template:Filename.

Reproducción Desde Last.fm

Reproducción Nativa

Desde la versión 0.16 MPD tiene un método para reproducir desde last.fm.

/etc/mpd.conf
playlist_plugin {
       name            "lastfm"
       user            "my_username"
       password        "my_password"
}

Por Ejemplo:

$ mpc load "lastfm://artist/Beatles"
Reproducir Desde Last.fm con Lastfmproxy

Lastfmproxy es un script escrito en python que permite reproducir música desde last.fm hacia cualquier otro reproductor. Para instalarlo lastfmproxy desde AUR debe editar /usr/share/lastfmproxy/config.py.

Note: El scrip se intslala en un directorio de solo lectura, pero este requiere lectura/escritura, puede mover /usr/share/lastfmproxy a su directorio Home.

Para iniciar lastfmproxy debe ir a http://localhost:1881/ en su navegador. Para gregar una estacion a last.fm navegue desde http://localhost:1881/ seguido por lastfm:// (por ejemplo: http://localhost:1881/lastfm://globaltags/punk). Vuelva a http://localhost:1881/ y descargue el archivo m3u seleccionando el enlace de Start Listening. Sólo tiene que añadirlo a su biblioteca de música.

Never play on start

This feature has recently been added to mpd git by Martin Kellerman, see commits b57330cf75bcb339e3f268f1019c63e40d305145 and 2fb40fe728ac07574808c40034fc0f3d2254d49d. As of September 2011, this feature has not yet arrived in a mpd version in the official repositories. If support for this feature is still required, have a look at the following proposals.

Installing mpd from the AUR

This is the best method currently available, but is only currently (as of April 2011) enabled in the git version. Install mpd-git from the AUR and add restore_paused "yes" to your mpd.conf file.

If you have issues with connecting your client to mpd-git, see Music Player Daemon#Other issues when attempting to connect to mpd with a client.

Method 1

If you do not want MPD to always play on your system start, but yet you want to preserve the other state information, add the following lines to your /etc/rc.d/mpd file:

Method 1.1

Simpler, working method (disables playing on startup of mpd daemon):

 start)

...

     mpc -q pause #add this line only
     add_daemon mpd
     stat_done
Method 1.2

This method was described here before Method 1.1 and is much more complicated:

   ...
   stat_busy "Starting Music Player Daemon"
   # always start in paused state
   awk '/^state_file[ \t]+"[^"]+"$/ {
       match($0, "\".+\"")
       sfile = substr($0, RSTART + 1, RLENGTH - 2)
   } /^user[ \t]+"[^"]+"$/ {
       match($0, "\".+\"")
       user = substr($0, RSTART + 1, RLENGTH - 2)
   } END {
       if (sfile == "")
               exit;
       if (user != "")
               sub(/^~/, "/home/" user, sfile)
       system("sed -i \x27s|^\\(state:[ \\t]\\{1,\\}\\)play$|\\1pause|\x27 \x27" sfile "\x27")
   }' /etc/mpd.conf
   /usr/bin/mpd /etc/mpd.conf &> /dev/null
   ...

This will change the player status to "paused", if it was stopped while playing. Next, you want this file to be preserved, so MPD updates won't erase this edit. Add (or edit) this line to your /etc/pacman.conf:

NoUpgrade = etc/rc.d/mpd

Method 2

Another simpler method, would be to add mpd to your rc.conf daemons array and add mpc stop or mpc pause to /etc/rc.local.shutdown and to /etc/rc.local. (Remember you must have mpc installed to use this method).

Adding only the order in /etc/rc.local cannot assure that mpd will play absolutely nothing, since there may be a delay before the stop command is executed. On the other hand, if you only add the order to /etc/rc.local.shutdown, that will assure that mpd won't play at all, as long as you properly shutdown your system. Even though they are redundant, adding it to /etc/rc.local would serve as a safety for those, presumably, rare occasions when you do not shutdown the system properly.

Method 3

The general idea is to ask mdp to pause music when the user logs out, so that mdp will stick to the "pause" state after a reboot. Sending such command can be achieved using mpc, the command line interface to MPD.

GDM users can then add /usr/bin/mpc pause to /etc/gdm/PostSession/Default (be sure to add it before exit 0):

Non-GDM users can use their own login manager's method to launch the line at logout.

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. /etc/rc.d/mpd restart, if it is a global configuration).

High CPU usage with ALSA

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 44kHz, thus forcing MPD to resample it. This operation takes lots of CPU cycles and results into high usage.

For most users the problem should be solved by telling MPD not to use resampling by adding auto_resample "no" into audio_output-part of /etc/mpd.conf. This will degrade quality slightly, however.

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

Example configuration: Output with 44.1 KHz at e. g. 16 bit depth, multiple programs at once

Why these formats? Because they are standard CDA, because ALSA on its own allows more than one program "to sound" only with dmix — whose resampling algorithm is inferior — and because dmix by default resamples anything lower to 48 KHz (or whatever higher format is playing at the time). Also, some get clicking sounds if at least mpd.conf is not changed this way.

What's the downside? These settings cause everything (if necessary) to be resampled to this format, such as material from DVD or TV which usually is at 48 KHz. But there is no known way to have ALSA dynamically change the format, and particularly if you listen to far more CDs than anything else the occasional 48 → 44.1 isn't too great a loss.

The following assumes that there are not already other settings which conflict resp. overwrite it. This applies especially to the current user's potential ~/.asoundrc — which MPD as its own user ignores, therefore the following should go to /etc/asound.conf:

/etc/asound.conf
defaults.pcm.dmix.rate 44100 # Force 44.1 KHz
defaults.pcm.dmix.format S16_LE # Force 16 bits
/etc/mpd.conf
audio_output {
        type                    "alsa" # Use the ALSA output plugin.
	name			"HDA Intel" # Can be called anything or nothing tmk, but must be present.
        options                 "dev=dmixer"
        device                  "plug:dmix" # Both lines cause MPD to output to dmix.
	format	        	"44100:16:2" # the actual format
	auto_resample		"no" # This bypasses ALSA's own algorithms, which generally are inferior. See below how to choose a different one.
	use_mmap		"yes" # Minor speed improvement, should work with all modern cards.
}

samplerate_converter		"0" # MPD's best, most CPU intensive algorithm. See 'man mpd.conf' for others — for anything other than the poorest "internal", libsamplerate must be installed.
Note: MPD gives the mp3 format a special treatment at decoding: It's always outputted as 24 bit. (The conversion as forced by the format line only comes after that.)

If one wants to leave the bit depth decision to ALSA resp. MPD, comment out resp. omit the dmix.format line and change the one for mpd with format to "44100:*:2".

Note: Crossfading between files decoded at two different bit depths (say, one mp3 and one 16 bit flac) does not work unless conversion is active.

Control MPD with lirc

There are already some clients designed for communications between lircd and MPD, however, as far as the practical use, they aren't very useful since their functions are limited.

It's recommended to use mpc with irexec. mpc is a command line player which only sends the command to MPD and exits immediately, which is perfect for irexec, the command runner included in lirc. What irexec does is that it runs a specified command once received a remote control button.

First of all, please setup your remotes as referred to the Lirc article.

Edit your favored lirc startup configuration file, default location is ~/.lircrc.

Fill the file with the following pattern:

begin
     prog = irexec
     button = <button_name>
     config = <command_to_run>
     repeat = <0 or 1>
end

An useful example:

## irexec
begin
     prog = irexec
     button = play_pause
     config = mpc toggle
     repeat = 0
end

begin
     prog = irexec
     button = stop
     config = mpc stop
     repeat = 0
end
begin
     prog = irexec
     button = previous
     config = mpc prev
     repeat = 0
end
begin
     prog = irexec
     button = next
     config = mpc next
     repeat = 0
end
begin
     prog = irexec
     button = volup
     config = mpc volume +2
     repeat = 1
end
begin
     prog = irexec
     button = voldown
     config = mpc volume -2
     repeat = 1
end
begin
     prog = irexec
     button = pbc
     config = mpc random
     repeat = 0
end
begin
     prog = irexec
     button = pdvd
     config = mpc update
     repeat = 0
end
begin
     prog = irexec
     button = right
     config = mpc seek +00:00:05
     repeat = 0
end
begin
     prog = irexec
     button = left
     config = mpc seek -00:00:05
     repeat = 0
end
begin
     prog = irexec
     button = up
     config = mpc seek +1%
     repeat = 0
end
begin
     prog = irexec
     button = down
     config = mpc seek -1%
     repeat = 0
end

There are more functions for mpc, run man mpc for more info.

Control MPD with bluetooth phone

You can also control MPD (to a certain extent) using a bluetooth enabled phone. You need to do the following:

  • install remuco -- a wireless remote control for several Linux media players (aur)
  • transfer remuco client -- jar/jad files from /usr/share/remuco/client/ to your phone and install it
  • run remuco-mpd (as current user)
  • run remuco on your phone, define a new bluetooth remuco connection (pair first if you haven't done this previously) and explore its capabilities

More information about remuco including troubleshooting to be found at its homepage

MPD & PulseAudio

Edit /etc/mpd.conf, and uncomment the audio_output section for the type "pulse". The server and sink lines of it should be commented unless you know what you're doing.

Then, add the mpd user (and yours if you haven't done so already) to the necessary pulse groups. The pulse-access group should be sufficient but you may want to add pulse-rt as well. The group "pulse" doesn't appear to be necessary.

# gpasswd -a mpd pulse-access
# gpasswd -a mpd pulse-rt

Lastly, you may or may not need to copy ~/.pulse-cookie from your current (pulse working) user's dir to your mpd user's home directory. It is likely to be /var/lib/mpd if you followed the first part of this wiki. This would probably only allow your current user to listen in on MPD's pulse. You may consider running pulse system-wide if that's insufficient.

Cue Files

To make cue file support actually work, you have to work around a nasty libcue bug. Libcue copied some files directly from libcdio, making it conflict with it. Steps to do to get proper cue support:

  • remove libcdio temporary (pacman -Rdd libcdio)
  • install libcue (pacman -S libcue)
  • install mpd with abs or from aur.
  • reinstall libcdio (pacman -S libcdio)

At the point of writing mpd does not parse tracknumbers from cue sheets. There is a patch available (http://musicpd.org/mantis/view.php?id=3230) Once this patch is merged into mpd, i will remove this line :)

HTTP Streaming

Since version 0.15 there is a built-in HTTP streaming daemon/server that comes with MPD. To activate this server simply set it as output device in mpd.conf:

audio_output {    
	type		"httpd"    
	name		"My HTTP Stream"    
	encoder		"vorbis"		# optional, vorbis or lame    
	port		"8000"    
#	quality		"5.0"			# do not define if bitrate is defined    
	bitrate		"128"			# do not define if quality is defined    
	format		"44100:16:1"    
}

Then to listen to this stream simply open the URL of your mpd server (along with the specified port) in your favorite music player. Note: You may have to specify the file format of the stream using an appropriate file extension in the URL. For example, using Winamp 5.5, You would use http://192.168.1.2:8000/mpd.ogg rather than http://192.168.1.2:8000/.

To use mpd to connect to the stream from another computer.

mpc add http://192.168.1.2:8000

Troubleshooting

Falla en Auto-detección

Durante el inicio de mpd, el intentará detectar automaticamente y configurar su salida de audio y control de volumen. Aunque en la mayoria de los casos esto suele funcionar, en otros sistemas puede fallar. Podria ser de ayuda para mpd especificar que utilizar como salida y mixer de sonido. Si su archivo Template:Filename es una copia de Template:Filename como se menciono anteriormente, simplemente descomente estas lineas:

Ejemplo de una salida tipo ALSA:

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

Avoiding timeouts

To get rid of timeouts (i.e. when you paused music for long time) in gpmc and other clients uncomment and increase connection_timeout option in mpd.conf.

If files and/or titles are shown in wrong encoding, uncomment and change filesystem_charset and id3v1_encoding options. Note that you cannot set encoding for ID3 v2 tags. To workaround this you may use external tag readers.

If you want to use another computer to control MPD over a network, the bind_to_address option in mpd.conf will need to be set to either your IP address, or any if your IP address changes frequently.

Streaming
With the latest version of MPD (0.15), built-in httpd streaming is now available.

To activate this feature, you'll just need to add a new output of type httpd in mpd.conf:

audio_output {
          type   "httpd"
          name   "What you want"
          encoder "lame"     # vorbis or lame supported
          port    "8000"
          bitrate  "128"
          format   "44100:16:2"  # change 2 to 1 for mono
  }
     

Restart the mpd daemon and, from another computer, simply load the stream as any other url.

$ mplayer http://<server's IP>:8000
Note: You must open the port on your router / firewall for the stream to be connectible to from another computer.

Most players (i.e. vlc or xmms2) should also be able to load the stream via their "add url..." menu option.

This is a nice clean way to replace your current icecast setup with something natively supported within MPD.

mpd se cuelga en el primer inicio

Este es un error común causado por etiquetas mp3 dañadas. Esta es una manera experimental para resolver este problema. Requirements:

  • kid3
  • easytag

Este método es tedioso, especialmente con bases de datos enormes. Para que entiendan, tomó 2.5 horas arreglar una una base de datos de 16Gb.

Easy Tag

Easytag aparece aquí porque detecta los errores en las etiquetas mp3, pero igual que mpd, se cuelga y muere. El truco es que easytag te dice cual es el archivo problemático en su barra de estado. Antes de empezar, asegúrate de empezar easytag en una terminal para estar listo para cerrarlo por si se cuelga. Cuando estes listo, en la vista ramificada selecciona el directorio donde tienes tu música. Como opción predeterminada, easytag busca en todos los subdirectorios en busca de archivos mp3. Cuando easytag se detenga, anota al culpable y mata easytag.

KID3

Aquí es donde usamos kid3. Con kid3, busca la canción dañada y reescribe una de sus etiquetas, guarda el archivo y ya. Esto forzará a kid3 a reescribir todas las etiquetas y arreglara el problema con mpd.

Repite hasta que tu biblioteca musical este limpia. .

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

Cannot connect to MPD (with ncmpcpp), if you are disconnected from network. Solution is disable IPv6 or add line to /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 the Arch bug report on this issue HERE.

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

Note: 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"

Port 6600 already in use

MPD needs to bind to port 6600 and cannot start if it's already in use. The most common reason for this is that the user has started MPD once and then subsequently tried to start mpd again. In general, nothing should be done here.

If port 6600 is tied up for some other reason, one can use the following command to find the offending process:

# netstat -tulpan | grep 6600

This will list IP:Port and the process name holding the connection (root privileges are required to see all processes).

If you need to restart mpd for whatever reason, use:
 $ mpd --kill
 $ mpd 

A more brute-force approach:

 $ killall mpd
 $ mpd 
Note: If you typically run MPD as root, you will need to run the above commands as root.
In the latest version of MPD, --create-db is completely deprecated. The database will be created automagically on first run and can subsequently be updated via your client (i.e. mpc update). You can now use inotify support to automatically update your music database. Add the following to
mpd.conf
auto_update "yes"
to enable it.

Binding to IPV6 before IPV4

If on startup, you see this message:

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"

Or, you could specify several binds, 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"

Crackling sound with some audio files

This is usually a playback speed problem and can be fixed by uncommenting the audio_output_format line in:

/etc/mpd.conf
  audio_output_format "44100:16:2"

This is usually a sane value for most mp3 files.

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

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

To solve the issue, simply start mpd as root.

$ su -c "rc.d start mpd"

or

# rc.d start mpd

External links