I’ve only heard good things about PipeWire so I must ask: will this finally give me a lower latency option for Bluetooth audio on Linux? After my old Anker speakers went belly-up° I “upgraded” to their latest model which I didn’t realize was aux/3.5mm-free and have been suffering ever since from horrendous lag when using the external speakers to stream movies on my Linux laptop.
° Ok, in actuality my kid broke half a male 3.5mm connector in the speaker’s 3.5mm female port and I was too lazy to break it open and solder in a replacement. Mostly due to not wanting to hunt for a layout-compatible female 3.5mm jack.
There are protocol limitations here. There have been very recent advances, that bring us to 40~60 ms, but they all root in Bluetooth 5 (officially announced july 2016 but holy fucking shit this adoption has been trashfire slow especially on pc) and it's incredibly confusing/difficult to understand which if any codecs have been able to take advantage of this possibility. It'd take me probably an hour to put together the basics on how available this is right now.
But that should not affect your use case; playing movies should work fine, period, end of statement. The fact that there is latency to your speaker is something that an bluetooth or other audio pipeline should know, should be able to compensate for. PulseAudio (which your music players are almost certainly using, under pipewire or other) has great understanding of latency built in. If you do experience big audio latency, open up pavucontrol & adjust your device's latency, and that problem should go away. It should be semi-stable. But pulseaudio & pipewire both should, in a wide range of cirumstances, understand what the expected latency is & "just work."
If you are on a videoconference, however, knowing that there's a second of latency doesn't help, won't bring things closer to real-time. It's still gonna be terrible. Newer specs, newer codecs could help significantly, but the audio daemon won't be able to help. Pulseaudio did have higher latency by default, tuneable (i think i'd tuned to using 2 frames of 16ms each = 32ms, pretty aggressive), but I think they've trimmed it significantly in very recent releases, but pipewire's architecture has allowed it to be significantly more aggressive.
I’m not certain Bluetooth 5 is it: I have a MacBook Pro 2012 w Bluetooth 4.0. Using it with two Bluetooth devices results in different latency, depending on the device.
JBL “true wireless” I have to adjust audio to about -200 ms delay while with AirPod pro I don’t have to make any adjustment.
Yes, it doesn't remove the latency completely, but it's the best we've got now. I'm using a Bose soundbar and the Bluetooth connection is way too laggy for movies on pulseaudio, windows, or Mac. Pipewire was great and usable with default settings. In an ironic twist, Linux has the best audio story of all systems right now.
Was latency ever an issue with movies? I know mine works without issue on pulseaudio+bluez by delaying the video to sync it with audio (which is actually noticable with an old noname speaker when you pause/play the video - the video stalls, then (i guess) the audio buffers are filled, and movie starts playing with syned a/v, and then when pausing, maybe half a second of audio is still played after you've paused it).
Definitely an issue with Netflix on Ubuntu. Enough that I prefer to “obtain” via other means the content I have paid access then watch it in mpv (where I must still manually introduce a video delay).
The delay you describe should be only as long as it takes for the audio packet to be processed by the audio stack as the video syncs with the audio and not the other way around. But I don’t think Bluetooth blocks for an ack of each packet (and if it did, you’d be delayed the other way because of the time it takes for the response to reach after the packet has finished playing)!
The half second of audio playing after you pause can be explained by the same delay I describe: that’s how long of a lag there is between source and sink (like you say, due to buffering - plus the transmission delays).
> Definitely an issue with Netflix on Ubuntu. Enough that I prefer to “obtain” via other means the content I have paid access then watch it in mpv (where I must still manually introduce a video delay).
pavucontrol let's you introduce a delay per device (in Output Devices under "Advanced" for the specific device), which might allow you to use it with Netflix directly. Or at least I managed to get it working wonkily once and then went back to using mpv...
But the audio already arrives late compared to the visual part. To compensate for that, PulseAudio has to support time travel, while any video player "merely" has to delay the image sequence by a few frames to let it line up with the sound...
I’ve been wanting to experiment with some hard-coded low-level (asm/C/rust) Bluetooth on a microcontroller to experimentally/empirically determine the lowest possible Bluetooth audio delay for some time (getting rid of all encoding, context switching, garbage collection, etc etc overhead). ~~I think~~ it’s fundamentally a laggy approach to audio streaming because of the packetization that takes place, but it shouldn’t be to the extent that it is so immediately noticeable.
° Ok, in actuality my kid broke half a male 3.5mm connector in the speaker’s 3.5mm female port and I was too lazy to break it open and solder in a replacement. Mostly due to not wanting to hunt for a layout-compatible female 3.5mm jack.