Open maxlueerprivate opened 2 months ago
Thereby, I am measuring a large audio latency on the bluealsa side of up to ~150ms compared to the manual setup just after starting the pipeline.
First question: how are you measuring this latency?
I am unsure if this is a bluealsa or just alsa related.
You can cut out ALSA from the picture by using bluealsactl open ...
(in v4.3.0 bluealsa-cli
). See https://github.com/arkq/bluez-alsa/blob/master/doc/bluealsactl.1.rst for reference.
EDIT: In the repo there is a simple script for measuring end-to-end latency (if you have two Linux hosts): https://github.com/arkq/bluez-alsa/blob/master/test/integration/test-e2e-latency.py
Hi @arkq, thank you for your fast reply! I am measuring the latency by recording the output of both headphones with a microphone and Audacity. Here for example I have a latency of about 74ms:
Thanks for providing the command to cut out ALSA. Without ALSA I observe the same behavior.
This audio latency difference is not stable. It decreases to ~50ms after a few seconds and varyies between 150ms and 50ms.
The variation in latency is 100ms. So, it looks like your headset is doing something funny with the audio - playback speed is not constant. Is that right? When you play a tone, does the pitch change?
Hello, I have the following problem OR question and hope someone can help me.
Problem
I am noticing a varying audio latency when using bluealsa in comparison to a manual audio setup with nearly constant latency.
Reproduction steps / Setup
I have two times the same bluetooth adapter and two times the same bluetooth headphones. I connect one bluetooth headphone to hci0 and one to hci1 where hci0 uses bluealsa (bluealsa -p a2dp-source -i hci0) and hci1 uses my manual SBC audio profile negotiation.
DBus Tree looks like this:
I am using GStreamer to play a tick audio signal (audiotestsrc wave=ticks) parallel to the bluealsa (audiosink - with buffer time 20ms and period time of 5ms) and manual audio setup (a2dpsink - direct to the dbus fd: /org/bluez/hci1/dev_5C_56_A4_88_4D_F3/sep1/fd0). Thereby, I am measuring a large audio latency on the bluealsa side of up to ~150ms compared to the manual setup just after starting the pipeline. This audio latency difference is not stable. It decreases to ~50ms after a few seconds and varyies between 150ms and 50ms. Looking onto bluealsa-cli and watching the "Delay" shows a constant latency between 150ms and 153ms. No variation of 100ms!
bluealsa-cli output:
I am wondering why there is this large variance in the latency when using bluealsa and I am unsure if this is a bluealsa or just alsa related.
Maybe someone noticed also a variation in latency or knows how to get rid of this.
Thank you in advance, Max