|
Sound Delay |
Xpicolo
Member #16,781
December 2017
|
Hi, Raspberry Pi3, Allegro 5. I have delays when playing wav sounds. I used pulseaudio (very bad, 5+ seconds). I tried al_load_sample/al_play_sample and also al_create_sample_instance/al_play_sample_instance. The wav file is short, about 1-2 seconds. With command aplay is ok. I have read https://www.allegro.cc/forums/thread/616209 |
Mark Oates
Member #1,146
March 2001
|
Are you loading your samples right at play time or are you preloading them all first before using al_play_sample. -- |
Chris Katko
Member #1,881
January 2002
|
Looks like others had it happen... both with Allegro ... and SDL. https://www.raspberrypi.org/forums/viewtopic.php?f=33&t=69266 See last post here: https://www.allegro.cc/forums/thread/616314 Quote: Okay, so I think I have the high latency issue resolved. It would seem to be an issue with the Raspberry Pi's sound hardware, or at least that's the perhaps simplistic conclusion I draw from getting low latency audio playback using USB headphones. I have heard the Raspberry Pi's audio is a little flaky and that external USB audio adapters have been handy with the RPi. Here's what I found works... 1) Disable the Raspberry Pi's on-board sound hardware. Not sure if it's related to your case or not. But I've definitely seem multiple threads about RPi and delay. -----sig: |
SiegeLord
Member #7,827
October 2006
|
Please try the attached patch, it helped significantly on my RPI. It adds a new configuration option under the alsa section called buffer_frames. Try reducing it if you still see a delay, or increasing it if the sound appears choppy. If this works, there'll be a slightly more advanced version of this change committed soon. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Xpicolo
Member #16,781
December 2017
|
Yes, that is. I leave value (2048) unchanged in your patch. Many thanks SiegeLord. |
|