Calimero | 28 Aug 19:28 2015
Picon

State file lost on brutal shutdown, needs atomic writes

Hello,

I've been a happy mpd user for years now.
Recently however, I have regularly been losing my playlist when I forgot to close mpd manually before rebooting.

The reason behind this is undoubtedly systemd, which TERMs and KILLs mpd quite fast in succession,
revealing the race condition.
The state file is truncated, but not yet written to.

The solution would be to make mpd immune to race conditions, just like many other applications. [1]
We need to create a temporary file (next to the file we want to replace, on the same filesystem).
And with the rename() syscall, we replace the old file atomically with the new one.

This is guaranteed to result in either the old or the new file being in place, instead of outright data loss.

I wonder whether to implement this in src/StateFile.cxx or src/fs/io/FileOutputStream.cxx.

If somebody could hint me on how to structure this, or directly implement the change, I'd be very grateful.

Cheers

[1] https://trac.gajim.org/ticket/8092#comment:1

_______________________________________________
mpd-devel mailing list
mpd-devel <at> musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel
Kim Tore Jensen | 27 Aug 13:27 2015
Picon

[PATCH] Document API changes between each libmpdclient version

Hi,

Attached is a patch which documents API changes between libmpdclient versions,
making it easier to add client support for old versions of libmpdclient.

Regards,
Kim Tore Jensen
_______________________________________________
mpd-devel mailing list
mpd-devel <at> musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel
Will Tiffany | 25 Aug 12:11 2015
Picon

[PATCH] CueParser.cxx: Append pregap to previous track

Only ignore indexes after first nonzero, preserving pregaps but
appending them to the previous track instead of prepending to the
current. The first index of the first track is used for the start time
regardless of its number. Unneeded bool last_updated removed.
---
 I spoke with Ryan from http://bugs.musicpd.org/view.php?id=4355
 and we determined his issue after the last patch was due to git, not
 the code itself. He expressed that the new behavior was, although better,
 not ideal, as the expected start time of tracks is at index 01. This
 patch plays all audio but sets start times to the first nonzero index.

 src/playlist/cue/CueParser.cxx | 9 +++------
 src/playlist/cue/CueParser.hxx | 6 ------
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/src/playlist/cue/CueParser.cxx b/src/playlist/cue/CueParser.cxx
index e0c84a0..81797fe 100644
--- a/src/playlist/cue/CueParser.cxx
+++ b/src/playlist/cue/CueParser.cxx
 <at>  <at>  -250,7 +250,6  <at>  <at>  CueParser::Feed2(char *p)
 		song_tag = header_tag;
 		song_tag.AddItem(TAG_TRACK, nr);

-		last_updated = false;
 	} else if (state == IGNORE_TRACK) {
 		return;
 	} else if (state == TRACK && strcmp(command, "INDEX") == 0) {
 <at>  <at>  -266,14 +265,12  <at>  <at>  CueParser::Feed2(char *p)
 		if (position_ms < 0)
 			return;
(Continue reading)

Will Tiffany | 23 Aug 04:19 2015
Picon

[PATCH] CueParser.cxx: ignore INDEX after first per track

Use the first INDEX in each TRACK section, instead of the last, for the
start time. This preserves the original CD layout (including gaps
between tracks), and avoids skipping sections of songs in more exotic
cuesheets (eg musical suite tracks).

Fixes 0004355 and 0003359
---
 src/playlist/cue/CueParser.cxx | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/playlist/cue/CueParser.cxx b/src/playlist/cue/CueParser.cxx
index 80bf79b..e0c84a0 100644
--- a/src/playlist/cue/CueParser.cxx
+++ b/src/playlist/cue/CueParser.cxx
 <at>  <at>  -273,6 +273,7  <at>  <at>  CueParser::Feed2(char *p)
 		}

 		current->SetStartTime(SongTime::FromMS(position_ms));
+		state = IGNORE_TRACK;
 	}
 }

--

-- 
2.5.0

_______________________________________________
mpd-devel mailing list
mpd-devel <at> musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel
(Continue reading)

Kim Tore Jensen | 19 Aug 22:26 2015
Picon

[PATCH] Add support for ArtistSort and AlbumArtistSort tags

Hi,

I propose to add support for the ArtistSort and AlbumArtistSort tags in
libmpdclient; see attached patch.

Best regards,
Kim Tore Jensen
Attachment (sorttags.patch): text/x-diff, 609 bytes
_______________________________________________
mpd-devel mailing list
mpd-devel <at> musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel
Dmitri Vereshchagin | 9 Aug 17:23 2015
Picon

[PATCH 0/2] Some improvements for MPC display format

Hello,

These patches add support for escape characters in format strings and setting
format string through MPC_FORMAT environment variable.

Dmitri Vereshchagin (2):
  format: add escape character to escape sequences
  format: check environment for format string

 doc/mpc.1     | 4 ++++
 src/format.c  | 4 ++++
 src/options.c | 9 ++++++++-
 src/options.h | 2 ++
 4 files changed, 18 insertions(+), 1 deletion(-)

--

-- 
Dmitri Vereshchagin

_______________________________________________
mpd-devel mailing list
mpd-devel <at> musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel
矛与盾 | 6 Aug 11:31 2015

CurlInputPlugin : broken connection sometimes -- Solved patch

Hi All,


Attached is for solving this issue which I was discussing at my last email:
http://mailman.blarg.de/pipermail/mpd-devel/2015-July/000375.html

It seems work fine after I test, and anyone helps me to double check? Thanks.

And any feedbacks? Thanks again.

Alex
Attachment (curl_retry.patch): application/octet-stream, 4855 bytes
_______________________________________________
mpd-devel mailing list
mpd-devel <at> musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel
Thorsten Wißmann | 28 Jul 12:09 2015
Picon

[PATCH] MPC: command: let listall print songs only

Formerly, the output of

    mpc listall --format ''

included directory paths and not only songs. Attached you can find the
patch 0001-command-let-listall-print-songs-only.patch which limits the
output songs (as it is already described by mpc's man page).

You can apply the patch by piping it through git am. Feel free to adjust
the commit message :-)

Cheers,
Thorsten
_______________________________________________
mpd-devel mailing list
mpd-devel <at> musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel
Alex | 23 Jul 13:36 2015

CurlInputPlugin : broken connection sometimes

Hi All,

I am using MPD to play some http streaming musics. Sometimes the connections will be broken because network
may become bad suddenly, and then MPD will play the next song. It's a very sick experience.

After I debug the codes, I found that there's not any code to retry to connect again where Curl return error. 
The error of Curl will be like this: "recv failure: connection reset by peer".

Any idea to add some retries to CurlInputPlugin.cxx? Sorry I am not very familiar with Curl Muti and MPD. Any helps?

Thanks so much! 

P.S. I really think that it's very very sick experience what the MPD will play the next song when network
become bad suddenly!
_______________________________________________
mpd-devel mailing list
mpd-devel <at> musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel
Wieland Hoffmann | 17 Jul 19:55 2015
Picon

[PATCH] mpd.service: Set the Documentation option

This makes references to mpd(1) and mpd(5) appear in systemd status output.
---
 systemd/mpd.service.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/systemd/mpd.service.in b/systemd/mpd.service.in
index a72eb92..caf0d67 100644
--- a/systemd/mpd.service.in
+++ b/systemd/mpd.service.in
 <at>  <at>  -1,5 +1,6  <at>  <at> 
 [Unit]
 Description=Music Player Daemon
+Documentation=man:mpd(1) man:mpd.conf(5)
 After=network.target sound.target

 [Service]
--

-- 
2.4.6

_______________________________________________
mpd-devel mailing list
mpd-devel <at> musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel
Andreas Mair | 28 Jun 08:40 2015
Picon

find track "1" not working as expected

Hi,

I'm trying to find out why MPDroid is so slow when it lists an
artist's albums. So I enabled debug logging in MPD and noticed that
MPDroid issues three MPD queries for each album it has to show.

For example:
client: [12] process command "find "albumartist" "Aerosmith" "album"
"Pump" "track" "1""
client: [12] command returned 0
client: [12] process command "find "albumartist" "Aerosmith" "album"
"Pump" "track" "01""
client: [12] command returned 0
client: [12] process command "search "albumartist" "Aerosmith" "album"
"Pump" "track" "1""
client: [12] command returned 0

I would expect, that the first command (track "1") should work, but
there's no result. That's also true for the second command (track
"01"). The third command returns every song of that album (because it
has 10 songs).
I've taken a look at the MPD sources and I think the problem is, that
MPD tries an exact *string* match. If I use "... find 01/10" it works,
but I think that's not ideal to work like this because one has to know
(1)  how many songs an album has and (2) if the number of total tracks
is stored and (3) if leading zeros are used.

I'd suggest that MPD uses *numeric* matches for numeric fields like
track or disc number. Or do I miss something?

What do you think?
Any chance to change that?

Best regards,
Andreas
_______________________________________________
mpd-devel mailing list
mpd-devel <at> musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel

Gmane