New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 835664 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

MiDIOutput.send() doesn't handle timestamp correctly

Reported by maximech...@gmail.com, Apr 22 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36

Steps to reproduce the problem:
This was previously working, but my browser has just received an update, and it doesn't work correctly anymore.

The MIDIOutput.send(msg, timestamp) function doesn't behave correctly when a nonzero timestamp is provided. The MIDI message is never sent. It does send the message immediately if the timestamp is zero or unspecified.

I've attached a reduced test case. My specific setup was using an Arturia Drumbrute connected over USB, but you should be able to reproduce this with any MIDI device. You might need to change the MIDI channel from 1 to 0.

What is the expected behavior?
When a nonzero timestamp is specified, the event should play some time in the future if the timestamp is greater than the value produced by performance.now().

What went wrong?
The MIDIOutput.send(msg, timestamp) function doesn't behave correctly when a nonzero timestamp is provided. The MIDI message is never sent. It does send the message immediately if the timestamp is zero or unspecified.

Did this work before? Yes 65

Does this work in other browsers? N/A

Chrome version: 66.0.3359.117  Channel: stable
OS Version: OS X 10.12.6
Flash Version: 

This API probably needs automated tests?
 
web_midi_send_fail.zip
2.8 KB Download
Labels: Needs-Bisect Needs-Triage-M66
Cc: toyoshim@chromium.org
Labels: Triaged-ET
As per comment #0, it seems that the issue is reproducible using a MIDI device set up only which is not available with TE-team. Hence, ccing dev @toyoshim from owners url: https://cs.chromium.org/chromium/src/media/midi/OWNERS?q=Blink%3EWebMID&sq=package:chromium&dr=C&l=11 and requesting to please help us in looking into the issue.

Thanks...!!
Owner: tzik@chromium.org
Status: Assigned (was: Unconfirmed)
hum... probably this is a regression of https://chromium-review.googlesource.com/c/chromium/src/+/892726

tzik, could you take a look?
Labels: -OS-Mac
tzik: https://jsfiddle.net/toyoshim/rbf6b6v1/ this is a simple repro case.
The problem seems to be platform independent.
Cc: yhirano@chromium.org
+yhirano just in case
Labels: -Needs-Bisect ReleaseBlock-Stable M-66 FoundIn-66 Target-66 RegressedIn-66 hasbisect OS-Mac
Thanks toyoshim@ for help based on C#3 and CL poitned out.
This seems to have regressed in M-66. Hence, adding M-66 stable blocker for stable refresh, feel free to adjust or remove the blocker lable if this should not be blocking.

Change log:
https://www.google.com/url?q=https://chromium.googlesource.com/chromium/src/%2Blog/66.0.3337.0..66.0.3338.0?pretty%3Dfuller%26n%3D10000&sa=D&source=hangouts&ust=1524554237435000&usg=AFQjCNH-XU300lYaYe2OrqsctAF5BBCVzw.

Note: Not sure about the OS in which the issue is reproducing as it can't be reproducible from TE-end due to unavailable set up.

Thanks...!!


re#6

The problem is platform independent, and my repro at #4 will work on Linux even without any real MIDI devices.

Status: Started (was: Assigned)
tzik@ is looking.

Comment 9 by tzik@chromium.org, Apr 24 2018

The previous one seems the culprit. Fixing...
https://chromium-review.googlesource.com/c/chromium/src/+/895129
Project Member

Comment 10 by bugdroid1@chromium.org, Apr 24 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0e5ce9438849cb3ac042e45f8ee964204634be06

commit 0e5ce9438849cb3ac042e45f8ee964204634be06
Author: tzik <tzik@chromium.org>
Date: Tue Apr 24 06:02:27 2018

Fix the time origin of delayed MIDIOutput::send

MIDIOutput starts using Performance::timeOrigin() as the time origin of
the delayed send request, which is wrong.
As timeOrigin() is a web-exposed, it's relative to a different timing to
TimeTicks value. We should use Performance::GetTimeOrigin() instread.

