You are not logged in.

#1 2008-09-29 10:08:47

k0rfain
Member
Registered: 2007-11-10
Posts: 28

mpd and ncmpcpp

well I installed ncmpcpp, but when ever I try to run it I get this:

Cannot connect to mpd: problems connecting to "localhost" on port 6600: Connection refused

I have no clue what mpd was/is, so I installed it.. and ran "mpd"

unable to bind port 6600: Address already in use
maybe MPD is still running?

I am not familiar with mpd so I dont know what to do... I tried searching around but didnt find anything that solved my problem. Thankshave

Last edited by k0rfain (2008-09-29 10:09:09)

Offline

#2 2008-09-29 10:55:35

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: mpd and ncmpcpp

Hmm, could you paste your .mpdconf here?


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#3 2008-09-29 11:36:43

k0rfain
Member
Registered: 2007-11-10
Posts: 28

Re: mpd and ncmpcpp

/etc/mpd.conf

# An example configuration file for MPD
# See the mpd.conf man page for a more detailed description of each parameter.

######################## REQUIRED PATHS ########################
#music_directory                 "~/music"
#playlist_directory              "~/playlists"
#db_file                         "~/mpd.db"
#log_file                        "~/mpd.log"
#error_file                      "~/mpd.error"

#music_directory                 "path_to_your_music_collection"
playlist_directory              "/var/lib/mpd/playlists"
db_file                         "/var/lib/mpd/mpd.db"
log_file                        "/var/log/mpd/mpd.log"
error_file                      "/var/log/mpd/mpd.error"

# Note: ~ is the home directory of user set in the "user" option
################################################################


######################## OPTIONAL PATHS ########################
#
# If you wish to use mpd --kill to stop MPD, then you must
# specify a file here in which to store MPD's process ID.
#
#pid_file                        "~/.mpd/mpd.pid"
pid_file                        "/var/run/mpd/mpd.pid"
#
# If specified, MPD will save its current state (playlist,
# current song, playing/paused, etc.) at exit.  This will be
# used to restore the session the next time it is run.
#
#state_file                      "~/.mpd/mpdstate"
state_file                      "/var/lib/mpd/mpdstate"
#
################################################################


######################## DAEMON OPTIONS ########################
#
# If started as root, MPD will drop root privileges and run as
# this user instead.  Otherwise, MPD will run as the user it was
# started by.  If left unspecified, MPD will not drop root
# privileges at all (not recommended).

user                            "mpd"

# The address and port to listen on.
#
bind_to_address                 "127.0.0.1"
#bind_to_address                 "any"
#port                            "6600"
#
# Controls the amount of information that is logged.  Can be
# "default", "secure", or "verbose".
#
#log_level                       "default"
#
################################################################


########################## PERMISSIONS #########################
#
# MPD can require that users specify a password before using it.
# You may specify one ore more here, along with what users who
# log in with that password are allowed to do.
#
#password                        "password@read,add,control,admin"
#
# Specifies what permissions a user who has not logged in with a
# password has.  By default, all users have full access to MPD
# if no password is specified above, or no access if one or
# more passwords are specified.
#
#default_permissions             "read,add,control,admin"
#
################################################################


########################## AUDIO OUTPUT ########################
#
# MPD supports many audio output types, as well as playing
# through multiple audio outputs at the same time.  You can
# specify one or more here.  If you don't specify any, MPD will
# automatically scan for a usable audio output.
#
# See <http://mpd.wikia.com/wiki/Configuration#Audio_Outputs>
# for examples of other audio outputs.
#
# An example of an ALSA output:
#
#audio_output {
#        type                    "alsa"
#        name                    "My ALSA Device"
#        device                  "hw:0,0"     # optional
#        format                  "44100:16:2" # optional
#}
#
# An example of an OSS output:
#
#audio_output {
#        type                    "oss"
#        name                    "My OSS Device"
#        device                  "/dev/dsp"   # optional
#        format                  "44100:16:2" # optional
#}
#
# An example of a shout output (for streaming to Icecast):
#
#audio_output {
#        type                    "shout"
#        name                    "My Shout Stream"
#        host                    "localhost"
#        port                    "8000"
#        mount                   "/mpd.ogg"
#        password                "hackme"
#        quality                 "5.0"
#        bitrate                 "128"
#        format                  "44100:16:1"
#        user                    "source"                # optional
#        description             "My Stream Description" # optional
#        genre                   "jazz"                  # optional
#        public                  "no"                    # optional
#}
#
# Force all decoded audio to be converted to this format before
# being passed to the audio outputs.
#
#audio_output_format             "44100:16:2"
#
################################################################


############################# MIXER ############################
#
# MPD needs to know what mixer settings to change when you
# adjust the volume.  If you don't specify one here, MPD will
# pick one based on which ones it was compiled with support for.
#
# An example for controlling an ALSA mixer:
#
#mixer_type                      "alsa"
#mixer_device                    "default"
#mixer_control                   "PCM"
#
# An example for controlling an OSS mixer:
#
#mixer_type                      "oss"
#mixer_device                    "/dev/mixer"
#mixer_control                   "PCM"
#
# If you want MPD to adjust the volume of audio sent to the
# audio outputs, you can tell it to use the software mixer:
#
#mixer_type                      "software"
#
################################################################


######################### NORMALIZATION ########################
#
# Specifies the type of ReplayGain to use.  Can be "album" or
# "track".  ReplayGain will not be used if not specified.  See
# <http://www.replaygain.org> for more details.
#
#replaygain                      "album"
#
# Sets the pre-amp used for files that have ReplayGain tags.
#
#replaygain_preamp               "0"
#
# Enable on the fly volume normalization.  This will cause the
# volume of all songs played to be adjusted so that they sound
# as though they are of equal loudness.
#
#volume_normalization            "no"
#
################################################################


########################### BUFFERING ##########################
#
# The size of the buffer containing decoded audio.  You probably
# shouldn't change this.
#
#audio_buffer_size               "2048"
#
# How much of the buffer to fill before beginning to play.
#
#buffer_before_play              "0%"
#
# Similar options for the HTTP stream buffer.  If you hear
# skipping while playing HTTP streams, you may wish to increase
# these.
#
#http_buffer_size                "128"
#http_prebuffer_size             "25%"
#
################################################################


########################### HTTP PROXY #########################
#
# Specifies the HTTP proxy to use for playing HTTP streams.
#
#http_proxy_host                 "proxy.isp.com"
#http_proxy_port                 "8080"
#http_proxy_user                 "user"
#http_proxy_password             "password"
#
################################################################


############################# LIMITS ###########################
#
# These are various limits to prevent MPD from using too many
# resources.  You should only change them if they start
# restricting your usage of MPD.
#
#connection_timeout              "60"
#max_connections                 "5"
#max_playlist_length             "16384"
#max_command_list_size           "2048"
#max_output_buffer_size          "8192"
#
################################################################


###################### CHARACTER ENCODINGS #####################
#
# If file or directory names do not display correctly, then you
# may need to change this.  In most cases it should be either
# "ISO-8859-1" or "UTF-8".  You must recreate your database
# after changing this (use mpd --create-db).
#
#filesystem_charset              "ISO-8859-1"
#
# The encoding that ID3v1 tags should be converted from.
#
#id3v1_encoding                  "ISO-8859-1"
#
################################################################


######################### OTHER OPTIONS ########################
#
# The metadata types MPD will recognize.
#
#metadata_to_use                  "artist,album,title,track,name,genre,date,composer,performer,disc"
#
# Enable this if you wish to use your MPD created playlists in
# other music players.
#
#save_absolute_paths_in_playlists "no"
#
################################################################

Offline

#4 2008-09-29 12:13:54

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: mpd and ncmpcpp

