Genre does not stick when flac and m4a files open

This is a little weird….

I frequently use XLD to convert files from FLAC to M4A.

If I first run XLD on a set of files first, then run mp3tag, I now have both file formats (FLAC and M4A) viewable in mp3tag. Now I change the Genre to “Rock” on all files (both FLAC and M4A). Now I drag the folder to Apple Music (Apple Music will ignore the FLAC files). Once imported to Apple Music I click on the album - the genre is blank. It should be “Rock” as I had set it.

But, if I first run mp3tag on the FLAC files ONLY, change the genre to “Rock” (on the FLAC files ONLY), then drop the folder into XLD where it creates the M4A files, then drag the folder to Apple Music (again FLAC files are ignored on import) - now the genre of “Rock” is shown in Apple Music.

I don’t know if having both FLAC and M4A open in mp3tag is the issue or if XLD is doing something to the M4A files it creates such that the Genre tag is not sticking.

Normal usage of just having M4A files open (files came in M4A format to start) in mp3tag and then changing the Genre and then dragging to Apple Music - these steps never have a problem.

Just for completeness….I did try running XLD first, then delete all FLAC files, then run mp3tag on M4A files only and Genre tag still does not stick. Very odd what XLD could be doing.

Could be related to this other very recent thread about Genre issues on MacOS.

I think at this point it will need some direct input from @Florian since I think all other potential solutions and workarounds seem be exhausted.

I sent Florian a test file this morning.

I've analyzed the issue and it's related to two different ways of storing the genre in the MP4 tag.

Mp3tag tries to use the gnre MP4 atom for genres that are part of the ID3v1 standard. This stores the index to the actual genre in this pre-defined genre list. For custom genres, it uses the ©gen MP4 atom, which is what Apple Music seems to expect now.

I have not decided on a solution for this so far.

Interesting. I am using #17 on the list (Rock). I would think Apple could handle that…maybe not. I also should note that I type “Rock” in the genre box on mp3tag, I do not use the drop down.

Yes, it detects genres that are part of the ID3v1 genre list internally and writes the corresponding index.

I believe Apple used to handle gnre atoms in the past, iTunes definitely did. My impression is that Apple Music is getting worse by the minute and the development focus has shifted elsewhere.

My analysis was incomplete and I've incorrectly blamed Apple Music on this.

Lots of code changed in the MP4 implementation to v1.9.7 and it seems that I'm not writing the typeID for the gnre atom expected by Apple Music anymore. Apple Music seems to expect no type (0x00) whereas Mp3tag for Mac currently writes signed integer 0x15.

I'll investigate further and keep you posted.

I've just released Mp3tag for Mac v1.9.10 with a fix for the issue where the MP4 gnre atom for GENRE used a type identifier that was incompatible with Apple Music so that "Unknown Genre" was displayed instead of the actual genre.

To be fair, Mp3tag used the correct type identifier, but Apple Music expects it to be unspecified to pick up the genre. This issue was introduced with v1.9.7, where lots of the MP4-related code changed.

To ensure that the genre is written in the correct format, you can change the genre to something else, then save, and then change it to the actual genre you want to use. This way, the genre atom is rewritten by Mp3tag in the correct format and not reused and simply copied over when saving.