OxygenCobalt / Auxio

A simple, rational music player for android
GNU General Public License v3.0
1.8k stars 118 forks source link

Multi-value m4a artist tags written by mutagen are incorrectly parsed #708

Open KraXen72 opened 3 months ago

KraXen72 commented 3 months ago

Please see https://github.com/OxygenCobalt/Auxio/issues/708#issuecomment-1933011165 old message: I am trying to tag my m4a music files with mutagen, and i've successfully added these tags:

©ART    EDEN & Leah Kelly
aART    EDEN
----:com.apple.iTunes:ARTISTS   EDEN
----:com.apple.iTunes:ARTISTS   Leah Kelly
----:com.apple.iTunes:MusicBrainz Album Artist Id   3fd78e94-efeb-43a1-bc19-ad2dd1afbd5a
----:com.apple.iTunes:MusicBrainz Artist Id 3fd78e94-efeb-43a1-bc19-ad2dd1afbd5a
----:com.apple.iTunes:MusicBrainz Artist Id a9c87bd1-a3f2-49ec-b85f-95fb4059ac85

among others. i am using https://audio-tag-analyzer.netlify.app to verify the tags. However, in auxio, the artist only shows up as Leah Kelly, even if i turn on the amperstand separator. Here is my sample file:

(link removed, see later comments) Please point me in the direction of what i should to do to fix the tagging, or try to see if it could be an auxio bug. I can see both artists, like Eden & Leah Kelly in the QuickLook windows player. I have spent over 3 hours working on this single issue, and i had to patch the mutagen library to even sucessfully write the multi-value m4a tags because of a bug. Thanks!~

if of any use, this is the tagger i'm currently writing/using. see files tagging.py>tagger_m4a() and metadata.py>get_mbids_for_song() if interested.~

KraXen72 commented 3 months ago

not adding a ----:com.apple.iTunes:ARTISTS tag alltogether to the file solves the issue, but it's not what i'd want to do, or what picard does. Ideally, i wouldn't have to rely on separators for multi-artists and just use ARTISTS tag. i added it in the first place because it's mentioned in the wiki that it has precedence over the normal frames.

KraXen72 commented 3 months ago

another ponentially related issue is that this song seemingly has all the tags correct (the ----:com.apple.iTunes:ARTISTS is abstent), but it shows Mori Calliope for both artists with multi value separator / enabled. TAKU INOUE_Mori Calliope - Yona Yona Journey.zip

i should've picked a different format than m4a, but then again, youtube already has most stuff in AAC, and only some in OPUS, and i want to avoid a lossy => lossy (AAC => OPUS) transcode if possible.

chocmake commented 3 months ago

i should've picked a different format than m4a

fwiw I use M4A with Auxio for multiple track artists without issue (since this issue was fixed), however I'm using generic track artist tags rather than iTunes-specific ones and also using Mp3Tag[1] for the tagging.

Perhaps iTunes-specific tags aren't being parsed by Auxio/ExoPlayer?

[1] Windows-only with excellent batch scripting, though for Linux I know many who use it under WINE and I've used it myself under macOS (though now there's a native, albeit non-feature-complete Mac version).

OxygenCobalt commented 3 months ago

Hey, I'll go about reproducing this later. Busy right now.

KraXen72 commented 3 months ago

okay, thanks! good luck with whatever you're busy with!

KraXen72 commented 3 months ago

Okay, so i did further investigation. I found out, that the only multi-value M4A tag implementation that is 1) not separator based 2) supported by auxio i could find is the one by mp3tag. This is an issue for several reasons:

Most tools like kid3 or audio-tag-analyzer don't see any difference between a Mutagen-tagged or mp3tag tagged file (kid3 doesen't even see the multi value artist tags iirc).

Here are the sample files: m4a samples.zip The only thing i did in the -fixed file is open the file in mp3tag, delete the last character off the artist field (which shows there as EDEN\\Leah Kelly), add it back and save the file.

I tried looking at the files in the hex editor - i found that the tags were slighly different data-wise, and in a different order, however, I do not know enough about the m4a tagging spec/lack thereof and also my hex editor was pretty basic (wxhex), so it's ascii representation of the hex data wasn't great - I could not easily figure out what could be the bug in mutagens tagging that i could patch so it would work. Therefore i would like to request that auxio supports both mutli-value tag implementations, since many taggers are using mutagen anyway. I've tried some other music players (oto music, although not that objective since it does some splitting by itself) and QuickLook (windows) (hardly a proper music player but it parses the multi-artist tags properly)

As for the ----:com.apple.iTunes:ARTISTS, it turns out auxio prioritizes it over the (c)ART field and only ever reads the last instance of it. However, this wouldn't really need to be fixed if native multi-value tags would be fixed.

The current workaround is to just write EDEN/Leah Kelly into the (c)ART as a string and use the / separator in auxio. However, i'd really like to avoid this - both because it can possibly break on some artists, and that i'd like to use the official "spec" (if there even is any) implementation of multi-value artist tags. feel free to add the bug label to this issue.

OxygenCobalt commented 3 months ago

Got the time to read your investigation. Very in depth, good job. I am under the impression though from my #558 implementation that Auxio should be correctly interpreting ARTISTS using the vorbis convention of duplicate tags. So that means:

I still won't have the time to fully confirm until later though.