音流

音流是国人近期开发的一个音乐播放器

与Tempo(老外开发)一样,需搭配NAS或自建服务器使用。

界面简洁,支持现在主流的各种音乐服务, 包括Subsonic,Navidrome.

由于采用了跨平台的开发技术,音流有安卓手机,苹果手机,Mac OS, Windows OS各个版本

同样也支持subsonic的同步歌词

小众产品,需要到其官网下载

https://music.aqzscn.cn/

Tempo是开源的,也是免费的,在F-Droid中下载。

音流是闭源的,部分功能收费

音流界面截图

音乐欣赏

孙露 冰吻

Eagles 加州旅馆

蔡琴 出塞曲

祖海 音乐殿堂

播放有困难?

都是高码率音源,带宽有要求
IPv4需要绕道香港转发,而且带宽很低,顺利播放困难较大
IPv6直连
按照协议规定,同时支持IPv4和IPv6时,自动首选走IPv6
在上海,除了东方有线,电信/联通/移动宽带都支持IPv6。

如果家庭宽带连接下,播放有问题,大概率应该更换路由器了。

MusicTag Web & Tempo

音乐刮削软件

所谓音乐刮削,是指自动从互联网获取信息,修改音乐文件的元数据,如标题、图片、演员/歌手、歌词等

有两个流行的音乐刮削软件,MusicTag和MusicTag Web。

前者是windows 平台下的刮削软件

后者是服务器端的刮削软件,并在浏览器上操纵执行。这个软件更加方便,配置好了,可以在需要时,随时从手机中进行处理。

安装Music Tag Web

Docker方式安装,非常方便,但对于国内用户,由于docker hub不易访问,而国内的镜像源也于去年全部停止了,需要想其它方式来安装:

先在镜外VPS上 Pull Image 安装,并export image,再在家中的服务器或NAS上 import image。

应用

在虚拟机上安装好MusicTag Web,并设置好对应的域名和网址后,就可以从任意的手机或PC访问了

有两个版本,V1免费,V2收费

对我而言,V1够用了

http://musictag.zhenglei.net/


Tempo

Tempo 是Android平台上,开源的Subsonic 轻量级客户端,老外开发的。

支持歌词同步显示,没有广告。

可在F-Droid 中下载。

歌词显示,是Tempo apk,subsonic 客户端的一个功能,分享到其它应用,是由subsonic 服务端提供的,这里是Navidrome,不支持歌词显示

Temp 歌词 Demo

Navidrome support SACD

Navidrome dosen’t support DSF/DFF decoding natively,

but it can be achieved via ffmpeg transcoding on the fly.

1 Enable transcoding in server side config file navidrome.toml:

FFmpegPath=”/opt/local/bin/ffmpeg”

EnableTranscodingConfig=”true”

2 Add flac transcode rule in Navidrome client (web browser):

3 Select flac transcode in Tempo (Android client)

Play DSD dff file within MPD daemon

To support play DSD dff file inrealtime mode, we must add dsdiff plugin in mpd config file.

decoder {
  plugin “ffmpeg”
  enable “yes”
}

decoder {
  plugin “dsdiff”
  enable “yes”
}

cat mpd.conf

music_directory     “/music”
playlist_directory “/opt/local/run/mpd/playlists”
db_file            “/opt/local/run/mpd/database”
log_file       “/opt/local/run/mpd/log”
pid_file       “/opt/local/run/mpd/mpd.pid”
state_file         “/opt/local/run/mpd/state”
sticker_file      “/opt/local/run/mpd/sticker.sql”

user           “root”
group          “root”
bind_to_address         “any”
#bind_to_address       “localhost”
bind_to_address         “/opt/local/run/mpd/socket”
port           “6600”


# default=notice
# secure=info

log_level      “default”
#log_level              “secure”
#log_level              “verbose”
#log_level              “warning”
#log_level              “error”



restore_paused         “no”
save_absolute_paths_in_playlists  “no”
metadata_to_use  “artist,album,title,track,name,genre,date,composer,performer,disc”

auto_update        “yes”
auto_update_depth      “8”


follow_outside_symlinks        “yes”
follow_inside_symlinks      “yes”



zeroconf_enabled       “yes”
zeroconf_name          “Music Player @ %h”


