This sounds like a problem in the power supply section. If this keyboard has an external power supply that plugs into a wall socket try to borrow one just like it from a store or a friend. See if that fixes the crackling. If it does just purchase a replacement power supply. If the power supply is internal to the keyboard (you can tell by a wall plug cable goes directly into the keyboard), have someone who knows electronics disassemble the unit and replace all the electrolytic capacitors in the power supply section. These capacitors sometimes breakdown and allow internal shorting which could cause the crackling and also could cause the unit to shut down temporarily.