Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

<SOLVED> Streaming with MPD and Icecast2

Linux Kernel, Network, and Services configuration.
Message
Author
Huecuva
Posts: 135
Joined: 2017-06-09 04:00

Re: Streaming with MPD and Icecast2

#21 Post by Huecuva »

So uh...not sure where to go with this from here.

Dennis99
Posts: 19
Joined: 2012-07-24 15:02

Re: Streaming with MPD and Icecast2

#22 Post by Dennis99 »

I'm still here, I've been trying to find a cure for covid-19 as it's easier! :mrgreen:
I have set-up a working mpd/mpc on Debian 10 in Virtualbox just by tweaking the original mpd.conf, putting the tracks in /var/mpd/music and chown that directory to mpd:<USER> so it can be done.
I'm also trying to learn FreeBSD in Virtualbox and got it running there too, it was slightly easier as well!
This track is playing in FreeBSD.

Code: Select all

$ mpc
10 000 Maniacs - Hey Jack Kerouac
[playing] #1/14   0:23/3:24 (11%)
volume: n/a   repeat: on    random: on    single: off   consume: off
What is?

Code: Select all

$ cat /etc/mpd.conf

Code: Select all

$ ls -la /home/radio
and

Code: Select all

$ cat /home/<USER>/mpd/mpd.log
I don't often use mp3 but I think the encoder should be

Code: Select all

encoder     "lame"

Huecuva
Posts: 135
Joined: 2017-06-09 04:00

Re: Streaming with MPD and Icecast2

#23 Post by Huecuva »

Dennis99 wrote:I'm still here, I've been trying to find a cure for covid-19 as it's easier! :mrgreen:
Hahaha fair enough!
Dennis99 wrote:I'm also trying to learn FreeBSD in Virtualbox and got it running there too, it was slightly easier as well!
I imagine FreeBSD could make a good server. I tried to set it up as a desktop OS on an old netbook I have and it was a nightmare. I gave up.
Dennis99 wrote:What is?

Code: Select all

$ cat /etc/mpd.conf

Code: Select all

$ ls -la /home/radio
and

Code: Select all

$ cat /home/<USER>/mpd/mpd.log
I don't often use mp3 but I think the encoder should be

Code: Select all

encoder     "lame"
You want the whole /etc/mpd.conf file? It's pretty long. /home/<USER>/ is the same as /home/radio/. Yeah, did I forget to change it in one place? radio is my username and hostname for this box I'm working on. I can tell you ls -la /home/radio/ is /Library and /mpd.

I'm at work right now and just got here, but I will get you the results of cat /etc/mpd.conf and cat /home/radio/mpd/mpd.log when I get home. Also, I will try putting encoder "lame" in my /etc/mpd.conf.

Huecuva
Posts: 135
Joined: 2017-06-09 04:00

Re: Streaming with MPD and Icecast2

#24 Post by Huecuva »

Here is /home/radio/mpd/mpd.log:

Code: Select all

