MusicPlayerDaemon / MPD

Music Player Daemon
https://www.musicpd.org/
GNU General Public License v2.0
2.16k stars 346 forks source link

MusicBrainz tags not being added to DB #82

Closed matthewleon closed 7 years ago

matthewleon commented 7 years ago

Here is a sample mp3 with ID3v2.3 tags: https://s3.amazonaws.com/www.flactunesapp.com/01+L'Amour+Toujours+1.mp3

Inspecting the file with id3v2 at the console shows that it has the appropriate MusicBrainz tags. For example:

TXXX (User defined text information): (MusicBrainz Artist Id): 09c88499-fd98-4f0e-a4c2-7e763140b611
TXXX (User defined text information): (MusicBrainz Artist Id): 09c88499-fd98-4f0e-a4c2-7e763140b611
TXXX (User defined text information): (MusicBrainz Album Artist Id): 09c88499-fd98-4f0e-a4c2-7e763140b611
TXXX (User defined text information): (MusicBrainz Release Group Id): d71f0ee6-5c77-4adf-99a0-488f3e4502be
TXXX (User defined text information): (MusicBrainz Release Track Id): 3581059b-2f5e-385e-b040-0492cbc7d87c

Importing the file to the MPD database doesn't add this metadata, however. This can be determined by uncompressing the database file and manually inspecting. The basic id3 tag info is there (Artist, Track, etc.) but the MusicBrainz info is never scanned in.

Further, the response to currentsong, for example, will not include any MusicBrainz info.

I've not been able to get any tracks' MusicBrainz info to be recognized by MPD. These are tracks whose metadata has been set by Picard, so this surprises me. However, a scan of past issues shows that this doesn't seem to have come up for anyone else.

MaxKellermann commented 7 years ago

MPD's mad and mpg123 plugins recognize your file just well! Since you did not provide any information about how you configured MPD (and I don't even know which version you're using), I must assume that you're using the ffmpeg decoder plugin. Your file uses tag names which are only specified for ID3 (https://picard.musicbrainz.org/docs/mappings/). However, in the ffmpeg decoder, MPD doesn't know it's looking at ID3, and the ffmpeg plugin supports only the generic MusicBrainz tag names.

matthewleon commented 7 years ago

Since you did not provide any information about how you configured MPD

My apologies. Version info below:

Music Player Daemon 0.20.9

Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright 2008-2017 Max Kellermann <max.kellermann@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Database plugins:
 simple proxy

Storage plugins:
 local

Decoders plugins:
 [dsdiff] dff
 [dsf] dsf
 [faad] aac
 [fluidsynth] mid
 [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve
 [pcm]

Filters:
 libsamplerate

Tag plugins:
 id3tag

Output plugins:
 null fifo openal osx httpd recorder

Encoder plugins:
 null wave

Archive plugins:
 [bz2] bz2

Input plugins:
 file archive curl ffmpeg

Playlist plugins:
 extm3u m3u pls cue embcue

Protocols:
 file:// http:// https:// gopher:// rtp:// rtsp:// rtmp:// rtmpt:// rtmps://

Other features:
 icu ipv6 tcp un
matthewleon commented 7 years ago

As you can see your theory is indeed correct. I'll recompile with mad and/or mpg123. Thanks.

matthewleon commented 7 years ago

I'm curious, then, is there somewhere in the documentation that mentions this subtlety regarding ffmpeg vs. the other mp3 decoding options? If not, perhaps it's worth adding somewhere. I'm a bit surprised by it, as I naïvely would assume that the "Tag plugins" above would be responsible for metadata, rather than the selection of decoder.

raftopoulos commented 7 years ago

Not able to reproduce issue with MPD from git and your audiofile. Check mpd.conf metadata_to_use option for musicbrainz tags. Default is all tags except for comments.

matthewleon commented 7 years ago

Not able to reproduce issue with MPD from git and your audiofile.

@raftopoulos can you confirm whether you compiled MPD with support for Mpeg123 or MAD? I have been able to confirm @MaxKellermann's hypothesis: if I compile MPD without support for either mpeg123 or mad, but with only ffmpeg, the problem shows up. As soon as I add support for either mpeg123 or mad, the problem is solved.

It seems that this problem should be solvable, though, using only ffmpeg, as running ffmpeg from the command line does dump the tags in question.

Would you potentially accept a patch that addresses the issue?

raftopoulos commented 7 years ago

Please ignore.

matthewleon commented 7 years ago

MPD from git, Debian buster/sid x64, ffmpeg 3.2.6.

@raftopoulos can you show the output from mpd --version as well as the content of the database file after this is run?

raftopoulos commented 7 years ago

D'oh! Messed up my build. Now same result as matthewleon described.

matthewleon commented 7 years ago

Now same result as matthewleon described.

Phew! Glad we got to the bottom of it :)