You are not logged in.

#1 2014-09-10 08:56:23

jiluan
Member
Registered: 2014-09-10
Posts: 22

[SOLVED] Cannot setup mpd

Hello!

I'm completely 100% new at linux and am trying to setup mpd. after creating the necessary directories, trying to run mpd in the terminal produces

socket: Failed to bind to '[::]:6600': Address already in use

Someone here resolved it by editing their  /etc/mpd.conf and /.mpd/mpd.conf in each of the separate directiories and matching their settings. I've checked and the settings are already matched for both of my mpd.conf files. mpd doesn't start at login either. What do???

Last edited by jiluan (2014-09-10 20:49:52)

Offline

#2 2014-09-10 09:00:54

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,372
Website

Re: [SOLVED] Cannot setup mpd

Do you understand what the error message is telling you? Something is already using the port you have told mpd to listen on. Find out what.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#3 2014-09-10 09:20:56

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] Cannot setup mpd

 Could it be that mpd is already running?

ps aux | grep mpd

 Mpd has a log file, you can also run 'mpd --no-daemon --stdout --verbose'.

Offline

#4 2014-09-10 09:40:24

jiluan
Member
Registered: 2014-09-10
Posts: 22

Re: [SOLVED] Cannot setup mpd

emeres wrote:

 Could it be that mpd is already running?

ps aux | grep mpd

 Mpd has a log file, you can also run 'mpd --no-daemon --stdout --verbose'.

WorMzy wrote:

Do you understand what the error message is telling you? Something is already using the port you have told mpd to listen on. Find out what.

I think you're right, I typed that in and got

mpd       1064  0.0  0.1 356608 11976 ?        Ssl  02:32   0:00 mpd
root      1070  0.0  0.0   9012  1612 pts/1    S+   02:33   0:00 grep mpd

so if I understand right, is root is using the same port? how do I stop it?

also, emeres, I checked that second thing and got

(mpd:1071): fatal_error-WARNING **: option parsing failed: Unknown option --daemon

Offline

#5 2014-09-10 09:57:41

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,372
Website

Re: [SOLVED] Cannot setup mpd

What are you trying to accomplish? Do you need to have having multiple instances of mpd running? If so, you will need to configure the other instances to use a different port.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#6 2014-09-10 10:12:14

jiluan
Member
Registered: 2014-09-10
Posts: 22

Re: [SOLVED] Cannot setup mpd

WorMzy wrote:

What are you trying to accomplish? Do you need to have having multiple instances of mpd running? If so, you will need to configure the other instances to use a different port.

There was only a single instance of mpd, which I closed. Using ps aux shows

root      1299  0.0  0.0   9012  1692 pts/1    S+   03:06   0:00 grep mpd

but I'm unsure if that's a process running and how I would stop it if it was.

Stopping mpd and reenabling it produces

server_socket: bind to '0.0.0.0:6600' failed: Address already in use (continuing anyway, because binding to '[::]:6600' succeeded)
main: Found db_file setting without music_directory - disabling database
output: No 'audio_output' defined in config file
output: Attempt to detect audio output device
output: Attempting to detect a alsa audio device
No protocol specified
xcb_connection_has_error() returned true
Failed to create secure directory (/run/user/0/pulse): Permission denied
output: Successfully detected a alsa audio device

and

Offline

#7 2014-09-10 10:12:15

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] Cannot setup mpd

 What gui/control do you want to use with mpd? Just start it*. Since both configurations are the same, it should work as expected. And explain exactly what you have done so far, if there is a wiki involved, list the steps you took. As for the command, it is '--no-daemon' not '--daemon'.

Edit: Too slow. No, that is the grep process, not mpd. * Irrelevant now, since you killed the process.

Last edited by emeres (2014-09-10 10:14:50)

Offline

#8 2014-09-10 10:18:12

jiluan
Member
Registered: 2014-09-10
Posts: 22

Re: [SOLVED] Cannot setup mpd

emeres wrote:

 What gui/control do you want to use with mpd? Just start it*. Since both configurations are the same, it should work as expected. And explain exactly what you have done so far, if there is a wiki involved, list the steps you took. As for the command, it is '--no-daemon' not '--daemon'.

Edit: Too slow. No, that is the grep process, not mpd. * Irrelevant now, since you killed the process.

Okay my mistake, I've started the process again, I think you may be right that there's only one instance. I'm trying to use ncmpcpp

Offline

#9 2014-09-10 10:35:50

jiluan
Member
Registered: 2014-09-10
Posts: 22

Re: [SOLVED] Cannot setup mpd

alright, I fixed it for the most part, now I've just messed up by configuring the music library wrong. I can run ncmpcpp in the terminal but it says MPD: No Database at the bottom. I checked the playlists folder and I have music there, so I'm investigating the problem now. Thanks for the help guys

Offline

#10 2014-09-10 10:43:09

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] Cannot setup mpd

 The playlist_direcotry is for playlists, not music. Is anything inside of music_directory? Update the database either from inside ncmpcpp by pressing 'u' or run 'mpc update'. I do not recall if the database file needs to be touch or if mpd creates it itself.

Last edited by emeres (2014-09-10 10:43:48)

Offline

#11 2014-09-10 11:37:25

jiluan
Member
Registered: 2014-09-10
Posts: 22

Re: [SOLVED] Cannot setup mpd

emeres wrote:

 The playlist_direcotry is for playlists, not music. Is anything inside of music_directory? Update the database either from inside ncmpcpp by pressing 'u' or run 'mpc update'. I do not recall if the database file needs to be touch or if mpd creates it itself.

ha, that makes sense
the update didn't load anything and I can't seem to find music_directory. I made the db file during the setup I believe.

Offline

#12 2014-09-10 11:50:09

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] Cannot setup mpd

Post your mpd.conf.

Offline

#13 2014-09-10 11:56:47

jiluan
Member
Registered: 2014-09-10
Posts: 22

Re: [SOLVED] Cannot setup mpd

emeres wrote:

Post your mpd.conf.

user "mpd"
pid_file "/run/mpd/mpd.pid"
db_file "/var/lib/mpd/mpd.db"
state_file "/var/lib/mpd/mpdstate"
playlist_directory "/var/lib/mpd/playlists"

Offline

#14 2014-09-10 11:59:46

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] Cannot setup mpd

man mpd.conf wrote:

       music_directory <directory>
              This  specifies  the  directory  where  music  is  located.   If you do not configure this, you can only play
              streams.

Offline

#15 2014-09-10 12:11:37

jiluan
Member
Registered: 2014-09-10
Posts: 22

Re: [SOLVED] Cannot setup mpd

emeres wrote:
man mpd.conf wrote:

       music_directory <directory>
              This  specifies  the  directory  where  music  is  located.   If you do not configure this, you can only play
              streams.

Okay I've added

music_directory    "/var/lib/mpd/music"

moved music to that location, exited mpd, restarted mpd and ncmpcpp, and there's still no music there, even after updating. Is it because it's in playlist view or something?

Offline

#16 2014-09-10 12:14:51

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] Cannot setup mpd

Hit F1 in ncmpcpp, read the basic keys. Browser should show your music and library as well.

Offline

#17 2014-09-10 12:24:45

jiluan
Member
Registered: 2014-09-10
Posts: 22

Re: [SOLVED] Cannot setup mpd

emeres wrote:

Hit F1 in ncmpcpp, read the basic keys. Browser should show your music and library as well.

the control shortcuts are useful, I can view my media libarary in grid mode and such, but there's still no database and nothing in the library. when I press 2 to open the browser it initiates a core dump and closes ncmpcpp

Offline

#18 2014-09-10 12:31:18

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] Cannot setup mpd

emeres wrote:

[...]Mpd has a log file, you can also run 'mpd --no-daemon --stdout --verbose'.

 Provide relevant information.

Offline

#19 2014-09-10 12:39:00

jiluan
Member
Registered: 2014-09-10
Posts: 22

Re: [SOLVED] Cannot setup mpd

config_file: loading file /root/.mpd/mpd.conf
server_socket: bind to '0.0.0.0:6600' failed: Address already in use (continuing anyway, because binding to '[::]:6600' succeeded)
path: SetFSCharset: fs charset is: UTF-8
libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
opus: libopus 1.1
errno: Failed to open database file "/var/lib/mpd/mpd.db": No such file or directory
fatal_error: Can't create db file in "/var/lib/mpd": Permission denied

interesting

Offline

#20 2014-09-10 12:42:38

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] Cannot setup mpd

https://wiki.archlinux.org/index.php/Mpd#Setup
Decide which you want and follow it through.

Offline

#21 2014-09-10 12:44:59

jiluan
Member
Registered: 2014-09-10
Posts: 22

Re: [SOLVED] Cannot setup mpd

emeres wrote:

https://wiki.archlinux.org/index.php/Mpd#Setup
Decide which you want and follow it through.

What do you mean which? Permission is denied. Ah it's 5:30am here, I'll try tomorrow morning to follow the wiki a second time quite carefully, thanks for all the help.

Offline

#22 2014-09-10 17:52:04

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: [SOLVED] Cannot setup mpd

to make things easy, setup mpd to run as your own user. the easiest way to archive this is to run my setup script, which you find in wiki.


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#23 2014-09-10 20:48:26

jiluan
Member
Registered: 2014-09-10
Posts: 22

Re: [SOLVED] Cannot setup mpd

Update, it's completely fixed, all I had to do was move my music to a different folder than where mpd takes the music from and create a systematic link between where I moved it to and the mpd folder and it all showed up in my library. smile

Offline

Board footer

Powered by FluxBB