$ cat /home/radio/mpd/mpd.log
Mar 29 11:11 : config: option 'encoding' on line 242 was not recognized
Mar 29 11:11 : config: option 'description' on line 245 was not recognized
Mar 29 11:11 : config: option 'host' on line 246 was not recognized
Mar 29 11:11 : update: added /Rick Astley - Never Gonna Give You Up.mp3
Mar 29 11:11 : client: [0] opened from [::1]:45360
Mar 29 11:11 : client: [0] closed
Mar 29 11:11 : client: [1] opened from [::1]:45362
Mar 29 11:11 : client: [1] closed
Mar 29 11:11 : client: [2] opened from [::1]:45364
Mar 29 11:11 : client: [2] closed
Mar 29 11:11 : client: [3] opened from [::1]:45366
Mar 29 11:11 : client: [3] closed
Mar 29 11:14 : client: [4] opened from [::1]:45368
Mar 29 11:14 : client: [4] closed
Mar 29 11:14 : client: [5] opened from [::1]:45370
Mar 29 11:14 : client: [5] closed
Mar 29 11:15 : client: [6] opened from [::1]:45372
Mar 29 11:15 : client: [6] closed
Mar 29 11:15 : client: [7] opened from [::1]:45374
Mar 29 11:15 : client: [7] closed
Mar 29 11:15 : exception: Failed to create /var/lib/mpd/state: Permission denied
Mar 29 11:15 : client: [8] opened from [::1]:45376
Mar 29 11:15 : client: [8] closed
Mar 29 11:15 : exception: Failed to enable output "Dead Pirate Radio" (httpd)
Mar 29 11:15 : exception: nested: Failed to bind to '[::]:8000'
Mar 29 11:15 : exception: Failed to bind socket: Address already in use
Mar 29 11:15 : exception: Failed to enable output "Dead Pirate Radio" (httpd)
Mar 29 11:15 : exception: nested: Failed to bind to '[::]:8000'
Mar 29 11:15 : exception: Failed to bind socket: Address already in use
Mar 29 11:15 : player: problems opening audio device while playing "Rick Astley - Never Gonna Give You Up.mp3"
Mar 29 11:15 : exception: Failed to create /var/lib/mpd/state: Permission denied
Mar 29 11:15 : exception: Failed to create /var/lib/mpd/state: Permission denied
Mar 29 11:15 : player: played "Rick Astley - Never Gonna Give You Up.mp3"
Mar 29 11:16 : config: option 'encoding' on line 242 was not recognized
Mar 29 11:16 : config: option 'description' on line 245 was not recognized
Mar 29 11:16 : config: option 'host' on line 246 was not recognized
Mar 29 11:17 : client: [0] opened from [::1]:57696
Mar 29 11:17 : client: [0] closed
Mar 29 11:18 : client: [1] opened from [::1]:57698
Mar 29 11:18 : client: [1] closed
Mar 29 11:19 : client: [2] opened from [::1]:57700
Mar 29 11:19 : client: [2] closed
Mar 29 11:42 : client: [3] opened from [::1]:57710
Mar 29 11:42 : client: [3] closed
Mar 29 11:42 : client: [4] opened from [::1]:57712
Mar 29 11:42 : client: [4] closed
Mar 29 11:42 : client: [5] opened from [::1]:57714
Mar 29 11:42 : client: [5] closed
Mar 29 11:42 : client: [6] opened from [::1]:57716
Mar 29 11:42 : client: [6] closed
Mar 29 11:42 : client: [7] opened from [::1]:57718
Mar 29 11:42 : client: [7] closed
Mar 29 11:42 : exception: Failed to enable output "Dead Pirate Radio" (httpd)
Mar 29 11:42 : exception: nested: Failed to bind to '[::]:8000'
Mar 29 11:42 : exception: Failed to bind socket: Address already in use
Mar 29 11:42 : exception: Failed to enable output "Dead Pirate Radio" (httpd)
Mar 29 11:42 : exception: nested: Failed to bind to '[::]:8000'
Mar 29 11:42 : exception: Failed to bind socket: Address already in use
Mar 29 11:42 : player: problems opening audio device while playing "Rick Astley - Never Gonna Give You Up.mp3"
Mar 29 11:42 : exception: Failed to create /var/lib/mpd/state: Permission denied
Mar 29 11:46 : exception: Failed to create /var/lib/mpd/state: Permission denied
Mar 29 11:46 : player: played "Rick Astley - Never Gonna Give You Up.mp3"
Mar 29 11:47 : config: option 'encoding' on line 242 was not recognized
Mar 29 11:47 : config: option 'description' on line 245 was not recognized
Mar 29 11:47 : config: option 'host' on line 246 was not recognized
Mar 29 11:47 : client: [0] opened from [::1]:47896
Mar 29 11:47 : client: [0] closed
Mar 29 11:48 : client: [1] opened from [::1]:47898
Mar 29 11:48 : client: [1] closed
Mar 29 11:48 : client: [2] opened from [::1]:47900
Mar 29 11:48 : client: [2] closed
Mar 29 11:48 : client: [3] opened from [::1]:47902
Mar 29 11:48 : client: [3] closed
Mar 29 11:48 : client: [4] opened from [::1]:47904
Mar 29 11:48 : client: [4] closed
Mar 29 11:50 : client: [5] opened from [::1]:47906
Mar 29 11:50 : client: [5] closed
Mar 29 11:50 : client: [6] opened from [::1]:47908
Mar 29 11:50 : client: [6] closed
Mar 29 11:50 : client: [7] opened from [::1]:47910
Mar 29 11:50 : exception: Failed to create /var/lib/mpd/state: Permission denied
Mar 29 11:50 : client: [7] closed
Mar 29 11:50 : exception: Failed to enable output "Dead Pirate Radio" (httpd)
Mar 29 11:50 : exception: nested: Failed to bind to '[::]:8000'
Mar 29 11:50 : exception: Failed to bind socket: Address already in use
Mar 29 11:50 : exception: Failed to enable output "Dead Pirate Radio" (httpd)
Mar 29 11:50 : exception: nested: Failed to bind to '[::]:8000'
Mar 29 11:50 : exception: Failed to bind socket: Address already in use
Mar 29 11:50 : player: problems opening audio device while playing "Rick Astley - Never Gonna Give You Up.mp3"
Mar 29 11:50 : exception: Failed to create /var/lib/mpd/state: Permission denied
Mar 29 11:58 : exception: Failed to create /var/lib/mpd/state: Permission denied
Mar 29 11:58 : player: played "Rick Astley - Never Gonna Give You Up.mp3"
Mar 29 11:58 : config: option 'encoding' on line 242 was not recognized
Mar 29 11:58 : config: option 'description' on line 245 was not recognized
Mar 29 11:58 : config: option 'host' on line 246 was not recognized
Mar 29 11:59 : config: option 'encoding' on line 242 was not recognized
Mar 29 11:59 : config: option 'description' on line 245 was not recognized
Mar 29 11:59 : config: option 'host' on line 246 was not recognized
Mar 29 11:59 : client: [0] opened from [::1]:34792
Mar 29 11:59 : client: [0] closed
Mar 31 18:00 : config: option 'encoding' on line 242 was not recognized
Mar 31 18:00 : config: option 'description' on line 246 was not recognized
Mar 31 18:00 : config: option 'host' on line 247 was not recognized
Mar 31 18:00 : client: [0] opened from [::1]:35830
Mar 31 18:00 : client: [0] closed
Mar 31 18:01 : client: [1] opened from [::1]:35832
Mar 31 18:01 : client: [1] closed
Mar 31 18:01 : client: [2] opened from [::1]:35834
Mar 31 18:01 : client: [2] closed
Mar 31 18:01 : client: [3] opened from [::1]:35836
Mar 31 18:01 : client: [3] closed
Mar 31 18:01 : client: [4] opened from [::1]:35838
Mar 31 18:01 : client: [4] closed
Mar 31 18:01 : exception: Failed to enable output "Dead Pirate Radio" (httpd)
Mar 31 18:01 : exception: nested: Failed to bind to '[::]:8000'
Mar 31 18:01 : exception: Failed to bind socket: Address already in use
Mar 31 18:01 : exception: Failed to enable output "Dead Pirate Radio" (httpd)
Mar 31 18:01 : exception: nested: Failed to bind to '[::]:8000'
Mar 31 18:01 : exception: Failed to bind socket: Address already in use
Mar 31 18:01 : player: problems opening audio device while playing "Rick Astley - Never Gonna Give You Up.mp3"
That permission denied error from the 29th about the state file is no longer relevant. I had forgotten to change that in my /etc/mpd.conf file but that has been fixed.

ls -la /home/radio/:

Code: Select all

$ ls -la /home/radio/
total 52
drwxrw-rw- 8 radio radio 4096 Mar 31 18:00 .
drwxr-xr-x 3 root  root  4096 Mar 15 15:28 ..
-rwxrw-rw- 1 radio radio 1414 Mar 30 08:57 .bash_history
-rwxrw-rw- 1 radio radio  220 Mar 15 15:28 .bash_logout
-rwxrw-rw- 1 radio radio 3526 Mar 15 15:28 .bashrc
drwxr-xr-x 3 radio radio 4096 Mar 28 11:48 .config
drwxrw-rw- 3 radio radio 4096 Mar 20 23:34 .gnupg
drwxrw-rw- 3 radio radio 4096 Mar 22 15:40 Library
drwxrw-rw- 3 radio radio 4096 Mar 15 16:04 .local
drwxr-xr-x 2 radio radio 4096 Mar 31 18:01 mpd
-rw-r--r-- 1 radio radio    5 Mar 31 18:00 pid
-rwxrw-rw- 1 radio radio  807 Mar 15 15:28 .profile
drwxrw-rw- 2 radio radio 4096 Mar 17 22:16 .ssh
I believe that pid file is the one I created previously. No longer used since I created /home/radio/mpd/pid and changed /etc/mpd.conf to reflect that.

The entirety of cat /etc/mpd.conf:

Code: Select all

$ cat /etc/mpd.conf
# An example configuration file for MPD.
# Read the user manual for documentation: http://www.musicpd.org/doc/user/
# or /usr/share/doc/mpd/html/user.html


# Files and directories #######################################################
#
# This setting controls the top directory which MPD will search to discover the
# available audio files and add them to the daemon's online database. This
# setting defaults to the XDG directory, otherwise the music directory will be
# be disabled and audio files will only be accepted over ipc socket (using
# file:// protocol) or streaming files over an accepted protocol.
#
music_directory         "/home/radio/Library"
#
# This setting sets the MPD internal playlist directory. The purpose of this
# directory is storage for playlists created by MPD. The server will use
# playlist files not created by the server but only if they are in the MPD
# format. This setting defaults to playlist saving being disabled.
#
playlist_directory              "/home/radio/Library/playlists"

user                            "radio"
#
# This setting sets the location of the MPD database. This file is used to
# load the database at server start up and store the database while the
# server is not up. This setting defaults to disabled which will allow
# MPD to accept files over ipc socket (using file:// protocol) or streaming
# files over an accepted protocol.
#
db_file                 "/home/radio/mpd/tag_cache"
#
# These settings are the locations for the daemon log files for the daemon.
# These logs are great for troubleshooting, depending on your log_level
# settings.
#
# The special value "syslog" makes MPD use the local syslog daemon. This
# setting defaults to logging to syslog, or to journal if mpd was started as
# a systemd service.
#
log_file                        "/home/radio/mpd/mpd.log"
#
# This setting sets the location of the file which stores the process ID
# for use of mpd --kill and some init scripts. This setting is disabled by
# default and the pid file will not be stored.
#
pid_file                        "/home/radio/mpd/pid"
#
# This setting sets the location of the file which contains information about
# most variables to get MPD back into the same general shape it was in before
# it was brought down. This setting is disabled by default and the server
# state will be reset on server start up.
#
state_file                      "/home/radio/mpd/state"
#
# The location of the sticker database.  This is a database which
# manages dynamic information attached to songs.
#
sticker_file                   "/home/radio/mpd/sticker.sql"
#
###############################################################################


# General music daemon options ################################################
#
# This setting specifies the user that MPD will run as. MPD should never run as
# root and you may use this setting to make MPD change its user ID after
# initialization. This setting is disabled by default and MPD is run as the
# current user.
#
#
# This setting specifies the group that MPD will run as. If not specified
# primary group of user specified with "user" setting will be used (if set).
# This is useful if MPD needs to be a member of group such as "audio" to
# have permission to use sound card.
#
#group                          "nogroup"
#
# This setting sets the address for the daemon to listen on. Careful attention
# should be paid if this is assigned to anything other then the default, any.
# This setting can deny access to control of the daemon. Choose any if you want
# to have mpd listen on every address. Not effective if systemd socket
# activation is in use.
#
# For network
bind_to_address         "localhost"
#
# And for Unix Socket
#bind_to_address                "/run/mpd/socket"
#
# This setting is the TCP port that is desired for the daemon to get assigned
# to.
#
#port                           "6600"
#
# This setting controls the type of information which is logged. Available
# setting arguments are "default", "secure" or "verbose". The "verbose" setting
# argument is recommended for troubleshooting, though can quickly stretch
# available resources on limited hardware storage.
#
#log_level                      "default"
#
# Setting "restore_paused" to "yes" puts MPD into pause mode instead
# of starting playback after startup.
#
#restore_paused "no"
#
# This setting enables MPD to create playlists in a format usable by other
# music players.
#
#save_absolute_paths_in_playlists       "no"
#
# This setting defines a list of tag types that will be extracted during the
# audio file discovery process. The complete list of possible values can be
# found in the user manual.
#metadata_to_use        "artist,album,title,track,name,genre,date,composer,performer,disc"
#
# This example just enables the "comment" tag without disabling all
# the other supported tags:
#metadata_to_use "+comment"
#
# This setting enables automatic update of MPD's database when files in
# music_directory are changed.
#
#auto_update    "yes"
#
# Limit the depth of the directories being watched, 0 means only watch
# the music directory itself.  There is no limit by default.
#
#auto_update_depth "3"
#
###############################################################################


# Symbolic link behavior ######################################################
#
# If this setting is set to "yes", MPD will discover audio files by following
# symbolic links outside of the configured music_directory.
#
#follow_outside_symlinks        "yes"
#
# If this setting is set to "yes", MPD will discover audio files by following
# symbolic links inside of the configured music_directory.
#
#follow_inside_symlinks         "yes"
#
###############################################################################


