Friday, August 26, 2016

TenFourFox 45.3.0b2 available

TenFourFox 45.3 beta 2 is now available (downloads, hashes, release notes). The issue with video frame skipping gone awry seems to be due to Mozilla's MediaSource implementation, which is (charitably) somewhat incomplete on 45 and not well-tested on systems of our, uh, vintage. Because audio is easier to decode than video the audio decoder thread will already have a speed advantage, but in addition the video decoder thread appears to only adjust itself for the time spent in decoding, not the time spent pushing the frames to the compositor or blitting them to the screen (which are also fairly costly in our software-rendered world). A frame that's simple to decode but requires a lot of painting will cause the video thread to get further and further behind queueing frames that the compositor can't keep up with. Even if you keep skipping keyframes, you'll end up more than one keyframe behind and you'll never catch up, and when this occurs the threads irrevocably go out of sync. The point at which this happens for many videos is almost deterministic and correlates well with time spent in compositing and drawing; you can invariably trigger it by putting the video into full screen mode which dramatically increases the effort required to paint frames. In a few cases the system would just give up and refuse to play further (hitting an assertion in debug mode).

After a few days of screaming and angry hacking (backporting some future bug fixes, new code for dumping frames that can never be rendered, throwing out the entire queue if we get so far behind we'll never reasonably catch up) I finally got the G5 to be able to hold its own in Reduced Performance but it's just too far beyond the G4 systems to do so. That's a shame since when it does work it appears to work pretty well. Nevertheless, for release I've decided to turn MediaSource off entirely and it now renders mostly using the same pipeline as 38 (fortunately, the other improvements to pixel pushing do make this quicker than 38 was; my iBook G4/1.33 now maintains a decent frame rate for most standard definition videos in Automatic Performance mode). If the feature becomes necessary in the future I'm afraid it will only be a reasonable option for G5 machines in its current state, but at least right now disabling MediaSource is functional and sufficient for the time being to get video support back to where it was.

The issue with the Amazon Music player is not related to or fixed by this change, however. I'm thinking that I'll have to redo our minimp3 support as a platform MP3 decoder so that we use more of Mozilla's internal media machinery; that refactoring is not likely to occur by release, so we'll ship with the old decoder that works most other places and deal with it in a future update. I don't consider this a showstopper unless it's affecting other sites.

Other changes in 45.3 beta 2 are some additional performance improvements. Most of these are trivial (including some minor changes to branching and proper use of single-precision math in the JIT), but two are of note, one backport that reduces the amount of allocation with scrolling and improves overall scrolling performance as a result, and another one I backported that reduces the amount of scanning required for garbage collection (by making garbage collection only run in the "dirty" zones after cycle collection instead of effectively globally). You'll notice that RAM use is a bit higher at any given moment, but it does go back down, and the browser has many fewer random pauses now because much less work needs to be done. Additionally in this beta unsigned extensions should work again and the update source is now set to the XML for 45. One final issue I want to repair before launch is largely server-side, hooking up the TenFourFox help button redirector to use Mozilla's knowledge base articles where appropriate instead of simply redirecting to our admittedly very sparse set of help documents on Tenderapp. This work item won't need a browser update; it will "just work" when I finish the code on Floodgap's server.

At this point barring some other major crisis I consider the browser shippable as 45.4 on time on 13 September, with Amazon Music being the highest priority issue to fix, and then we can start talking about what features we will add while we remain on feature parity. There will also be a subsequent point release of TenFourFoxBox to update foxboxes for new features in 45; stay tuned for that. Meanwhile, we could sure use your help on a couple other things:

  • Right now, our localized languages for the 45 launch are German, Spanish, French and Japanese, with an Italian translation in progress. We can launch with that, but we're losing a few languages there we had with 38. You can help.

  • Even minor releases of the browser get a small bump in support tickets on Tenderapp; a major release (such as 31 to 38, and now 38 to 45) generally brings lots of things out of the woodwork that we've never seen during the beta cycle. Most of these reports are spurious, but sometimes serious bugs have been uncovered even though they looked obviously bogus at first glance, and all of them need to be triaged regardless. If you're a reasonably adept user and you've got a decent understanding of how the browser works, help us help your fellow users by being a volunteer on Tenderapp. There's no minimum time commitment required; any help you can offer is appreciated, even if just temporary. Right now it's just Chris Trusch and me trying to field these reports, which is unsatisfactory to cover all of them (Theo used to but we haven't seen him in awhile). If you'd like to help, post in the comments and we'll make you a "blue name" on Tenderapp too.

That's it for now. See what you think.

