Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Problem: Bluetooth audio latency
#1
I have a question that might be already asked. I wonder about some possibilities to fix latency while stream audio from phone/tablet/notebook/PC to my moOdeaudioed RPi3 via bluetooth. I've found answer about syncing audio and video on Samsung TV, where Tim said you can use Airplay with latency adjustments. But why there is a 0.7 sec bluetooth latency? Is it a blueZ or something else problem? Is it fixable, and, if could, how? It would be great to see detailed actual answer. Thanks in advance.
Reply
#2
Try posting the question in the Bluez-alsa Git repo.
https://github.com/Arkq/bluez-alsa
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
I changed the systemd script and added a configuration file to set the buffer size for bluez alsa.
In detail, I added --pcm-buffer-time=<buffer_time> parameter to bluealsa-aplay command line.
At the end, it is enough to change the BUFFERTIME value in /etc/bluealsaaplay.conf.
I had no success in setting values lower than 20000 (20ms) on my Pi1, but it is enough to watch movies with moode as audio sink.

Code:
echo 'BUFFERTIME=20000' >> /etc/bluealsaaplay.conf
sed -i 's|bluealsa-aplay --profile-a2dp|bluealsa-aplay --pcm-buffer-time=${BUFFERTIME} --profile-a2dp|g' /etc/systemd/system/bluealsa-aplay@.service
Reply
#4
Tested on Youtube videos and it more or less fixes lip sync issues.

I added a setting for this to BlueZ config in upcoming moOde 6 release :-)
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#5
Playing the devil's advocate for a moment, why would this need to be a configuration setting rather than just a reduction in the value baked into the build? 

For a given system, is there a range of values ranging from better synchronization for the A/V enthusiast on one end to better listening for the audiophile on the other? If so, what kind of user guidance will be provided concerning this setting?

Inquiring minds want to know Smile

Regards,
Kent
Reply
#6
It's a setting thats meant to fix a specific issue i.e., lip sync but the value that works best in a given usage scenario may depend on the quality of the BT connection so I figured its prolly better to just let user chose values from a list.

Here's some screenies.

               
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#7
That works.
Reply
#8
Thumbs Up 
(07-30-2019, 06:26 PM)Tim Curtis Wrote: It's a setting thats meant to fix a specific issue i.e., lip sync but the value that works best in a given usage scenario may depend on the quality of the BT connection so I figured its prolly better to just let user chose values from a list.

Here's some screenies.

  

WOW!!!
Reply
#9
@badbat75

Thank you for this tip, that's so fantastic. Now I can play the sound of my LG TV over the speakers (using the Pi 3 with the 2x 30W Amp2 from Hifiberry).

I'm really impressed and did not think it would work without the aptX (low latency) codec, but the voices on the TV are lip-syncing.

And thanks to moodeaudio, the whole thing works without switching the inputs.
Who comes last ... gets the speakers Smile)
Reply


Forum Jump: