5

So on my Raspberry pi when I play audio through the headphone jack, the first few seconds of sound are lost. However, I if I immediately play the sound again, the audio works fine from the very beginning of the sample. The end of period when I can start the second sample and have the audio work properly is signaled by a slight pop from the speakers. I'm using pulseaudio on RP-3

Searching online has led me to the options of disabling idling of sinks and constantly playing silent sound (using play -n from sox) to keep the sink running. Neither has any effect on the issue.

I'm playing the sound using paplay sound.wav.

Output of pactl list short sinks:

0 alsa_output.platform-soc_audio.analog-mono module-alsa-card.c s16le 1ch 48000Hz RUNNING 

Why is the PI losing the first few seconds of audio and how can I fix it?

4
  • I think it’s a bug in Buster - I did not have this in Stretch and it’s gone with an I2S DAC I’ve added. Commented Apr 19, 2020 at 0:29
  • @Andyroo forgive me, but could clarify what an I2C DAC is? Commented Apr 19, 2020 at 0:30
  • Sorry typing error - I meant and I2S DAC. These are add on cards that use the I2S bus built into the Pi and provides a digital to analogue converter output for speakers or headphones - they start from around £15 upwards volumio.org/raspberry-pi-i2s-dac-sounds-so-good Commented Apr 19, 2020 at 0:39
  • Just wondering whether anyone else had any thoughts on this? Having the same issue, and would like to avoid adding a further component in the form of a DAC. Commented Dec 9, 2020 at 21:44

1 Answer 1

1

You should unload the pulse audio module module-suspend-on-idle.

To do that create a file under </etc/pulse/default.pa.d/disable-idle.pa> containing unload-module module-suspend-on-idle.

To do that you can use the following command:

sudo sh -c 'echo "unload-module module-suspend-on-idle" > /etc/pulse/default.pa.d/disable-idle.pa' 

Then restart pulseaudio with the commands:

pulseaudio -k pulseaudio --start 

After that this problem should go away for good.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.