QUOTE(davelasker @ Mar 19 2005, 08:53 PM)
I'm completing testing of a version 1.3 that corrects this problem and hope to release it soon.
After much hair-pulling, and with the help of several iPod-Shuffle-endowed users (unfortuantely I don't own one), I got to the root cause of the problem:
In an mp3 file, the metadata tags (i.e. song name, album, artist, etc.) are stored at the end of the file after the digitized audio. This allows them to be modified or expanded without touching the audio part of the file.
AACGain and mp3gain both add additional custom metadata tags to save the results of analysis and undo information in the file.
In mp4/m4a files as created by iTunes, the tags are near the beginning of the file inside the 'moov' atom. There is an empty 'free' atom after the tags. When tags are added in iTunes, the tag data expands, and the free atom shrinks, allowing tags to be added without rewriting the entire file.
The mpeg4ip/mp4v2 library used by AACGain doesn't work that way. When tags are changed, the entire atom containing the tags is replaced by a free atom, and a new atom for tags is written to the end of the file, after the digitized audio.
A file in this non-standard order can be played on iTunes and older iPods, but will not play on the iPod Shuffle.
The mpeg4ip/mp4v2 library includes an 'Optimize' function, which rewrites the file in the normal order, with the tags in front of the audio. When the output from AACGain is Optimized, it will once again play on the Shuffle.
When AACGain is run from the command line with the
/t (Use Temp File) option, it uses the Optimize function to rewrite the file. When I use AACGain myself, I always run it from the command line, so I never saw this problem.
However, the MP3GainGui.exe program, which most users use as a front-end to AACGain, doesn't pass the
/t option under all circumstances. So many users unexpectedly got files in the "bad" order. However, in some cases it would pass the option, resulting in the "bad" files getting fixed.
Another result of the missing option is that if AACGain is ever interrupted mid-file, the file could be left in a corrupted state. I believe this is the cause of very sporadic corruption that only 2 users have reported.
The fix is very simple - I am changing AACGain to always ignore the setting of the
/t option, and to always use a temp file and Optimize.
Once the new release is out (should be by this weekend) anyone with a misordered file will be able to correct it just by processing it again.
Thanks to all the users who helped me through this!
Dave