omega1
Posts: 113
Joined: Mon Jul 02, 2012 3:10 pm
Location: UK
Contact: Website

Poor audio quality on analog output

Wed Mar 13, 2013 5:35 pm

Hi all,

I'm having problems with the audio on the analog output and for my project I can't use the HDMI audio.

As I am using the Pi to play a live audio stream I don;t have a problem with the 'popping' between tracks that has been described, my issue is with the general poor audio quality and background noise that is always present (if there is silence or low audio playing).

I am using omxplayer to play the live feed, I have noticed that the + and - do not seem to work to alter the levels at all, I would like to make sure that the feed is playing at the loudest to make sure I'm not amplifying noise by not having the player at its loudest.

A few questions:

- Is there a 'mixer' like in Windows to check the levels? If so, where can I find them?
- Has anyone been able to reduce the background noise on the analog output?
- I have noticed there is a USB sound device being used, is this much better?
- Can you point me to the above confirmed working USB device, say on eBay or Amazon?
- Any cheap ways of extracting analog audio from the HDMI port?

Thanks in advance!

Spid
Posts: 525
Joined: Sat Jan 19, 2013 12:47 pm

Re: Poor audio quality on analog output

Wed Mar 13, 2013 6:21 pm

Additional ALSA Packages:

apt-get install alsa-tools
apt-get install alsamixergui

http://debianarmpi.blogspot.co.uk

Sound output by default will by either HDMI or Audio Out Jack, and by default it will auto-detect,
though I prefer to pre-set to the output I will be using, on the command line type any of the
following, pressing the enter key after each entry:

HDMI output:
sudo modprobe snd_bcm2835
sudo amixer cset numid=3 2

Audio Jack output:
sudo modprobe snd_bcm2835
sudo amixer cset numid=3 1

Autodetect output:
sudo modprobe snd_bcm2835
sudo amixer cset numid=3 0

http://blog.scphillips.com/2013/01/soun ... -with-alsa

http://www.jackenhack.com/raspberry-pi- ... y-problems

http://www.ebay.co.uk/itm/USB-EXTERNAL- ... 0806006085
http://www.ebay.co.uk/itm/UK-PCM2704-US ... 0940457164
I will always assume you are running Raspbian for desktop and Raspbmc for XMBC !

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5171
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Poor audio quality on analog output

Wed Mar 13, 2013 6:47 pm

omega1 wrote:my issue is with the general poor audio quality and background noise that is always present (if there is silence or low audio playing).
I (and most people) don't have this issue. It is likely interference on the ground line. Possibly from the power supply, or from something plugged into the Pi.

Can you try (while playing audio) unplugging hdmi/composite/network/usb devices and see if one olf them makes it stop.
Can you try another power supply (or powering from PC/HUB/TV).

omega1
Posts: 113
Joined: Mon Jul 02, 2012 3:10 pm
Location: UK
Contact: Website

Re: Poor audio quality on analog output

Wed Mar 13, 2013 7:05 pm

Thank you both for your replies.

I had thought about trying a different PSU and hadn't got round to it, as I had heard problems about the analog audio I thought it was inherent to the device.

I tried it with a battery backup (for my phone!) and it worked fine, no audio background issues.

Good idea about forcing the analog output rather than autodetect!

I'm happy to buy another PSU for it, can anyone point me in the direction of one that they have purchased that definitely doesn't display this issue?

Many thanks!
Get your Pi from here! http://bit.ly/18blVup

Spid
Posts: 525
Joined: Sat Jan 19, 2013 12:47 pm

Re: Poor audio quality on analog output

Wed Mar 13, 2013 7:53 pm

I will always assume you are running Raspbian for desktop and Raspbmc for XMBC !

jdudeck
Posts: 1
Joined: Sat May 04, 2013 7:43 pm

Re: Poor audio quality on analog output

Sat May 04, 2013 7:55 pm

I was getting a lot of noise and hum from my raspberry pi. I did some experimenting, and found that the undesired noise was coming from the power supply. The cleaner the power, the less noise there is in the audio.

First, I tried a different power supply. I had two handy, and found that one of them gave a lot less noise than the other, but it still was far from clean.

Second, I use a USB hub to connect everything except the keyboard. I have a "powered" hub, with an external power supply that connects directly to the hub. I found that the hub was sending power up the usb cable to the raspberry pi, and that this was contributing to the noise, for example whenever I moved my mouse around. I cut the power connection between hub and pi, so that only the data and ground wires were connected. This was the trick that completely cleaned up the audio.

mwrona
Posts: 1
Joined: Tue Dec 03, 2013 5:21 pm

Re: Poor audio quality on analog output

Tue Dec 03, 2013 5:31 pm

OK...I had what sounds to be the same problem being described here...I didn't have a spare power supply handy at the time, but I did have a spare power cord (the USB cord that goes from the phone charger to the pi). When I swapped out the cord, the hum was gone. Not being an electronics expert, the only thing visual that I noted being different between the cords was the thickness. This led me to think that logically the difference in thickness was probably shielding since I don't think the wire thickness itself varies from cord to cord. Hope this can help someone out. I wanted to contribute something, for all the times that I've been helped by this community!

omega1
Posts: 113
Joined: Mon Jul 02, 2012 3:10 pm
Location: UK
Contact: Website

Re: Poor audio quality on analog output

Tue Dec 03, 2013 7:56 pm

Thanks... Mine was solved with a new PSU, but maybe a new cord would have been sufficient...

As you say, at least this may help someone in the future.
Get your Pi from here! http://bit.ly/18blVup

User avatar
Douglas6
Posts: 4472
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Poor audio quality on analog output

Tue Dec 03, 2013 9:42 pm

Adafruit has a PSU that works great for both of my Pi music players. They also have a USB sound card for cheap.
http://www.adafruit.com/products/501
http://www.adafruit.com/products/1475

I frankly don't notice the difference between my one Pi with the USB DAC and the one without, but maybe these old ears aren't as audiophiliac as they used to be.

middlewordie
Posts: 1
Joined: Thu Mar 06, 2014 5:40 pm

Re: Poor audio quality on analog output

Thu Mar 06, 2014 5:49 pm

I have the same issue, but it appears to be the 2No 32GB USB drives plugged into the Pi. Removing them removes the noise (not a very helpful solution), as does putting them on a USB extension cable (not a very elegant solution).

Basically it just makes noise whenever it does anything and the LEDs are flashing - processing etc. It's a bit like listening to and old Amstrad CPC464 loading from the integral casette tape drive...

gwidaz
Posts: 12
Joined: Sun Nov 06, 2016 12:58 am

Re: Poor audio quality on analog output

Mon Nov 07, 2016 8:38 pm

Neither power supply or USB makes a difference.. I tested with mines and it was a very bad sound. So I tested with console playing directly the mp3 sound and it was a very poor sound, then I tested with different plugin and the sound was as clear as you can get..

User avatar
braselectron
Posts: 4
Joined: Tue Apr 26, 2016 5:18 pm
Contact: Website

Re: Poor audio quality on analog output

Wed Mar 08, 2017 11:36 am

Dear gwidaz,
Can you better explain what is: "...I tested with different plugin and the sound was as clear as you can get..."

Is this a different driver, usb sound hardware, or both?

dark705
Posts: 1
Joined: Fri Mar 31, 2017 12:04 am

Re: Poor audio quality on analog output

Fri Mar 31, 2017 12:06 am

In /boot/config.txt add the following line:
audio_pwm_mode=2

jkur56
Posts: 1
Joined: Wed May 17, 2017 2:01 am

Re: Poor audio quality on analog output

Wed May 17, 2017 2:06 am

Many thanks to the poster of this solution dark705

I had the poor quality sound problem described by users listed above and using this setting worked:
audio_pwm_mode=2

ccpizz
Posts: 2
Joined: Sat Nov 25, 2017 10:15 pm

Re: Poor audio quality on analog output

Sat Nov 25, 2017 10:21 pm

A simple workaround is to to increase the audio volume on the pi close to 100% and decrease the volume on the amplifier — this way you increase the signal/noise ratio in analogue audio cable which pretty much reduces the noise to acceptable levels.

Return to “Graphics, sound and multimedia”