Check the auxiliary headphone jack (3.5mm) to make sure that it is not obstructed by dirt or an object that is making contact between the pins.
If there does not appear to be anything wrong with the socket, restart the tablet.
If still the problem continues, we advise you perform a factory reset. To do this, go to:
Settings > Backup and restore > Restore factory settings > Reset tablet.
Note: When restoring the device's default settings, you will lose all user information related to applications, accounts, settings, etc., as well as all photos, music or videos. Therefore, before proceeding, we recommend that you backup the device.