3

I'm getting static over the pi's composite audio (currently through an amp, but happens with other amps, a computer, and even headphones).

I thought the 3.5mm jack cable was the issue (3 pole vs 4), but I've removed that by going back to an rpi B model.

It seems the cause is buried somewhere when I updated raspbian to work with the model B+, giving the illusion that it was the model B+ itself (as I had no reason to update when on the model B and was keeping separate sd cards).

How I am playing audio is through python and pygame. Simply calling

import pygame
pygame.mixer.init()

is enough to trigger the static/noise. Stopping pygame stops the static/noise.

The version of pygame is 1.9.1 release and I'm using python 2.7.3.

Checking python 3.2.3 and pygame '1.9.2a0' also results in the same issue.

Any ideas?

  • You should delete the old question. – Steve Robillard Mar 26 '15 at 1:28
  • "when I updated raspbian to work with the model B+, giving the illusion that it was the model B+" -> The Raspbian software used on a B+ is exactly the same as on a B, an A, or an A+. There is no such form of update. – goldilocks Mar 26 '15 at 14:17
  • Just make sure that your audio jack is securely inserted into the raspberry pi. – Shayan Doust Mar 26 '15 at 21:43
  • You're probably right, it just felt like an update as my older image didn't work properly and I had to grab a newer image and apt-get update/upgrade to get the added usb ports, etc to work. But right now, my model B and B+ does run using the same image/software. – mitim Mar 26 '15 at 22:51
3

Ok, I've finally figured it out. Took me a long time of searching, testing, and going through audio devices, cables, looking for audio settings, attempting all sorts of values in pygame.mixer.init() when it was this:

to /boot/config.txt add:

disable_audio_dither=1

A little bit annoyed that I couldn't find this earlier, but I've found it now, so all is well. >.>

This link seems to add evidence: https://github.com/raspberrypi/firmware/issues/380

It mentions someone had the same issue during an upgrade 16-02-2015 , which would similar to me as I was running on something old, then upgraded. Someone also mentions it may be specific to Raspbian and does not happen with the hdmi audio.

Since adding that, my static levels have dropped and are back to what it was before (which is ruled to be the amp, which is acceptable).

  • 1
    I added a ground loop isolator between my audio jack and my amp and that got rid of the last of the hiss (the audio_pwm_mode=2 setting got rid of most of it, but this might work for you too) – Robert Corvus Aug 20 '17 at 15:30
  • 1
    I've never heard of such a device (just did a quick search on them). I'll keep it in mind next time. Thanks – mitim Aug 26 '17 at 5:11
2

For me, adding audio_pwm_mode=2 to my /boot/config.txt removes the hissing sound I heard when playing music. I came across this solution in PWWN's comment over at the GitHub issue tracker:

The recommended config.txt option for high-quality audio from the 3.5mm jack is audio_pwm_mode=2. This enables the sigma-delta oversampled PWM with ~16-bit resolution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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