Actually, I don't scan the disk to find random albums; I have a text file that contains a list of every album's full path, and I pick a random line from that file. So only the selected album's directory gets scanned. And the mp3 partition is mounted read-only (I should have mentioned that before), so the atimes shouldn't be getting written as it is.
OK, so it's not a disk IO problem at all. It's really related to the sound
driver it seems. Now that you say it, I remember having noticed skips on
my laptop with a via 82cxxx chip after tens of minutes playing. At first
I thought it was related to other activity on the system, but it did exactly
what you describe, play seconds 1, 2, then 5 without a hole between them.
There may be a problem with the way the audio buffer gets allocated or freed.
So I'm guessing that there isn't actually a way to manually move buffer-data out of RAM?
Yes, there is. I have a quick'n'dirty program which does exactly that.
Basically, you tell it how many kB you want to free, then it allocates
and uses that amount of memory, frees it and exits. Buffered data gets
flushed very quickly. I sometimes give it a try before starting to work
on large kernel trees, because it helps the entire directories to fit in
Here it is if you're interested. Don't start it without an argument, it
will try to allocate 4G !