What ID3v2 could have been
underjord.io
underjord.io
One of the most frequent problems is how to organize various pressings of an album. Specifically, if I have an album that was originally released in 1970, but my copy in question is a Remaster from 2001, what do I use for the year? 1970, or 2001? You might initially think to pick the Remaster year, but let's assume that this is Album II of Famous Band, and I don't happen to have a rip of the original release. Now when I'm navigating through the band chronologically (as I usually do), the order looks like this:
Famous Band - 1968 - Album I
Famous Band - 1969 - Album II
Famous Band - 1974 - Album IV
Famous Band - 1980 - Album V
Famous Band - 1990 - Album VI
Famous Band - 2001 - Album III (Remastered)
My solution thus far has been to tag the album with the original release year, but then change the Album Name to "Album III (Remastered, 2001)". It's still not perfect, though.
It's somewhat gratifying to see that streaming platforms have the same problem, though, as I can see on Spotify/Tidal/Youtube Music that they regularly disagree on the release date of an album if their source is the remaster or re-release pressing.
- TDRL: release date
https://wiki.hydrogenaud.io/index.php?title=Tag_Mapping
Unfortunately ID3 doesn't define a VERSION tag like Vorbis does, which can be used to store the "Remastered", "Japanese Version", etc. metadata.
Compilation albums pose similar issues, by the way. If I tag the release year of the compilation album, then the individual songs won't be filtered correctly if I want to do something like "play 60s music" or "play 70s music" etc. (and the same issue also applies to your "remastered album" scenario), and if I tag the original release years of the individual songs, then the positioning of the album will be a bit wonky (and I've found that some software uses the earliest date found for the whole album, whereas other software uses the perhaps somewhat more sensible latest date. I'm sure some software exists out there that simply uses the date of the first/last track [1], as well).
Next problem is that support for timestamps more fine-grained than a year is equally spotty, so if an artist has released multiple albums in one year that don't happen to sort alphabetically, you also run into problems. To some extent you can override it by setting a custom sort order album name, but that can cause other issues elsewhere (i.e. when you do want to actually sort the albums alphabetically) and isn't supported by all players, either.
Curiously enough, I've found that files bought from the iTunes store often come with a full timestamp in their tags, even though iTunes itself only supports years, i.e. you can only view and enter a year within the UI and the full timestamp doesn't even appear to be used internally behind the scenes, because multiple albums released within the same year are still only sorted alphabetically even if they have full timestamp tags with the proper dates set.
[1] In fact iTunes does that for displaying the genre of an album – it just uses the genre of the first track, regardless of how representative that might be (or not).
Then you have fun things like should you use "; " or " / " or ";" or "/" to do multi item fields. Or should the tagger put the same tag in more than once? What happens if the band/artist has that char in its name? What will the player do? Do you want utf-8 or 16? It is a quirky mess. Then lord help you if you mix in 2 or 3 different programs that have their own interpretations of all of that.
Oh then you can have all flavors of an id3 tag in one file, plus ape, etc. That may or may not be synced between each other.
Then there is the generic TXXX tag. Oh boy that thing is an interesting one. Random things are stored in them. Is it necessary? Some is, some isnt. I have seen anything from picard NVP bits, random binary data, XML purchasing data, volume leveling, etc. Then if your editor of choice does not recognize the particular NVP they usually just ignore it. So removing them is interesting.
Oh then the data in the tags themselves can be fun. Depending on your source data. You can end up with "Random Person" "Random Q. Person" "R. Person" "R. 'coolnick' Person" "Random P." and so on. Musicbrainz uuid tag for that sort of fixes it. But only if the player supports it.
There is a tool out there that does a sanity check of some of this. Unfortunately the name eludes me at the moment. I usually use it to remove extra padding. Some of the editors like to leave 2-4k extra padding in each file for if you make another update. It speeds up updating. But once you are done...
I've not personally done this as I only keep one copy of each album (whichever I think is the best, subjective I know but it's my collection) but they have a powerful file naming scripting interface[2] which you can probably come up with something to satisfy your needs.
Obligatory: Make sure you perfect this with your edgecases on some copies of the files first!
1. https://picard.musicbrainz.org/
2. https://picard-docs.musicbrainz.org/en/config/options_filere...
I tried one of those software packages to fix tags and that was an unmitigated disaster. I kept the blast radius small, but it trashed everything I put through it, so I gave up on using anything automatic.
I think I only made it through the Bs or Cs (going alphabetically by artist) when it came to the level of detail to get release dates.
As you mention, steaming platforms have the same issue, which I find annoying, but at least I don't feel like it's my responsibility to fix it anymore.
Oof. I recently embarked on a similar retagging project, but since I'm not that big a music listener and only had a few thousand files, I actually made it through.
On the other hand in a similar vein I decided that I wanted to geotag all my old pictures and I've got no idea whether I'll ever make it through that project, or not…
This is something I should probably do as well. Lucky for me I've had an iPhone since 2007, so a good number of my stuff is geotagged, but I do have older photos and gaps due to photos given to me by others.
I just made a Smart Album in Photos to show me all the photos that aren't geotagged... Just shy of 2,000. That seems like something I can chip away at while bored.
The biggest pain point I have with ID3 tags is how compilations are handled, particularly when that compo is a DJ mix with individual tracks. I prefer to not have these pop up in searches unless I specifically want to listen to the whole album, so I've taken to setting the genre to "Mixed / Drum & Bass", for example. (I usually queue up music by the genre tag.) I also like to separate tracks with vocals vs purely instrumental, so those guys get "/ Vocal" appended.
iMusic on iPhone handles both cases poorly. It is sad that they are letting that app essentially rot.
I wish there was a better way.
My personal strategy when it comes to remasters is to pick my favorite version of each song and delete the others.
Automatically tagging files with information that might be personally identifiable (bought media from retailer X on date Y) is also the sort of thing that turns off users in a hurry. The possible benefits are far outweighed by the potential problems.
I wrote it in the spirit of taking the idea and going with it, off the deep end if you wish :)
At least the iTunes store actually does that.
It is useful though. In the iTunes implementation at least I think (I haven't checked in a decade or more, it was like this once but not sure about the latest) it only advances when a song is completed, not when it's started. So having a song come up one doesn't like that they immediately skip will appear in the number as the years go by.
- beets [1] for music tagging
- m4b-tool [2] and tone [3] for audio books merging and tagging (Note: I'm the author of these)
- iTunes and an iPod Nano 7g and iPod classic 2009 to listen "offline" (although audiobookshelf supports offline downloads)
- self-hosted navidrome [4] + substreamer[5] for music and audiobookshelf [6] for audio books on my android / ios devices
Everything with docker containers without further dependencies. I must say, that this works pretty good so far and I never missed something really bad on id3v2.3 or mp4/m4b native tags.
[1]: https://beets.io/
[2]: https://github.com/sandreas/m4b-tool/
[3]: https://github.com/sandreas/tone
[4]: https://github.com/navidrome/navidrome
I'm just setting up audiobookshelf this week and it seems promising. My hope is that they could eventually handle the m4b conversion in their app while also fixing chapter alignment with silence checking. Right now it still requires some manual work.
Audiobookshelf is evolving very quickly, so maybe one day it will provide these features. There are some rough edges, though.
I also considered audioserve + app [1], but I did not have the time to try it out.
Thanks, I hate it.
HxD will modify file in place one character at a time, that is individual WriteFile commands per byte. Depending on write caching policy modifying 100KB of a file has a chance of generating 100K*(cluster size) total written bytes to SSD.
Frhed DGAF and replaces whole file in place from offset 0 no matter the size of a file, offset of edit or size of edits.
The safe way nowadays is write new file, rename, delete old one. Best case scenario you get appends.
It’s difficult to tell how common it is, but it is trivial by either using seek() and write() or by mmap()-ing a file. I’ve done the former for the purpose of simulating virtual memory to work with multi-gigabyte data structures in 32-bit memory space. Dropbox does it when syncing changed blocks within a file. Databases usually do it.
...could a DoS attack on any SSD-based cloud database/storage provider be done simply by doing lots of small writes?
------------
If this really is true, it makes me wonder why Intel's 3D XPoint (y'know: Optane SSD) lost its steam - it's byte-addressable (and so I assume it's also byte-writeable... right?), so surely would be perfect for OLTP scenarios like this?
At the same time, I'm not aware of any actual modern RDMBS that reads and writes anything less than a 4KB page at a time, regardless of underlying storage media, simply because 4096 bytes is such a common allocation-unit everywhere you look: Linux, Windows, HDDs, SSDs, NTFS, extfs, even btrfs defaults to 4KB for file extents.
Can anyone with experience with the internals of "serious" RDBMS (i.e. MySQL, PostgreSQL, Sybase, MSSQL, Oracle, etc) explain exactly what happens at a low-level on-disk or on-SSD (or on-SAN?) when you run a SQL UPDATE to overwrite a single `int` column in a single row?
Simplifiying a lot here of course. E.g if your DB uses MVCC (multiversion concurrency control) old values cannot be removed until the last transaction is done seeing them.
Of course if you write your own storage engine you can do whatever you want. I wrote one for MariaDB a few years ago and you basically just have to implement the minimally required interfaces for it to work.
DBs traditionally have these technical details figured out pretty well, and the line between what is part of the DB and what is done by the OS can be blurry at times.
I've dealt with torrents, large file databases and backups. Well aware of hashing which makes this more amusing, not less, in my eyes.
I like having a play account, but that does not seem like a good solution at all.
In these days of interconnectivity something like modifying metadata or storing metadata inside a file is a deprecated concept. This is a good thing but it takes away the simplicity of files.
I have worked with MP3 files (built 2 audio players for Windows) and while it's fun, its very cumbersome as well. For example the metadata is not consistent across files. Not to mention how slow IO is. Furthermore it's not synced with the file. If another program changes a file, everything else stays behind. You can resync but that's slow.
This is a sacrifice we made for owning the music we bought. Today you pay a couple of dollars for a Spotify subscription and get access to millions of albums. Is that a good thing? It's certainly an evolution. You don't have to copy files around anymore if you want to share a song. You can just send a link. You don't have to manage metadata, sync lyrics, deal with quality etc. anymore. That's all done for you.
It's certainly convenient but it takes away the novel feeling of owning something.
MP3 or video files should have been left pure and untouched, with their original checksums. These media files should have then been wrapped in a standardized binary container that pointed to the inner file as well as a metadata payload.
Changing metadata shouldn't change the inner file or its checksum, which would make many tasks easy: distinguishing amongst various recordings and transcodings, consolidating metadata, stripping metadata, updating album art, etc.
The storing stars (ratings), tags, etc. could be easily accomplished in a portable way without sharing them to other users.
(Even something as ubiquitous as ZIP-files as a sort of unofficial generic container format is still mostly treated as an opaque blob by that kind of software.)
And as for software that does specifically handle media files: What do you think things like MP4 or OGG are? Exactly, container file formats holding the raw media data. And even without a proper container format like in MP3s (the ID3 tag is just directly prepended/appended to the raw MPEG stream) it's not too difficult, and any music player already needs to be able to skip the tag data.
So nobody's stopping you from writing a fingerprinting program that only looks at the audio streams within a file, and I'm sure something like that actually already exists.
Citation needed. I for one hate that everything nowadays wants to be a rent-extracting service. I will own my files, thank you very much.
Years later, they added back the lyrics button, but it's on so few songs if you don't listen to major artists. I understand a lot of that is on the artist's end, but the situation would be much better now if it was never removed.
I'm being pedantic, but it's one of many reasons I dislike Spotify these days, despite using it at this very moment.
For example between version 2.3 and 2.4 the size of the bytes to store information changed from 8 bit per byte to 7 bits per byte. In Version 2.4 they wanted to have the MSB always set to zero so it doesn't trip up hardware mp3 decoders in portable mp3 player that use the MSB so sync to audio dataframes. (Otherwise you may listen to the screaming loud noise made by the device turning your metadata into audio)
Many parts of the spec are just being able to parse different buggy implementations of audio tagging programs from the early 2000s.
It really was the wild west back then. Looking at it now is really charming as the post elaborated.
Obviously you've never experienced the shitshow that is HL7.
The ID3v2 spec is actually a complete disaster, horribly misjudging what was needed. Xiph (Vorbis) was a lot saner, but they didn't account well for people wanting to store binary data in tags (cover art, mostly). An almost perfect system would simply have been a property system with key / mime-type / value; mime-type could even have been restricted to 8-ish values (a byte) for simplicity.
I did not want to reclassify/reanalyze/add-cue-points to my track lib EVER again.
So far so good, it worked :)
Thanks for taglib btw.
MP3 tags specifically are a particularly weird thing. Music can rarely be attributed to one specific genre precisely, band and song names are routinely spelled different ways, same songs composed by one artist are often performed by another (or worse: same artist, same performer, but audibly different way another day) and everything is almost always messed up.
- You could have indexed all files on your computer or phone, searched for weird stuff like: "Voice recordings I had in the park (GPS coordinates + radius) last year."
- No odd "MIME auto-detect / file detection algorithms".
- No odd "encoding detection" algorithms.
- No Byte order mark (BOM).
- No odd "http-equiv" for storing encoding and file type.
We might have even gone as far as to implement some kind of "metadata firewall" in Internet browsers, to make sure you don't reveal more about your privacy then you choose.
Having a graph for metadata feels overkill. I'd rather opt for key-values, like ID3 or EXIF.
The French expression "usine à gaz" comes to my mind: https://en.m.wiktionary.org/wiki/usine_%C3%A0_gaz
And yet this isn't good enough - I often wish I had the orientation or sometimes the z-coordinate but it's not saved.
My first thought was shared file systems, e.g. a file server on a home network where each user would play MP3s from their client computer and could store their individual ratings in the files without overwriting any other user’s rating.
Darktable uses it to store editing history, for example, to enable non-destructive editing of the images.
In my experience trying to get photographers to use Darktable, the xmp files are their main complaint. Luckily you can disable them now, but it's still a strange and jarring default.
All that being said, I definitely appreciate the elegance of using sidecars from a software point of view. They are a decent and sometimes necessary compromise. If I was a developer given such a task, I'd probably suggest the same approach. But as a user...no thanks!
I remember Adobe Bridge would do this as well. I only used Bridge for a short while during the Creative Suite 2 era, so I don’t know if Bridge does this still or not.
Here’s an old thread from 2005 on a forum site where some people discuss the xmp files created by Bridge. https://forum.luminous-landscape.com/index.php?topic=9151
The first version of Bridge was released earlier that same year [1], as part of Creative Suite 2, so the discussion in the above thread is about that same version of Bridge for sure. The next version of Bridge came a couple of years later, in 2007 as part of CS3. I also remember that prior to the release of Bridge 1.0 as part of CS2, there was a public beta version of Bridge that I tested, which was pretty much the same as the eventual version that was released as part of CS2.
FLAC uses Vorbis tags which are very similar to ID3v2. AAC is also using its own tags which are very similar to ID3v2.
The tool I use (Kid3) treats all the same.
The amount of time I spent on getting these right in my collection…
It'd mean that the tagging standard could change but the audio file would remain the same as long as you don't modify it for whatever reason.
That day, when it begins to sound like an actual, legit good idea to write thousands of times the same piece of software in your music, photo, book, or video library, all the while tweaking parameters individually for each collection (each album, season…), and you can actually justify it rationally as a future time-saver because you already spent that much time fiddling with meta-'stuff' instead of enjoying pieces of content themselves…
Then maybe, just maybe, it's time to focus on your sanity, get a life, grab a spoon, and let smarter people (and more importantly bigger teams) than the army of you_alone_in_the_dark solve the problem of sorting the world's data. Or at least, for f#$%'s sake at the very least, get paid to do it. Because let's face it, it has become a job to listen to music "properly", and that's probably not good for your vascular tension.
Also, the world has moved to streaming in the meantime. Deal with it.
___
1: have funsies https://www.dublincore.org/specifications/dublin-core/dcmi-t...
---
Disclaimer: Any resemblance with my real life is obviously fortuitous. It is also absolutely preposterous to think that this kicked off a journey that led me to learn Linux, virtualizations/containers of all kinds (like VFIO/virtio, cgroups, deep-level stuff), eventually programming… It is expressly not because I had to "translate" some bullshit ID3vX into Vorbis comments that I wrote my first Python lines way back when. And nothing in here is of any interest to any of you whatsoever. Except, find the hardest problem you can see and try to solve it. You likely won't if it's really hard, but the journey is its own reward.