Ok. Do you by any chance start mpd at boot or as a daemon (/etc/rc.d/mpd start)?
Because in that case, as normal user you have no permissions to play music. You can fix this by either specifying a user in the conf file (look under "daemon options") or just run mpd as a normal user from CLI.


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#5 2008-09-29 12:25:42

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: mpd and ncmpcpp

You better just start mpd as a user. Much less hassle.
And be sure you have write permissions for /var/lib/mpd/


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#6 2008-09-29 12:48:43

kclive18
Member
From: Columbus, Ohio, USA
Registered: 2008-05-08
Posts: 219

Re: mpd and ncmpcpp

I use mpd as a daemon on my laptop and it works just fine.  You just have to make sure you change this line:

user                            "mpd"

And replace "mpd" with your user in quotes.


My Rigs:
- Mid-2007 iMac 20", Intel 2GHz Core 2 Duo, 2x1GB DDR2-800, 250GB SATA HDD, and...MIGHTY MOUSE!!! tongue, OSX 10.5 Leopard, ATI Radeon 2400XT 128MB
- HP zv6203cl, AMD Athlon 64 3200 S939, 2x512MB DDR400, 80GB 4200rpm HDD, ATI Radeon Xpress 200M 128MB, Arch i686 cool
- 1986 Gibson SG Junior Cherry Red, Ibanez 15W amp, DigiTech RP250 modeling processor

Offline

#7 2008-09-29 14:34:03

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: mpd and ncmpcpp

ncmpcpp? Good choice wink On the first run, I also had some problems getting mpd to work, but the hints given above are exactly those, which I had wrong, so I'm sure you'll get it to work.

Offline

#8 2008-09-29 21:11:20

k0rfain
Member
Registered: 2007-11-10
Posts: 28

Re: mpd and ncmpcpp

im still getting this error when i try running ncmpcpp

Cannot connect to mpd: problems connecting to "localhost" on port 6600: Connection refused

Offline

#9 2008-09-29 21:18:02

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: mpd and ncmpcpp

Please, provide more details: did you follow all the above suggestions? And how?


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#10 2008-09-29 21:21:46

k0rfain
Member
Registered: 2007-11-10
Posts: 28

Re: mpd and ncmpcpp

i re-edited my conf file,

# An example configuration file for MPD
# See the mpd.conf man page for a more detailed description of each parameter.

######################## REQUIRED PATHS ########################
#music_directory                 "/home/k0rfain/Music"
#playlist_directory              "~/playlists"
#db_file                         "~/mpd.db"
#log_file                        "~/mpd.log"
#error_file                      "~/mpd.error"

music_directory                 "/home/k0rfain/Music"
playlist_directory              "~/playlists"
db_file                         "~/mpd.db"
log_file                        "~/mpd.log"
error_file                      "~/mpd.error"

# Note: ~ is the home directory of user set in the "user" option
################################################################


######################## OPTIONAL PATHS ########################
#
# If you wish to use mpd --kill to stop MPD, then you must
# specify a file here in which to store MPD's process ID.
#
pid_file                        "~/.mpd/mpd.pid"
pid_file                        "/var/run/mpd/mpd.pid"
#
# If specified, MPD will save its current state (playlist,
# current song, playing/paused, etc.) at exit.  This will be
# used to restore the session the next time it is run.
#
state_file                      "~/.mpd/mpdstate"
state_file                      "/var/lib/mpd/mpdstate"
#
################################################################


######################## DAEMON OPTIONS ########################
#
# If started as root, MPD will drop root privileges and run as
# this user instead.  Otherwise, MPD will run as the user it was
# started by.  If left unspecified, MPD will not drop root
# privileges at all (not recommended).

user                            "k0rfain"

# The address and port to listen on.
#
bind_to_address                 "127.0.0.1"
bind_to_address                 "any"
port                            "6600"
#
# Controls the amount of information that is logged.  Can be
# "default", "secure", or "verbose".
#
#log_level                       "default"
#
################################################################


