You are not logged in.

#1 2014-03-20 02:21:23

Beelzebud
Member
From: Illinois, U.S.
Registered: 2010-07-16
Posts: 154

[SOLVED] MPD doesn't consistently save the player state.

I'm not sure what exact version this cropped up in, but I've noticed for the past 2 weeks that most of the time when I start my Linux machine MPD will begin playing something from the previous session.  It seems to be saving the state during a session, but not when the session is being closed.  Anyone else getting this behavior?  I've checked my mpd.state file for permissions, and everything seems like it should be.

Last edited by Beelzebud (2014-04-13 17:30:09)

Offline

#2 2014-03-20 11:53:20

o_caino
Member
Registered: 2013-06-06
Posts: 166

Re: [SOLVED] MPD doesn't consistently save the player state.

Same for me.

Beelzebud wrote:

MPD will begin playing something from the previous session

Yes, sometimes not necessarily last song played.

Offline

#3 2014-03-20 12:08:15

Psykorgasm
Member
Registered: 2011-11-24
Posts: 177

Re: [SOLVED] MPD doesn't consistently save the player state.

I've had it also within the past 2/3 weeks, something else too though;

I've had it completely clear my playlist and ncmpcpp just open up completely empty or maybe only load songs up to a certain artist a few letters in to the alphabet, at first I thought it was mpd auto_update which (most likely by luck/coincidence) stopped it for about a week but then it happened again.

Offline

#4 2014-03-20 23:20:41

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

Re: [SOLVED] MPD doesn't consistently save the player state.

We also had some complain about state file not properly being saved on reboots in the irc channel. Sadly they were not able to provide a git bisect.
If one of you could provide one, I would appreciate this, since I wasn't able to reproduce this issue.


My guess tho is, that this is something in systemd, since a) everyone who was complaining also used systemd and b) it only happened on reboots.

Last edited by Rasi (2014-03-20 23:26:07)


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

#5 2014-03-20 23:32:39

curson
Member
From: London
Registered: 2010-12-03
Posts: 32
Website

Re: [SOLVED] MPD doesn't consistently save the player state.

I'm having this issue as well. The ~/.config/mpd/mpdstate file is devour of playlist information most of the time and my client of choice starts, of course, with an empty playlist. I still haven't figured out what is triggering this behaviour, and while easy to solve, it really seems to happen in a very unpredictable and totally random ways.

Glad, in a way, I'm not the only one experiencing this, but as the others (few) in this thread have stated, I have no clues on how to solve this.

Offline

#6 2014-03-21 00:17:37

o_caino
Member
Registered: 2013-06-06
Posts: 166

Re: [SOLVED] MPD doesn't consistently save the player state.

I don't know if this is relevant, but even though I use systemd I don't have mpd.service enabled, I just start mpd in my user's .xinitrc

Offline

#7 2014-03-21 09:53:47

Psykorgasm
Member
Registered: 2011-11-24
Posts: 177

Re: [SOLVED] MPD doesn't consistently save the player state.

o_caino, I too do not use the service, I start mpd myself from a terminal and a friend of mine with the same issue also starts mpd via his xinitrc.

It swear it came with the last update to mpd or the at a stretch the one previous because it was working fine before that for as long as I can remember. As much as I would love to do some bisects of git I just dont have the time to try reproduce it that much, at least not now hmm

Last edited by Psykorgasm (2014-03-21 09:54:17)

Offline

#8 2014-03-21 14:57:07

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

Re: [SOLVED] MPD doesn't consistently save the player state.

But does it only happen with reboots or is stopping and starting mpd by hand also causing it?

Last edited by Rasi (2014-03-21 14:57:18)


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

#9 2014-03-21 17:31:42

Beelzebud
Member
From: Illinois, U.S.
Registered: 2010-07-16
Posts: 154

Re: [SOLVED] MPD doesn't consistently save the player state.

Forgive me for being absent, I haven't had much time.   

I'm starting MPD from an autostart script in KDE's autostart folder.  I just killed mpd and restarted it a few times, and it seemed to work fine.  This only happens on a restart.   The weird thing, is that like someone else mentioned, it won't even begin from the last thing that was played, just some random point from the previous session.   

It's almost like the state file will get saved once during a session, and then it doesn't save again.

Last edited by Beelzebud (2014-03-21 17:32:34)

Offline

#10 2014-03-21 18:18:19

Psykorgasm
Member
Registered: 2011-11-24
Posts: 177

Re: [SOLVED] MPD doesn't consistently save the player state.

Rasi, only on a new boot but since I don't stop mpd after starting it... who knows.
It wasn't every boot or reboot though, when I was messing with some new kernels I had a failure rate (for lack of a better term) once every probably 4 or 5 starts from memory and the failure were a random mix of OP's and the ones I detailed extra.

Offline

#11 2014-03-21 22:10:16

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

Re: [SOLVED] MPD doesn't consistently save the player state.

so i stick to my point. in all your cases its the init system that kills mpd. as soon as you cleanly shut it down yourself everything works fine. seems like a systemd issue to me

But again, without a bisect this is a useless discussion smile

Last edited by Rasi (2014-03-21 22:10:40)


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

#12 2014-03-21 22:42:38

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] MPD doesn't consistently save the player state.

I think you're right Rasi, I've also started to lose zsh history from instances that I didn't exit before shutting down.

Offline

#13 2014-03-31 06:35:49

curson
Member
From: London
Registered: 2010-12-03
Posts: 32
Website

Re: [SOLVED] MPD doesn't consistently save the player state.

My problem about starting mpd.service through systemd, has always been the inability to by-pass the permission problem on Pulseaudio. Launching mpd through my .xinitrc has worked flawlessly for a long time, but it's now clear that mpd doesn't update/save the mpdstate file anymore, as I have random problems with playlist disappearing, play state being either play/stop and so on.

Is there a straightforward way to make mpd work through systemd without running in the permission problems for the audio device? Because if the culprit lies with .xinitrc (and the fact that mpd doesn't feel it's closed properly anymore), then it's worth a try.

Offline

#14 2014-04-01 22:25:43

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

Re: [SOLVED] MPD doesn't consistently save the player state.

curson wrote:

My problem about starting mpd.service through systemd, has always been the inability to by-pass the permission problem on Pulseaudio. Launching mpd through my .xinitrc has worked flawlessly for a long time, but it's now clear that mpd doesn't update/save the mpdstate file anymore, as I have random problems with playlist disappearing, play state being either play/stop and so on.

Is there a straightforward way to make mpd work through systemd without running in the permission problems for the audio device? Because if the culprit lies with .xinitrc (and the fact that mpd doesn't feel it's closed properly anymore), then it's worth a try.

[Unit]
After=network.target
After=sound.target

[Service]
User=YOUR_USER
PAMName=system-local-login
ExecStart=/usr/bin/mpd --no-daemon

[Install]
WantedBy=multi-user.target

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

#15 2014-04-02 09:58:02

curson
Member
From: London
Registered: 2010-12-03
Posts: 32
Website

Re: [SOLVED] MPD doesn't consistently save the player state.

Yep, after posting that, I kind of figured out what I was doing wrong with that, and managed to use systemd user session to start mpd. So far, it seems that might have fixed the issue for me, but I need to give it some more tries just to be sure.

Anyway, thank you for your reply Rasi smile

Offline

#16 2014-04-13 17:29:39

Beelzebud
Member
From: Illinois, U.S.
Registered: 2010-07-16
Posts: 154

Re: [SOLVED] MPD doesn't consistently save the player state.

Again, apologies for not keeping up with this, I've been busy.   Last night mpd had an update, and afterwards I noticed that it was starting with systemd by default now, and it all seems to be working fine.   I haven't had any weirdness with state saves after a couple of test restarts, so I'm going to label this solved.

Offline

Board footer

Powered by FluxBB