#password                        “password@read,add,control,admin”
default_permissions         “read,add,control,admin”



#database {
#       plugin “proxy”
#       host “other.mpd.host”
#       port “6600”
#}


decoder {
  plugin “ffmpeg”
  enable “yes”
}

decoder {
  plugin “dsdiff”
  enable “yes”
}


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


#audio_output {
#   type       “alsa”
#   name       “ALSA”
#   device     “hw:0,0”   # optional
#   mixer_type      “hardware” # optional
#   mixer_device   “default”  # optional
#   mixer_control  “PCM”      # optional
#   mixer_index “0”     # optional
#}

#audio_output {
#    type                    “fifo”
#    name                    “my_fifo”
#    path                    “/tmp/mpd.fifo”
#    format                  “44100:16:2”
#}


# creative usb card
#audio_output {
#        type            “alsa”
#        name            “MP3”
#        device          “hw:CARD=MP3,DEV=0”
#        mixer_type      “software”      # optional
#}


#audio_output {
#        type            “alsa”
#        name            “TerraTec”
#        device          “iec958:CARD=Device,DEV=0”
#        mixer_type      “software”      # optional
#}

#audio_output {
#        type            “alsa”
#        name            “C-Media”
#        device          “iec958:CARD=Set,DEV=0”
#        mixer_type      “hardware”      # optional
#}

# Via Winner AD-86D amplifer
audio_output {
        type            “alsa”
        name            “Audio”
        device          “hw:CARD=AUDIO,DEV=0”
        mixer_type      “software”    
}



# via Jack Daemon
#audio_output {
#        type “jack”
#        name “My Jack Output”
#        mixer_type      “software”
#}



#
# An example of an OSS output:
#
#audio_output {
#   type       “oss”
#   name       “My OSS Device”
##  device     “/dev/dsp” # optional
##  mixer_type      “hardware” # optional
##  mixer_device   “/dev/mixer”   # optional
##  mixer_control  “PCM”      # optional
#}
#
# An example of a shout output (for streaming to Icecast):
#
#audio_output {
#   type       “shout”
#   encoder    “vorbis”       # optional
#   name       “My Shout Stream”
#   host       “localhost”
#   port       “8000”
#   mount      “/mpd.ogg”
#   password   “hackme”
#   quality    “5.0”
#   bitrate    “128”
#   format     “44100:16:1”
##  protocol   “icecast2”     # optional
##  user       “source”       # optional
##  description “My Stream Description”    # optional
##  url     “http://example.com”   # optional
##  genre      “jazz”         # optional
##  public     “no”           # optional
##  timeout    “2”        # optional
##  mixer_type      “software”     # optional
#}
#
# An example of a recorder output:
#
#audio_output {
#   type       “recorder”
#   name       “My recorder”
#   encoder    “vorbis”       # optional, vorbis or lame
#   path       “/opt/local/run/mpd/recorder/mpd.ogg”
##  quality    “5.0”          # do not define if bitrate is defined
#   bitrate    “128”          # do not define if quality is defined
#   format     “44100:16:1”
#}
#
# An example of a httpd output (built-in HTTP streaming server):
#
#audio_output {
#   type       “httpd”
#   name       “My HTTP Stream”
#   encoder    “vorbis”       # optional, vorbis or lame
#   port       “8000”
#   bind_to_address “0.0.0.0”      # optional, IPv4 or IPv6
##  quality    “5.0”          # do not define if bitrate is defined
#   bitrate    “128”          # do not define if quality is defined
#   format     “44100:16:1”
#   max_clients “0”        # optional 0=no limit
#}
#
# An example of a pulseaudio output (streaming to a remote pulseaudio server)
#
#audio_output {
#   type       “pulse”
#   name       “My Pulse Output”
##  server     “remote_server”    # optional
##  sink       “remote_server_sink”   # optional
#}
#
# An example of a winmm output (Windows multimedia API).
#
#audio_output {
#   type       “winmm”
#   name       “My WinMM output”
##  device     “Digital Audio (S/PDIF) (High Definition Audio Device)” # optional
#       or
##  device     “0”     # optional
##  mixer_type “hardware” # optional
#}
#
# An example of an openal output.
#
#audio_output {
#   type       “openal”
#   name       “My OpenAL output”
##  device     “Digital Audio (S/PDIF) (High Definition Audio Device)” # optional
#}
#
# An example of an sndio output.
#
#audio_output {
#   type       “sndio”
#   name       “sndio output”
#   mixer_type “hardware”
#}
#
# An example of an OS X output:
#
#audio_output {
#   type       “osx”
#   name       “My OS X Device”
##  device     “Built-in Output”  # optional
##  channel_map      “-1,-1,0,1”   # optional
#}
#
## Example “pipe” output:
#
#audio_output {
#   type       “pipe”
#   name       “my pipe”
#   command    “aplay -f cd 2>/dev/null”
## Or if you’re want to use AudioCompress
#   command    “AudioCompress -m | aplay -f cd 2>/dev/null”
## Or to send raw PCM stream through PCM:
#   command    “nc example.org 8765”
#   format     “44100:16:2”
#}
#
## An example of a null output (for no audio output):
#
#audio_output {
#   type       “null”
#   name       “My Null Output”
#   mixer_type      “none”         # optional
#}
#
###############################################################################


