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?

DonyorM
  • 181
  • 1
  • 4

1 Answers1

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.