Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problems with mpd losing connection
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Dralnu
Veteran
Veteran


Joined: 24 May 2006
Posts: 1919

PostPosted: Sun Dec 03, 2006 5:11 am    Post subject: Problems with mpd losing connection Reply with quote

Ok, quick, annoying, and somewhat strange mpd problem.

I (like many others) don't shut down my PC all the time. Well, I keep mpd running constantly, but recently I've been having issues with it not working.

I've tried to get it to run via mpc, ncmpc, but all that seems to work (since the connection seems to be timing out. Don't know much about hunting down errors in those kind of places) is restarting mpd, and I don't want to do so via cronjob since it should work without a deamon reboot.

It seems to cause problems when you stop playing music, like its dropping the connection or something (it is running, but not accepting connections I guess).

Anyone got any ideas, need any info, or something?

BTW: This isn't on a network.
_________________
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Back to top
View user's profile Send private message
tmr
n00b
n00b


Joined: 19 Sep 2002
Posts: 48
Location: Finland

PostPosted: Sun Dec 03, 2006 5:46 pm    Post subject: Reply with quote

Output of "egrep -v -e '^[[:space:]]*#' -e '^[[:space:]]*$' -e 'password' /etc/mpd.conf" might help.

And what /var/log/mpd/mpd.error.log says after this happens..
Back to top
View user's profile Send private message
Dralnu
Veteran
Veteran


Joined: 24 May 2006
Posts: 1919

PostPosted: Sun Dec 03, 2006 6:16 pm    Post subject: Reply with quote

Quote:
cat /var/log/mpd.error.log
Nov 10 17:33 : Max Connections Reached!
Nov 10 17:33 : Max Connections Reached!
Nov 10 17:33 : Max Connections Reached!
Nov 10 17:33 : Max Connections Reached!
Nov 10 17:33 : Max Connections Reached!
Nov 10 17:33 : Max Connections Reached!
Nov 10 17:33 : Max Connections Reached!
Nov 10 17:33 : Max Connections Reached!
Nov 10 17:33 : Max Connections Reached!
Nov 10 17:33 : Max Connections Reached!
Nov 10 17:33 : Max Connections Reached!
Nov 10 17:33 : Max Connections Reached!
Nov 10 17:34 : Max Connections Reached!
Nov 13 22:13 : Max Connections Reached!
Nov 13 22:13 : Max Connections Reached!
Nov 13 22:13 : Max Connections Reached!
Nov 13 22:13 : Max Connections Reached!
Nov 13 22:13 : Max Connections Reached!
Nov 13 22:13 : Max Connections Reached!


Ok, this is odd. Max connections I have set is 5, and I am the only one who connects to mpd -.-

My mpd.conf is pretty stock. I didn't see a need to mess with it any (I've tweaked it some to see about fixing the problems, though), so I don't think posting it would do much good due in fact to the fact that mpd started acting up BEFORE I make config changes.
_________________
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Back to top
View user's profile Send private message
tmr
n00b
n00b


Joined: 19 Sep 2002
Posts: 48
Location: Finland

PostPosted: Sun Dec 03, 2006 6:29 pm    Post subject: Reply with quote

Try adding 'log_level "secure"' in mpd.conf to see from where are those connections coming from.
Back to top
View user's profile Send private message
Dralnu
Veteran
Veteran


Joined: 24 May 2006
Posts: 1919

PostPosted: Sun Dec 03, 2006 6:50 pm    Post subject: Reply with quote

tmr wrote:
Try adding 'log_level "secure"' in mpd.conf to see from where are those connections coming from.
Something I just noticed - mpd isn't logging anything atm o.o

The dates on the log there are for Nov 13 (the last), and last night was Dec 2...









wtf...
_________________
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Back to top
View user's profile Send private message
tmr
n00b
n00b


Joined: 19 Sep 2002
Posts: 48
Location: Finland

PostPosted: Sun Dec 03, 2006 7:09 pm    Post subject: Reply with quote

Dralnu wrote:
Something I just noticed - mpd isn't logging anything atm o.o


Hmm... Maybe "/etc/init.d/mpd stop && mpd --no-daemon --stdout --verbose" shows the cause.
Back to top
View user's profile Send private message
Dralnu
Veteran
Veteran


Joined: 24 May 2006
Posts: 1919

PostPosted: Sun Dec 03, 2006 7:55 pm    Post subject: Reply with quote

Quote:
interface 0: process command "add "Akon Feat. Eminem - Smack That (Dirty).mp3""
get song: Akon Feat. Eminem - Smack That (Dirty).mp3
interface 0: command returned 0
interface 0: process command "status"
interface 0: command returned 0
interface 0: process command "playlistinfo "-1""
interface 0: command returned 0
interface 0: process command "playid "0""
playlist: play 0:"Akon Feat. Eminem - Smack That (Dirty).mp3"
closeAllListenSockets called
closing listen socket 0
interface 0: closed
took 0.000000 to init player
copyMpdTagToOB: !acceptMetadata || !tag
decoder PID: 14035


That seems odd, doesn't it? Someone connects to play a file, and it closes all connections...

