iTunes special tags


I'd like some help, please, from Florian and the experts here. I was confused by the special tags that iTunes adds to mp3 files. These are for things like volume normalising (SoundCheck), gapless playback, CDDB, etc. It looks like iTunes adds these as multiple comment frames. iTunes and mp3tag can handle them correctly, but some other programs get confused. The result is the tags often get mangled and you end up with garbage in the comments like strings of hexadecimal numbers.

I've done a lot of searching but there isn't much information around. Few people seem to understand it fully and most of them are on this board. I've written down what I found so far to help other people. Please correct me if I got anything wrong.

In ID3 a file can have multiple comment tags. This is unlike most other tag types which can only occur once in a file. The regular comment is in a frame called COMM (or COM in the earlier v2.2 standard). Then any additional comments are in extra COMM frames which have a special content descriptor. There is a null between the content descriptor and the actual value.

iTunes adds several of these extra COMM frames for its own purposes. I've seen content descriptors like iTunPGAP, iTunNORM, iTunSMPB, iTunes_CDDB_1, iTunes_CDDB_TrackNumber. There may be more.

In most programs you wouldn't know these extra COMM frames were there at all. All you can see is the standard comment. I'm not sure what algorithm programs use for this. Presumably when the program sees a null in the middle of the comment it ignores the whole thing.

I haven't been able to track down which program is mangling these frames in my files. At various times I have used MediaMonkey, XMPlay, Winamp and others. They are all good programs and I wouldn't criticise them. But something messes up the tags so that the data from the special comment turns into a regular comment. You end up with lots of files where the comments are strings of hex numbers. There are lots of reports of other people with this problem, but few explanations.

The good news is that mp3tag handles everything correctly. It displays the extra comments in the extended tag editing box like this "COMMENT ITUNPGAP". You can then edit the contents or delete the tag completely.

So I have done a mass cleanup and removed these unwanted tags completely to avoid further trouble. In mp3tag I selected all the files at once and used the extended tag editor to delete the extra iTunes tags. I then selected the files which had corrupted comments and changed the comment to a single space. This is important if you want iTunes to read the new value and discard the one it already has.

I then updated the database in iTunes by re-reading the tags from the files. iTunes will only read the tags from the file when you play it or open the Get Info dialog. So it's a bit tricky to update the whole database at once. The best way I found was to select everything then open Get Info on all the files together. You actually need to write something to make it work, so pick an unwanted field. I wrote something into the "Disk n of n" field which then updated everything in the database over several minutes.

So for now I am very happy. But I have a few remaining questions.

(1) Is my description above correct or have I misunderstood what is happening?

(2) Can we please have some documentation for mp3tag about the special fields like "COMMENT ITUNPGAP"? I searched through the help and couldn't find anything about these field types.

(3) How can I get these special fields to display as columns in the main window? I think there is some special way to code this but I couldn't find the documentation.

(4) Can I use mp3tag to add a special comment frame of my own? What is the syntax for doing that?

Thanks for your help, tenbob

  1. Enter the "Columns ..." dialogue by right-clicking on any column header.
    Enter the field to which the information should be stored in the mp3tag variable syntax, e.g. %comment itungap%
    IF you also want to write to that field, enter the value in the same syntax, e.g. %comment itungap%

  2. Either create yourself a column in the fashion described above - entering any value in the field will then create a corresponding tag in the file or use the extended tags dialogue and press the "New" button. THen enter the tag name without the enclosing % delimiters.

Thanks Ohrenkino. Your suggestion is working fine. With this technique I can now write any arbitrary tags into the file.

There is no validity checking, but I don't need this. I can write a new tag named XRAY to the file. I can also write a tag named XYLOPHONE which is invalid because the ID should be four characters.

I am pleased to see that mp3tag correctly handles multiple COMM tags with content descriptors. If I enter a new tag with a name like "COMMENT CROCODILE" then this is parsed into two parts. It creates a COMM tag with a content descriptor of CROCODILE.

There are a couple of quirks. Everything you enter for the tag name has to be in capitals. For simple tags this is correct. But it's not correct for content descriptors. It means you can't exactly reproduce an iTunes descriptor like "iTunPGAP".

Also the drop down list of extented tags is constantly updated with all the new tags you have used. This can be a bit confusing if you make mistakes, change your mind or mis-spell the tag name. You are offered several choices that you don't actually want.

It would be really helpful if the help file included some information about using non standard tags, and how to add comments with content descriptors.

Thanks for your help.