Why do some earphones work but some have garbled audio on my phone? I recently bought a rebranded Innos D9 from China. When I tried using the earphones that came with the phone and the Sony earphones I have, the audio is fine. Really awesome too. 

However, when I use a generic Samsung earphones, I hear garbled audio, like the sound is coming from a cave. When I play a video, the voices / speech of people are distorted. Also, I don't think equalizers would fix this because I know how they work. I also tested Apple's Earpods, to the same effect.

I would like to know why this happens. Maybe I could download an app to correct the sound, or at least know what earphones to buy in the future.

Note: The phone has a built-in Yamaha music amplifier that boosts AAC or something, if that information would help.

Another update: Found a relevant thread on XDA and the fix I did was to push the answer button on the Samsung earphones, and the audio was fixed. Do note that for the audio to stay that way, the button should be pressed always. This is not a good fix.
The pin layout between the working and not working head phones might be different and hence this behaviour.  Though it appears to be simple there is no one standard to which all these manufactures seems to stick with. For instance my LG P500's stock ear phones exhibit this issue with Sony Ericsson SK17i, while Sony's head set played well in my LG P500.  

The same problem exhibits when I use my LGP500 head phones in my desktop computer. While doing so, I just pull out the head phone slightly out to solve this issue.