EDIT:
It kind of froze, so I opened another terminal. /etc/init.d/mpd stop says mpd hadn't even started...

Maybe I should just remove all my config files, uninstall, eclean-distfiles, and then try a reinstall?
_________________
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Back to top
View user's profile Send private message
BlackEdder
Advocate
Advocate


Joined: 26 Apr 2004
Posts: 2588
Location: Dutch enclave in Egham, UK

PostPosted: Tue Jan 16, 2007 6:51 pm    Post subject: Reply with quote

Did you ever solve this problem. I'm having similar problems nowadays.
Back to top
View user's profile Send private message
Dralnu
Veteran
Veteran


Joined: 24 May 2006
Posts: 1919

PostPosted: Tue Jan 16, 2007 7:34 pm    Post subject: Reply with quote

BlackEdder wrote:
Did you ever solve this problem. I'm having similar problems nowadays.


I commented out the lines dealing with the connection prefrences. It seemed to work, even though I randomly have 2 or 3 connections on the same port.
_________________
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Back to top
View user's profile Send private message
slackline
Veteran
Veteran


Joined: 01 Apr 2005
Posts: 1471
Location: /uk/sheffield

PostPosted: Tue Jan 29, 2008 9:56 am    Post subject: Reply with quote

I too am having problems with this.

Things used to work fine 0.13.0, but since the upgrade I start mpd using the init script, but then can't connect with either of the clients I've tried (mpc and gmpc) and /var/log/mpd/mpd.error just indicates that Max Connections have been reached.

I've tried uncommenting the relevant line in /etc/mpd.conf to explicitly specify five connections, and restarted mpd, but it makes no difference.

I tried emerge -C mpd && eclean-dist && eclean-pkg && emerge mpd then manually modified /etc/mpd.conf back to the same configuration that had previously worked, but no joy.

Very frustrating as I now can't stream music to icecast (which I've not explicitly started yet, so it can't be that which is connecting) to listen to music downstairs.

Any thoughts or ideas would be much appreciated.

Cheers

slack
Back to top
View user's profile Send private message
Roguelazer
Veteran
Veteran


Joined: 10 Feb 2003
Posts: 1233
Location: San Francisco, CA

PostPosted: Wed Apr 16, 2008 4:05 am    Post subject: Reply with quote

I know that this is a ridiculously late reply, but I just had (and solved) the same problem when I moved to baselayout-2, and I imagine that lots of other people will also have the same problem in the coming weeks.

Basically, MPD gets sad if MPD_HOST and MPD_PORT are not set globally. I have no idea why, or why it worked under baselayout-1. I assume there was a file setting these somewhere. Anyhow, adding the following to /etc/env.d/99mpd fixes the problem:
Code:

MPD_HOST=127.0.0.1
MPD_PORT=6600


These are used by the server and as defaults for the client, but if you want to connect to other hosts, you can always override them in your shell.
_________________
Registered Linux User #263260
Back to top
View user's profile Send private message
Dralnu
Veteran
Veteran


Joined: 24 May 2006
Posts: 1919

PostPosted: Wed Apr 16, 2008 4:20 am    Post subject: Reply with quote

Roguelazer wrote:
I know that this is a ridiculously late reply, but I just had (and solved) the same problem when I moved to baselayout-2, and I imagine that lots of other people will also have the same problem in the coming weeks.

Basically, MPD gets sad if MPD_HOST and MPD_PORT are not set globally. I have no idea why, or why it worked under baselayout-1. I assume there was a file setting these somewhere. Anyhow, adding the following to /etc/env.d/99mpd fixes the problem:
Code:

MPD_HOST=127.0.0.1
MPD_PORT=6600


These are used by the server and as defaults for the client, but if you want to connect to other hosts, you can always override them in your shell.


I think those variables are supposed to be set by mpd at startup, and aren't supposed to be set outside of mpd's default config.

If you want to do that, I'd see about parsing the config file and using the listed entries there, or else using the defaults (which, again, should be set by mpd)
_________________
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Back to top
View user's profile Send private message
Anardil
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jun 2004
Posts: 90

PostPosted: Wed May 07, 2008 9:29 pm    Post subject: Reply with quote

I am sorry, but I think I have to disappoint you Roguelazer but
I have exactly set the variables you prospose since I am using MPD to ensure the correct default username vor the clients.

It is not set by the mpd-daemon itself at all.
It is only use for those clients, that cannot take the username and host by the commandline as mpc.

I am actually having the same issue as all of you do.

mpd plays perfectly, I can skip forward, backwards, load playlists, save playlists and so on.
But as soon as I pause or stop mpd by whichever client I cannot restart playback of mpd.
mpc still reporst that mpd is playing but after 3 or 4 attempts to actually get it to play, mpd connection times out and will never ever accept any connection
from whatever client :-(

The logs in my case don't show anything at all. Not even the run out of connections issue occoured!

Sorry musiclovers but simply setting the environmental variables does not solve the problem, at least not for me :-(

I also already watched out on the official mpd-homepage for a bug addressing that issue but did not find one (to be honest I could not even find a buglist, maybe I was too lazy to search deep enough).

Well hopefully someone can solve this soon :-(

MPD ROCKS ANYWAY
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum