News for hackers. Stuff that matters.
Re:The Case of the Extra 40ms by asdfasgasdgasdg on Monday December 14, 2020 @11:32PM (#25427026)
If I'm reading correctly, they're saying that Netflix is not doing realtime audio, so they need not have this level of precision. They should buffer more than 40ms of audio data.
Re:The Case of the Extra 40ms by scoutt on Tuesday December 15, 2020 @11:33AM (#25431835)
I think they are doing so ("The Netflix application is complex, but at its simplest it streams data from a Netflix server, buffers several seconds worth of video and audio data on the device").

The system was built to fill the (hardware) buffers for 15ms worth of audio. The problem is that the 15ms window was not invoked in time (sometimes it took 40ms). Some suggested Netflix that in that case they could fill audio data for 40ms into the HW, but they didn't wanted to because it required low-level modifications.

Re:The Case of the Extra 40ms by tomnipotent on Monday December 14, 2020 @11:58PM (#25427170)
Except buffering wasn't the problem, an OS-managed thread was.
Re:The Case of the Extra 40ms by wolrah on Tuesday December 15, 2020 @12:17AM (#25427273)
The reason it caused a problem is because Netflix wasn't loading more than a frame worth of data at a time. That's a strategy that makes sense for a game streaming app like Stadia or Steam Link where every frame of latency matters, but for a movie/TV streaming app it really doesn't.

The point is that there was never any good reason to make the Netflix app so timing-dependent. Had Netflix not done this they wouldn't have even noticed.

---

That said, if a company was releasing an Android 5.0 powered device in late 2017 when Android 8.0 had already been released I can't help but say they brought this on themselves by being idiotically out of date. There's no excuse for launching a device with an OS three years and three versions out of date.

Everybody in this story is doing really dumb things.

Re:The Case of the Extra 40ms by tomnipotent on Tuesday December 15, 2020 @12:32AM (#25427348)
> wasn't loading more than a frame worth of data at a time

So the real question should be, does Netflix have a valid reason for only delivering a single frame of video and audio at a time? Is it bad software design, or good software design for an unknown problem (to us)?

I've seen plenty of things that looked stupid out of context, then made sense later on after understanding why the "stupid" things was done in the first place.

Re:The Case of the Extra 40ms by csharptwdec19 on Tuesday December 15, 2020 @10:20AM (#25431059)
Stupid thought, especially thinking about Netflix's history as one of the earliest services that streamed licensed content, it would not surprise me if this was at some point a way to minimize how much unencrypted data was in memory or similar.

Other thought would be, whether the architecture was somehow related to how one had to do things in Silverlight (any silverlight devs still remember how one would do this sort of thing? Any Silverlight devs still around?)

Re:The Case of the Extra 40ms by jfim on Tuesday December 15, 2020 @01:20AM (#25427561)
It's probably easier to keep the audio and video in sync with a simple implementation. They can't really drift out of sync if all that's being one is handling one frame at a time.
Re:The Case of the Extra 40ms by ghusbands on Tuesday December 15, 2020 @02:16AM (#25427831)
Though it sounds like they aren't even getting that advantage, because the audio thread is separate, and the described problem is starvation of the audio buffer alone.
Re:The Case of the Extra 40ms by Closi on Tuesday December 15, 2020 @02:56AM (#25428042)
It probably makes it easier to implement things like variable frame rates.
Re:The Case of the Extra 40ms by andi999 on Tuesday December 15, 2020 @06:55AM (#25429429)
"There's no excuse for launching a device with an OS three years and three versions out of date." Really? Why not? I mean if you only launch for the newest OS version, you cut out a lot of devices which were not or cannot be upgraded. Maybe in the US this is not a problem, but in Europe I wouldnt be surprised if this were actually a larger than 50% market share you cut out.
Re:The Case of the Extra 40ms by wolrah on Tuesday December 15, 2020 @03:19PM (#25434669)
You have misunderstood. The hardware device that was misbehaving had not yet been released to the public, yet it was running an ancient and out-of-date OS build. That's what I'm saying is idiotic.

Netflix can and should support their software on as old of OS releases as makes sense for them, but a hardware vendor introducing a new device to market on an outdated OS is inexcusable. Android 5.x received its final update in early 2015, over two full years before this mystery TV box was to be released. There is no good reason it couldn't have been on Android 7 or 8.

Re:The Case of the Extra 40ms by PaulDavisThe1st on Tuesday December 15, 2020 @12:15AM (#25427266)
It was the interaction between the expected amount of required buffering and the thread scheduling behavior that caused the problem. As typically happens when there's a video programmer around, the audio timing is considered less important, and there's a belief that "we can always get the audio we need for the video". Ergo, not much need for buffering. In this case, the odd/incorrect behavior of the thread scheduler exposed the optimistic assumption that you can rely on waking up every 15ms and handling the audio.
Re:The Case of the Extra 40ms by marcan_42 on Tuesday December 15, 2020 @01:03AM (#25427479)
And further, video latency is much less noticeable than audio latency. ~nobody will notice one dropped frame, but ~everyone will notice 16ms of audio missing, because you get a blatant click. Therefore, it is always important to prioritize audio buffering over video buffering.
Re:The Case of the Extra 40ms by gpderetta on Tuesday December 15, 2020 @05:12AM (#25428788)
oh, yes, I had to use some videoconferencing software recently that appears to drop audio before video. It was basically unusable.