# Normalization automatic volume adjustments ##################################
#
# This setting specifies the type of ReplayGain to use. This setting can have
# the argument “off”, “album”, “track” or “auto”. “auto” is a special mode that
# chooses between “track” and “album” depending on the current state of
# random playback. If random playback is enabled then “track” mode is used.
# See <http://www.replaygain.org> for more details about ReplayGain.
# This setting is off by default.
#
#replaygain        “album”
#
# This setting sets the pre-amp used for files that have ReplayGain tags. By
# default this setting is disabled.
#
#replaygain_preamp     “0”
#
# This setting sets the pre-amp used for files that do NOT have ReplayGain tags.
# By default this setting is disabled.
#
#replaygain_missing_preamp “0”
#
# This setting enables or disables ReplayGain limiting.
# MPD calculates actual amplification based on the ReplayGain tags
# and replaygain_preamp / replaygain_missing_preamp setting.
# If replaygain_limit is enabled MPD will never amplify audio signal
# above its original level. If replaygain_limit is disabled such amplification
# might occur. By default this setting is enabled.
#
#replaygain_limit      “yes”
#
# This setting enables on-the-fly normalization volume adjustment. This will
# result in the volume of all playing audio to be adjusted so the output has
# equal “loudness”. This setting is disabled by default.
#
#volume_normalization      “no”
#
###############################################################################

# Character Encoding ##########################################################
#
# If file or directory names do not display correctly for your locale then you
# may need to modify this setting.
#
#filesystem_charset        “UTF-8”
#
###############################################################################

Creating udev rule for USB DAC

Target:

Create a new udev rule which will:

Stop the Jack Daemon if DAC power off

Start the Jack Daemon if DAC power on

Identify USB DAC Card:

Power on USB DAC

Check the name of USB DAC

ls -l /proc/asound/
lrwxrwxrwx 1 root root 5 11月 22 17:55 AUDIO -> card2
dr-xr-xr-x 3 root root 0 11月 16 18:43 card0
dr-xr-xr-x 4 root root 0 11月 16 18:43 card1
dr-xr-xr-x 4 root root 0 11月 22 17:55 card2
-r–r–r– 1 root root 0 11月 16 16:36 cards
-r–r–r– 1 root root 0 11月 16 18:43 devices
lrwxrwxrwx 1 root root 5 11月 16 18:43 Generic -> card0
-r–r–r– 1 root root 0 11月 16 18:43 hwdep
-r–r–r– 1 root root 0 11月 16 18:43 modules
dr-xr-xr-x 2 root root 0 11月 16 18:43 oss
-r–r–r– 1 root root 0 11月 16 18:43 pcm

card2 is the name of DAC Card

ls  /sys/class/sound
card0  card2      controlC1  hwC0D0  pcmC0D3p  pcmC1D0p  pcmC2D0p
card1  controlC0  controlC2  hwC1D0  pcmC1D0c  pcmC2D0c  timer


Get the Attr List of card2

