It could be an infection, or it could be 'Eustachian tube dysfunction' or ETD.
The crackling noises that you hear in your ears are as a result of the fluid in the middle ear becoming thickened, usually as the result of a cough or cold. There is a fine tube that runs from the middle ear to the back of the throat called the 'Eustachian tube' and this becomes blocked by this sticky fluid, or mucus. The crackling is due to the mucus moving within the middle ear, and it is the blockage which may be causing the pain.
You could try inhaling steam, or over the counter decongestants some of which are available in tablet, or nose spray form. Nonetheless, if the symptoms persist though, you should get your ears checked over with your GP.