Jump to content

Null character used for multiple artists in ID3 tags (MP3 files) not parsing correctly


Recommended Posts

When using a null character for tagging multiple artists in MP3 files, the artists are not split as they should be. I do this by typing "\\" in the mp3tag program, which according to them inputs a null character as required by the ID3v2.4 specs for multiple artists although this is informally applied to ID3v2.3 as well. Splitting multiple artists works perfectly for FLAC files using this method. For MP3 files, using characters like ";" or "/" and defining them as a symbol to split artists in Poweramp works as well. The only thing that doesn't work is using null characters in MP3 files.

I believe this to be classified as a bug since the null character is what is specified for multiple artists in the ID3 specs and it is not working in Poweramp. I am hoping to see this bug fixed because I believe Poweramp is the best music player on Android, and the dev seems quite active responding to bugs and feature requests.

Poweramp build: 933
Device: Samsung Galaxy S8
Android version: 9
Steps to reproduce: Use null characters as delimiters for multiple artists in tags for MP3 files

Link to comment
Share on other sites

Null characters created via MP3Tag's "\\" separator should work fine, they were implemented in PA build 911 about six months ago (previously only multiple instances of the ARTIST tag in FLAC/Vorbis tags was supported). As you say, technically it's an ID3v2.4 feature, but it also works in 2.3. You do need to have something (normally a semicolon) saved in the 'Symbols to Split Multiple Artists' option though, otherwise the splitting feature won't be enabled at all.

What do you see in the Artist field when you try to view the Info/Tags data in PA for such a file? (Remember you may need to do a Full Rescan to update the scanned library data after making a change to a file).

Andre

Link to comment
Share on other sites

Hi Andre. Here's a couple pics of what I'm working with as well as my settings for splitting. I have done full rescans multiple times and still end up with artists unsplit for MP3s like this. At this point I'm thinking I should reset all Poweramp settings or reinstall the app if the feature should be working as you say.

Screenshot_20220518-163915_Poweramp.jpg

Screenshot_20220518-163942_Poweramp.jpg

Link to comment
Share on other sites

I have reinstalled the app so all my settings are freshly default and I have done a full scan. Still have the same issues, but here are my findings and observations:

  1. For FLAC, in PA, artists can be stored in multiple, separate ARTIST tags. Artists are shown in PA as separated with "; " (semicolon and space), so they are shown as "artist1; artist2". Although the multiple ARTIST tags are recognized and separated with a "; ", for some reason they are not split by default due to the underline going underneath the entire tag. Therefore, using default settings, multiple artists are not working. However, a workaround exists by adding ";" to the "Symbols to Split Multiple Artists" setting. After adding that, "artist1; artist2" are properly split into 2 separate artists shown by 2 underlines, one beneath each artist name. If this is intentionally done to support multiple artists in such a roundabout way, then ";" should be included in "Symbols to Split Multiple Artists" as the default setting.
  2. For MP3, in PA, null characters become replaced with a " " (space), so if an ARTIST tag was artist1<null>artist2 (or artist1\\artist2 in mp3tag for example), PA shows it as "artist1 artist2" and the multiple artists are not split due to the underline going underneath the entire tag. There will be no way to get this to work using the "Symbols to Split Multiple Artists" feature properly if any artist names include a space.
  3. It seems using the above findings, we can determine that at least for PA build 933, null characters for multiple artists are not supported for MP3 files only. It seems like the null characters in MP3 files are intended to be replaced by "; " so that the "Symbols to Split Multiple Artists" feature can split the artists with ";", but this is currently not the case.
  4. If null characters were supported properly for MP3 files and working in previous builds, then a regression in the source code probably occurred.
  5. Semicolon ";" should be included in "Symbols to Split Multiple Artists" as the default setting due to the way current support for multiple artists work.

Attached pics below show how this works for FLAC files with default settings and then with ";" added to "Symbols to Split Multiple Artists".

20220518_214817.jpg

20220518_214913.jpg

20220518_214927.jpg

20220518_214950.jpg

Link to comment
Share on other sites

It does sound like there's a problem with parsing your MP3 files. Could you post a sample of one that does not work for you? This is what a null-byte separated ID3 Artist tag looks like for me:

image.png


You are right that there needs to be something in the 'Symbols to Split Multiple Artists' option though, otherwise the scanner's entire splitting feature is disabled and Artist tags are always handled as one single item. When disabled, any instances of null bytes in MP3/ID3 tags will be replaced by spaces, and multiple FLAC/Vorbis ARTIST tags will be concatenated with "; " between each entry (and the whole field will show as underlined in Info/Tags, indicating PA is treating it as a single item).

Andre

Link to comment
Share on other sites

A bit off-topic, but when the artist splitting system was first introduced I suggested then that multiple individual items (e.g. separate content generated by null bytes in tags, or multiple ARTIST entries) should be delimited using a special/unique character, rather than inserting a semicolon or anything else that might occur in normal text. I suggested using a blob symbol, to make it clear that these are in fact individual items rather than one long string that has been parsed and split.

I still think that would make sense, e.g:

image.png

 

Andre

Link to comment
Share on other sites

Thanks for your time in helping me with this Andre.

Here is a sample MP3 that does not have the multiple artists split in PA. The artist tag is entered in mp3tag as "Bring Me The Horizon\\BABYMETAL" and shows up in the artist field in PA as "Bring Me The Horizon BABYMETAL".

Edited by PrinceMojo
Link to comment
Share on other sites

The tagging data seems correct to me, but I too experience the same problem when I scan that MP3 file into PA - the null byte separator (or null two-bytes, as it's Unicode) is being ignored and treated as a space.

  | Artist = Bring Me The Horizon/BABYMETAL
  | - Tag 'TPE1' (67 bytes):
  |     0059: 01 ff fe 42 00 72 00 69 00 6e 00 67 00 20 00 4d [...B.r.i.n.g. .M]
  |     0069: 00 65 00 20 00 54 00 68 00 65 00 20 00 48 00 6f [.e. .T.h.e. .H.o]
  |     0079: 00 72 00 69 00 7a 00 6f 00 6e 00
00 00 ff fe 42 [.r.i.z.o.n.....B]
  |     0089: 00 41 00 42 00 59 00 4d 00 45 00 54 00 41 00 4c [.A.B.Y.M.E.T.A.L]
  |     0099: 00 00 00        
                               [...]

@maxmp one for you I'm afraid, there must be something strange elsewhere in the file format, but I don't know enough of the low-level detail to find it. Slightly modifying and re-saving the file in MP3Tag does not seem to resolve the problem.

Andre

Link to comment
Share on other sites

14 hours ago, PrinceMojo said:

I do this by typing "\\" in the mp3tag program, which according to them inputs a null character as required by the ID3v2.4 specs for multiple artists although this is informally applied to ID3v2.3 as well

@maxmp As a note to this, mp3tag only uses the "\\" internally as a split character reference. This data is not actually stored in the tag field, but rather forces the tag to insert a second/third/etc. field with same heading.

 

In the above file sample, the Artist "Bring Me The Horizon\\BABYMETAL" Results in two ARTIST fields;

ARTIST Bring Me The Horizon

ARTIST BABYMETAL

Link to comment
Share on other sites

5 minutes ago, MotleyG said:

In the above file sample, the Artist "Bring Me The Horizon\\BABYMETAL" Results in two ARTIST fields

It would for FLAC files where Vorbis tagging supports multiple instances of the same tag name, but in this case we're looking at an MP3 file (ID3 tagging) so should generate a null-byte separator within the single TPE1 tag. But for some reason PA is not parsing this particular file correctly, not sure why as yet.

Andre

Link to comment
Share on other sites

At this moment, for id3v2 only genre tag separates multiple tags by :

I added NUL separation with ; (as for other tagging schemes) for id3v2 as well - will be in builds 940+. As previously this will require adding ";" to the split symbols in Poweramp scanner settings.

Thanks for the request and test file.

Link to comment
Share on other sites

The original question in this thread was about null-byte separators in the Artist (TPE1) tag, which as far as I know should work for MP3 / ID3v2.3 tagging (it works for me anyway, without needing v2.4 spec files). However for some reason separated artists are not being generated by this sample ID3v2.3 file.

Andre

Link to comment
Share on other sites

2 hours ago, PrinceMojo said:

Since Max has indicated that this will be fixed in build 940+, I will mark his post as the solution. Thank you to everyone who participated in this thread.

OK, as long as you are happy that the problem is with splitting the Genre tag as Max mentioned, but I thought your issue was with multiple Artist names?

Andre

Link to comment
Share on other sites

8 hours ago, andrewilley said:

OK, as long as you are happy that the problem is with splitting the Genre tag as Max mentioned, but I thought your issue was with multiple Artist names?

Andre

Yes, my issue is with multiple artists.

On 5/19/2022 at 9:11 AM, maxmp said:

At this moment, for id3v2 only genre tag separates multiple tags by :

I added NUL separation with ; (as for other tagging schemes) for id3v2 as well - will be in builds 940+.

I interpreted this as "current versions of PA support multiple tags for genre and nothing else, but multiple artists (as well as other tags) would be included in future build 940+." If it is, then I think this solves my issue since multiple artists will be supported in the future builds. Otherwise, we could use some clarification from @maxmp and would still need a fix for multiple artists specifically.

Link to comment
Share on other sites

Support for null-byte separators to create multiple individual items within Artist (and other?) ID3 tags has been provided since PA build 911, which was released in August of last year:

image.png


What I'm not sure of is why your sample file is not working though, as my similar test files (also ID3v2.3) work fine with what looks like exactly the same binary formatting for the TPE1 tag.

This is your tag breakdown (which fails to split):

  | Artist = Bring Me The Horizon/BABYMETAL
  | - Tag 'TPE1' (67 bytes):
  |     01 ff fe 42 00 72 00 69 00 6e 00 67 00 20 00 4d [...B.r.i.n.g. .M]
  |     00 65 00 20 00 54 00 68 00 65 00 20 00 48 00 6f [.e. .T.h.e. .H.o]
  |     00 72 00 69 00 7a 00 6f 00 6e 00 
00 00 ff fe 42 [.r.i.z.o.n.....B]
  |     00 41 00 42 00 59 00 4d 00 45 00 54 00 41 00 4c [.A.B.Y.M.E.T.A.L]
  |     00 00 00                                        [...]

Versus one of my own MP3 files (which works):

  | Artist = David Bowie/Mick Jagger
  | - Tag 'TPE1' (53 bytes):
  |     01 ff fe 44 00 61 00 76 00 69 00 64 00 20 00 42 [...D.a.v.i.d. .B]
  |     00 6f 00 77 00 69 00 65 00
00 00 ff fe 4d 00 69 [.o.w.i.e.....M.i]
  |     00 63 00 6b 00 20 00 4a 00 61 00 67 00 67 00 65 [.c.k. .J.a.g.g.e]
  |     00 72 00 00 00                                  [.r...]


Andre

Link to comment
Share on other sites

Hmm, I've just re-checked my own file by removing it, copying over a new edit from MP3Tag, and doing a Full Rescan - and now PA is mis-reading that file too. I think something may have changed in the scanner, or perhaps in MP3Tag.

Before the rescan, my test file was showing (as per my 19 May screenshot) as:

image.png

Whereas today with a replaced file (with the above quoted TPE1 tag) after a rescan in build 939, it is showing as:

image.png

 

Perhaps Max found a general bug in the null-byte parsing code, and has fixed it for 940?

Andre

Link to comment
Share on other sites

I think it's some sort of bug as you said. I just tested a few different files by editing the artist tags using MusicBee instead of MP3Tag and it also failed to split the artists.

Edited by PrinceMojo
Link to comment
Share on other sites

  • 3 months later...
  • 1 year later...

@andrewilley  Hello Andre! Unfortunatel, I ja e to reopen this thread. I have a problem or maybe a lack of knowledge with multiple composer tags. In current PA version 977, multiple tags version work fine with tags for flac files. But the same files converted into AAC format, with the same tagging as in flac files (Display composer= A composer; B composer; C composer and three separate entries COMPOSER) are read by the PA like a single string:  A composer B composer C composer. In other words PA ignores ; as separator in m4a files, despite the relevant options chosen in the settings.

Attached screenshots with the same track but in different formats.

I'm not sure whether it's a bug or limitations set by AAC format itself. Just want to know whether it can be solved or maybe I should regard using Vorbis format instead 

Screenshot_20231220_054126_Poweramp.jpg

Screenshot_20231220_054108_Poweramp.jpg

Edited by NickIst
Link to comment
Share on other sites

@NickIst

M4A tends to be an Apple-sourced format (proprietary), as as such the documentation, such as it is, is somewhat reverse-engineered. When I did some tests in PA, it does look like multiple M4A composer tags (separate tags defined as "\xa9wrt") are getting concatenated with joining newline separators within one PA Composer string. I've just done a test of FLAC (Vorbis tags), MP3 (ID3 tags), and M4A (Apple, go figure!), which showed:

FLAC (separate individual COMPOSER tags):

 Composer = Composer A
 - Tag 'COMPOSER' (19 bytes):
     01ab: 43 4f 4d 50 4f 53 45 52 3d 43 6f 6d 70 6f 73 65 [COMPOSER=Compose]
     01bb: 72 20 41                                        [r A]
 Composer = Composer B
 - Tag 'COMPOSER' (19 bytes):
     01c2: 43 4f 4d 50 4f 53 45 52 3d 43 6f 6d 70 6f 73 65 [COMPOSER=Compose]
     01d2: 72 20 42                                        [r B]
 Composer = Composer C
 - Tag 'COMPOSER' (19 bytes):
     01d9: 43 4f 4d 50 4f 53 45 52 3d 43 6f 6d 70 6f 73 65 [COMPOSER=Compose]
     01e9: 72 20 43                                        [r C]

image.png

 

MP3 (null-separator zero-bytes within one TCOM tag string):

 Composer = Composer A / Composer B / Composer C
 - Tag 'TCOM' (38 bytes):
     0053: 00 43 6f 6d 70 6f 73 65 72 20 41 20 00 20 43 6f [.Composer A . Co]
     0063: 6d 70 6f 73 65 72 20 42 20 00 20 43 6f 6d 70 6f [mposer B . Compo]
     0073: 73 65 72 20 43 00                               [ser C.]

image.png

 

M4A (separate individual '\xa9wrt' tags, which seem to be getting concatenated within PA rather than being treated as multiple items):

 Composer = Composer A
 - Tag '\xa9wrt', Type='data', Flags=0x1 (10 bytes):
     0497: 43 6f 6d 70 6f 73 65 72 20 41                   [Composer A]
 Composer = Composer B
 - Tag '\xa9wrt', Type='data', Flags=0x1 (10 bytes):
     04b9: 43 6f 6d 70 6f 73 65 72 20 42                   [Composer B]
 Composer = Composer C
 - Tag '\xa9wrt', Type='data', Flags=0x1 (10 bytes):
     04db: 43 6f 6d 70 6f 73 65 72 20 43                   [Composer C]

image.png

 

However as a workaround, instead of using multiple '\xa9wrt' tags in M4A files, try saving the individual composer names within a single string (separated by semicolons) and it will work:

 Composer = Composer A ; Composer B ; Composer C
 - Tag '\xa9wrt', Type='data', Flags=0x1 (36 bytes):
     0497: 43 6f 6d 70 6f 73 65 72 20 41 20 3b 20 43 6f 6d [Composer A ; Com]
     04a7: 70 6f 73 65 72 20 42 20 3b 20 43 6f 6d 70 6f 73 [poser B ; Compos]
     04b7: 65 72 20 43                                     [er C]

image.png

 

It might help Max if you could provide an example of one of your problem M4A files, to gpmaxmpz [at] gmail.com.

Andre 

Link to comment
Share on other sites

@andrewilley  thanks for the suggestion. But I'm not sure whether it's possible to implement this workaround in automated manner and not to put manually composers in one string with semicolon as a separator. You know, it'll be quite a drudgery)

 

Edited by NickIst
Link to comment
Share on other sites

You could probably batch edit them in MP3Tag, but it'd probably be easier to see if Max manages to create a workaround based on your submitted sample file.

I just created two small test M4A files in MP3Tag (ignore the audio content). One is using individual separate tags for each new name, while the other uses semicolon characters within single tags. These were the results for three entries each for Artist, Album Artist, Composer, and Genre:

image.png

image.png 

As you can see, the 'semicolon within one string' versions worked fine for all four tag types. The separated versions failed to split only for Composer, and it also failed completely for Genre (which seems to have been encoded in a different manner in the file structure).

Single Tags with Semicolons:

 

Multiple Tags:

 

Andre

Link to comment
Share on other sites

On 12/20/2023 at 9:26 PM, andrewilley said:

The separated versions failed to split only for Composer, and it also failed completely for Genre (which seems to have been encoded in a different manner in the file structure).

In my use-case scenario, I can't reproduce bug with genres as my desktop software player's (MusicBee) tagging tools, use ony one string for genres. Regarding composer it has two type of fields: display composer and composer. By the way MusicBee says that m4a files use MPEG tags. 
Updated images

 

 

Снимок экрана 2023-12-22 004241.png

Снимок экрана 2023-12-22 004328 1.png

Edited by NickIst
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...