« Functional Programming in C# on Deep Fried BytesInstant gratification for developers »

Making iTunes stop that gapless playback nonsense

06/11/08

Permalink 08:14:49 pm
Categories: General, Mac

Making iTunes stop that gapless playback nonsense

Here's a problem that a lot of people are having: iTunes supports gapless playback since version 7.x. Okay, admittedly there are also people who think it's great - to clarify, my personal negative reaction to it is not strictly about gapless playback as such, but rather about Apple's implementation approach.

Apple seem to assume a number of things:

  • everybody needs it
  • the process of gathering all the required info is short, painless and unintrusive
  • their implementation is perfect and doesn't have any bugs

These assumptions have led them to leave out a simple checkbox in an Options dialog, which would allow to switch the collection of gapless playback information off. Not only that, since 7.x (we're now on 8.x) they have continuously ignored feedback from users asking them to add this option. I count myself lucky not to have stumbled upon this issue shortly after the introduction of the feature, because it must have been much worse then - many people reported severe problems at that time, which usually ended in iTunes crashes.

Before I get to the point of describing my own issue, I would just like to state that I find Apple's attitude towards this issue despicable. It seems to constitute a severe error of judgment not to introduce the option above from the start. I don't know the right words to describe what I think about the neglect of customer opinion that is apparent today, seeing how the latest versions still haven't changed in this regard. And at the same time Apple continually makes iTunes a more and more important application - it used to be for dealing with music, now it does podcasts, videos and the iTunes and App stores, in addition to being the only feature complete management frontend for iPods and iPhones. If you're listening, Apple, this is ridiculous.

Now, the issue I was seeing is not a bug - or maybe it is one, on some level. I have a collection of music on a network share, with a total volume of around 40GB. Around 600 CDs I ripped myself, a few songs recorded from internet radio stations and the rest is podcasts. When I ran iTunes, it started analyzing all the files for gapless playback info (whatever that actually means, I was unable to find out precisely what this analysis step entails). This process went rather slowly, at maybe one file per two seconds or so. More importantly though, the implementation of this is such that iTunes uses up all available CPU for the duration of the scan. Since I need to use my computer every now and then, I never actually saw whether the process would complete at some point - it might, but then again, I have seen some forum posts that claim the process started over the next time they ran iTunes.

The process certainly started over for me every time I re-ran iTunes, and confusingly the total number of files in the status message always seemed to be the same. Since the information gathered is allegedly stored in the MP3 headers of the files, I don't really understand why iTunes apparently scans the same files all over every time. At least canceling the process usually worked for me, if only for a while. I saw that on occasion the scanning would resume later on - not hard to notice, since the computer became unusable every time this happened - and of course at the next iTunes start it would start over.

In some forum I found the hint that there's an option on each file which says "this file is part of a gapless album". I found the option and set it to "no" for all files in my collection, as per instructions. Unfortunately this didn't help at all, no idea why. There seems to be an additional confusing connection to the global "crossfading" option, but I tried all possible combinations without success.

So, on a technical level, these here seem to be the issues:

  • The process is implemented with what seems to be high priority (in contrast to just "normal" priority). It appears to use both cores in my machine, thereby effectively blocking the rest of my system. Not a good multi-tasking citizen.
  • Status saving for analyzed files seems to be either broken or brain-dead, otherwise the process would at least get done over time. As it is, the scan seems to be run for the same files over and over.
  • The information is stored in the files themselves. Why do iTunes developers assume they have the right to change my files without asking me? Don't do that! It would not have been a problem to add an option to my iTunes library file instead. (Admittedly, the workaround below would not work then, so at this point, without the option to switch gapless playback off altogether, I'm glad they were insolent enough to store the info to the files.)
  • The per-song option to configure gapless seems to be broken. If it's not broken, it's badly implemented - an option that doesn't do what it name says is useless.

Now, for the positive news. There's an easy way I found to "deactivate" the collection of gapless playback information.

It is to simply make the folders in which your iTunes library resides (yes, the physical files) read-only. If iTunes can't write to the files, it doesn't collect gapless playback info. In my case we're talking MP3 files, and while I wouldn't expect any difference, I don't have a clue about other file types.

Depending on your setup, there are probably several possible ways of doing that, with various benefits and drawbacks. In my case, I simply went to my file server and set the permissions on the entire network share to read-only. Then I created a second share for the same directory, on which I set read-write permissions. This way I can now access the data on the share just as easily as before, but iTunes can't change the files anymore. When it comes up, I see the status message about gathering gapless playback info flash by quickly, but it doesn't last more than maybe a second or so. Nice.

