There is an issue with a lot of Android phones where the OS thinks the headphone is being plugged in and unplugged on its own.
I have rooted 4.0.4 AOKP and it still occured. The app should include older versions of Android shortly as soon as Google Play shows my latest changes.