Is it shutting off entirely, with no display; or is the sound just turning off?
If it's shutting down entirely, then it's probably starved for voltage. This is usually caused by a poor ground connection or a problem with the (yellow) constant power wire. As you turn up the volume, the deck requires more current flow; and if there's a resistance on the ground or power wire, then the increased current results in a voltage drop. When the voltage drops too low, the deck shuts off.
On the other hand, if the sound is cutting out, then there's a problem with a speaker or the speaker wiring. You may have a blown speaker; a pinched or shorted speaker wire; or the speakers may not be wired correctly. The deck's internal amplifier is shutting down for protection.