Noise on Analog Audio Line

I am happily running OSMC RC3 on RPi2. I use HDMI video and Analog audio (OSMC set to HDMI + Analog out).

I am having an audio problem when watching some movies. Specifically, there is distinct audio noise / static. The noise is present even if OSMC is on mute. But the noise stops if I pause the video, and starts again when I push play (again, I hear the noise even if mute is on).

The problem seems to be really bad for some videos, and a non-issue for others. It also seems like the problem gets worse as the movie goes on - I thought maybe the Pi was overheating, but a check in System Settings shows CPU temperature at a normal 47C.

I would really appreciate if anyone else has had a similar issue and a solution that is confirmed to work.

The issue I am having sounds a lot like this thread, but unfortunately there was no solution provided there (@gelsenbart decided to bypass audio through a USB card).

This thread also ends with the purchase of a USB sound card. Although in this case @DBMandrake gave some suggestions to improve things:

  • Settings->System->Audio Output, turn on “Maintain original volume on downmix”
  • increase “Boost centre channel when downmixing” on the same page to between 3-10dB
  • OSD controls >> audio settings >> Volume Amplification (increase this)
  • 6 dB volume amplification and 3 dB boost centre channel gives decent result on most videos

This thread mentions that the RPi audio connector is special (it also has integrated video), and that could potentially cause audio output issues. My audio connector only had 3 rings (photo below), and looks like video (sleeve) and ground (ring 2) are joined. So I am not sure if that is likely to have caused the symptoms I described? But then, shouldn’t I expect noise for all movies and probably even when the video is paused?

That looks like a standard stereo connector - not the correct thing for the job. I suggest you get the correct lead, and see if it fixes things.
My own experience is that you can get odd results with a stereo lead, especially if it hasn’t been seated properly.

There’s nothing wrong with using a 3 pole plug in the B+ / Pi 2 - I do so all the time. Unless you need to use the composite video output you don’t need a 4 pole plug. (The composite signal gets shorted to ground when you do this, but the circuitry will be designed to handle this)

I hate to be the bearer of bad news but the analog output of the Pi is quite noisy unfortunately, and at low volume levels you will also hear significant distortion. Nothing really that can be done about that in software other than to keep the master volume at 100% and make use of volume amplification etc as described in that other thread.

The analog output is just a simple PWM (pulse width modulated) output directly from the SoC passed through a very rudimentary analog low pass filter. Effective resolution is approximately 11 or 12 bits (nowhere near 16 bit CD quality - some 30dB less SNR in fact) and there also seem to be problems with correct dithering not being applied before the samples are truncated and sent to the PWM system. (Which causes the harsh sounding distortion at low volumes - also known as quantization noise)

There was some talk a while back of replacing the PWM routines in the Pi’s firmware with Sigma Delta modulation which in theory could make a big improvement to the analog output quality but I’ve heard no more about that happening. That’s something that the OSMC and Kodi devs can’t do anything about though, only the engineers working on the Pi’s firmware could implement such functionality.

For use plugged into a small pair of computer speakers or similar you might find the analog output satisfactory, but for plugging into a proper stereo/home theatre system which doesn’t support HDMI sound input you’re much better off getting an HDMI audio splitter which will split the audio out of the HDMI stream to some analog outputs - the quality will be MUCH better than the built in analog output will ever be.

It doesnt seem to be a huge issue if you avoid playing with the volume on the machine itself and just max it out like mandrake said before.

Noise normalization or the downmixing thing it does to level the volume seems much less effective than old xbmc on the xbox for whatever reasons. It’s sort of a pain if you intended to use the machine itself for volume.

The 360 controller I’m using and planned wiimote with bluetooth once properly supported for volume controller are already looking to be stupid decisions on my end.

@DBMandrake @rasbpiuser584

Sorry, I should have added that I always keep the OSMC volume at 100% (I think this is what you are referring to as “master volume” - or is there even a second master volume elsewhere?)

I would agree the problems are from inherent Pi limitations, except I am hung up on a couple of things:

  1. the static goes away if I pause video. Doesn’t this tell us the
    problem is not a physical hardware issue?
  2. the static is present if the video is playing but on mute. The audio track is muted, but not the noise. But the noise stops as soon as I hit pause (i.e. scenario #1). Why would the DAC and other issues you mentioned be applicable while on mute?

The noise goes away when you pause because the audio device is closed, which turns off the pulse width modulator.

When you only mute the audio the audio device remains open and pulse width modulator remains on generating its own noise even when there volume level from Kodi is right down.

What you describe is exactly how the analog audio out on a Pi behaves I’m afraid.

Do you use an usb wifi stick? I can hear the digital noise of the stick in the analog output of the pi when it transfers data or scans for networks.

@DBMandrake thanks for the extra details and information. I actually feel more confident this is the problem now that you have described how the symptoms match expectation.

I will play with the setting changes previously recommended. If the audio performance is still not good enough, I will look at an HDMI to Analog converter (I actually had one before, but returned it when I realized the RPi natively supported analog audio output).

@mcobit no, I am using wired ethernet. And the noise is not really intermittent, but persistent static for certain movies.

@DBMandrake I forgot to ask before - why would some movies have very clear audio, while others have the noise problem? Is that just due to the quality and settings of the file itself? Seems strange if we are saying that noisy audio is inherent to the Pi?

Do you think a USB sound card would improve the audio situation? Or would it just be more of the same? The sound cards seem inexpensive enough to give a try (<$5), but I would be interested in your take on this.

Here are a few examples with seemingly positive reviews:

OK, well I bought one. Will test and report back when it arrives.

It depends entirely on the volume level in the file - which varies greatly from file to file and also depending on whether you are trying to downmix from 5.1 to stereo or not.

On a file that is already stereo and has had compression applied during ripping the audio will be fairly loud most of the time so you probably won’t notice an issue.

But play a file with 5.1 audio downmixed to stereo on the Pi and you’ll get a big loss in volume level, now you’ll start to notice noise and distortion on the analog output.

@DBMandrake thanks again for your patient and helpful replies; I am really learning a lot here :smile:

Well I tried the $2 eBay special, and it made a marked improvement; I tested a couple of the movies giving especially bad noise before, and found the problem is significantly reduced. Will continue testing, but so far this looks promising!