-
Notifications
You must be signed in to change notification settings - Fork 693
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
MediaPlayerElement/MediaElement: Closed Caption and Subtitle Styling got Broken by Recent Update #9126
Comments
Is there anybody in charge or do I need to escalate otherwise? |
Thanks for transferring. The offending element in this context is the ClosedCaptionProperties class which conveys the data from the registry key (mentioned above) to Besides changing the implementation (which only MS can do), I had identified the following ways as potential methods for working around this bug: 1 Unregister the WinRT Class ClosedCaptionPropertiesWinUI3
This might work with a WinUI3 app with runFullTrust, but it would require to manipulate the general registration of this class, which would be a really dirty way. WinUI2Yet, runFullTrust is not the goal and - most importantly - we're also targeting Xbox/UWP where permissions don't allow any such manipulation. 2 Ship a Custom Replacement for ClosedCaptionPropertiesWinUI2I made some attempts to include a custom implementation of the What I haven't tried is to do the same but as a C++/WinRT component. I'm not sure whether this might have better chances to inject a runtime replacement for 3 Manipulate at the Registry LevelWinUI3Without WinUI2UWP uses a different containerization model and doesn't seem to support those install-time registry settings (no matter what I tried). Even though the tooling for viewing data/registry in the context of the running application was showing the override values, in the registry, the UWP app itself got the actual registry data instead of the overridden ones from the container. Windows.Media.dllI "analyzed" the core implementation of Windows.Media, specifically looking for some kind of mechanism to disable or intercept the behavior of Summing UpThere's a half-way reasonable workaround for WinUI3 - but nothing for UWP. What can be done to resolve or workaround this on UWP? We want to get this ready and ship it to the store rather sooner thatn later. Thanks again |
I wouldn't call those workarounds. This is the kind of headache that disqualifies UWP/winui 3 for any project. |
I think in this case, it's been about an action taken on one side (caption styles in sysctl dropping defaults) after it had previously been mandated that all playback components have to obey to those settings (while relying on the premise that defaults will always be neutral). But what's really not understandable is that it has been reported a year ago already (even when the full impact might not have been visible) and no action has been taken since then. A new framework will always have bugs, but what makes the difference between a solid and relatable platform on which want to build and rely on - or something whether rather like to turn around quickly is whether and how quickly such issues are getting addressed. It appears that the subtitle rendering has been completely re-built for WinUI3 (presumably due to its disabilities in composition), and when looking at the code and all the (admittedly nice and funny) ASCII paintings there, it surely wasn't done quickly and under time pressure - easily a 6-figure total. With all the effort, time and money having been invested in just this part, it should actually be a red alert for every program manager, when it turns out that the result of that effort gets nullified by the fact that nobody can use it. Hopefully ASCII art can be suspended for a moment for getting this resolved. |
This kind of bug in this kind of endeavour shouldn't have seen the outsides of Microsoft offices. Makes you question how did they test the implementation in the first place. |
I believe that the captions settings change came afterwards. It's also this change alone which is to blame for the mess that it has created. What goes on this team, is "just" the fact that it hasn't been addressed. |
@codendone - Do you have any updates, what's the status? Thanks |
Any news? |
Yes, they made it worse. Some of the built-in fonts that you can select in settings don't work anymore (subtitles render blank lol). |
@codendone - What's the status? |
I passed the status request on to the person who this issue is assigned to (internally). |
Oh, that's great news. Thank you very much. |
@codendone - Was there any response so far? |
In fact, this is very well actionable in this repository! It can be fixed in the same file for which I have already submitted two PRs (#9248, #9224). I just didn't submit a PR because there are several ways to do it. And the PRs are ignored same like most other issues here. What's actually happening here? |
@softworkz - thank you for the detailed investigation here… it all makes sense, as you mentioned, custom CC settings would get overridden when the default profile no longer had 0 values throughout. Trying this out on public 23H2 OS build 22621.1.amd64fre.ni_release.220506-1250, I was pleasantly surprised to see that (on a fresh install VM), the default is again filled with 0s:
It appears the regression in Settings you identified has been fixed, and WinUI MPE should again be applying custom CC attributes (specified in .ttm file, etc). Can you confirm the issue is resolved for you on updated OS? |
@softworkz, closing this issue per above findings. If you can still repro, please comment here and we'll investigate further. |
@DmitriyKomin Thanks a lot for confirming the issue and my findings. Though - Can you please re-open? Because the problem is this: The change has already happened, and this means that more than a Billion of Windows devices have these settings applied and these don't get reverted automatically. The fact that new installations don't have those values is interesting but doesn't change the situation in any way. |
@softworkz - apologies, you are right... I rushed the conclusion on this :-(. Experimenting more on the 23H2 VM, I see the HKCU key gets populated with nonzero values once Caption style is touched in Settings (including the 'Default' value). So indeed the problem is mostly still present (it does seem the OS default is at least fixed). The problem is clearly outside of XAML, we'll need help from Windows Settings/Captions area owners. I'm working on getting the right people looped in internally, and post updates here as they come. Thank you for your persistence in getting this important issue resolved. |
@DmitriyKomin - thanks a lot for re-opening. I have thought a lot about possible remedies since I opened this issue and I see things a bit more clear meanwhile:
And here's why I think so: In their world, subtitles don't have styles and colors. Subtitle format in Windows.Media has always been very limited and windows media based players needed extra codecs and renderers (like the DirectShow filter 'VSFilter' for SSA/ASS subtitles). The "misfit": Windows.Media.CoreThis is what I'm unable to fit into the picture: Windows.Media.Core has introduced an incredibly detailed and comprehensive object model for subtitles with types like TimedTextCue, TimedTextStyle TimedTextLine, TimedTextSubformat, etc. Hence I think the best place to get answers might be the Windows.Media.Core owners. |
I just fear that these people don't exist anymore (in that position), because otherwise they would have noticed this mess already and taken action, because the current situation essentially renders their designed API unusable. |
Possible SolutionsLet's analyze this a bit to understand the range of possible solutions that even exist on the technical side, so we don't try to rely on some who aren't even able to help in this regard. We want to prevent the registry settings from overriding our own style settings in the application and the flow goes over 3 "hops" only: graph LR
A["1. Registry"] --> B["2. ClosedCaptionProperties"]
B --> C["3. CueStyler.cpp"]
1. RegistryThis is where the override settings are stored - even when a user has never set any.
2. ClosedCaptionPropertiesThe XAML text cue renderer reads the user's CC settings by using the static WinRT class For the developer side, I had seen two possible strategies: 2.1 Replace
|
@softworkz, thank you for the insightful response. I am now engaged internally on this issue with folks SettingsUI (owning Captions page), and also from MediaFoundation (owning ClosedCaptionProperties), and we have an active discussion around possible ways to address this. I don't have anything to report yet, but personally I am hoping for a global solution in SettingsUI/regkey, presumably a new knob of some kind to indicate user preference for app/content-provided caption style. This change definitely requires some design and would take more time, but we're now having the needed conversation. Regarding your proposed workarounds, #2.3 is closest in sprit (or maybe rather in scope) to what I want to see, but it's questionable giving apps a way to bypass User Settings (without user interaction)... I expect this question will get clarified in the Settings owner I mentioned above. Fixes in WASDK also seem problematic as another "rogue behavior" against user settings, and additionally create inconsistency in behavior of various media players, I am hoping we can avoid this. I will post an update here with results of the cross-team conversation, and then we pick up this discussion as appropriate. Thanks again for your helpful insights and engagement! |
Any news? |
@DmitriyKomin - Months have passed, what was the outcome of your discussions? What's the current state? We have released our application now, and users on Xbox are experiencing that our app-level settings are not working. The OS-level Captioning settings (under Accessibility) are disabled. I think this is because the same stupid registry update for Win11 has been rolled out to Xbox as well, but Xbox settigns still follow the (much better) logic from Win10, where the user is able to clear the OS-level settings. This is such a mess. One of the worst Windows changes I've seen in many years - not in terms of impact, but it was done without thinking (to say it friendly).
I think I have overread this somehow, so I didn't come to say the following: It's our application and it's our own and sole decision how to display subtitles. This is none of your business, Microsoft!
On Windows, we can simply erase the stupid default settings in the registry. Store apps can run full-trust and with registry virtualization disabled. This means: you don't have any leverage in this regard. If MS isn't cooperative by allowing apps to have their own settings take precedence, then we will just delete those registry keys on every machine where our application gets installed. And I would recommend to all other developers to just do the same. This issue is open since more than a year without a solution, so let's go and RegDeleteKeyExuntil MS provides a solution. A cooperative way would be absolutely preferrable, but I wanted to make it very clear that MS is not in the possition to dictate anything in this regard. Except on Xbox, but gladly, the Xbox settings app deletes those keys juist like Win10 did and how it actually should be done. |
This is a tough one, because it spans wide and it's interdisciplinary - a kind of RACE condition between multiple
Teams/Areas Involved
Microsoft.UI.Xaml
Windows.Media.ClosedCaptioning.ClosedCaptionProperties
Accessibility Section
(probably originated by)
I'm not sure whether this is the best place for this, but for Windows.Media and UWP, there's a cluttered forum only and over at MS.UI.Xaml, an earlier report has been ignored since (precisely) one year. The App Sdk seems to have the widest scope and - lastly - has the most welcoming text 😄
Feel free to move it, though.
Symptoms
WinUI3: Subtitles are not visible
There's no way for an application to change that through the media apis.
WinUI2: Subtitle Styles cannot be controlled
Certain properties of TimedTextStyle, most importantly the FontFamily.
Impact
This is showstopping for us. We are migrating a media player application to UWP (xbox) and WinUI3 and are blocked by this.
I guess the "invisible" subtitles effect doesn't need further explanation, and regarding the font setting, one might easily think that this is a minor problem - but it's not like that:
Not being able to properly display them won't be acceptable for many users
But it's not just about us. It probably affects Millions of systems and not only custom WinUI apps - it also includes Media Player and Chrome + Edge browsers.
It's not invisible on the latter, but they're still affected. To understand the issue, we need to step back a little first.
Background
After intensive research, I have come to the following picture of what has happened:
Attempting to Reconstruct
In 2015, a new class was introduced in the Windows.Media namespace: ClosedCaptionProperties.
The static readonly properties are corresponding to these values in the registry:
(also mirrored under HKCU)
The purpose of this is obviously a system-wide (or rather "user-session-wide") override of caption/subtitle styles to provide an adjustable experience which fits everybody's needs. A very good thing without doubt!
The controls on Windows 10 looked like this:
Pattern: Default + Optional Override
Here we get to the core of the subject:
The pattern is clear and makes sense: Those settings do nothing until the user deliberately changes a value.
Implementations followed
Probably there are many more cases where implementations were done to make the presentation of captions adhere to those settings. These are the ones I know so far:
(the new one art least)
(in CueStyler.cpp)
(caption_style_win.cc)
In all cases this has been implemented consequently and without further ado: When an override is set, then it will be applied.
Again, this makes sense, because nothing happens until a user makes such a setting change. And when he does that, he should be able to rely on getting the result as configured.
The Fatal Mistake
I can only speculate about why it happened - but at least it's quite plausible that during the process of bringing those captions settings into the new Win11 settings UI, someone (or multiple) started to wonder and doubt about all the settings having the value "Default" - which raises the question "what does 'default' even mean'?"
Clearly, such things as audio transcriptions or live captions do not have any default text style - but seemingly it wasn't considered or known that subtitles can very well have their own ("default") styles and even their own embedded fonts.
Even ATSC captions (EIA-708 and CEA-708)) can have some style information. Or maybe it wasn't known that it would affect all the media players and browsers.
No matter why, the new UI for caption styles was introduced:
You can choose between five presets and you can also create new ones - but three mistakes were made:
=> You can't turn off all overrides
=> It is impossible to reset individual setting so that the content defaults are used
The shipment of the update has set override values on - probably - many, most or even all Windows machines in the world
Remember - these are override values, which were meant to be applied explicitly only by users.
And even worse: Users cannot get out of this situation, because it is impossible set all values back to zero (= defaults, no override).
People are forced to view subtitles with the Windows styles settings applied and are unable to set all back to default, to have captions being presented in the original way and style.
What you get from the update is this:
The preset is called "Default", but it's just a preset like all the others and it brings explicit values for all properties.
Individual Remedy
As an individual, you can fix this for your own machine, for example by merging a REG file like this: WindowsCaptionsUser.zip
It adds a custom preset named "Controlled by Application" which has all zeros and sets it as default.
But it's not something an application can do. For once, you can't mess around with a user's settings and as a store or UWP app, you don't even have the permissions to do so at runtime.
Point of Return?
For the MS side, it's a similar problem: It has been rolled out already. Can it be reverted in another update? Just adding a "real default" preset wouldn't be sufficient, it would also need to be set active. I'm not sure whether that's feasible...
If it cannot be done like that, then a different method would be needed. For example a way to prevent those styles from being applied. But all other video playback implementations that I mentioned plus those that I don't know about would all need to implement it on their side to get everything right again.
The text was updated successfully, but these errors were encountered: