The headphone jack on my phone doesn't work from time to time. Sound is then played over the loudspeaker, not the headphone. It's quite annoying, but not yet worth the trouble to send in my phone for repair.
Phone: Sony Z1 Compact, Android 5.0
Is there a way (setting) to force Android to send sound to the headphone jack?