Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise hardwareAcceleration based on consensus decision. #313

Merged
merged 11 commits into from
Aug 16, 2021
Merged

Conversation

dalecurtis
Copy link
Contributor

@dalecurtis dalecurtis commented Jul 28, 2021

  • It's now a hint instead of being required.
  • Values are noPreference, preferSoftware, and preferHardware.

Fixes: #239


Preview | Diff

* It's now a hint instead of being required.
* Values are noPreference, preferSoftware, and preferHardware.

Fixes: #239
index.src.html Outdated Show resolved Hide resolved
During the AudioSampleFormat discussion it was decided we should
be using lower case plus dashes.
Copy link
Collaborator

@padenot padenot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to have a bit of prose somewhere that does the rejection in the case the UA decides to reject, right? I thought we had something in the current text but I can't find anything.

Probably just a rather vague line in the valid VideoDecoderConfig steps or something.

@dalecurtis
Copy link
Contributor Author

We need to have a bit of prose somewhere that does the rejection in the case the UA decides to reject, right? I thought we had something in the current text but I can't find anything.

Probably just a rather vague line in the valid VideoDecoderConfig steps or something.

Yeah I thought we had one as well. Done.

"allow",
"deny",
"require",
"no-preference",
Copy link
Contributor

@youennf youennf Jul 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in #239, I tend to prefer a more descriptive default value.
@dalecurtis mentionned renaming no-preference to prefer-efficiency if we can all agree on this default behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I defer final decision to @aboba @padenot, I prefer no-preference.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no-preference is fine. I've also seen "balanced" used.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this rather descriptive. In passing this value, the author explicitly signals that they don't have any particular preference, and defers to the UA to make the decision on what decoder to use, based on the scenario characteristics (on battery power, video resolution, etc.).

@dalecurtis dalecurtis requested a review from padenot July 30, 2021 20:24
@dalecurtis
Copy link
Contributor Author

Bump @youennf @padenot . Thanks!

@youennf
Copy link
Contributor

youennf commented Aug 9, 2021

I am fine with a MUST. I would try to be more straightforward in the way to state it.
Something like: To prevent any fingerprinting issue, the hardwareAccelaration preference value MUST have no effect on rejection of a given configuration.

@dalecurtis
Copy link
Contributor Author

@youennf the current text is accurate, I've changed the wording slightly (avoid => prevent, SHOULD => MUST), but per editors consensus rejection using the preference will be allowed if it doesn't expose any fingerprinting information.

@youennf
Copy link
Contributor

youennf commented Aug 9, 2021

rejection using the preference will be allowed if it doesn't expose any fingerprinting information.

Can you describe what is the advantage of the current PR wording?
For instance, what are the cases where using the preference would trigger/prevent rejection and would not expose fingerprinting information?

@dalecurtis
Copy link
Contributor Author

We've discussed this extensively on the issue, but to recap: the advantage is a clearer articulation of capabilities to developers (ideally resulting in a better end user experience) for UAs which have exposed equivalent information through Media Capabilities or other mechanisms.

  • Per the issue thread this is important to developers -- both Zoom and VLC have expressed a desire to manage deny-lists for robustness and/or select their own internal software codecs when necessary.
  • Data from @padenot and Zoom supports those requests. @padenot indicated that WASM is performant enough for low complexity operations that Firefox is replacing significant internal pieces with it. Zoom has confirmed independently that WASM is as performant or better for low resolutions (<=360p) using H264.

As for cases where it won't reveal additional fingerprinting, that's going to depend on the UA's implementation of other APIs. If a UA doesn't expose Media Capabilities or doesn't reveal hardware acceleration through the powerEfficient bit (or some other mechanism), a UA implementing WebCodecs will need to ignore the hardwareAcceleration value entirely.

For example, in Chromium software decoders are known based on major version, so no additional information is revealed with the no-preference or prefer-software values. MediaCapabilities reveals hardware presence via the powerEfficient bit for both encoding and decoding, so IsConfigSupported() provides zero additional information in our implementation. I expect this to be similar for most UAs, but if not they are required by this text to ensure zero impact on fingerprinting.

@youennf
Copy link
Contributor

youennf commented Aug 10, 2021

MediaCapabilities reveals hardware presence via the powerEfficient bit

In that case, let's be specific, being open-ended makes the whole sentence weak, I believe we can safely remove 'or other web exposed capability systems the User Agent may provide'.
FWIW, the probability for another capabilities mechanism is probably low and it is safer to revisit the issue if such a new mechanism happens.

@dalecurtis
Copy link
Contributor Author

Done, I've made the text clearer.

@chcunningham
Copy link
Collaborator

@padenot @aboba friendly ping to take a look at the latest here

"allow",
"deny",
"require",
"no-preference",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this rather descriptive. In passing this value, the author explicitly signals that they don't have any particular preference, and defers to the UA to make the decision on what decoder to use, based on the scenario characteristics (on battery power, video resolution, etc.).

@chcunningham
Copy link
Collaborator

We need to have a bit of prose somewhere that does the rejection in the case the UA decides to reject, right? I thought we had something in the current text but I can't find anything.
Probably just a rather vague line in the valid VideoDecoderConfig steps or something.

Yeah I thought we had one as well. Done.

This is covered by step 3 of the Check Configuration Support algo.
https://www.w3.org/TR/webcodecs/#config-support

3. If the User Agent can provide a <a>codec</a> to support all entries of the
    |config|, including applicable default values for keys that are not
    included, return `true`.

It intentionally doesn't reference individual attributes of the config, since that would be a long list and the current text is pretty clear. This algo is invoked for both IsConfigSupported() and for the support checks that take place during configure().

I'll take the liberty of reverting @dalecurtis commit to check this in the config validation steps. The semantics of that algo are "is your input valid" which we want to distinguish from "supported". This algo is called earlier on in the synchronous steps of the methods that take configs and produces rejection via TypeError (invalid input).

Copy link
Collaborator

@chcunningham chcunningham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Looks like all comments are addressed. On naming, sticking w/ "no-preference" given majority approval.

@chcunningham chcunningham merged commit 6f90d4e into main Aug 16, 2021
@chcunningham chcunningham deleted the hwaccel branch August 16, 2021 23:58
github-actions bot added a commit that referenced this pull request Aug 16, 2021
SHA: 6f90d4e
Reason: push, by @chcunningham

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Aug 17, 2021
SHA: 6f90d4e
Reason: push, by @chcunningham

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Aug 17, 2021
SHA: 6f90d4e
Reason: push, by @chcunningham

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Aug 17, 2021
SHA: 6f90d4e
Reason: push, by @chcunningham

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Aug 17, 2021
SHA: 6f90d4e
Reason: push, by @chcunningham

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Aug 17, 2021
SHA: 6f90d4e
Reason: push, by @chcunningham

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Aug 17, 2021
SHA: 6f90d4e
Reason: push, by @chcunningham

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Aug 17, 2021
SHA: 6f90d4e
Reason: push, by @chcunningham

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Aug 17, 2021
SHA: 6f90d4e
Reason: push, by @chcunningham

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Aug 17, 2021
SHA: 6f90d4e
Reason: push, by @chcunningham

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is exposing https://w3c.github.io/webcodecs/#enumdef-hardwareacceleration a good idea
6 participants