# Zeroconf / Avahi Service Discovery ##########################################
#
# If this setting is set to "yes", service information will be published with
# Zeroconf / Avahi.
#
#zeroconf_enabled               "yes"
#
# The argument to this setting will be the Zeroconf / Avahi unique name for
# this MPD server on the network. %h will be replaced with the hostname.
#
#zeroconf_name                  "Music Player @ %h"
#
###############################################################################


# Permissions #################################################################
#
# If this setting is set, MPD will require password authorization. The password
# setting can be specified multiple times for different password profiles.
#
#password                        "password@read,add,control,admin"
#
# This setting specifies the permissions a user has who has not yet logged in.
#
#default_permissions             "read,add,control,admin"
#
###############################################################################


# Database #######################################################################
#

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

# Input #######################################################################
#

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

# QOBUZ input plugin
input {
        enabled    "no"
        plugin     "qobuz"
#        app_id     "ID"
#        app_secret "SECRET"
#        username   "USERNAME"
#        password   "PASSWORD"
#        format_id  "N"
}

# TIDAL input plugin
input {
        enabled      "no"
        plugin       "tidal"
#        token        "TOKEN"
#        username     "USERNAME"
#        password     "PASSWORD"
#        audioquality "Q"
}

# Decoder #####################################################################
#

decoder {
        plugin                  "hybrid_dsd"
        enabled                 "no"
#       gapless                 "no"
}

#
###############################################################################

# Audio Output ################################################################
#
# MPD supports various audio output types, as well as playing through multiple
# audio outputs at the same time, through multiple audio_output settings
# blocks. Setting this block is optional, though the server will only attempt
# autodetection for one sound card.
#
# An example of an ALSA output:
#
audio_output {
#       type            "shout"
        encoding        "mp3"
        encoder         "lame"
        type            "httpd"
        name            "Dead Pirate Radio"
        description     "Dead Pirate Radio"
        host            "localhost"
#       mount           "/mpd.mp3"
        port            "8000"
#       tags            "yes"
#       quality         "5.0"
        bitrate         "192"
#       password        "<password>"
#       protocol        "icecast2"
#       device          "hw:0,0"        # optional
#       mixer_type      "hardware"      # optional
#       mixer_device    "default"       # optional
#       mixer_control   "PCM"           # optional
#       mixer_index     "0"             # optional
}
#
# 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            "/var/lib/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)
# Please see README.Debian if you want mpd to play through the pulseaudio
# daemon started as part of your graphical desktop session!
#
#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
#}
#
## 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"
#
###############################################################################
And just for completion purposes:

Code: Select all

$ ls -la /home/radio/Library
total 4988
drwxrw-rw- 3 radio radio    4096 Mar 22 15:40  .
drwxrw-rw- 8 radio radio    4096 Mar 31 18:00  ..
drwxr-xr-x 2 radio radio    4096 Mar 21 22:53  playlists
-rwxr--r-- 1 radio radio 5092133 Mar 20 23:30 'Rick Astley - Never Gonna Give You Up.mp3'

Code: Select all

$ ls -la /home/radio/mpd
total 36
drwxr-xr-x 2 radio radio  4096 Mar 31 18:01 .
drwxrw-rw- 8 radio radio  4096 Mar 31 18:00 ..
-rw-r--r-- 1 radio radio  7023 Mar 31 18:01 mpd.log
-rw-r--r-- 1 radio radio     0 Mar 29 10:29 pid
-rw-r--r-- 1 radio radio   263 Mar 31 18:01 state
-rw-r--r-- 1 radio radio 12288 Mar 29 11:11 sticker.sql
-rw-r--r-- 1 radio radio   303 Mar 29 11:11 tag_cache
EDIT: Adding encoder "lame" to my /etc/mpd.conf file does seem to have made some kind of difference. After rebooting:

Code: Select all

radio@radio:~$ mpc ls
Rick Astley - Never Gonna Give You Up.mp3
radio@radio:~$ mpc ls | mpc add
radio@radio:~$ mpc -w update
Rick Astley - Never Gonna Give You Up.mp3
[paused]  #1/2   0:00/3:32 (0%)
volume: n/a   repeat: off   random: off   single: off   consume: off
ERROR: Failed to enable output "Dead Pirate Radio" (httpd); Failed to bind to '[::]:8000'; Failed to bind socket: Address already in use
radio@radio:~$ mpc play
Rick Astley - Never Gonna Give You Up.mp3
[paused]  #1/2   0:00/3:32 (0%)
volume: n/a   repeat: off   random: off   single: off   consume: off
ERROR: Failed to enable output "Dead Pirate Radio" (httpd); Failed to bind to '[::]:8000'; Failed to bind socket: Address already in use

Dennis99
Posts: 19
Joined: 2012-07-24 15:02

Re: Streaming with MPD and Icecast2

#25 Post by Dennis99 »

I'm sure we are nearly there!
I think we are trying to run as 2 different things which need different setups, I run as a system daemon, you are trying to run a user daemon and that needs the configs in a totally different place.
Thought I would RTFM! From the manual If you run MPD as a user daemon (and not as a system daemon) blah blah blah
https://www.musicpd.org/doc/html/user.html
So as a system daemon, clean up mpd.conf by cleaning up the httpd bit with only the following:

Code: Select all

audio_output {
         type          "httpd"        
         name        "Dead Pirate Radio"
         encoder     "lame"
         port            "8000"
         bitrate         "192"
         tags             "yes"
}
As root:

Code: Select all

# systemctl stop mpd.service

Code: Select all

# systemctl start mpd.service
Exit root

Code: Select all

mpc
Hopefully we get

Code: Select all

$ mpc
volume: n/a   repeat: on    random: on    single: off   consume: off
then try the mpc update mpc ls | mpc add mpc play

