Issue metadata
Sign in to add a comment
|
Audio resets to beginning when playing large audio from Data URL and seeking beyond a given point
Reported by
shlomoro...@gmail.com,
Dec 10
|
||||||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3636.0 Safari/537.36 Example URL: https://chrome-long-mp3-issue.firebaseapp.com/ Steps to reproduce the problem: 1. Load the above page in chrome and wait until player controls become available (i.e. file has downloaded). 2. Press the play button and note the sound content at the start of the track. 3. Scrub to any point past 27 min on the timeline, pay attention to the content being played, if it's not the content you heard at the beginning continue to step 4 below. 4. Scrub backward to the middle of the timeline. At this point you should be hearing the audio that you heard at the start of the track. What is the expected behavior? After each scrub the player should begin playing from the newly updated position. What went wrong? 1. Player plays the beginning of the track instead of requested point. 2. Indication on the timeline (as well as audioElement.currentTime) is as if the player is playing at the correct spot. Did this work before? N/A Is it a problem with Flash or HTML5? HTML5 Does this work in other browsers? Yes Chrome version: 73.0.3636.0 Channel: n/a OS Version: 10.0 Flash Version: Contents of chrome://gpu: In addition to the Chrome Version/OS noted above, this issue seems reproducible across multiple chrome versions on multiple Operating Systems. This issue is not isolated to using the seek bar, it can also be reproduced using the HTMLAUdioElement.currentTime. I've seen this reproduceable on MP3 files as well as on Opus files so long they were larger than 28MB. On files below 22 MB I was not able to reproduce this. I didn't have any files between 22MB and 28MB to check so I don't know the exact point at which it begins to appear. You can see the source code to the above web-app in this repository: https://bitbucket.org/JewishEducationalMedia/chrome-long-downloaded-mp3-bug Our use case is an audio PWA where we let users save (/download) the files for offline use.
,
Dec 10
Hmm, seems to be working on 71+ (including 73) w/ macOS, can you provide some more details on your setup? Can you check chrome://media-internals and include the player log for this file when you hit the issue.
,
Dec 10
Right now I'm consistently reproducing on Windows 10 Google Chrome Version 73.0.3635.0. What else regarding my setup would you like to know? I've attaching the log I've saved a few seconds after reproducing the issue. Hope it's helpful.
,
Dec 10
Does this happen on stable or only on 73? Thanks, log looks normal, no weird non-seekable issues reported there.
,
Dec 10
Just reproduced this on Google Chrome (Windows 10) Version 70.0.3538.110 Attached here are the Media Internals logs for that. BTW I've seen this on Chrome/Android as well. If you want I can get you more details on that.
,
Dec 10
Thanks, will try to get it to happen. Are you able to record a quick screen capture of you reproducing the issue? I want to make sure I understand exactly what you're seeing.
,
Dec 10
Yea sure. See attached. I couldn't get the audio to be in-sync on the recording so I dropped it but essentially after I make the seeking jump I hear the audio from the beginning of the track. The reason why in this issue I've added more steps to reproducing this than what you see in the video is because I recalled that sometimes I wasn't able to reproduce this with a single step) but right now I'm reproducing this consistently with just the action you see in the video. Thank you
,
Dec 11
Ahhh, I see the issue, you're seeking before playback begins. I wonder if seeks are broken while in the suspended state currently...
,
Dec 11
+sandersd, tmathmeyer, possibly resume while a seek is pending isn't resuming at the seek target... What do you expect to happen in the pipeline when this occurs Dan?
,
Dec 11
I'm not sure what you mean by that but in the video above you can clearly see that by the time I press the cursor down at the end of the seek bar the player has already begun playing as 1. it's already at 0:02. 2. The audio playing icon on the chrome tab is visible.
,
Dec 11
Hmm, yeah I can now reproduce without it paused and on 71. Not sure what's happening here, will debug tomorrow. So probably not suspend/resume related. Instead seems like the seek isn't taking affect for some reason. Can't get it to reproduce w/ file:/// URL, so perhaps something specific to data:// +Blink>Loader in case this sounds familiar.
,
Dec 12
Hmm, solved it here https://chromium-review.googlesource.com/c/chromium/src/+/1373020 but two things are unclear: 1. Why data:// URLs aren't working with range requests? Blink>Loading folks, can you chime in? Has this never worked? 2. Why MultiBuffer isn't working with these resources, they are returning 200 OK and treated as fully buffered, but part of how we handle these is to force range request support, so ultimately this may go back to 1? +horo in case he knows why or who to route the question in #1 to.
,
Dec 12
Sorry I don't know. +yhirano@: Do you know?
,
Dec 12
+mmenke@ for net::DataURL (see #12).
,
Dec 12
Range requests are handled for data URLs that make it to the network stack layer by URLRequestDataJob, a consumer of net::DataURL. Many data URLs are handled in blink, and there's a new network service path (Which does not send data URLs to the network stack), neither of which I'm familiar with, so can't comment on them.
,
Dec 12
Do you know who we can cc? Or have advice on narrowing the issue one way or another? I'm seeing 200 responses to a data URL request. Each time the full resource is being returned. So I'm guessing one of these new paths is broken in regards to range requests for data.
,
Dec 12
[+jam]: John, I don't suppose you either know where the network service data URL code is, or who ported that code to worth with the network service? Unclear if this is a network service issue or not, but a pointer would give us a place to start. I assume someone on the loading team would know how blink internally handles data URLs - I'd have no idea where to start there, other than digging my way back up the stack using breakpoints. I suspect digging down the stack from where the media code makes requests to see where they end up would be easier.
,
Dec 12
@Matt: ProfileNetworkContextService::CreateNetworkContextParams always sets network_context_params->enable_data_url_support = true; so data URLs end up going to the network process and reusing the net/ code. Does enabling/disabling network-service in about:flags change the repro? I'm a slightly confused by the repro steps above, but it seems that I can repro this on trunk without network service.
,
Dec 12
btw I should also add: for navigations, we'll always go to the network process. see comment around IsURLHandledByDefaultLoader in navigation_url_loader_impl.cc. For subresources, the common case which this should hit stays in process, see WebURLLoaderImpl::Context::Start's CanHandleDataURLRequestLocally.
,
Dec 12
Thanks for the details folks. I'll keep digging based on this and see what I can figure out.
,
Dec 13
@horo/yhirano: Are data:// URLs subject to CORS restrictions in the context of media? I don't think so, but want to double check before I land a bypass of the loading stack for them. See CL in c#12.
,
Dec 13
data:// URLs are always considered as CORS-same-origin, as specified.
,
Dec 13
Thanks! Will land the workaround and finish debugging why things stopped working.
,
Dec 13
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4841c71bfd6966584d0e7f8e96fb769c36f34e50 commit 4841c71bfd6966584d0e7f8e96fb769c36f34e50 Author: Dale Curtis <dalecurtis@chromium.org> Date: Thu Dec 13 18:14:05 2018 Don't use MultiBufferDataSource for data:// URLs. Using the network based path just increases memory usage and causes worse performance since all reads are asynchronous. It also seems like data:// URLs don't support range requests, so each read pulls in the entire data stream again and again. I'm not sure if data:// URLs not supporting range requests is a new thing, or if they should be supporting this. Will ask loading team. It's also unclear why MultiBuffer is breaking in this case, it's not efficient, but it shouldn't be broken, so there's still some minor investigation left to do there. BUG= 913681 TEST=linked bug plays correctly. Change-Id: I3183ca0c5d8f3ecf09304cdcd1c77e55825a98d6 Reviewed-on: https://chromium-review.googlesource.com/c/1373020 Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Reviewed-by: Dan Sanders <sandersd@chromium.org> Cr-Commit-Position: refs/heads/master@{#616364} [modify] https://crrev.com/4841c71bfd6966584d0e7f8e96fb769c36f34e50/media/base/data_source.cc [modify] https://crrev.com/4841c71bfd6966584d0e7f8e96fb769c36f34e50/media/base/data_source.h [modify] https://crrev.com/4841c71bfd6966584d0e7f8e96fb769c36f34e50/media/blink/multibuffer_data_source.cc [modify] https://crrev.com/4841c71bfd6966584d0e7f8e96fb769c36f34e50/media/blink/multibuffer_data_source.h [modify] https://crrev.com/4841c71bfd6966584d0e7f8e96fb769c36f34e50/media/blink/multibuffer_data_source_unittest.cc [modify] https://crrev.com/4841c71bfd6966584d0e7f8e96fb769c36f34e50/media/blink/webmediaplayer_impl.cc [modify] https://crrev.com/4841c71bfd6966584d0e7f8e96fb769c36f34e50/media/blink/webmediaplayer_impl.h [modify] https://crrev.com/4841c71bfd6966584d0e7f8e96fb769c36f34e50/media/blink/webmediaplayer_impl_unittest.cc [modify] https://crrev.com/4841c71bfd6966584d0e7f8e96fb769c36f34e50/media/filters/memory_data_source.cc [modify] https://crrev.com/4841c71bfd6966584d0e7f8e96fb769c36f34e50/media/filters/memory_data_source.h
,
Dec 18
This has been broken since M52 when we enabled multibuffer, so there is no new regression here and this is now fixed by avoiding Multibuffer.
,
Dec 18
,
Dec 18
,
Dec 18
mmenke: The reason things don't work is the URLRequestDataJob does not support range requests. Should it?
,
Dec 18
dalecurtis: It does in fact support range requests. It subclasses URLRequestSimpleJob, which handles them using its GetData method.
,
Dec 18
The linked code shows that method is overridden?
,
Dec 18
Yes, because URLRequsetSimpleJob gets the data it provides via GetData, as opposed to the generic URLRequestJob::ReadRawData method (Or something like that).
,
Dec 18
Ah, sorry I misunderstood your wording. I read "its GetData" to be URLRequestSimpleJob's, will dig into this further to see what's going on.
,
Dec 18
Hmm, GetData is never called, only BuildResponse.
,
Dec 18
It's actually the code that calls GetData that does all the heavy lifting (Which isn't exactly all that heavy) - URLRequestSimpleJob::ReadRawData.
,
Dec 18
Ah, which is due to Blink eating the load before it goes to net: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc?l=851 https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc?l=544 https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/network/network_utils.cc?l=68 So my earlier question should have been directed to yhirano, horo: Should blink support range requests for data:// URLs? |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by dalecur...@chromium.org
, Dec 10Status: Assigned (was: Unconfirmed)