Bug:  835664 
Change-Id: I413ed6387351d55a72150163d09cfa2eb66bca92
Reviewed-on: https://chromium-review.googlesource.com/1025450
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553012}
[modify] https://crrev.com/0e5ce9438849cb3ac042e45f8ee964204634be06/third_party/blink/renderer/modules/webmidi/midi_output.cc

Comment 11 by tzik@chromium.org, Apr 24 2018

Labels: Merge-Request-67 Merge-Request-66
The fix at #c10 looks working fine locally.
Project Member

Comment 12 by sheriffbot@chromium.org, Apr 24 2018

Labels: -Merge-Request-66 Merge-Review-66 Hotlist-Merge-Review
This bug requires manual review: Request affecting a post-stable build
Please contact the milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), josafat@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: M-67
Labels: -Merge-Review-66 Merge-Approved-66
Chatting with tzik@, this is tested locally, safe merge overall, and this is breaking webapps using WebMIDI. Fix is landing in Canary 68.0.3406. Conditionally approving CL for merge to M66 (once it's verified in canary). 
Project Member

Comment 15 by sheriffbot@chromium.org, Apr 25 2018

Labels: -Merge-Request-67 Merge-Approved-67 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M67. Please go ahead and merge the CL to branch 3396 manually. Please contact milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), kbleicher@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: krajshree@chromium.org
Labels: Needs-Feedback
Tested the issue on Win-10, mac 10.13.3 and ubuntu 17.10 using chrome version #68.0.3406.0 as per comment #4 and #7.
Attached screenshots of Win-10, mac 10.13.3 and ubuntu 17.10 behaviour.

Win-10 behaviour
================
Observed that MIDIOutput.send(msg, timestamp) function doesn't behave correctly when a nonzero timestamp is provided on Win-10 using both chrome with fix and chrome without fix.
Mac 10.13.3 behaviour
=====================
Observed that MIDIOutput.send(msg, timestamp) function doesn't behave correctly when a nonzero timestamp is provided on mac 10.13.3 using both chrome with fix and chrome without fix.
ubuntu 17.10 behaviour
======================
Able to reproduce the issue using chrome without fix. But using chrome version #68.0.3406.0, observed that the message is sent immediately if the timestamp is non-zero as expected. Hence, fix is verified on ubuntu 17.10.

tzik@ - Could you please check the screen shots and please let us know the different OS behaviour as per comment #7 and please confirm the fix.  

Thanks...!!
835664@ubuntu 17.10.png
438 KB View Download
835664@win10.PNG
97.1 KB View Download
835664@mac.png
540 KB View Download
tzik@, pls merge to M67 branch 3396 if test verification listed at #16 looks good to you.

Comment 18 by tzik@chromium.org, Apr 26 2018

#c16 looks good. The repro case was for Linux only, as Web MIDI requires a MIDI device, and Linux has a default one.
Project Member

Comment 19 by bugdroid1@chromium.org, Apr 26 2018

Labels: -merge-approved-67 merge-merged-3396
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e08acd16ff25cc24fe9ed55810ed4395980d1104

commit e08acd16ff25cc24fe9ed55810ed4395980d1104
Author: tzik <tzik@chromium.org>
Date: Thu Apr 26 03:23:08 2018

Fix the time origin of delayed MIDIOutput::send

MIDIOutput starts using Performance::timeOrigin() as the time origin of
the delayed send request, which is wrong.
As timeOrigin() is a web-exposed, it's relative to a different timing to
TimeTicks value. We should use Performance::GetTimeOrigin() instread.

Bug:  835664 
Change-Id: I413ed6387351d55a72150163d09cfa2eb66bca92
Reviewed-on: https://chromium-review.googlesource.com/1025450
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#553012}(cherry picked from commit 0e5ce9438849cb3ac042e45f8ee964204634be06)
Reviewed-on: https://chromium-review.googlesource.com/1029690
Reviewed-by: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/branch-heads/3396@{#318}
Cr-Branched-From: 9ef2aa869bc7bc0c089e255d698cca6e47d6b038-refs/heads/master@{#550428}
[modify] https://crrev.com/e08acd16ff25cc24fe9ed55810ed4395980d1104/third_party/blink/renderer/modules/webmidi/midi_output.cc

Comment 20 by tzik@chromium.org, Apr 26 2018

Status: Fixed (was: Started)
I verified that on the latest Chrome Canary on Windows with LoopMIDI. Landing the fix to M66 too.
Project Member

Comment 21 by bugdroid1@chromium.org, Apr 26 2018

Labels: -merge-approved-66 merge-merged-3359
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/391fec2a18cfc0e1738763eebab996c38f7b42ae

commit 391fec2a18cfc0e1738763eebab996c38f7b42ae
Author: tzik <tzik@chromium.org>
Date: Thu Apr 26 05:15:54 2018

Fix the time origin of delayed MIDIOutput::send

MIDIOutput starts using Performance::timeOrigin() as the time origin of
the delayed send request, which is wrong.
As timeOrigin() is a web-exposed, it's relative to a different timing to
TimeTicks value. We should use Performance::GetTimeOrigin() instread.

Bug:  835664 
Change-Id: Ie1257eb037dcecb897dfc433578d7c5553e1b5b0
Reviewed-on: https://chromium-review.googlesource.com/1025450
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#553012}(cherry picked from commit 0e5ce9438849cb3ac042e45f8ee964204634be06)
Reviewed-on: https://chromium-review.googlesource.com/1029555
Reviewed-by: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/branch-heads/3359@{#769}
Cr-Branched-From: 66afc5e5d10127546cc4b98b9117aff588b5e66b-refs/heads/master@{#540276}
[modify] https://crrev.com/391fec2a18cfc0e1738763eebab996c38f7b42ae/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp

Thank you for your quick response. How long should it take until this fix gets pushed to end users in a browser update?

Comment 23 by tzik@chromium.org, Apr 27 2018

This is fixed after 66.0.3359.141, that will probably shipped in 10 days or so.
 Issue 837993  has been merged into this issue.
Labels: TE-Verified-M67 TE-Verified-67.0.3396.30 OS-Linux
Able to reproduce the issue on ubuntu 17.10 using chrome reported version #66.0.3359.117 as per comment #4 and #18.

Verified the fix on Ubuntu 17.10 using Chrome beta version #67.0.3396.30 as per the comment #4 and #18.
Attaching screen shot for reference.
observed that the message is sent immediately if the timestamp is non-zero as expected.
Hence, the fix is working as expected. 
Adding the verified labels after verifying fix on OS-linux..

Thanks...!!
835664@ubuntu17.10.png
439 KB View Download
Labels: OS-Android OS-Chrome OS-Windows
Update OS flags. Because this was a problem in Blink side, it affected all platforms that support Web MIDI.

tzik@, than you for all your works.
agoode@, thank you for triaging another report.
Able to reproduce the issue on ubuntu 17.10 using chrome reported version #66.0.3359.117 as per comment #4 and #18. But unable to reproduce the issue on OS-win and OS-Linux due to no repro case for those OS.

Verified the fix on Ubuntu 17.10 using Chrome version #66.0.3359.170 as per the comment #4 and #18.
Attaching screen shot for reference.
observed that the message is sent immediately if the timestamp is non-zero as expected.

Thanks...!!
835664@M66.png
473 KB View Download
Labels: TE-Verified-66.0.3359.170
I've verified this issue on "Debian GNU/Linux rodete" for Latest Stable RC#66.0.3359.170 and the fix is working as intended.

PS: C#18 says that the repro case is applicable for "Linux" only.

Thank you!

Sign in to add a comment