I'm not an expert by any means, but does your keyboard have buttons to control sound, music/video playback, etc.? If so, it might be a problem with the wiring inside the keyboard related to that (loose/bad connection, broken wire, etc.). My first (non-expert) suggestion would be to connect a different keyboard and see how the sound works. If that fixes it, you may have found the problem.