12

I'm having the following issues with my amp on the Raspberry Pi 2, Model B.

  1. Boot up the Pi, everything sounds great.
  2. Play a sound byte through the Pi (using ALSA)
  3. Speakers hiss regardless of PCM being "muted" (using alsamixesr) or having a any kind of volume.

I have set disable_audio_dither=1 in the /boot/config.txt, however it doesn't fix this issue.

I tested to make sure it was enabled by running:

# vcgencmd get_config disable_audio_dither
disable_audio_dither=1

What could be happening from when I bootup to when I play the first bit of sound and how can I stop the hiss after the first play again?

Edit

My question differs from the question asked here How to get better Audio quality from audio jack output, because this question talks about issues with popping noises between songs. My issue is that after any audio is played on the Pi whatsoever there is henceforth a hissing sound from the speakers until the Pi is restarted. I have having no popping sounds whatsoever and using a USB card has not fixed this issue for me.

Edit 2

Tried using a Tendak HDMI to VGA for the sound (http://www.amazon.com/Tendak-Converter-Adapter-Projector-Blu-ray/dp/B00SKP88VA/ref=sr_1_10?ie=UTF8&qid=1450364986&sr=8-10&keywords=tendak+hdmi) thinking that we'd have more like that way, but the issue still persists.

15
  • How bad a hiss are we talking about? The Pi definitely leaves something to be desired WRT to interference and quality on the 3.5mm jack. If muting doesn't change it, you might as well use a high (90-95%) output volume so you can turn down the volume at the amp.
    – goldilocks
    Commented Nov 9, 2015 at 19:20
  • It's bad. If we turn it down on the amp end the volume is too low to hear anything when sound is playing. Physically turning the volume dial all of the way down and up every time we have to play audio, also isn't an option in this case unfortunately. Commented Nov 9, 2015 at 19:25
  • 1
    Do you think that there is a high probability that getting another sound card, USB, will make this issue disappear? Commented Nov 9, 2015 at 19:48
  • 3
    Possible duplicate of How to get better Audio quality from audio jack output Commented Nov 9, 2015 at 22:17
  • 1
    @allanonmage Thanks for your comment. Is there a more specific version other than the one I have mentioned in the top of the post? Commented May 31, 2016 at 18:08

5 Answers 5

2

I was able to get rid of the hiss entirely by adding audio_pwm_mode=2 to my /boot/config.txt. BTW: I also have a ground loop isolator between my audio jack and my amp.

1
  • Apparentely I've solved using your solution (just the file config)
    – Mitro
    Commented Nov 21, 2017 at 21:29
1

The Pi's audio port isn't very good but this consequence of a cheap audio port can be mitigated by one of two ways.

1. PulseAudio


PulseAudio is a higher quality way of playing audio through any port.

You can read more and learn how to install/use it here: https://dbader.org/blog/crackle-free-audio-on-the-raspberry-pi-with-mpd-and-pulseaudio

2. USB Sound Cards


This is the more widely used solution, as with a USB sound card you can use a microphone. You can pick one up for less than $5 on eBay and Amazon.

2
  • We aren't hearing any crackling when sound is playing. Sound is actually quite clear. Please let me know if my question is not clear. I have also tried USB as indicated in my question. Commented Dec 17, 2015 at 15:16
  • The hissing noise is created because the audio channel is not initialised. Because of this there is an open impedance creating noise to be picked up. (the wire picks up electrical noises almost like an antenna) Once you start playing a sound the audio channel seems to sort it self out, possible some internal pullups or pulldowns that get initialised. Possibly a driver problem or a hardware one. The same happens on my audio system for my TV. When the TV is off, I hear hissing noises until the TV is turned on. Pretty annoying....
    – Piotr Kula
    Commented Jan 17, 2016 at 19:55
1

I suspect the amp is still on after playing the first audio file. There are a few things you can try (some of which you may have tried already of course).

  • Closing the software used to play the samples. I was testing using sonic pi on a model 2, and closing sonic pi stopped the hiss made it much quieter. Further testing demonstrates that the quiet hiss is there even during boot, before snd_bcm2835 is loaded, and that sonic pi starts the louder hiss.
  • Stopping (rmmod) various modules related to sound. You'll need to enable the "force" option to do this as some modules appear to be "in use" but not used by anything specific. There's a reason it's disabled by default (high chance of crashing).

When testing in sonic Pi I could hear the same (loud) hiss in the gaps between beeps -- I suspect you're only not hearing it during the samples because it's drowned out by the sample. Like you the volume and mute buttons didn't do anything. My tests were with some awful earphones in the onboard audio port.

The fact that the hiss was louder with playing software suggests 2 sources. I don't know the topology but I would guess the DAC and the amp, with the amp always powered.

As I'm into playing with the hardware, and have made some simple audio hardware years ago, I'd consider a hardware mute circuit controlled by a GPIO pin. Off the top of my head I'm thinking something like a 1K resistor to ground switched by a small FET (all per channel, but you could run them off the same GPIO pin). This is likely to be better than breaking the circuit using a transistor, as you may get a switch-off pop and increase pickup at the next stage (I assume amplified speakers). Of course this wouldn't help much if you have silences within your audio clips.

It sounds like white noise (near enough) so you wouldn't be able to filter it (unlike mains hum), and I suspect it's loud enough that ramping up the output volume so you can turn down your amp/speakers wouldn't be enough.

5
  • The hardware solution sounds the absolute best with the mute circuit (and my best option so far!!). I want to give that a shot since I've tried, also, unloading loading the sound drivers. Silence in the audio is not a big deal. Just that it's muted when done. I don't have any hardware experience so I'm not 100% sure where you're saying to do because I'm not a hardware guy. If you can put it in a more layman way, that's fine. Either way I'm going to do research. Commented Dec 18, 2015 at 12:57
  • I'd need to have a play to be more specific, but there are some ideas at sound.westhost.com/articles/muting.html - I'd be keen on Figure 4A (note the only reason it uses 12V is to light an LED, by reducing R2 you could get down to 5V or 3.3V operation). MY intial though was more like sound.westhost.com/project147.htm (figure 1)
    – Chris H
    Commented Dec 18, 2015 at 13:11
  • The problem is I don't understand the diagram. I may have to contract somebody to help us. If you do contracting work also please let me know. Then after I get it settled post the findings so this issue could be solved for people in the future as well. Commented Dec 18, 2015 at 14:01
  • I had hoped there would be a simple off-the-shelf impementation for you, but couldn't find one. If the circuit diagram is beyond your scope, I suspect assembling it would be too (apologies if I'm wrong).
    – Chris H
    Commented Dec 18, 2015 at 14:31
  • If it requires soldering, then yes. So then I'll definitely need to contract somebody to do that, too, then I guess. If you know anybody good for this, please let me know. Thanks for searching for an off-the-shelf solution already! You have helped a lot. Commented Dec 18, 2015 at 14:40
0

It's a hardware problem.

The original Pi's suffered from hiss due to power supply noise injection. The '+' (and B2) series are a lot better in this respect (because they decouple the sound from the GPU with a separate regulator), however you can reduce hiss by using a 'higher quality' PSU (those rated at 1.5 A are usually better) and/or adding an extra electrolytic cap. across the GPU power near the 'sound output' power pins.

2
  • We are using a 2.5 A PSU and have tried many others. Not sure if it makes a difference. The weird issue is that the device sounding fine when it first boots up but then after playing the first sound bite (and it stopping playing) from whatever program sounding like it's still "on." My point is, I would think that if it's related to something like the PSU that it would sound bad even before any sound is played. Commented Dec 17, 2015 at 15:14
  • 1
    I would not necessarily presume more rated or "rated" amperage means cleaner power. righto.com/2012/10/a-dozen-usb-chargers-in-lab-apple-is.html goes pretty in depth about how to measure quality and what you may encounter. Commented May 31, 2016 at 17:42
0

I was facing this same issue and infact i did reinstall OS, finally I found that my issue was with servoblaster using as pwm, As servoblaster use PIN 18 which is used for 3.5 audio Jack also, using PCM flag --pcm i was able to get back my audio. Please find more detail on this site https://leenabot.com/en/Driving-Servo-Motors-Servo-Blaster-for-Raspberry-Pi/. Hope this is helpful for other who are using servoblaster.

Your Answer

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

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