udevadm info /sys/class/sound/card2
P: /devices/pci0000:00/0000:00:12.0/usb2/2-4/2-4:1.0/sound/card2
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:12.0/usb2/2-4/2-4:1.0/sound/card2
E: SUBSYSTEM=sound
E: USEC_INITIALIZED=523137960408
E: ID_PATH=pci-0000:00:12.0-usb-0:4:1.0
E: ID_PATH_TAG=pci-0000_00_12_0-usb-0_4_1_0
E: ID_FOR_SEAT=sound-pci-0000_00_12_0-usb-0_4_1_0
E: SOUND_INITIALIZED=1
E: ID_VENDOR_FROM_DATABASE=Actions Semiconductor Co., Ltd
E: ID_VENDOR=ACTIONS
E: ID_VENDOR_ENC=ACTIONS
E: ID_VENDOR_ID=10d6
E: ID_MODEL=USB_AUDIO
E: ID_MODEL_ENC=USB\x20AUDIO
E: ID_MODEL_ID=dd01
E: ID_REVISION=0100
E: ID_SERIAL=ACTIONS_USB_AUDIO_4512482ADF0FEEEE
E: ID_SERIAL_SHORT=4512482ADF0FEEEE
E: ID_TYPE=audio
E: ID_BUS=usb
E: ID_USB_INTERFACES=:010100:010200:030000:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=snd-usb-audio
E: ID_ID=usb-ACTIONS_USB_AUDIO_4512482ADF0FEEEE-00
E: SYSTEMD_WANTS=sound.target
E: TAGS=:systemd:seat:
udevadm info --path=/sys/class/sound/card2 --attribute-walk

looking at device '/devices/pci0000:00/0000:00:12.0/usb2/2-4/2-4:1.0/sound/card2':
    KERNEL=="card2"
    SUBSYSTEM=="sound"
    DRIVER==""
    ATTR{number}=="2"
    ATTR{id}=="AUDIO"

  looking at parent device '/devices/pci0000:00/0000:00:12.0/usb2/2-4/2-4:1.0':
    KERNELS=="2-4:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="snd-usb-audio"
    ATTRS{supports_autosuspend}=="1"
    ATTRS{bInterfaceProtocol}=="00"
    ATTRS{authorized}=="1"
    ATTRS{bNumEndpoints}=="00"
    ATTRS{bInterfaceClass}=="01"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bInterfaceSubClass}=="01"
    ATTRS{bAlternateSetting}==" 0"

  looking at parent device '/devices/pci0000:00/0000:00:12.0/usb2/2-4':
    KERNELS=="2-4"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{devpath}=="4"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bmAttributes}=="c0"
    ATTRS{quirks}=="0x0"
    ATTRS{tx_lanes}=="1"
    ATTRS{product}=="USB AUDIO"
    ATTRS{busnum}=="2"
    ATTRS{bcdDevice}=="0100"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{manufacturer}=="ACTIONS"
    ATTRS{bNumInterfaces}==" 4"
    ATTRS{bDeviceClass}=="00"
    ATTRS{configuration}==""
    ATTRS{maxchild}=="0"
    ATTRS{devnum}=="20"
    ATTRS{serial}=="4512482ADF0FEEEE"
    ATTRS{bMaxPower}=="300mA"
    ATTRS{idVendor}=="10d6"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{urbnum}=="25748"
    ATTRS{idProduct}=="dd01"
    ATTRS{version}==" 1.00"
    ATTRS{removable}=="unknown"
    ATTRS{authorized}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="12"
    ATTRS{rx_lanes}=="1"
    ATTRS{lATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:12.0/usb2':
    KERNELS=="usb2"
    SUBSYSTEMS=="usb"DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{idProduct}=="0001"
    ATTRS{version}==" 1.10"
    ATTRS{tx_lanes}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bDeviceClass}=="09"
    ATTRS{removable}=="unknown"
    ATTRS{authorized_default}=="1"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{interface_authorized_default}=="1"
    ATTRS{busnum}=="2"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bMaxPower}=="0mA"
    ATTRS{quirks}=="0x0"
    ATTRS{speed}=="12"
    ATTRS{bcdDevice}=="0419"
    ATTRS{maxchild}=="5"
    ATTRS{idVendor}=="1d6b"
    ATTRS{devpath}=="0"
    ATTRS{manufacturer}=="Linux 4.19.0-9-amd64 ohci_hcd"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{rx_lanes}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{urbnum}=="511"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{product}=="OHCI PCI host controller"
    ATTRS{serial}=="0000:00:12.0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{ltm_capable}=="no"
    ATTRS{devnum}=="1"
    ATTRS{authorized}=="1"

    
# Get kernel prop
udevadm monitor --kernel --property --subsystem-match=usb
monitor will print the received events for:
KERNEL - the kernel uevent

KERNEL[1083.319560] add      /devices/pci0000:00/0000:00:12.0/usb2/2-4 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:12.0/usb2/2-4
SUBSYSTEM=usb
DEVNAME=/dev/bus/usb/002/002
DEVTYPE=usb_device
PRODUCT=10d6/dd01/100
TYPE=0/0/0
BUSNUM=002
DEVNUM=002
SEQNUM=2112
MAJOR=189
MINOR=129

Write your udev rule based on selected attrs

cat /opt/local/libexec/udev/rules.d/99-AD-86d.rules

ACTION=="add",SUBSYSTEM=="sound",ATTR{id}=="AUDIO",RUN+="/opt/local/bin/add_ad_86d.sh"
ACTION=="remove",SUBSYSTEM=="usb",ATTRS{idVendor}=="10d6",ATTRS{idProduct}=="dd01",RUN+="/opt/local/bin/remove_ad_86d.sh"

Split Music Image in Debian

Share my script used to split music image file into indivdual track of wav or flac

OS: Debian/ununtu

Install necessary tool:

sudo apt-get clean

sudo apt-get update

sudo apt-get install -y shntool dos2unix enca flac ffmpeg

Convert

# output track in wav format

sudo split.sh CDImage.wav wav

# output track in flac format

sudo split.sh CDImage.wav flac

Split.sh

#/bin/bash

if [ $# -ne 2 ] && [ $# -ne 1 ]
then

echo "Usage:   sudo split.sh FILE [DECODE]"
echo "Example: sudo split.sh CDImage wav"
echo "         sudo split.sh CDImage flac"
echo "         sudo split.sh CDImage.wav"
echo "         sudo split.sh CDImage.wav flac"
echo "         sudo split.sh CDImage"
echo "Note:"
echo "         The Input Audio File =   FILE.wav or FILE.flac or FILE.ape"
echo "         DECODE               =   wav or flac (Output Audio Format)"
echo "         The Input CUE File   =   FILE.cue"
exit

fi


BFILE=$1

if [ -f ${BFILE} ];then
  AUDIO_FILE=${BFILE}
  EXT=${BFILE##*.}
  case $EXT in
    "wav"|"WAV")
       FORMAT="wav"
       ;;
    "flac"|"FLAC")
       FORMAT="flac"
       ;;
    "ape"|"APE")
       FORMAT="ape"
       ;;
    esac
else if [ -f $BFILE.wav ];then
       AUDIO_FILE=$BFILE.wav
       FORMAT="wav"
     else if [ -f $BFILE.flac ];then
             AUDIO_FILE=$BFILE.flac
             FORMAT="flac"
          else if [ -f $BFILE.ape ];then
                 AUDIO_FILE=$BFILE.ape
                 FORMAT="ape"
               else
                 echo "Not found audio file: $1.wav or $1.flac or $1.ape "
                 echo "Exit"
                 exit
               fi
          fi  
     fi
fi


if [ $# -ne 1 ];then
DECODE=$2
fi

if [ "A${DECODE}B" = "AB" ];then
  DECODE="wav"
fi


if [ "A${FORMAT}B" = "AB" ];then
  FORMAT="${DECODE}"
fi

if [ "A${DECODE}B" = "AapeB" ];then
  DECODE="wav"
fi


echo "Audio  File   = ${AUDIO_FILE}"
echo "Input  Format = ${FORMAT} " 
echo "Output Format = ${DECODE} "


if [ "$FORMAT" = "ape" ]
then
echo -e "First, convert ape format to ${DECODE} format, waite a minute..."
DECODE_FILE=$BFILE.${DECODE}
#avconv -i "$AUDIO_FILE" "$DECODE_FILE"
ffmpeg -i "$AUDIO_FILE" "$DECODE_FILE"
AUDIO_FILE=$DECODE_FILE
CONVERT="true"
FORMAT="${DECODE}"
fi


#if [ ! "$DECODE" = "$FORMAT" ];then
#echo -e "First, convert ${FORMAT} format to ${DECODE} format, waite a 
#minute..."
#DECODE_FILE=$BFILE.${DECODE}
#avconv -i "$AUDIO_FILE" "$DECODE_FILE"
#ffmpeg -i "$AUDIO_FILE" "$DECODE_FILE"
#AUDIO_FILE=$DECODE_FILE
#CONVERT="true"
#fi


CUE_FILE=$BFILE.cue
CUE_FILE_LINUX=$BFILE-linux.cue

if [ ! -f ${CUE_FILE} ];then
  MY_DIR="`dirname ${BFILE}`"
  MY_NAME="`basename ${BFILE}`"
  MY_BASE="${MY_NAME%.*}"
  CUE_FILE=${MY_DIR}/${MY_BASE}.cue
  if [ ! -f ${CUE_FILE} ];then
   echo "unable to find cue file of:"
   echo "  $BFILE.cue or ${CUE_FILE} "
   exit
  fi
fi

CODE="`enca ${CUE_FILE} |grep ";"|sed "s/.*; //"`"
echo "CODE=${CODE}"

echo iconv -f "${CODE}" -t utf8 "$CUE_FILE" -o "$CUE_FILE_LINUX"

iconv -f "${CODE}" -t utf8 "$CUE_FILE" -o "$CUE_FILE_LINUX"


dos2unix "$CUE_FILE_LINUX"


echo shntool split -t "%n-%t" -f "$CUE_FILE_LINUX" -o $DECODE "$AUDIO_FILE"
shntool split -t "%n-%t" -f "$CUE_FILE_LINUX" -o $DECODE "$AUDIO_FILE"


if [ "$CONVERT" = "true" ]
then
if [ ! "AB" = "A${DECODE_FILE}B" ];then
  if [ -f ${DECODE_FILE} ];then
   echo -e "Remove temporary flac file: $DECODE_FILE"
   rm -f "$DECODE_FILE"
  fi
fi

fi

Debian Wheezy: Audio with 2nd Sound Card

# Check sound card
aplay -l

  • # Config 2nd sound card for aplay, add .asoundrc file under home directory
    nano ~/.asoundrc
    defaults.pcm.card 1
    defaults.pcm.device 0
    defaults.ctl.card 1
  • defaults.timer.card 1

# Config 2nd sound card for mpd, update /etc/mpd.conf
nano /etc/mpd.conf
audio_output {
type “alsa”
name “My ALSA Device”
— device “hw:0,0” # optional
++ device “hw:1,0”
format “44100:16:2” # optional
mixer_device “default”
mixer_control “PCM”
mixer_index “0”
}

Debian Wheezy: install ncmpcpp, Ncurses Based MPD Client

# Install ncmpcpp client
apt-get install ncmpcpp

# Update config of ncmpcpp
nano ~/.ncmpcpp/config
mpd_host = “192.168.127.72”
#
mpd_port = “6600”
#
mpd_music_dir = “/share/mpd/music/”
#
mpd_connection_timeout = “5”
#
mpd_crossfade_time = “3”
#
##### music visualizer #####
##
## Note: In order to make music visualizer work you’ll
## need to use mpd fifo output, whose format parameter
## has to be set to 44100:16:1. Example configuration:
## (it has to be put into mpd.conf)
##
##audio_output {
## type “fifo”
## name “My FIFO”
## path “/tmp/mpd.fifo”
## format “44100:16:1”
##}
##
#
visualizer_fifo_path = “/tmp/mpd.fifo”
#
##
## Note: Below parameter is needed for ncmpcpp
## to determine which output provides data for
## visualizer and thus allow syncing between
## visualization and sound as currently there
## are some problems with it.
##
#
visualizer_output_name = “My FIFO”
#
##
## Note: To enable spectrum frequency visualization
## you need to compile ncmpcpp with fftw3 support.
##
#
visualizer_type = “spectrum” (spectrum/wave)
#
##### system encoding #####
##
## ncmpcpp should detect your charset encoding
## but if it failed to do so, you can specify
## charset encoding you are using here.
##
## Note: You can see whether your ncmpcpp build
## supports charset detection by checking output
## of `ncmpcpp –version`.
##
## Note: Since MPD uses utf8 by default, setting
## this option makes sense only if your encoding
## is different.
##
#
#system_encoding = “”
#
##### delays #####
#
## delay after playlist highlighting will be disabled (0 = don’t disable)
#
playlist_disable_highlight_delay = “5”
#
## defines how long various messages are supposed to be visible
#
message_delay_time = “4”
#
##### song format #####
##
## for song format you can use:
##
## %l – length
## %f – filename
## %D – directory
## %a – artist
## %t – title
## %b – album
## %y – year
## %n – track number (01/12 -> 01)
## %N – full track info (01/12 -> 01/12)
## %g – genre
## %c – composer
## %p – performer
## %d – disc
## %C – comment
## $R – begin right alignment
##
## you can also put them in { } and then it will be displayed
## only if all requested values are available and/or define alternate
## value with { }|{ } eg. {%a – %t}|{%f}
##
## Note: Format that is similar to “%a – %t” (i.e. without any additional
## braces) is equal to “{%a – %t}”, so if one of the tags is missing,
## you’ll get nothing.
##
## text can also have different color than the main window has,
## eg. if you want length to be green, write $3%l$9
##
## available values:
##
## – 0 – default window color (discards all other colors)
## – 1 – black
## – 2 – red
## – 3 – green
## – 4 – yellow
## – 5 – blue
## – 6 – magenta
## – 7 – cyan
## – 8 – white
## – 9 – end of current color
##
## Note: colors can be nested.
##
#
song_list_format = “{%a – }{%t}|{$8%f$9}$R{$3(%l)$9}”
#
song_status_format = “{{%a{ \”%b\”{ (%y)}} – }{%t}}|{%f}”
#
song_library_format = “{%n – }{%t}|{%f}”
#
tag_editor_album_format = “{(%y) }%b”
#
##
## Note: Below variables are for alternative version of user’s interface.
## Their syntax supports all tags and colors listed above plus some extra
## markers used for text attributes. They are followed by character ‘$’.
## After that you can put:
##
## – b – bold text
## – u – underline text
## – r – reverse colors
## – a – use alternative character set
##
## If you don’t want to use an attribute anymore, just put it again, but
## this time insert character ‘/’ between ‘$’ and attribute character,
## e.g. {$b%t$/b}|{$r%f$/r} will display bolded title tag or filename
## with reversed colors.
##
#
#alternative_header_first_line_format = “$b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b”
#
#alternative_header_second_line_format = “{{$4$b%a$/b$9}{ – $7%b$9}{ ($4%y$9)}}|{%D}”
#
##
## Note: Below variables also supports
## text attributes listed above.
##
#
now_playing_prefix = “$b”
#
#now_playing_suffix = “$/b”
#
#browser_playlist_prefix = “$2playlist$9 ”
#
#selected_item_prefix = “$6”
#
#selected_item_suffix = “$9”
#
## colors are not supported for below variable
#
#song_window_title_format = “{%a – }{%t}|{%f}”
#
##### columns settings #####
##
## syntax of song columns list format is “column column etc.”
##
## – syntax for each column is:
##
## (width of column)[column’s color]{displayed tag}
##
## Note: Width is by default in %, if you want a column to
## have fixed size, add ‘f’ after the value, e.g. (10)[white]{a}
## will be the column that take 10% of screen (so the real column’s
## width will depend on actual screen size), whereas (10f)[white]{a}
## will take 10 terminal cells, no matter how wide the screen is.
##
## – color is optional (if you want the default one, type [])
##
## Note: You can give a column additional attributes by putting appropriate
## character after displayed tag character. Available attributes are:
##
## – r – column will be right aligned
## – E – if tag is empty, empty tag marker won’t be displayed
##
## E.g. {lr} will give you right aligned column of lengths.
##
#
song_columns_list_format = “(7f)[green]{l} (25)[cyan]{a} (40)[]{t} (30)[red]{b}”
#
##### various settings #####
#
##
## Note: Custom command that will be executed each
## time song changes. Useful for notifications etc.
##
## Attention: It doesn’t support song format anymore.
## Use `ncmpcpp –now-playing SONG_FORMAT` instead.
##
#execute_on_song_change = “”
#
#playlist_show_remaining_time = “no”
#
playlist_display_mode = “columns” (classic/columns)
#
browser_display_mode = “classic” (classic/columns)
#
#search_engine_display_mode = “classic” (classic/columns)
#
#incremental_seeking = “yes”
#
#seek_time = “1”
#
#autocenter_mode = “no”
#
#centered_cursor = “no”
#
#progressbar_look = “=>”
#
#default_place_to_search_in = “database” (database/playlist)
#
user_interface = “classic” (classic/alternative)
#
#media_library_left_column = “a” (possible values: a,y,g,c,p, legend above)
#
default_find_mode = “wrapped” (wrapped/normal)
#
default_space_mode = “add” (add/select)
#
#default_tag_editor_left_col = “albums” (albums/dirs)
#
#default_tag_editor_pattern = “%n – %t”
#
header_visibility = “no”
#
statusbar_visibility = “no”
#
#header_text_scrolling = “yes”
#
#fancy_scrolling = “yes”
#
cyclic_scrolling = “no”
#
#lines_scrolled = “2”
#
follow_now_playing_lyrics = “no”
#
#ncmpc_like_songs_adding = “no” (enabled – add/remove, disabled – always add)
#
show_hidden_files_in_local_browser = “no”
#
#display_screens_numbers_on_start = “yes”
#
#jump_to_now_playing_song_at_start = “yes”
#
#ask_before_clearing_main_playlist = “no”
#
clock_display_seconds = “no”
#
#display_bitrate = “no”
#
#display_remaining_time = “no”
#
#regular_expressions = “basic” (basic/extended)
#
##
## Note: If below is enabled, ncmpcpp will ignore leading
## “The” word while sorting items in browser, tags in
## media library, etc.
##
#ignore_leading_the = “no”
#
#block_search_constraints_change_if_items_found = “yes”
#
#mouse_support = “yes”
#
#mouse_list_scroll_whole_page = “yes”
#
#empty_tag_marker = “”
#
#tag_editor_extended_numeration = “no”
#
#enable_window_title = “yes”
#
##
## Note: These triggers will allow you to phisically remove
## files and directories from your hdd in using ncmpcpp’s
## browser screen.
##
#
allow_physical_files_deletion = “no”
#
allow_physical_directories_deletion = “no”
#
##### lyrics support #####
##
## supported lyrics databases:
##
## – 1 – lyricsplugin.com
##
#
#lyrics_database = “1”
#
#external_editor = “”
#
#use_console_editor = “no” (set to yes, if your editor is console app)
#
##### colors definitions #####
#
colors_enabled = “yes”
#
#empty_tag_color = “cyan”
#
#header_window_color = “default”
#
#volume_color = “default”
#
#state_line_color = “default”
#
#state_flags_color = “default”
#
#main_window_color = “yellow”
#
#color1 = “white”
#
#color2 = “green”
#
#main_window_highlight_color = “yellow”
#
#progressbar_color = “default”
#
#statusbar_color = “default”
#
#alternative_ui_separator_color = “black”
#
#active_column_color = “red”
#
#window_border_color = “green”
#
#active_window_border = “red”
#

Debian Wheezy: Play music with mpd/mpc

# Install mpd ( music play daemon )
apt-get install mpd

# Stop mpd service
/etc/init.d/mpd stop

# Update config of mpd
nano /etc/mpd.conf
music_directory = “/share/mpd/music”
playlist_directory = “/share/mpd/playlists”
db_file = “/share/mpd/tag_cache”
log_file = “/share/mpd/mpd.log”
pid_file = “/share/mpd/mpd”
state_file = “/share/mpd/state”
sticker_file = “/share/mpd/sticker.sql”
user = “mpd”
bind_to_address = “localhost”
bind_to_address = “192.168.127.72”
port = “6600”
log_level = “default”
follow_outside_symlink = “yes”

# Install mpc ( music play client )
apt-get install mpc

# Launch mpd service
/etc/init.d/mpt start

# Update mpd DB
mpc update

# Create playlist to include all song
mpc ls|mpc add

# check mpd status
mpc status

# Check volume
mpc volume

# Start local Play
mpc play

# Start remote play
mpc -h 192.168.127.27 play

# Play next
mpc next

# Stop Play
mpc stop

# Mpd clients
http://mpd.wikia.com/wiki/Clients