Translate

8.8 File di configurazione "/etc/mpd.conf"

Se volete un file di configurazione di "/etc/mpd.conf" più facile da consultare e da modificare fate copia di quanto segue modificando alcuni parametri in base al vostro sistema:

#######################################
#######################################
#     AUDIO

 audio_output {
type "alsa"
name "hw:0,0"
device "hw:0,0"
use_mmap "yes"
# usb_dsd   "yes"
# format "44100:16:2"
# period_time  "200000"
# mixer_device "default"
# mixer_control "PCM"
# mixer_index "0"
}

# audio_output {
# type "alsa"
# name "hw:1,0"
# device "hw:1,0"
# usb_dsd   "yes"
# use_mmap "yes"
# format "44100:16:2"
#}

# audio_output {
# type "alsa"
# name "hw:1,1"
# device "hw:1,1"
# use_mmap "yes"
# format "44100:16:2"
#}

#######################################
#     MIXER

# mixer_type   "hardware"
# mixer_type   "software"
 mixer_type   "none"

#######################################
#     BUFFER

# audio_buffer_size  "2048"
# buffer_before_play  "10%"

 audio_buffer_size  "16864"
 buffer_before_play  "0%"

#######################################
#     MUSICA

music_directory       "/var/lib/mpd/music"
db_file               "/var/lib/mpd/tag_cache"

# music_directory       "/media/cb/musica"
# db_file               "/media/cb/mpd/tag_cache"

 music_directory       "/mnt/samba/musica"
 db_file               "/mnt/samba/mpd/tag_cache"

playlist_directory       "/var/lib/mpd/playlists"
# playlist_directory       "/media/cb/mpd/playlists"
 playlist_directory       "/mnt/samba/mpd/playlists"

 log_file       "/var/log/mpd/mpd.log"
# log_file       "/media/cb/mpd/mpd.log"
# log_file       "/mnt/samba/mpd/mpd.log"

 pid_file       "/var/run/mpd/pid"
# pid_file       "/media/cb/mpd/pid"
# pid_file       "/mnt/samba/mpd/pid"

 state_file       "/var/lib/mpd/state"
# state_file       "/media/cb/mpd/state"
# state_file       "/mnt/samba/mpd/state"

#######################################
#     CONTROLLO REMOTO SERVER

 port    "6600"
 bind_to_address  "any"
# bind_to_address  "localhost"
# bind_to_address   "0.0.0.0"
# bind_to_address  "/var/run/mpd/socket"

#######################################
#     METADATA (tag)

  metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc"
  id3v1_encoding   "UTF-8"
  filesystem_charset  "UTF-8"
# id3v1_encoding   "ISO-8859-1"
# filesystem_charset  "ISO-8859-1"

#######################################
#     SICUREZZA

# user   "mpd"
# password   "password@read,add,control,admin"
# default_permissions      "read,add,control,admin"

#######################################
#     INPUT

# input {
#   plugin "curl"
# proxy "proxy.isp.com:8080"
# proxy_user "user"
# proxy_password "password"
#}

#######################################
#     ALTRO

# max_playlist_length  "16864"
# connection_timeout  "60"
# max_connections  "10"
# max_command_list_size  "2048"
# max_output_buffer_size  "8192"

# gapless_mp3_playback   "yes"
# save_absolute_paths_in_playlists "no"

 log_level   "verbose"

 follow_outside_symlinks "yes"
 follow_inside_symlinks "yes"

 zeroconf_enabled "no"
 zeroconf_name "MPD"

# auto_update    "yes"
# auto_update_depth "3"

# sticker_file    "/var/lib/mpd/sticker.sql"

#######################################
##################################FINE

#######################################
#     RESAMPLING

# audio_output_format  "192000:32:2"
# audio_output_format  "192000:24:2"
# audio_output_format  "96000:24:2"
# audio_output_format  "44100:16:2"
 samplerate_converter  "Best Sinc Interpolator"         #0  (97dB SNR, 96% BW)
# samplerate_converter  "Medium Sinc Interpolator"   #1  (97dB SNR, 90% BW)
# samplerate_converter  "Fastest Sinc Interpolator"     #2  (97dB SNR, 80% BW)
# samplerate_converter  "ZOH Interpolator"               #3  (low quality)
# samplerate_converter  "Linear Interpolator"             #4  (very low quality)
# samplerate_converter   "internal"


#######################################
#     STREAMING (.mp3, .ogg, .flac, .wav)

 audio_output {
 type  "httpd"
 name  "MP3"
 port  "9001"
 encoder  "lame"
# encoding "mp3"
# quality  "10"
 bitrate  "64"
 format  "44100:16:2"
 enabled  "no"
}

audio_output {
 type  "httpd"
 name  "OGG"
 port  "9002"
 encoder  "vorbis"
 quality  "8"
# bitrate  "64"
 format  "44100:16:2"
 enabled  "no"
}

audio_output {
 type  "httpd"
 name  "FLAC"
 port  "9003"
 encoder  "flac"
 format  "44100:16:2"
 enabled  "no"
}

audio_output {
 type  "httpd"
 name  "WAV"
 port  "9004"
 encoder  "wave"
 format  "44100:16:2"
 enabled  "no"
}
  
#######################################
#     STREAMING (southcast)

# audio_output {
# type        "shout"
# encoding    "lame"
# name        "Radio CB"
# host        "localhost"
# port        "8000"
# mount        "/mpd.mp3"
# password    "hackme"
# quality        "5.0"
# bitrate        "64"
# format        "44100:16:2"
# enabled "no"
# protocol    "icecast2"        # optional
# user        "source"        # optional
# description    "My Stream Description"    # optional
# genre        "jazz"            # optional
# public        "no"            # optional
# timeout        "2"            # optional
# }

#######################################
#     DECODER

#   decoder {
#   plugin "sndfile"
#    enabled "no"
#}

#######################################
##################################FINE2


E' possibile lasciare la "music_directory" di default. Questo è l'unico modo per dire ad MPD di prendere contemporaneamente la musica in più posti, in varie directory/cartelle a nostra scelta. Per fare ciò bisognerà dire ad MPD in quale directory sta la musica con questi due comandi:

cd /var/lib/mpd/music/

e creare un collegamento

ls -s /media/cb/musica

Naturalmente al posto di "/media/cb/musica" inserite la directory dove avete la vostra musica.