Difference between revisions of "Music Player Daemon (Español)"

From ArchWiki
Jump to: navigation, search
(Edición Instrucciones de Configuración)
(Actualizado desde versión en ingles)
Line 3: Line 3:
 
{{Translateme}}
 
{{Translateme}}
  
{{Nota|Este artículo está incompleto. Ahora mismo está siendo traducido desde [[Music Player Daemon|su versión en ingles]]}}
+
'''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 [http://www.musicpd.org/ página web].
'''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 [http://www.musicpd.org/ página web].
+
  
 
==Procedimiento de Instalación del Daemon==
 
==Procedimiento de Instalación del Daemon==
Line 12: Line 11:
  
 
==Instrucciones de Configuración==
 
==Instrucciones de Configuración==
Para más información de la configuración de mpd, por favor visite http://mpd.wikia.com/wiki/Configuration
+
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===
+
===Linea de Tiempo del Comportamiento Habitual de MPD===
* mpd es iniciado al cargar el sistema operativo por medio de {{Filename|/etc/rc.conf}}, incluyéndole en el apartado DAEMONS. (O, esto puede ser hecho manualmente ejecutando {{Ic|/etc/rc.d/mpd start}} con privilegios de root).
+
* MPD es iniciado al cargar el sistema operativo por medio de {{Filename|/etc/rc.conf}}, incluyéndole en el apartado DAEMONS. (O, esto puede ser hecho manualmente ejecutando {{Ic|/etc/rc.d/mpd start}} con privilegios de root).
* Al ser iniciado mpd como root, leerá el archivo {{Filename|/etc/mpd.conf}}.
+
* Al ser iniciado MPD como root, leerá el archivo {{Filename|/etc/mpd.conf}}.
* mpd lee la variable usuario en el archivo {{Filename|/etc/mpd.conf}}, y cambia de root a este usuario.
+
* MPD lee la variable usuario en el archivo {{Filename|/etc/mpd.conf}}, y cambia de root a este usuario.
* mpd continúa leyendo el contenido del archivo {{Filename|/etc/mpd.conf}} y se configura de acuerdo a este.
+
* MPD continúa leyendo el contenido del archivo {{Filename|/etc/mpd.conf}} y se configura de acuerdo a este.
  
Recuerde que mpd cambia el usuario de root a aquel mencionado en el archivo {{Filename|/etc/mpd.conf}}. 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.
+
Recuerde que MPD cambia el usuario de root a aquel mencionado en el archivo {{Filename|/etc/mpd.conf}}. 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===
 
===Correcta Configuración de Sonido===
Line 30: Line 29:
 
* Como root, verifique si {{Filename|/etc/mpd.conf}} existe y elimine el archivo en caso de que exista. Esto es hecho por seguridad.
 
* Como root, verifique si {{Filename|/etc/mpd.conf}} 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 {{Filename| /usr/share/doc/mpd/mpdconf.example}}. 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.
+
MPD viene con un archivo de configuración de ejemplo, disponible en {{Filename| /usr/share/doc/mpd/mpdconf.example}}. 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.
  
 
* Como root, copie este archivo de ejemplo a {{Filename|/etc/mpd.conf}}.
 
* Como root, copie este archivo de ejemplo a {{Filename|/etc/mpd.conf}}.
Line 51: Line 50:
 
  # port                  "6600"
 
  # 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.
+
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.
 
* Ahora como root, cree los archivos especificados en {Filename|/etc/mpd.conf}}, si los directorios no existen también deben ser creados.
Line 63: Line 62:
 
* 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.
 
* 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'.  
 
* 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.
+
**El método anterior, crear la base de datos de MPD como root (# mpd --create-db), es obsoleto.
  
 
===Configuración Por Usuario===
 
===Configuración Por Usuario===
Line 69: Line 68:
 
# Puede manejar un solo directorio ~/.mpd (o cualquier otro directorio bajo /home/usuario) para todos los archivos de configuración de MPD
 
# Puede manejar un solo directorio ~/.mpd (o cualquier otro directorio bajo /home/usuario) para todos los archivos de configuración de MPD
 
# No hay errores de lectura/escritura
 
# No hay errores de lectura/escritura
# llamado más flexible a MPD haciendo uso de {{Filename|~/.xinitrc}} en vez de incluir 'mpd' en la sección de DAEMONS en {{Filename|/etc/rc.conf}}.
+
# llamado más flexible a MPD haciendo uso de {{Filename|~/.xinitrc}} en vez de incluir MPD en la sección de DAEMONS en {{Filename|/etc/rc.conf}}.
  
 
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.}}
 
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.}}
Line 93: Line 92:
 
{{Note| no tiene que poner un "&" al final de la linea, dado que MPD automáticamente se daemonizará.}}
 
{{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 {{Filename|/etc/rc.conf}}, ya que no será ejecutado como root nunca más.
+
Finalmente, elimine MPD de la sección de DAEMONS en {{Filename|/etc/rc.conf}}, ya que no será ejecutado como root nunca más.
 +
 
 
===Configuración Multi-MPD===
 
===Configuración Multi-MPD===
 
'''Útil si desea ejecutar un servidor icecast, por ejemplo.'''
 
'''Útil si desea ejecutar un servidor icecast, por ejemplo.'''
Line 100: Line 100:
 
==Instalando Clientes para MPD==
 
==Instalando Clientes para MPD==
 
Los mas populares son:
 
Los mas populares son:
 +
 
* '''mpc''' – Cliente para línea de comandos. Lo mas común es instalar este en paralelo a otro cliente más avanzado.
 
* '''mpc''' – Cliente para línea de comandos. Lo mas común es instalar este en paralelo a otro cliente más avanzado.
 
* '''ncmpc''' – Cliente que emplea la librería ncurses. Muy útil para usar en consola. [http://hem.bredband.net/kaw/ncmpc/ Pagina oficial de ncmpc]
 
* '''ncmpc''' – Cliente que emplea la librería ncurses. Muy útil para usar en consola. [http://hem.bredband.net/kaw/ncmpc/ Pagina oficial de ncmpc]
Line 121: Line 122:
 
==Extra stuff==
 
==Extra stuff==
  
===Envío de canciones a Last.fm===
+
===Envío de Canciones a Last.fm===
 
Para enviar los títulos de las canciones hacia [http://www.last.fm Last.fm] con MPD existen varias alternativas.
 
Para enviar los títulos de las canciones hacia [http://www.last.fm Last.fm] con MPD existen varias alternativas.
  
====mpdscribble====
+
====Mpdscribble====
 
mpdscribble es otro demonio, pero sólo está disponible en [http://aur.archlinux.org/packages.php?ID=22274 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.   
 
mpdscribble es otro demonio, pero sólo está disponible en [http://aur.archlinux.org/packages.php?ID=22274 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 <tt>/etc</tt>. Para más información, se puede visitar [http://mpd.wikia.com/wiki/Client:El sitio oficial de Mpdscribble].
 
No es necesario el acceso root para su configuración, porque no necesita realizar ningún cambio dentro del directorio <tt>/etc</tt>. Para más información, se puede visitar [http://mpd.wikia.com/wiki/Client:El sitio oficial de Mpdscribble].
Line 146: Line 147:
 
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.
 
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====
 
lastfmsubmitd es un demonio disponible dentro del repositorio "community". Para instalarlo, primero edite {{Filename|/etc/lastfmsubmitd.conf}} y luego añada {{Ic|lastfmsubmitd}} y {{Ic|lastmp}} a la sección {{Ic|DAEMONS}} dentro de su {{Filename|/etc/rc.conf}}.
 
lastfmsubmitd es un demonio disponible dentro del repositorio "community". Para instalarlo, primero edite {{Filename|/etc/lastfmsubmitd.conf}} y luego añada {{Ic|lastfmsubmitd}} y {{Ic|lastmp}} a la sección {{Ic|DAEMONS}} dentro de su {{Filename|/etc/rc.conf}}.
  
===Last.fm playback with lastfmproxy===
+
====Reproducción Desde Last.fm====
lastfmproxy is a python script that streams a last.fm music stream to another media player.  To setup, install from AUR: {{Ic|yaourt -S lastfmproxy}} and then edit {{Filename|/usr/share/lastfmproxy/config.py}}. If you plan to only stream to mpd on the same host, just edit the login info.
+
=====Reproducción Nativa=====
 +
Desde la versión 0.16 MPD tiene un método para [http://mpd.wikia.com/wiki/Last.fm_Radio reproducir desde last.fm].
  
{{Note | Since it installs to a read only directory but it requires read/write access for features like saving previously listened to stations, it would be wise to copy {{Filename|/usr/share/lastfmproxy}} to your home directory.}}
+
{{hc|/etc/mpd.conf|2=
 +
  playlist_plugin {
 +
      name            "lastfm"
 +
      user            "my_username"
 +
      password        "my_password"
 +
}
 +
}}
  
Start lastfmproxy with {{Ic|lastfmproxy}} and visit http://localhost:1881/ in your web browser. To add a last.fm station navigate to http://localhost:1881/ followed by the lastfm:// url.  Example: http://localhost:1881/lastfm://globaltags/punk . Navigate back to http://localhost:1881/ and download the m3u file by selecting the ''Start Listening'' link. Simply add it to your music library path.
+
Por Ejemplo:
 +
 
 +
{{bc|$ 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 [http://aur.archlinux.org/packages.php?ID=14214 lastfmproxy] desde [[AUR]] debe editar {{ic|/usr/share/lastfmproxy/config.py}}.
 +
 
 +
{{Note | El scrip se intslala en un directorio de solo lectura, pero este requiere lectura/escritura, puede mover {{ic|/usr/share/lastfmproxy}} a su directorio Home.}}
 +
 
 +
Para iniciar {{ic|lastfmproxy}} debe ir a {{ic|http://localhost:1881/}} en su navegador. Para gregar una estacion a last.fm navegue desde {{ic|http://localhost:1881/}} seguido por lastfm:// (por ejemplo: {{ic|http://localhost:1881/lastfm://globaltags/punk}}). Vuelva a {{ic|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===
 
===Never play on start===
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 {{Filename|/etc/rc.d/mpd}} file:
+
This feature has recently been added to mpd git by Martin Kellerman, see commits {{ic|b57330cf75bcb339e3f268f1019c63e40d305145}} and {{ic|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 [https://aur.archlinux.org/packages.php?ID=19676 mpd-git] from the [[AUR]] and add {{ic|restore_paused "yes"}} to your {{ic|mpd.conf}} file.
 +
 
 +
If you have issues with connecting your client to [https://aur.archlinux.org/packages.php?ID=19676 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 {{ic|/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"''
 
  ''  stat_busy "Starting Music Player Daemon"''
Line 179: Line 213:
 
  ''  ...''
 
  ''  ...''
  
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 {{Filename|/etc/pacman.conf}}:
+
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 {{ic|/etc/pacman.conf}}:
 
  NoUpgrade = etc/rc.d/mpd
 
  NoUpgrade = etc/rc.d/mpd
Or Simple method add mpd to your rc.conf daemons array and add mpc stop to rc.local loacated in /etc (Remember you must got mpc installed to have this method working).
 
  
===MPD & Alsa===
+
====Method 2====
 +
Another simpler method, would be to add mpd to your {{ic|[[rc.conf]]}} daemons array and add {{ic|mpc stop}} or {{ic|mpc pause}} to {{ic|/etc/rc.local.shutdown}} and to {{ic|/etc/rc.local}}. (Remember you must have mpc installed to use this method).
  
Sometimes, when you use other audio output, e.g: some web pages containing Flash applets, mpd cannot reproduce anything anymore (until you restart). The error looks something like: (if you search the file {{Filename|/var/log/mpd/mpd.error}})
+
Adding only the order in {{ic|/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 {{ic|/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 {{ic|/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 [http://www.archlinux.org/packages/extra/x86_64/mpc/ mpc], the command line interface to MPD.
 +
 
 +
GDM users can then add {{ic|/usr/bin/mpc pause}} to {{ic|/etc/gdm/PostSession/Default}} (be sure to add it before {{ic|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
 
  Error opening alsa device "hw:0,0": Device or resource busy
  
And here is the solution (dmix saving our life again). Apply these lines in your {{Filename|/etc/mpd.conf}}:
+
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
  
<pre>
+
For a detailed description, it is recommended to take a look at [http://mpd.wikia.com/wiki/Alsa this] link.
 +
 
 +
This problem may be solved by adding the following lines to {{ic|mpd.conf}}:
 +
{{hc|mpd.conf|2=
 
audio_output {
 
audio_output {
 
         type                    "alsa"
 
         type                    "alsa"
Line 197: Line 248:
 
         options                "dev=dmixer"
 
         options                "dev=dmixer"
 
         device                  "plug:dmix"
 
         device                  "plug:dmix"
}
+
}}
</pre>
+
  
And then restart with {{Ic|/etc/rc.d/mpd restart}}.
+
To make the changes have effect, restart mpd (e.g. {{ic|/etc/rc.d/mpd restart}}, if it is a global configuration).
 
+
Searching on Internet I found the reason for why that happens in Gentoo's wiki:
+
* The sound card does not support hardware mixing (uses '''dmix''' plugin)
+
* An application does not work with ALSA with it's default settings
+
  
 
====High CPU usage with ALSA====
 
====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.
 
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 {{Ic|auto_resample "no"}} into audio_output-part of {{Filename|/etc/mpd.conf}}.
+
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}}. This will degrade quality slightly, however.
  
Example from {{Filename|mpd.conf}}:
+
{{hc|mpd.conf|2=
 +
audio_output {
 +
  type "alsa"
 +
  name "My ALSA Device"
 +
  auto_resample "no"
 +
}
 +
}}
  
audio_output {
+
Although it may not give as drastic a speedup, enabling mmap may still speed things up:
    type "alsa"
+
{{hc|mpd.conf|2=
    name "My ALSA Device"
+
audio_output {
    auto_resample "no"
+
  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 from: [http://mpd.wikia.com/wiki/Tuning MPD wiki]
+
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 [http://mpd.wikia.com/wiki/Tuning MPD wiki]
  
===Control mpd with lirc===
+
====Example configuration: Output with 44.1 KHz at e. g. 16 bit depth, multiple programs at once====
There are already some clients designe for communications between lircd and mpd, however, as far as the practical use, they aren't very useful since their functions are limited.
+
''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 {{ic|mpd.conf}} is not changed this way.
  
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.
+
''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 {{ic|~/.asoundrc}} — which MPD as its own user ignores, therefore the following should go to {{ic|/etc/asound.conf}}:
 +
 
 +
{{hc|/etc/asound.conf|
 +
defaults.pcm.dmix.rate 44100 # Force 44.1 KHz
 +
defaults.pcm.dmix.format S16_LE # Force 16 bits
 +
}}
 +
 
 +
{{hc|/etc/mpd.conf|2=
 +
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.
 
First of all, please setup your remotes as referred to the '''[[Lirc]]''' article.
  
Edit your favored lirc startup configuration file, default location is {{Filename|~/.lircrc}}.
+
Edit your favored lirc startup configuration file, default location is {{ic|~/.lircrc}}.
  
 
Fill the file with the following pattern:
 
Fill the file with the following pattern:
 
 
  begin
 
  begin
 
       prog = irexec
 
       prog = irexec
Line 240: Line 326:
  
 
An useful example:
 
An useful example:
 
 
  ## irexec
 
  ## irexec
 
  begin
 
  begin
Line 316: Line 401:
 
  end
 
  end
  
There are more functions for mpc, run {{Ic|man mpc}} for more info.
+
There are more functions for mpc, run {{ic|man mpc}} for more info.
  
===Control mpd with bluetooth phone===
+
===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:
+
You can also control MPD (to a certain extent) using a bluetooth enabled phone. You need to do the following:
  
 
* install [http://remuco.sourceforge.net/index.php/Remuco remuco] -- a wireless remote control for several Linux media players ([http://aur.archlinux.org/packages.php?ID=25072 aur])
 
* install [http://remuco.sourceforge.net/index.php/Remuco remuco] -- a wireless remote control for several Linux media players ([http://aur.archlinux.org/packages.php?ID=25072 aur])
* transfer remuco client -- jar/jad files from {{Filename|/usr/share/remuco/client/}} to your phone and install it
+
* transfer remuco client -- jar/jad files from {{ic|/usr/share/remuco/client/}} to your phone and install it
* run {{Ic|remuco-mpd}} (as current user)
+
* run {{ic|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
 
* run remuco on your phone, define a new bluetooth remuco connection (pair first if you haven't done this previously) and explore its capabilities
  
Line 329: Line 414:
  
 
===MPD & PulseAudio===
 
===MPD & PulseAudio===
 
+
Edit {{ic|/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.
First, install ([http://aur.archlinux.org/packages.php?ID=18722 mpd-pulse]) in the Arch User Repository as opposed to the regular mpd client in the Extra repository.
+
 
+
Then, edit {{Filename|/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.
 
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.
Line 338: Line 420:
 
  # gpasswd -a mpd pulse-rt
 
  # gpasswd -a mpd pulse-rt
  
Lastly, you may or may not need to copy {{Filename|~/.pulse-cookie}} from your current (pulse working) user's dir to your mpd user's home directory. It is likely to be {{Filename|/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.
+
Lastly, you may or may not need to copy {{ic|~/.pulse-cookie}} from your current (pulse working) user's dir to your mpd user's home directory. It is likely to be {{ic|/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.
  
==Solución de Problemas==
+
===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:
  
===Avoid Timeouts===
+
* remove libcdio temporary (pacman -Rdd libcdio)
{{out of date}}
+
* install libcue (pacman -S libcue)
To get rid of timeouts (i.e. when you paused music for long time) in gpmc and other clients uncomment and increase {{Ic|connection_timeout}} option in {{Filename|mpd.conf}}.
+
* install mpd with abs or from aur.
 +
* reinstall libcdio (pacman -S libcdio)
  
If files and/or titles are shown in wrong encoding, uncomment and change {{Ic|filesystem_charset}} and {{Ic|id3v1_encoding}} options.
+
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)
Note that you cannot set encoding for ID3 v2 tags. To workaround this you may use [http://mpd.wikia.com/wiki/GenericDecoder#Generic_Tagreader external tag readers].
+
Once this patch is merged into mpd, i will remove this line :)
  
If you want to use another computer to control mpd over a network, the {{Ic|bind_to_address}} option in {{Filename|mpd.conf}} will need to be set to either your IP address, or {{Ic|any}} if your IP address changes frequently. Remember to add mpd to the {{Filename|/etc/hosts.allow}} file to enable external access.
+
===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:
  
'''Streaming'''
+
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"   
 +
}
  
With the latest version of mpd (0.15), built-in httpd streaming is now available.
+
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 activate this feature, you'll just need to add a new output of type httpd in {{Filename|mpd.conf}}:
+
To use mpd to connect to the stream from another computer.
  
  audio_output {
+
  mpc add http://192.168.1.2:8000
            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
+
 
+
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.
+
 
+
===Autodetección Fallida===
+
  
 +
==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 {{Filename|/etc/mpd.conf}} es una copia de {{Filename|/etc/mpd.conf.example}} como se menciono anteriormente, simplemente descomente estas lineas:
 
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 {{Filename|/etc/mpd.conf}} es una copia de {{Filename|/etc/mpd.conf.example}} como se menciono anteriormente, simplemente descomente estas lineas:
  
Ejemplo de una salida tipo ALSA:
+
Ejemplo de una salida tipo ALSA:  
 
  audio_output {
 
  audio_output {
 
  type "alsa"
 
  type "alsa"
Line 384: Line 462:
 
  device "hw:0,0" # optional
 
  device "hw:0,0" # optional
 
  format "44100:16:2" # optional
 
  format "44100:16:2" # optional
 +
mixer_type "hardware"
 +
mixer_device "default"
 +
mixer_control "PCM"
 
  }
 
  }
  
Ejemplo del mixer ALSA:
+
'''Note:''' in case of permission problems when using ESD with MPD run this as root:
mixer_type "alsa"
+
mixer_device "default"
+
mixer_control "PCM"
+
 
+
'''Nota:''' en caso de problemas con los permisos cuando utilize ESD, ejecute esto como root:
+
 
  # chsh -s /bin/true mpd
 
  # chsh -s /bin/true mpd
  
===Permisos de archivos y directorios===
+
===Avoiding timeouts===
{{Warning|Estas direcciones se prestan a problemas de seguridad.}}
+
To get rid of timeouts (i.e. when you paused music for long time) in gpmc and other clients uncomment and increase {{ic|connection_timeout}} option in {{ic|mpd.conf}}.
  
MPD necesita tener permiso para ejecutar los directorios que conforman la coleccion de musica. Ademaz, el comando {{Ic|useradd}} asigna permisos 1700 drwx------ para el directorio principal de el usuario, significando que tendras que cambiar el acceso designado a {{filename|/home/$USER}} para que MPD pueda funcionar correctamente. Suponiendo que la coleccion en cuestion se ubica en:
+
If files and/or titles are shown in wrong encoding, uncomment and change {{ic|filesystem_charset}} and {{ic|id3v1_encoding}} options.
$ /home/usuario/musica
+
Note that you cannot set encoding for ID3 v2 tags. To workaround this you may use [http://mpd.wikia.com/wiki/GenericDecoder#Generic_Tagreader external tag readers].
los comandos correctos serian:
+
$ chmod a+x /home/usuario
+
$ chmod -R g+X /home/usuario/musica
+
  
====Solucion alternativa====
+
If you want to use another computer to control MPD over a network, the {{ic|bind_to_address}} option in {{ic|mpd.conf}} will need to be set to either your IP address, or {{ic|any}} if your IP address changes frequently.  
Otra opcion seria usar el grupo 'users' como forma para compartir archivos selectos, entre ellos la coleccion de musica. Primero quita todos los permisos de grupo actualmente asignados para luego establecer el nuevo esquema:
+
$ chmod -R g-rwx /home/user
+
$ chmod g+rx /home/user
+
$ chmod -R g+rX /home/user/music
+
  
===mpd --create-db se cuelga===
+
'''Streaming'''<br>
Este es un error común causado por etiquetas mp3 dañadas.
+
With the latest version of MPD (0.15), built-in httpd streaming is now available.
Esta es una manera experimental para resolver este problema.
+
 
 +
To activate this feature, you'll just need to add a new output of type httpd in {{ic|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.
  
Necesitas:
+
===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
 
* kid3
 
* easytag
 
* 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.
+
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====
 
====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.
+
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.  
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====
 
====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.
 
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.
+
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: host "localhost" not found: Temporary failure in name resolution===
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
+
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
  
===Port 6600 already in use===
+
===Other issues when attempting to connect to mpd with a client===
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 mpd --create-db. New mpd behavior is the --create-db option also attempts to start the daemon; if it's already been started, this will fail. If this is the case, try the following:
+
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
  
$ mpd --kill
+
Please see posts on ncmpcpp on the Arch Forums [https://bbs.archlinux.org/viewtopic.php?id=109962 HERE] and [https://bbs.archlinux.org/viewtopic.php?id=113493 HERE]. Also see the Arch bug report on this issue [https://bugs.archlinux.org/task/22071 HERE].
$ mpd --create-db
+
  
A more brute-force approach:
+
====First fix====
 +
Check {{ic|mpd.conf}} for a line like {{ic|mpd.error}} and remove it. The mpd error file is deprecated and has been removed.
  
$ killall mpd
+
====Second fix====
$ mpd --create-db
+
{{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 {{ic|mpd.conf}}:
 +
{{bc|
 +
bind_to_address "127.0.0.1"
 +
port "6600"
 +
}}
  
{{Note| If you typically run mpd as root, you will need to run the above commands as root.}}
+
Afterwards, instruct your client to connect via 127.0.0.1. For example, add the following to the ncmpcpp config file:
 +
{{bc|
 +
mpd_host "127.0.0.1"
 +
mpd_port "6600"
 +
}}
  
In the git 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). Eventually, inotify support will offer fully automatic database updates as you add content to your music folders
+
===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:
 
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
  # netstat -tulpan | grep 6600
+
  
 
This will list IP:Port and the process name holding the connection (root privileges are required to see all processes).
 
This will list IP:Port and the process name holding the connection (root privileges are required to see all processes).
  
===Crackling sound with some audio files===
+
If you need to restart mpd for whatever reason, use:
 +
{{bc|
 +
$ mpd --kill
 +
$ mpd
 +
}}
 +
A more brute-force approach:
 +
{{bc|
 +
$ 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 {{hc|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:
 
This is usually a playback speed problem and can be fixed by uncommenting the audio_output_format line in:
  
{{File|name=/etc/mpd.conf|content=
+
{{hc|/etc/mpd.conf|
 
   audio_output_format "44100:16:2"}}
 
   audio_output_format "44100:16:2"}}
  
 
This is usually a sane value for most mp3 files.
 
This is usually a sane value for most mp3 files.
  
==Enlaces Externos==
+
===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.
 +
{{bc|$ su -c "rc.d start mpd"}}
 +
or
 +
{{bc|# rc.d start mpd}}
  
* [http://www.musicpd.org/ Web site Oficial]
+
==External links==
* [http://mpd.wikia.com/wiki/Main_Page Wiki Oficial]
+
* [http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki Official Web Site and wiki]
* [http://mpd.wikia.com/wiki/Clients Lista de clientes para MPD]
+
* [http://mpd.wikia.com/wiki/Clients Sorted List of MPD Clients]
* [http://www.musicpd.org/forum/ Foro de MPD]
+
* [http://www.musicpd.org/forum/ MPD forum]

Revision as of 14:27, 2 January 2012

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