Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KraXen72 opened this issue Feb 6, 2024 · 7 comments
Open
Assignees
Labels
bug Something isn't working music Related to music loading non-criticial Will fix later

Comments

@KraXen72
Copy link

KraXen72 commented Feb 6, 2024

Please see #708 (comment)
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
Copy link
Author

KraXen72 commented Feb 6, 2024

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
Copy link
Author

KraXen72 commented Feb 6, 2024

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
Copy link

chocmake commented Feb 6, 2024

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
Copy link
Owner

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

@KraXen72
Copy link
Author

KraXen72 commented Feb 6, 2024

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

@KraXen72
Copy link
Author

KraXen72 commented Feb 7, 2024

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:

  • Musicbrainz Picard, beets and most other python based taggers (which deal with m4a anyway) use the python Mutagen library, which tags it differently. (Beets uses mediafile which is a mutagen wrapper. eyed3 only writes id3 and tinytag only reads tags).
  • Mp3tag is only available on windows, and most of the actual tag manipulation is abstracted away - it doesen't even tell you the real m4a atom names.

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.

@KraXen72 KraXen72 changed the title Multiple artists not showing up - likely incorrect tags, but at ends Multi-value m4a artist tags written by mutagen are incorrectly parsed Feb 7, 2024
@OxygenCobalt OxygenCobalt added the bug Something isn't working label Feb 9, 2024
@OxygenCobalt
Copy link
Owner

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:

  • Auxio is not correctly accumulating text-based metadata, which is super weird.
  • ExoPlayer is not parsing the multi-value tags correctly.

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

@OxygenCobalt OxygenCobalt added the music Related to music loading label Feb 28, 2024
@OxygenCobalt OxygenCobalt self-assigned this Feb 28, 2024
@OxygenCobalt OxygenCobalt added the non-criticial Will fix later label Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working music Related to music loading non-criticial Will fix later
Projects
Status: v4.0.0
Development

No branches or pull requests

3 participants