########################## PERMISSIONS #########################
#
# MPD can require that users specify a password before using it.
# You may specify one ore more here, along with what users who
# log in with that password are allowed to do.
#
#password                        "password@read,add,control,admin"
#
# Specifies what permissions a user who has not logged in with a
# password has.  By default, all users have full access to MPD
# if no password is specified above, or no access if one or
# more passwords are specified.
#
#default_permissions             "read,add,control,admin"
#
################################################################


########################## AUDIO OUTPUT ########################
#
# MPD supports many audio output types, as well as playing
# through multiple audio outputs at the same time.  You can
# specify one or more here.  If you don't specify any, MPD will
# automatically scan for a usable audio output.
#
# See <http://mpd.wikia.com/wiki/Configuration#Audio_Outputs>
# for examples of other audio outputs.
#
# An example of an ALSA output:
#
#audio_output {
#        type                    "alsa"
#        name                    "My ALSA Device"
#        device                  "hw:0,0"     # optional
#        format                  "44100:16:2" # optional
#}
#
# An example of an OSS output:
#
#audio_output {
#        type                    "oss"
#        name                    "My OSS Device"
#        device                  "/dev/dsp"   # optional
#        format                  "44100:16:2" # optional
#}
#
# An example of a shout output (for streaming to Icecast):
#
#audio_output {
#        type                    "shout"
#        name                    "My Shout Stream"
#        host                    "localhost"
#        port                    "8000"
#        mount                   "/mpd.ogg"
#        password                "hackme"
#        quality                 "5.0"
#        bitrate                 "128"
#        format                  "44100:16:1"
#        user                    "source"                # optional
#        description             "My Stream Description" # optional
#        genre                   "jazz"                  # optional
#        public                  "no"                    # optional
#}
#
# Force all decoded audio to be converted to this format before
# being passed to the audio outputs.
#
#audio_output_format             "44100:16:2"
#
################################################################


############################# MIXER ############################
#
# MPD needs to know what mixer settings to change when you
# adjust the volume.  If you don't specify one here, MPD will
# pick one based on which ones it was compiled with support for.
#
# An example for controlling an ALSA mixer:
#
#mixer_type                      "alsa"
#mixer_device                    "default"
#mixer_control                   "PCM"
#
# An example for controlling an OSS mixer:
#
#mixer_type                      "oss"
#mixer_device                    "/dev/mixer"
#mixer_control                   "PCM"
#
# If you want MPD to adjust the volume of audio sent to the
# audio outputs, you can tell it to use the software mixer:
#
#mixer_type                      "software"
#
################################################################


######################### NORMALIZATION ########################
#
# Specifies the type of ReplayGain to use.  Can be "album" or
# "track".  ReplayGain will not be used if not specified.  See
# <http://www.replaygain.org> for more details.
#
#replaygain                      "album"
#
# Sets the pre-amp used for files that have ReplayGain tags.
#
#replaygain_preamp               "0"
#
# Enable on the fly volume normalization.  This will cause the
# volume of all songs played to be adjusted so that they sound
# as though they are of equal loudness.
#
#volume_normalization            "no"
#
################################################################


########################### BUFFERING ##########################
#
# The size of the buffer containing decoded audio.  You probably
# shouldn't change this.
#
#audio_buffer_size               "2048"
#
# How much of the buffer to fill before beginning to play.
#
#buffer_before_play              "0%"
#
# Similar options for the HTTP stream buffer.  If you hear
# skipping while playing HTTP streams, you may wish to increase
# these.
#
#http_buffer_size                "128"
#http_prebuffer_size             "25%"
#
################################################################


########################### HTTP PROXY #########################
#
# Specifies the HTTP proxy to use for playing HTTP streams.
#
#http_proxy_host                 "proxy.isp.com"
#http_proxy_port                 "8080"
#http_proxy_user                 "user"
#http_proxy_password             "password"
#
################################################################


############################# LIMITS ###########################
#
# These are various limits to prevent MPD from using too many
# resources.  You should only change them if they start
# restricting your usage of MPD.
#
#connection_timeout              "60"
#max_connections                 "5"
#max_playlist_length             "16384"
#max_command_list_size           "2048"
#max_output_buffer_size          "8192"
#
################################################################


###################### CHARACTER ENCODINGS #####################
#
# If file or directory names do not display correctly, then you
# may need to change this.  In most cases it should be either
# "ISO-8859-1" or "UTF-8".  You must recreate your database
# after changing this (use mpd --create-db).
#
#filesystem_charset              "ISO-8859-1"
#
# The encoding that ID3v1 tags should be converted from.
#
#id3v1_encoding                  "ISO-8859-1"
#
################################################################


######################### OTHER OPTIONS ########################
#
# The metadata types MPD will recognize.
#
#metadata_to_use                  "artist,album,title,track,name,genre,date,composer,performer,disc"
#
# Enable this if you wish to use your MPD created playlists in
# other music players.
#
#save_absolute_paths_in_playlists "no"
#
################################################################

i also did what kclive18 said, and when i enter /etc/rc.d/mpd start, i get

:: Starting Music Player Daemon                                          [FAIL]

Offline

#11 2008-09-29 22:05:16

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: mpd and ncmpcpp

Alright. As for the folders you have specified, you have to make sure they exist. Also, I would recommend, at least for testing purposes, to run mpd as normal user via command line (just running "mpd"), so you will be able to see some debugging output.


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#12 2008-09-29 22:15:29

k0rfain
Member
Registered: 2007-11-10
Posts: 28

Re: mpd and ncmpcpp

[k0rfain@core ~]$ mpd
unable to bind port 6600: Address already in use
maybe MPD is still running?

and im sure all of the folders are there(just checked, will re-check later)... Im not sure what the problem is. why so much work to get an audio player to work anyway

Last edited by k0rfain (2008-09-29 22:16:09)

Offline

#13 2008-09-29 22:33:08

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: mpd and ncmpcpp

Did you check whether mpd is actually running?

ps aux | grep mpd

Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#14 2008-09-29 22:38:13

AD28
Member
Registered: 2008-09-16
Posts: 161

Re: mpd and ncmpcpp

What is the output of the following?

ls -l /var/lib/mpd /var/log/mpd /var/run/mpd

Offline

#15 2008-09-29 23:11:35

k0rfain
Member
Registered: 2007-11-10
Posts: 28

Re: mpd and ncmpcpp

@finferflu:

[k0rfain@core mpd]$ ps aux | grep mpd
k0rfain   3626  0.0  0.3   3412   820 pts/1    D+   01:09   0:00 grep mpd

@AD28:

[k0rfain@core mpd]$ ls -l /var/lib/mpd /var/log/mpd /var/run/mpd
/var/lib/mpd:
total 4
drwxr-xr-x 2 mpd mpd 4096 2008-07-19 22:54 playlists

/var/log/mpd:
total 0

/var/run/mpd:
total 4
drwxr-xr-x 2 root root 4096 2008-09-29 22:49 mpd.pid

Last edited by k0rfain (2008-09-29 23:12:19)

Offline

#16 2008-09-29 23:18:06

AD28
Member
Registered: 2008-09-16
Posts: 161

Re: mpd and ncmpcpp

Those are the wrong permissions.. make sure you go through the ArchWiki :: Mpd - Quick Single User Installation section.

Offline

#17 2008-09-29 23:26:14

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: mpd and ncmpcpp

Also, you need to kill mpd before you run it as a user, so:

killall -9 mpd; mpd

You might need to run the first command as root, or with sudo.


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#18 2008-09-29 23:45:52

k0rfain
Member
Registered: 2007-11-10
Posts: 28

Re: mpd and ncmpcpp

oi, it finally works.. thanks to everyone that has helped me in this thread.. thanks alot

Offline

#19 2008-09-29 23:54:54

AD28
Member
Registered: 2008-09-16
Posts: 161

Re: mpd and ncmpcpp

good to hear cool

Offline

Board footer

Powered by FluxBB