19 comments:

  1. Youtube videos in 360p now play very nicely again on my G4 1.67 GHz PowerBook. The ability to choose different resolutions on YT, however, is somehow tied to Mediasource Extensions, right? But I still prefer fluid 360p over having to select 240p or 144p each time to be able to view the video.

    ReplyDelete
    Replies
    1. It might be tied, yes. How were you selecting it before? If you reenable them from about:config (look under *.mediasource.*), do you get the resolution options back?

      Delete
    2. Yes, I get the resolution option back when I re-enable Media Source Extensions in about:config. Click the gear icon and choose "Quality". Most videos on YT are encoded in different resolutions if they have a substantial view count, otherwise they'll be 360p only for web.m.
      https://s13.postimg.org/3r4iddytj/YTres.png

      The sync issue (and worse performance at 360p) also re-appear, of course. But it's good to have a choice in case we ever need this functionality.

      Delete
    3. …Maybe one could ship with Media Source Extensions enabled for G5, but off for G4? And on again for G3, because the ability to choose 144p has made YT videos watchable on my 800 MHz G3 iBook for the first time in ages?

      Delete
    4. Given what you say, it makes sense to enable it for G3 and 7400 since those systems probably couldn't play video well if at all before. So this is a definite win for them.

      I'm less certain about G5. The Quad in reduced performance handles it fine, but that's the Quad. If someone is using it on a single processor G5 and it works well there too, then I'll enable it for those.

      Unfortunate that 7450 is kind of left out here but as you say it's surprising UX for it not to work out of the box when it did before. For this reason we'll surface the control option eventually in the Preferences dialogue (as we discussed in the Localization thread).

      Anyone with a low-spec G5 tried it with MediaSource on? How well does it work for you now?

      Delete
  2. Just exactly how does one go about re-enabling
    media source extensions? Where is about: config?

    thanks

    ReplyDelete
    Replies
    1. about:config can be typed into the browser's address bar. After displaying a warning about potentially wrecking the browser (which is very true!) you can continue on to view the settings that are available.

      Be careful, because the warning isn't a joke. If you don't understand something, don't change it.

      Delete
    2. As bill says, go into about:config by typing it in. The only one to change is media.mediasource.enabled (you can filter it by typing mediasource into the search box). Double click to change it to true and restart the browser. DO NOT change any other options.

      Delete
  3. "issue with video frame skipping gone awry seems to be due to Mozilla's MediaSource implementation, which is (charitably) somewhat incomplete on 45" and what in your expert opinion would be "incomplete implementation" in Firefox 45?
    Charitably that is...

    your analysis is wrong in many ways. Firefox does take into account the time it takes for the compositor to push/draw a frame.

    The issue you're seeing is that YouTube decision which stream (resolution) they are going to serve is uniquely based on your available network bandwidth. They do not use the information that some frames got dropped (either because the decoder is too slow, or because the compositor is too slow).
    So fast network, means you get high-def, which is much harder to decode.

    When you disable MSE, YouTube serves you 360p webm: so of course it's going to work well there. It's got nothing to do with the mediasource implementation.

    If you want to fix A/V sync, you may want to look at https://bugzilla.mozilla.org/show_bug.cgi?id=1258870 instead.

    ReplyDelete
    Replies
    1. I appreciate the feedback, but you didn't read what I wrote above. If it were simply a bandwidth concern, there should be no difference on the G5 between doing it fullscreen or otherwise because playback would simply frameskip when the compositor has a backlog of frames. It doesn't; the G5 has no problem with hi-def streams if it doesn't have to blit them to the entire screen. It's when it does that everything goes out of sync. I don't see anywhere in 45ESR where the time taken to blit the frame is used to advance the video forward if it's too slow. I see where that occurs for the *decoder* but decoding is not the problem (it might be on G4, but not G5). If that computation is occuring, please show me where.

      While I don't expect it to have been tested on machines of our generation, it is indeed a flaw in the implementation.

      As far as 1258870, unless I'm reading that bug wrong, it covers the decoding situation and rendering frames that are late to decode. For the G5 at least, that's not the issue. Again, advise if there's some side effect in the code I'm not seeing.

      Delete
  4. Do TenFourFox 45 will support web.skype?


    I ask this because I'm still using Skype 2.8 with this trick:

    and I can chat with my contacts except the groups... :-(

    Thank you

    Pablo Chiacchio
    Firenze - Italy

    iMac G5 2.1 GHz, MacOs 10.5.8

    ReplyDelete
  5. Hey Cameron,

    I went through the thread for the translations, and I don't see any Portuguese in there. Could you confirm?

    I could do it.

    Shiunbird

    ReplyDelete
  6. Correct, we don't have a Portuguese localization yet. A contribution in issue 42 would be most welcome:
    https://github.com/classilla/tenfourfox/issues/42
    Wiki:
    https://github.com/classilla/tenfourfox/wiki/Localization

    ReplyDelete
  7. Hmm... my mediasource extensions seem all off (false) and I get 360p only. On a 2.3 GHz G5 dualie (the older PCI-X version) the rate in a window is ok; full screen on a 1920 by 1200 screen is actually fairly crappy; 10fps at best with some stuttering. I do not see any real difference to TFF 38.8 on this machine.
    Am I getting the expected performance, or is this slower than expected? CPU load is not 100%. My network is plenty fast.
    Thanks,
    M.D.

    ReplyDelete
    Replies
    1. Full screen does not perform well on any Power Mac (see the FAQ). Even the Quad doesn't do it very well, even in Highest performance.

      As Chris mentioned, you don't get the quality options if MediaSource is off. You can try changing media.mediasource.enabled to true and see if your playback changes. Do NOT change any of the other options; they will not be supported.

      Delete
  8. The New Beta is pretty Amazing. For the first time, I am finding myself going to TenFourFox proper (not a FoxBox) much of the time over TenFourKit for basic searches and such. Generally, when it isn't something critical, TFK is just much peppier, but this build of TFF has really improved. The Google-Fonts, Captchas and Wordpress support have really improved too. The only downside seems to be memory burden (on 32-bit systems). If I start the browser just after restart, it is amazing. If I start it later, and any significant amount of RAM is already in use, the results are much more mixed. Strangely-enough, this doesn't seem to apply nearly as much in the FoxBoxes.

    Could there a way to redirect a troublesome link into a "Turbo"(FoxBox) window from main TFF? Say with a Right-Click? About the only thing that would need to be included would be bookmarking/captureURL options and access to the sign-ons.

    ReplyDelete
    Replies
    1. Presumably yes but TenFourFoxBox isn't really set up for dynamically instantiating (and assumably self-destructing) foxboxes. It would need some plumbing to rig that.

      Delete

Due to an increased frequency of spam, comments are now subject to moderation.