Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I've read and experienced that music (mp3 etc) through the audio-jacket is poorly (popping sounds in between songs). Is this already solved or what's the best way (setting) to decrease this problem?

share|improve this question
add comment

4 Answers

This is a known problem that you can read about here and see the bug report here.

It appears to be an issue with the Broadcom VideoCore firmware, and the popping is caused by voltage jumps as the audio is enabled and disabled.

There is no current solution to the problem, however you can mitigate it's effect by playing audio continuously, instead of having a gap between songs. A script to do this is provided by ski522 in the same forum thread I posted before.

Create a shell script:

sudo nano mpgapless.sh

Then enter the following into the shell script.

#!/bin/bash
# mpgapless

case "$@" in
   *.m3u) PL="-playlist"
   ;;
esac
rm /tmp/audiofifo
mkfifo /tmp/audiofifo
aplay -t raw -c 2 -f S16_LE -r 48000 /tmp/audiofifo &> \
/tmp/aplayfifo.log & mplayer -noconfig all -nolirc -nojoystick \
-novideo -benchmark -vc null -vo null -ao pcm:fast -af resample=48000 -nocache \
-ao pcm:nowaveheader:file=/tmp/audiofifo $PL "$@"

Make the file executable:

chmod 555 ./mpgapless.sh

If you have a directory of music files you can use it like:

./mpgapless.sh *

All credit for this script to ski522.

share|improve this answer
1  
You can also work around the problem by using a USB audio adaptor. –  TomG Feb 9 '13 at 0:03
add comment

I gave up on the integrated audio jack and am glad that I did. I bought the following USB audio interface for a few dollars:

http://www.amazon.com/dp/B001MSS6CS/ref=pe_175190_21431760_3p_M3T1_ST1_dp_1

This way, the Pi does something it's good at (emitting digital data) and leaves the D/A conversion to the interface. It sounds great. Here's how I got it to work:

  1. edit /etc/modprobe.d/alsa-base.conf

  2. comment out the following line in /etc/modprobe.d/alsa-base.conf (uncommented, I think it gives the USB sound card minimum priority to become the default sound device)

options snd-usb-audio index=-2

ref: http://forums.linuxmint.com/viewtopic.php?f=48&t=95337

The only downside is the added bulk of a dongle and that you lose a USB port.

share|improve this answer
add comment

The issue with the popping has now been fixed, but you need to upgrade your Raspberry Pi's firmware to take advantage of the fix. I had this issue with a brand-new Pi running Linux raspberrypi 3.6.11+ #399 (2013-02-09-wheezy-raspbian). As cited above, this is the history of the audio popping sound issue:

This is the web site I used to find out how to update my Pi's firmware:

For those not familiar with the "&&" syntax in Bash, these are the specific commands you can use to update your Pi (note the sudo prefix to ensure that commands are run with root privileges).

Update to the latest version of the Raspbian OS:

sudo apt-get update
sudo apt-get upgrade

Install the git version control system:

sudo apt-get install git

Install Hexxeh's rpi-update firmware update script:

sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update
sudo sudo chmod +x /usr/bin/rpi-update

Run the firmware update process, then reboot:

sudo rpi-update
sudo shutdown -r now

After that, my Pi no longer clicks before and after playing an audio file. After rebooting and logging in again, try it on your Pi with the following command:

omxplayer /usr/share/scratch/Media/Sounds/Vocals/Hey-yay-hey.mp3 
share|improve this answer
add comment

It looks like you can use pulse audio and then disable the sleep between no activity in the audio. ( disable a line in /etc/pulse/default.pa). It should fix the audio popping issue.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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