How to map volume buttons on Apple EarPods

I cannot control volume using Apple EarPods's buttons. Is there any way to do so?

My system: Ubuntu 14.04 64bit.


Apple EarPods use a special/different type of connector layout called CTIA.

Your Macbook works perfectly with CTIA headphones because they are both Apple products and implement CTIA. Your ubuntu setup most likely uses OMTP.

Here is an image depicting the mismatch:

enter image description here

This incompatibility will prevent you from using your Apple EarPods