If your setup doesn't involve a network share, you would probably succeed most easily by changing the NTFS (or Unix, if you're on a Mac) permissions for the directory, taking away write permissions. I don't use iTunes to download podcasts, but I imagine it would even be possible to leave a certain sub-directory read-write for these (or videos perhaps), while making the rest read-only. In any case I think it's beneficial if the actual music directory is not the same as the "iTunes music folder". That's what things are like for me, and it works just fine. Ah well... YMMV. Enjoy.

11 comments

Comment from: mp3 [Visitor]
mp3Thank you for this.
07/31/09 @ 11:26
Comment from: Andrew [Visitor]
AndrewThe disadvantage is that itunes can no longer manage your library automatically, moving and renaming files.
02/13/10 @ 18:38
Comment from: David [Visitor]
DavidHi there,

This has been a problem for me with iTunes 8 and now 9. I tried your suggestion--changed the folder on my external to "read only"-- but it still wants to determine gapless playback on open.

Any other suggestions much appreciated.

David
02/23/10 @ 13:25
Comment from: Brandon [Visitor] Email
BrandonI also tried the read-only trick but no go. It is UNBELIEVABLE that gapless cannot be turned off. Stupid, stupid, stupid Apple. I mean, really?

Also, I tried to turn on Apple's organization after I made everything read-only and it created artist and album folders, but did not move any tracks.

Any help, any suggestions? Anyone want to invest in PEARPODs?

Icarly.
03/01/10 @ 14:44
Comment from: JohnsonsJohnson [Visitor]
JohnsonsJohnsonprops

props still required - thank you we're at version 10 and beyond

apple is creating their own downfall
02/09/11 @ 20:50
Comment from: adam [Visitor]
adamWhat I'd like to know is what exactly is being analyzed? What is the point of this whole stupid exercise?

All that is necessary to provide gapless playback is a buffer on the player to allow the next song to be retrieved while the last song is finishing up. About a day's software effort and a hundreth of a penny buffer memory.

Why does apple think it necessary to spend trillions of cycles of number crunching to do something so trivial?
06/23/11 @ 22:20
Comment from: Dave Tufte [Visitor]
Dave TufteI got partial success with the method from the original post.

We have about 25K songs on an NAS (MyBook World "White"). Mostly MP3s.

My wife runs iTunes and has only about 8K songs in her library. Mostly MP3s accessed off the NAS. The rest are iTunes on her local (Vista) PC.

When her library was corrupted, and I rebuilt it, iTunes 10 insisted on gathering gapless playback information on about 7K songs. Again, mostly, but not all, MP3s from the NAS.

Here's what I did:
1) Old-school: changed the attributes of the files on the NAS to read-only. This did not work because NAS doesn't preserve that information.
2) New-school: I followed the directions here and created a user on the NAS itself for my wife's account, and made the share containing our MP3s read-only from that account.

This did not solve the problem completely, but when I reopened iTunes it was down to about 300 songs that still needed gapless playback information gathered.

It sucks that I didn't get it to zero, but it is still a big improvement. I have no idea why these 300 songs are different from the other 6,700. They are all on the same read-only share.
05/29/12 @ 17:59
Comment from: matty ice [Visitor] Email
matty icei really need apple to add a on/off feature for determining gapless playback! i have over 25,000 songs, and it totals around 160 GB and it takes at least 2 minutes to finish determining gapless playback, and thats only if i don't have any music going. sometimes it takes up to 8 minutes and usually when it takes over 5 minutes it crashes my itunes, and running my itunes is no problem at all after determining gapless playback, but every time i add a song, it starts the process again.
07/24/12 @ 06:55
Comment from: macman [Visitor]
macmanAhh Now I know how itunes audio files can get that double take at start or repeat, Apple are corruption your music file... Its all a bit suspect if you ask m all I know is there is lots of discussion over ont eh Apple boards and no action. You think Microsoft was big brother.. hehe

Got to go and put my fist in the GAP.... Before it bashes my Raid to death...
10/14/12 @ 13:15
Comment from: Wilson [Visitor]
WilsonMy first ploy was to install and use Media Monkey. It's far superior, works faultlessly and has no drawbacks that I can see so far, and I really recommend giving it a go.
As a matter of principle I then uninstalled ITunes, using an unistallation programme that scans for left overs.
In spite of this, there must have been something embedded in my computer that prompted repeated demands to 're-install Itunes'!
For the sake of a quiet life I did so, I now never open Itunes, and I get on with my life.
09/09/13 @ 13:52
Comment from: Wilson [Visitor]
WilsonTry using Media Monkey instead. Far superior!
09/09/13 @ 13:53

Leave a comment


Your email address will not be revealed on this site.
(Line breaks become <br />)
(For my next comment on this site)
(Allow users to contact me through a message form -- Your email will not be revealed!)
Please complete the song title below. Hint: enter 's', 'a', 't', 'i', 's', 'f', 'a', 'c', 't', 'i', 'o', 'n'
antispam test

Enter your email address:

Search

Oliver
MVP logo
September 2014
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30