problem with keeping iphone 4 ON

hi im facing a problem with my iphone4 the roblem is once i lock it after 10 mins while its locked it turned off and wont start till i force restart it or completely remove the motherboard but this doesnt happen if i leave music played (when music is played the phone doesnt turned off even if its locked) :/