HD2 Troubleshooting - bibanon/android-development-codex GitHub Wiki
Before throwing it in the bin, check that the pin connections actually touch the battery. The HD2 has the unfortunate flaw of having a pin stick out from time to time, so just push it back in and you're ready to go.
If MAGLDR was just installed, note that it cannot charge the battery when fully powered off; your HD2 will only charge once it has booted into an operating system. That's why it is imperative to have your battery more than 50% charged when first installing MAGLDR.
Your phone is not dead yet, though. Just buy a cheap external battery charger and your HD2 will work again. It's also advantageous to have two or more batteries so that you can just switch them out and lose the downtime of having to plug in your phone.
In most cases, your headphones are being wrongly recognized as a headset, confusing the music player into interpreting signals from a nonexistent play/pause/skip button.
The solution is to disable headset commands from your music player app.
The WizDroid app is a perfect solution. You will need to have Android 4.0+ to use this app, though.
If the headset cannot be disabled or there are problems elsewhere, the simplest solution is to actually use headphones with 3 ring jacks or buttons (like iPod earphones).
If you want to use your normal headphones, you need to get a "audio input/output splitter", which will redirect the headset band to nothing, and also allow you to use conventional microphones with the HD2. This is nice to get, especially now that new laptops are using the same 3 ring jack.
See the Key Remapping guide.