As to playlists, I put some songs in the song queue as a test, it's mpc save <filename> to save the playlist, it's saved as a .m3u
eg:
$ cat /mpd/playlists/test.m3u
Kate Bush- Them Heavy People.ogg
Love - Alone Again Or.ogg
etc
Then mpc clear to empty the queue and mpc load <filenam> to load the playlist.

Huecuva
Posts: 135
Joined: 2017-06-09 04:00

Re: Streaming with MPD and Icecast2

#26 Post by Huecuva »

I edited my /etc/mpd.conf file to comment out everything but what you said in the audio_output section. Everything else in that file is the same as before. Now:

Code: Select all

audio_output {
#	type		"shout"
#	encoding	"mp3"
	encoder		"lame"
	type		"httpd"
	name		"Dead Pirate Radio"
#	description	"Dead Pirate Radio"
#	host		"localhost"
#	mount		"/mpd.mp3"
	port		"8000"
	tags		"yes"
#	quality		"5.0"
	bitrate		"192"
#	password	"<password>"
#	protocol	"icecast2"
#	device		"hw:0,0"	# optional
#	mixer_type      "hardware"      # optional
#	mixer_device	"default"	# optional
#	mixer_control	"PCM"		# optional
#	mixer_index	"0"		# optional
}

Code: Select all

radio@radio:~$ su -
Password: 
root@radio:~# nano /etc/mpd.conf
root@radio:~# systemctl stop mpd.service
root@radio:~# systemctl start mpd.service
root@radio:~# exit
logout
radio@radio:~$ mpc
Rick Astley - Never Gonna Give You Up.mp3
[paused]  #1/3   0:00/3:32 (0%)
volume: n/a   repeat: off   random: off   single: off   consume: off
radio@radio:~$ mpc -w update
Rick Astley - Never Gonna Give You Up.mp3
[paused]  #1/3   0:00/3:32 (0%)
volume: n/a   repeat: off   random: off   single: off   consume: off
radio@radio:~$ mpc play
Rick Astley - Never Gonna Give You Up.mp3
[paused]  #1/3   0:00/3:32 (0%)
volume: n/a   repeat: off   random: off   single: off   consume: off
ERROR: Failed to enable output "Dead Pirate Radio" (httpd); Failed to bind to '[::]:8000'; Failed to bind socket: Address already in use
I'll worry about playlists after I get it actually streaming. I guess I will actually have to figure out whether httpd or shout is better for icecast2 streaming or if I even need icecast2 to do what I want to do at some point as well.

Huecuva
Posts: 135
Joined: 2017-06-09 04:00

Re: Streaming with MPD and Icecast2

#27 Post by Huecuva »

So it appears that in order to set up multiple MPD streams, I do in fact need to use icecast.

I'll just worry about getting one stream working first.

Dennis99
Posts: 19
Joined: 2012-07-24 15:02

Re: Streaming with MPD and Icecast2

#28 Post by Dennis99 »

No you don't.
You can have a different mpd.conf with a different name with differently named music directory if you want and playlist(s) and differently named tag_cache, log, pid. state and sticker.sql files.
In the new conf, have the same user but a different port (eg 6610) and on the audio output httpd a different port (eg 8002).
Then start the new mpd with

Code: Select all

$ sudo mpd /etc/<newconf>.conf
Then it's

Code: Select all

$ mpc -h 127.0.0.1 -p 6610

Code: Select all

$ mpc -h 127.0.0.1 -p 6610 -w update

Code: Select all

$ mpc -h 127.0.0.1 -p 6610 ls | mpc -h 127.0.0.1 -p 6610 add

Code: Select all

mpc -h 127.0.0.1 -p 6610 play
Where h is the host and p the port.
Just as an aside the original can still be seen on

Code: Select all

$ mpc
or

Code: Select all

$ mpc -h 127.0.0.1 -p 6600[
It will run in tandem with the original, so in theory you could have, say, a top 40 music directory and say a "gold" directory and playlists running together.
The world is your lobster.

Huecuva
Posts: 135
Joined: 2017-06-09 04:00

Re: Streaming with MPD and Icecast2

#29 Post by Huecuva »

Ah, well, that's more informative than any of the tutorials or walkthroughs or even the mpd man page or the mpd page on the archlinux wiki, as none of those have been very helpful about how to run more than one instance of mpd. However, how do you set up more than one mpd.conf since mpd will always look in the same location for the mpd.conf file and you can't have more than one file of the same name in the same folder?

I'm still working on getting this first stream working though. It says it failed to enable httpd output and the address is already in use. I think I'm going to try shout and see if I can't get that working. I really don't understand why there aren't more comprehensive tutorials for this.

Dennis99
Posts: 19
Joined: 2012-07-24 15:02

Re: Streaming with MPD and Icecast2

#30 Post by Dennis99 »

Dennis99 wrote: You can have a different mpd.conf with a different name
Then start the new mpd with

Code: Select all

$ sudo mpd /etc/<newconf>.conf

Huecuva
Posts: 135
Joined: 2017-06-09 04:00

Re: Streaming with MPD and Icecast2

#31 Post by Huecuva »

Oh, I missed that part of your post. Heh. So then does that make all the different instances of mpd start on boot with their correct .conf files?

Huecuva
Posts: 135
Joined: 2017-06-09 04:00

Re: Streaming with MPD and Icecast2

#32 Post by Huecuva »

So I changed the type to "shout" and changed the port to "6600". It didn't complain about being unable to start the type this time but it's still complaining about the port and socket. Here is systemctl status mpd.service:

Code: Select all

● mpd.service - Music Player Daemon
   Loaded: loaded (/lib/systemd/system/mpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2020-04-05 12:16:27 PDT; 11s ago
     Docs: man:mpd(1)
           man:mpd.conf(5)
           file:///usr/share/doc/mpd/user-manual.html
  Process: 10161 ExecStart=/usr/bin/mpd --no-daemon $MPDCONF (code=exited, status=1/FAILURE)
 Main PID: 10161 (code=exited, status=1/FAILURE)

Apr 05 12:16:26 radio systemd[1]: Starting Music Player Daemon...
Apr 05 12:16:27 radio mpd[10161]: Apr 05 12:16 : exception: Failed to bind to '[::1]:6600'
Apr 05 12:16:27 radio mpd[10161]: Apr 05 12:16 : exception: nested: Failed to bind socket: Address already in use
Apr 05 12:16:27 radio systemd[1]: mpd.service: Main process exited, code=exited, status=1/FAILURE
Apr 05 12:16:27 radio systemd[1]: mpd.service: Failed with result 'exit-code'.
Apr 05 12:16:27 radio systemd[1]: Failed to start Music Player Daemon.
I don't know what else could be using localhost and I'm not sure how to figure that out. Also, after rebooting it has a whole bunch more complaints. I'll post more about those when I've moved to my other rig to better be able to work on this.

EDIT #1: So after changing type to "shout" mpd had a whole bunch of other complaints. Every time it complained about something I edited /etc/mpd.conf until I ended up with:

Code: Select all

audio_output {
	type		"shout"
	encoding	"mp3"
	encoder		"lame"
#	type		"httpd"
	name		"Dead Pirate Radio"
#	description	"Dead Pirate Radio"
	host		"localhost"
	mount		"/mpd.mp3"
	port		"6700"
	tags		"yes"
#	quality		"5.0"
	bitrate		"192"
	password	"<password>"
#	protocol	"icecast2"
#	device		"hw:0,0"	# optional
#	mixer_type      "hardware"      # optional
#	mixer_device	"default"	# optional
#	mixer_control	"PCM"		# optional
#	mixer_index	"0"		# optional
}
Now it gives me this error. I thought uncommenting encoding "mp3" would fix that but it made no difference at all.

Code: Select all

root@radio:~# systemctl status mpd.service
● mpd.service - Music Player Daemon
   Loaded: loaded (/lib/systemd/system/mpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2020-04-05 12:42:00 PDT; 14min ago
     Docs: man:mpd(1)
           man:mpd.conf(5)
           file:///usr/share/doc/mpd/user-manual.html
  Process: 450 ExecStart=/usr/bin/mpd --no-daemon $MPDCONF (code=exited, status=1/FAILURE)
 Main PID: 450 (code=exited, status=1/FAILURE)

Apr 05 12:41:55 radio systemd[1]: Starting Music Player Daemon...
Apr 05 12:42:00 radio mpd[450]: Apr 05 12:42 : exception: Failed to configure output in line 240
Apr 05 12:42:00 radio mpd[450]: Apr 05 12:42 : exception: nested: Need full audio format specification
Apr 05 12:42:00 radio systemd[1]: mpd.service: Main process exited, code=exited, status=1/FAILURE
Apr 05 12:42:00 radio systemd[1]: mpd.service: Failed with result 'exit-code'.
Apr 05 12:42:00 radio systemd[1]: Failed to start Music Player Daemon.
EDIT#2: Well, that's odd. After changing my /etc/mpd.conf file back to what I had with httpd:

Code: Select all

root@radio:~# systemctl stop mpd
root@radio:~# systemctl start mpd
root@radio:~# mpc
Rick Astley - Never Gonna Give You Up.mp3
[paused]  #1/3   0:00/3:32 (0%)
volume: n/a   repeat: off   random: off   single: off   consume: off
root@radio:~# systemctl status pd
Unit pd.service could not be found.
root@radio:~# systemctl status mpd
● mpd.service - Music Player Daemon
   Loaded: loaded (/lib/systemd/system/mpd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-04-05 13:17:58 PDT; 17s ago
     Docs: man:mpd(1)
           man:mpd.conf(5)
           file:///usr/share/doc/mpd/user-manual.html
 Main PID: 658 (mpd)
    Tasks: 6 (limit: 4915)
   Memory: 13.0M
   CGroup: /system.slice/mpd.service
           └─658 /usr/bin/mpd --no-daemon

Apr 05 13:17:57 radio systemd[1]: Starting Music Player Daemon...
Apr 05 13:17:58 radio systemd[1]: Started Music Player Daemon.
Now let's see what happens after I reboot. TBC.

EDIT#3: Alright. After rebooting:

Code: Select all

radio@radio:~$ mpc
Rick Astley - Never Gonna Give You Up.mp3
[paused]  #1/3   0:00/3:32 (0%)
volume: n/a   repeat: off   random: off   single: off   consume: off
radio@radio:~$ mpc play
Rick Astley - Never Gonna Give You Up.mp3
[paused]  #1/3   0:00/3:32 (0%)
volume: n/a   repeat: off   random: off   single: off   consume: off
ERROR: Failed to enable output "Dead Pirate Radio" (httpd); Failed to bind to '[::]:8000'; Failed to bind socket: Address already in use
radio@radio:~$ systemctl status mpd
● mpd.service - Music Player Daemon
   Loaded: loaded (/lib/systemd/system/mpd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-04-05 13:26:43 PDT; 29s ago
     Docs: man:mpd(1)
           man:mpd.conf(5)
           file:///usr/share/doc/mpd/user-manual.html
 Main PID: 449 (mpd)
    Tasks: 6 (limit: 4915)
   Memory: 41.2M
   CGroup: /system.slice/mpd.service
           └─449 /usr/bin/mpd --no-daemon
And going to <myIP:8000> still just times out. I don't know what the hell is going on here.

Here are the results of ss -natu, if that helps at all:

Code: Select all

Netid        State         Recv-Q        Send-Q                  Local Address:Port                  Peer Address:Port         
udp          UNCONN        0             0                             0.0.0.0:68                         0.0.0.0:*            
udp          UNCONN        0             0                             0.0.0.0:68                         0.0.0.0:*            
udp          UNCONN        0             0                     169.254.<sub.net?>:137                        0.0.0.0:*            
udp          UNCONN        0             0                       169.254.<?.???>:137                        0.0.0.0:*            
udp          UNCONN        0             0                       <otherip>:137                        0.0.0.0:*            
udp          UNCONN        0             0                       <myLANip>:137                        0.0.0.0:*            
udp          UNCONN        0             0                             0.0.0.0:137                        0.0.0.0:*            
udp          UNCONN        0             0                     169.254.<sub.net?>:138                        0.0.0.0:*            
udp          UNCONN        0             0                       169.254.<?.???>:138                        0.0.0.0:*            
udp          UNCONN        0             0                       <otherip>:138                        0.0.0.0:*            
udp          UNCONN        0             0                       <myLANip>:138                        0.0.0.0:*            
udp          UNCONN        0             0                             0.0.0.0:138                        0.0.0.0:*            
tcp          LISTEN        0             128                           0.0.0.0:22                         0.0.0.0:*            
tcp          LISTEN        0             50                            0.0.0.0:445                        0.0.0.0:*            
tcp          LISTEN        0             5                             0.0.0.0:8000                       0.0.0.0:*            
tcp          LISTEN        0             5                           127.0.0.1:6600                       0.0.0.0:*            
tcp          LISTEN        0             50                            0.0.0.0:139                        0.0.0.0:*            
tcp          ESTAB         0             0                       <myLANip>:22                   <myLANip>:40358        
tcp          LISTEN        0             128                              [::]:22                            [::]:*            
tcp          LISTEN        0             50                               [::]:445                           [::]:*            
tcp          LISTEN        0             5                               [::1]:6600                          [::]:*            
tcp          LISTEN        0             50                               [::]:139                           [::]:*    
And here is everything from mpd.log dated today:

Code: Select all

Apr 05 12:07 : exception: RTIOThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted
Apr 05 12:07 : exception: OutputThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted
Apr 05 12:07 : exception: Failed to enable output "Dead Pirate Radio" (httpd)
Apr 05 12:07 : exception: nested: Failed to bind to '[::]:8000'
Apr 05 12:07 : exception: Failed to bind socket: Address already in use
Apr 05 12:29 : player: played "Rick Astley - Never Gonna Give You Up.mp3"
Apr 05 13:17 : exception: Failed to enable output "Dead Pirate Radio" (httpd)
Apr 05 13:17 : exception: nested: Failed to bind to '[::]:8000'
Apr 05 13:17 : exception: Failed to bind socket: Address already in use
Apr 05 13:18 : client: [0] opened from [::1]:46178
Apr 05 13:18 : client: [0] closed
Apr 05 13:25 : player: played "Rick Astley - Never Gonna Give You Up.mp3"
Apr 05 13:26 : exception: Failed to enable output "Dead Pirate Radio" (httpd)
Apr 05 13:26 : exception: nested: Failed to bind to '[::]:8000'
Apr 05 13:26 : exception: Failed to bind socket: Address already in use
Apr 05 13:26 : client: [0] opened from [::1]:39212
Apr 05 13:26 : client: [0] closed
Apr 05 13:26 : client: [1] opened from [::1]:39214
Apr 05 13:26 : exception: Failed to enable output "Dead Pirate Radio" (httpd)
Apr 05 13:26 : exception: nested: Failed to bind to '[::]:8000'
Apr 05 13:26 : exception: Failed to bind socket: Address already in use
Apr 05 13:26 : exception: Failed to enable output "Dead Pirate Radio" (httpd)
Apr 05 13:26 : exception: nested: Failed to bind to '[::]:8000'
Apr 05 13:26 : exception: Failed to bind socket: Address already in use
Apr 05 13:26 : client: [1] closed

Huecuva
Posts: 135
Joined: 2017-06-09 04:00

Re: Streaming with MPD and Icecast2

#33 Post by Huecuva »

It seems like I may end up having to use Alsa instead of httpd or shout.

Huecuva
Posts: 135
Joined: 2017-06-09 04:00

Re: Streaming with MPD and Icecast2

#34 Post by Huecuva »

So after adding a bind_to_address to my audio_output section and changing the port thus:

Code: Select all

audio_output {
#       type            "shout"
#       type            "alsa"
#       encoding        "mp3"
#       encoder         "lame"
        type            "httpd"
        name            "Dead Pirate Radio"
#       description     "Dead Pirate Radio"
        bind_to_address "<MyLANIP>"
#       host            "localhost"
#       mount           "/mpd.mp3"
        port            "8001"
        tags            "yes"
#       quality         "5.0"
        bitrate         "192"
#       password        "<password>"
#       protocol        "icecast2"
#       device          "hw:0,0"        # optional
#       mixer_type      "hardware"      # optional
#       mixer_device    "default"       # optional
#       mixer_control   "PCM"           # optional
#       mixer_index     "0"             # optional
}
and then editing the port forwarding in my router and restarting mpd:

Code: Select all

root@radio:~# systemctl restart mpd
root@radio:~# mpc
Rick Astley - Never Gonna Give You Up.mp3
[paused]  #1/3   0:00/3:32 (0%)
volume: n/a   repeat: off   random: off   single: off   consume: off
root@radio:~# mpc play
Rick Astley - Never Gonna Give You Up.mp3
[playing] #1/3   0:00/3:32 (0%)
volume: n/a   repeat: off   random: off   single: off   consume: off
Here is systemctl status mpd:

Code: Select all

● mpd.service - Music Player Daemon
   Loaded: loaded (/lib/systemd/system/mpd.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-04-09 19:30:48 PDT; 14min ago
     Docs: man:mpd(1)
           man:mpd.conf(5)
           file:///usr/share/doc/mpd/user-manual.html
 Main PID: 11144 (mpd)
    Tasks: 6 (limit: 4915)
   Memory: 13.5M
   CGroup: /system.slice/mpd.service
           └─11144 /usr/bin/mpd --no-daemon

Apr 09 19:30:47 radio systemd[1]: Starting Music Player Daemon...
Apr 09 19:30:48 radio systemd[1]: Started Music Player Daemon.
Here is everything from mpd.log dated today after my failed Alsa attempt:

Code: Select all

Apr 09 19:28 : client: [1] closed
Apr 09 19:30 : player: played "Rick Astley - Never Gonna Give You Up.mp3"
Apr 09 19:30 : client: [0] opened from [::1]:41178
Apr 09 19:30 : client: [0] closed
Apr 09 19:30 : client: [1] opened from [::1]:41180
Apr 09 19:30 : client: [1] closed
Apr 09 19:34 : player: played "Rick Astley - Never Gonna Give You Up.mp3"
Apr 09 19:37 : player: played "Rick Astley - Never Gonna Give You Up.mp3"
Apr 09 19:41 : player: played "Rick Astley - Never Gonna Give You Up.mp3"
Apr 09 19:47 : client: [2] opened from [::1]:41190
Apr 09 19:47 : client: [2] closed
However, going to <MyPublicIP>:8001 still just times out. I don't know if this is some kind of networking issue now or if my streaming just still isn't working.

Dennis99
Posts: 19
Joined: 2012-07-24 15:02

Re: Streaming with MPD and Icecast2

#35 Post by Dennis99 »

Just for interest, other streamers are available especially into Icecast and I've tried them all:
Ices (ogg only): http://icecast.org/ices/
ezstream: http://icecast.org/ezstream/
butt: https://danielnoethen.de/butt/
Liquidsoap (proably the most complicated but fully featured): https://www.liquidsoap.info/
New talk on Liquidsoap
https://www.youtube.com/watch?v=GmMUuKyy6hY

Huecuva
Posts: 135
Joined: 2017-06-09 04:00

Re: Streaming with MPD and Icecast2

#36 Post by Huecuva »

I don't need too many fancy features, so I won't be using Liquidsoap if it's that complicated. Mpd seems simple enough but it seems to be refusing to work so I want to stick to simple. My music is 99.9% mp3 so that rules out ices of that's ogg only. Is ezstream easier to use than mpd? I might give that one a try. At this point I'm really starting to lose patience with mpd.

Dennis99
Posts: 19
Joined: 2012-07-24 15:02

Re: Streaming with MPD and Icecast2

#37 Post by Dennis99 »

Once you get your head round Liquidsoap, you can get an output for an Icecast server which is what you want with one line!
liquidsoap 'output.icecast(%vorbis,host = "HOST", port = PORT,password = "PASSWORD", mount = "mount.ogg", mksafe(playlist("playlist.txt")))'

where playlist.txt is a list of tracks one per line with the full path /media/usb/The Aurora Principle - Before the Storm.ogg

Image

or change to mp3 by changing 2 things:
liquidsoap 'output.icecast(%mp3,host = "HOST", port = PORT,password = "PASSWORD", mount = "mount.mp3", mksafe(playlist("playlist.txt")))'

Image
You can also normalize and do smart crossfades still on 1 line if you want:
liquidsoap 'output.icecast(%mp3,host = "HOST", port = PORT,password = "PASSWORD", mount = "mount.mp3", mksafe(smart_crossfade(normalize(playlist("playlist.txt")))))'

Huecuva
Posts: 135
Joined: 2017-06-09 04:00

Re: Streaming with MPD and Icecast2

#38 Post by Huecuva »

Well, it turns out my stream has been working. I was able to connect to it if I went to my mpd server's LAN IP. It wasn't working on my public IP because the DMZ hadn't been configured correctly. Or rather, it was configured correctly but the modem/gateway was never rebooted.

My stream is all working now. Man, this has been frustrating. I have one mpd stream set up without icecast and soon I plan to get to work setting up the other mpd streams.

I will keep this thread bookmarked though, in case I decide I want to try out Liquidsoap. It does seem pretty interesting. I'm not much interested in having all the fancy features right now but one day I may change my mind.

Thanks for the help, mate. You're a hero.

Huecuva
Posts: 135
Joined: 2017-06-09 04:00

Re: <SOLVED> Streaming with MPD and Icecast2

#39 Post by Huecuva »

The main issue of this thread is taken care of, so I'm not going to set it back to unsolved, but running more than one instance of mpd is proving more troublesome than you lead me to believe. If this fails to get any attention I'll make a new thread. I've already posted about this on the mpd forum but the one guy who has bothered to respond there seems a wee bit condescending so far so we'll see how well that goes.

I copied my /etc/mpd.conf file and changed the path to the files that needed their own paths, changed the port for the user (now 6601) and output (8002) and the music source directory path as well as the music output port and I'm getting an error:

Code: Select all

root@radio:~# mpd /etc/mpd2.conf
Apr 11 18:12 : exception: Failed to bind to '[::]:6601'
Apr 11 18:12 : exception: nested: Failed to bind socket: Address already in use
The second mpd instance will not start automatically. When I reboot the mpd server, I can log into it and type in mpc and get the status for 6600 which is the first instance and it works but if I type in mpc -h 127.0.0.1 -p 6601 it says connection refused. However, despite the error above, it will work if run manually.

EDIT: After changing the user port of the second mpd to 6700, I get far fewer errors and the errors I do get I still get for the instance of mpd that does work, so clearly that error means nothing. However, the second instance of mpd still will not start on boot. I don't know how to make it start on boot.

Dennis99
Posts: 19
Joined: 2012-07-24 15:02

Re: <SOLVED> Streaming with MPD and Icecast2

#40 Post by Dennis99 »

I bet the condescending blokes name is Max, I think he is the main developer and unless you have the very latest version he's not interested.
The second instance needs you to fiddle about with systemd and I only have a little knowledge of it.
Have a read of https://fedoramagazine.org/systemd-template-unit-files/, I think it's what you need.

Post Reply