Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> It gets compensated by delaying the video by an equal amount

Is this actually done? Who would be doing it, the OS? It just sounds like the separation of concerns and the design of the interfaces would make it pretty unlikely.



Yup, Bluetooth devices can report the latency via AVDTP 1.3 Delay Reporting. If I remember correctly from the last time I looked at this, the media framework in OS's tend to expose this to applications by reporting the timestamp that a submitted audio buffer is actually played back. The video player can use these timestamps to adjust the video delay accordingly. And since it's per buffer, it can handle the latency changing (eg. by switching from Bluetooth to a wired connection).

I know at least Android and Linux + Pipewire support this. I haven't encountered a single application on desktop Linux that doesn't support this properly. All the standard video players and browsers work. It works for HDMI too, when the TV/AV receiver is well designed and communicates the latency in the EDID.


Indeed, there is some (usually much smaller, but depending on buffer sizes) audio delay even in regular desktop systems so video players and audio APIs mostly already had proper handling for it.


Yes, this is called AVDTP 1.3 Delay Reporting feature. It allows headphones to report the delay to a sending device that actually plays the sound.


Empirically: videos are perfectly synced using my Sony headphones (which use Bluetooth 5.0) on Android. But anything interactive (games, and UI sound effects) has a significant delay.

I think Bluetooth 5.0 includes something where the audio latency is communicated back to the phone.


Yeah, playing twitchy games with bluetooth on is janky suicide. I was trying to play a difficult platformer on my phone with a clipped-on game controller and it was miserable until I switched to wired audio.

Not sure if it was the audio latency or the crowded traffic on bluetooth slowing down my BT game controller, but the difference in feel and success was night-and-day when I did that.


It is absolutely done, mostly by the media player/library used, e.g exoplayer on Android has automatic lag compensation for that purpose.


Not always. Just got some wireless headphones at work, and now I can no longer enjoy YouTube videos (mostly KEXP) because of the 100ms audio delay. It's too disturbing even only in side view.

So at least with a browser on Windows it's not done.


I’ve definitely noticed it on macOS. Videos in the browser will stall for a fraction of a second after pressing play to give the audio time to catch up.


"Using an AirPlay-enabled device for your audio content can result in a 2-second delay. Check for this delay in game content."

https://developer.apple.com/documentation/avfaudio/avaudiose...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: