My iPhone 4S recently started adjusting its volume (both ringer and music) all by itself. A little research revealed that it was a somewhat common problem. The cause turns out to be a spring in the volume control assembly that rubs against a flex PCB, eventually cutting through the insulation on the PCB, and shorting the spring to the traces on the PCB. Apple developed a fix in the form of a shim that gets placed between the spring and the flex PCB. I made an appointment with a Genius at the Apple Store and had the fix performed on my iPhone 4S. It COMPLETELY and immediately fixed the problem with the volume control. Even though my iPhone 4S was nearly a year out of warranty, Apple only charged me $6 (including tax) for the placement of the shim. Thumbs up!!
I wrote a bit more about this on my blog, including a diagram of the how the shim gets installed:
If you've got an iPhone 4S (and perhaps the iPhone 4 too) with a volume that adjusts itself magically, as if a ghost is pushing the buttons, make an appointment at your local Genius Bar!
Bravo to Apple for repairing my iPhone for the extremely reasonable sum of $6!