2

I have been messing around with pi3 for a couple of days now and I made a project with java netbeans which would play the audio file etc.

On my desktop everything works fine, project, sound etc.

On my raspberry pi3 project works fine as well, it plays the audio but its quiet and has some sort of distortions..

Now I did some research and I used omxplayer to test the audio from console. So when I play audio via console using omxplayer it sounds perfect, loud and with no distortion..

Does anyone point me to where I should look to solve this problem? Should I add extra packages or can I change some settings maybe? I am still consider myself a noob with pi3 and linux

1
  • 2
    It's going to be difficult to diagnose unless you post the code you're using to play the audio at the moment.
    – goobering
    Nov 7, 2016 at 22:33

2 Answers 2

4

IMHO the audio quality never was great on the original Raspberry Pi model A and B. It even got worse with the introduction of the A+, B+ and all following models.

There are only two things you can do to improve the sound quality:

UPDATE:
The sound quality has improved on the Model 3B+. To me it is now no longer distinguishable from the original Raspberry Pi A/B but much better than A+/B+, 2B and 3B.

3
  • These are all sensible suggestions which I'd normally upvote (might also be an idea to include HDMI audio via something like this. In this case, however, it sounds as if omxplayer from the terminal is working fine, but audio through Java isn't. Changing the hardware isn't likely to be effective if the issue is software related.
    – goobering
    Nov 8, 2016 at 9:24
  • @goobering Thank you! that's exactly what I am always saying while reading every single topic in the forums about that where everyone is saying to add some extra hardware, change to hdmi etc, which makes no sense at all.. If it sounds great from console that means hardware have nothing to do with it at all..Maybe the power supply as when you execute java code it will take good amount of juices from the raspi3 to execute it all while console takes like 1% of the cpu usage.. but I doubt it.. Nov 8, 2016 at 17:07
  • There is a list of sound cards available here : elinux.org/RPi_Expansion_Boards#Sound
    – Matt
    Nov 8, 2016 at 22:00
0

If it sounds good when using omxplayer, then you don't need to replace the sound card or anything like that.

If you hear distortion, it would be interesting to know whether there are underruns, where you application isn't presenting data fast enough to the ALSA driver. Which sound library are you using in java ? Perhaps you need to understand how to turn the volume up and increase the playback block size ?

Matt

1
  • Well I use MP3Player with java code, its strange that it sounds good on othe pc's etc. I increased the volume of 100% which made things a bit better, but it's not as clear as I would play with console.. Nov 8, 2016 at 22:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.