10

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.

Mikey A. Leonetti
  • 291
  • 1
  • 3
  • 11
  • 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 Nov 09 '15 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. – Mikey A. Leonetti Nov 09 '15 at 19:25
  • So the hiss goes away when there is something playing? You could try unloading the driver (sudo rmmod snd_bcm2835, sudo rmmod snd_pcm) to see if that deinitializes the hardware and stops the hiss, but it is a bit of a hail mary move. – goldilocks Nov 09 '15 at 19:46
  • 1
    Do you think that there is a high probability that getting another sound card, USB, will make this issue disappear? – Mikey A. Leonetti Nov 09 '15 at 19:48
  • I think I've seen people here report that the interference issues don't go away even when using an external card, but that would be more a faint popping or clicking (supposedly the +/2 models were supposed to be better this way but I did not notice an improvement). What you are talking about sounds genuinely abnormal. Try it plugged in on the same circuit/outlet as the amp (if it isn't already) to see if that makes a difference. Or vice versa if it is. – goldilocks Nov 09 '15 at 19:55
  • If I could describe it better, it is not a hum, buzz, pop, or click. It is the sound of like volume being pushed through a speaker, as if something is being played but that something is very low and all you hear is air. What puzzles me is that the sound isn't heard when the Pi first starts up, but only after a sound is played. It won't silence again until after the Pi is restarted. – Mikey A. Leonetti Nov 09 '15 at 19:58
  • Have you seen this http://raspberrypi.stackexchange.com/questions/29024/static-over-composite-audio/29053#29053 – Steve Robillard Nov 09 '15 at 21:03
  • Yes, I did. I modified my answer to reflect this. I wish it was that simple! – Mikey A. Leonetti Nov 09 '15 at 21:07
  • I suspect interference. I have experienced hum/noise problems trying to connect computers to amplifiers. There are ways to minimise this, some extreme. To confirm if this is the case use a set of headphones, and see if this is also a problem. – Milliways Nov 09 '15 at 21:54
  • Headphones are not an issue. They seem to work when I use them. – Mikey A. Leonetti Nov 09 '15 at 21:55
  • 3
  • This issue isn't related to popping betwixt songs. I believe it to be a different issue unless you are suggesting that the solutions are the same. – Mikey A. Leonetti Nov 10 '15 at 03:52
  • You could also try playing incredibly quiet audio from the Pi to keep the port active and an internal resistor inside of your amplifier should pick up the signal and start blocking out any noise on the line, the downside being that I'm not sure how loud of a sound you would need to trigger the noise cancelation on your amplifier as it is very amplifier specific, trial and error would be your best bet here. – Mohammad Ali May 05 '16 at 16:18
  • 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? – Mikey A. Leonetti May 31 '16 at 18:08
  • The jack socket is a 4 pin audio/video connector so possibly the video causing it –  Oct 25 '16 at 20:30

5 Answers5

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.

Patrick Cook
  • 6,365
  • 7
  • 37
  • 63
  • 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. – Mikey A. Leonetti Dec 17 '15 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 Jan 17 '16 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.

Chris H
  • 575
  • 2
  • 12
  • 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. – Mikey A. Leonetti Dec 18 '15 at 12:57
  • I'd need to have a play to be more specific, but there are some ideas at http://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 http://sound.westhost.com/project147.htm (figure 1) – Chris H Dec 18 '15 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. – Mikey A. Leonetti Dec 18 '15 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 Dec 18 '15 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. – Mikey A. Leonetti Dec 18 '15 at 14:40
1

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.

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.

user37374
  • 3
  • 1
  • 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. – Mikey A. Leonetti Dec 17 '15 at 15:14
  • 1
    I would not necessarily presume more rated or "rated" amperage means cleaner power. http://www.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. – YetAnotherRandomUser May 31 '16 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.