The facts that Flash performs just as poorly on Linux as on OS X, and far worse on a fast PowerPC (youtube is painfully choppy on a G5 Quad) than a slow x86 (youtube is tolerable on an Atom) suggest explanations that differ from the Adobe party line.
This is because Mainconcept's H.264 decoder doesn't have Altivec optimizations, only x86 SIMD. The VP6 and FLV decoders, as far as I know, do have Altivec, probably because back when they were released, PowerPC was a significant market.
The best explanation I've seen is http://www.kaourantin.net/2010/02/core-animation.html when you also realize that for video playback and animation in general, OpenGL > Core Animation > Quartz 2D > QuickDraw for OS X 10.2 and newer (I think QuickDraw was better pre-compositing.)
The overall experience is worse on Linux, with sound issues and on 64-bit Linux, clickable areas that don't line up with the visible controls. I was just talking about CPU usage.
Not a good way to make your point in my opinion. 3D rendering is also slower on both OSX and linux distributions. I don't doubt Adobe and their software is a problem, but I also think it's become far to popular to blame everything on Adobe.
Your account is new so I'm going to give you some advice: generally people on Hacker News have a reasonably high technical baseline and it would do you well to assume so. For example, a number of FFmpeg and x264 developers frequent the site and we have a pretty good idea of how video decoding works.
I wasn't discussing whether or not the post was funny. I don't care if it was funny.
I was reacting to what I think is an occasional problem with HN. In a nutshell, some people here take "serious" so far that it turns into "puritanically self-righteously lacking in any sense or awareness of humor or irony." That can lead to really bizzare misfires of communication.
Case in point is the reaction to a recent comment by Jrockway's on the anti-IRS nutcase: http://news.ycombinator.com/item?id=1135693 (again, please don't feel the need to say whether you find his comment funny or in poor taste or whatever).
I think the comment you link to is actually kinda an odd illustration of your point[1]: the first reply (Poe's rule) clearly recognizes it as humor and suggests that others will take it overly-seriously.
The second reply is somewhere in the middle -- at least it didn't start out with "OMG you are a terrible person how could you say that!!!11" I don't know who jrockway is: maybe he's making a joke, and maybe not. It's more likely that he's making a joke, but you never can tell on teh intarwebs... even in a place like HN.
Regardless, I wouldn't consider pw0ncakes' comment puritanical or self-righteous in the least: in fact he/she slightly revels in the possibility of fat-cat execs getting their comeuppance.
[1] Though I don't disagree with your point; I have indeed seen the issue of which you speak, though I can't think of any specific examples.
To play devil's advocate a little bit it's funny how all the negativity is now focused on Adobe when not many months ago it was all focused on Apple's App Store policy.
This article doesn't directly deal with the iPhone or app store. It's talking about Flash on desktop/laptop Macs, and as far as I can tell, the vast majority of the problems with that are Adobe's fault.
I hate that Apple has made its phone OS a walled garden. I won't buy one, and I won't develop for it, but this article doesn't really have anything to do with it.
Apple's fixed the criticisms from a few months ago (long submission updates, poor/inconsistent private API policy, etc). Not to say that you wouldn't have to look far to find new criticisms (their recent removal of "adult" apps, to name one).
Adobe, on the other hand, hasn't fixed any of their problems. And they've had much longer to fix their problems than Apple has. Hell, it took less time for Apple to create a problem that had to be fixed then for Adobe to fix their problems.
Well the Apple App Store problems were merely procedural issues whereas the Adobe issues are technically difficult problems that haven't been solved well by anyone and aren't helped by platform/codec war politics.
From what I know of the issue, the technical problems with Flash are not difficult to solve. The fundamental problem seems to be that Adobe is not willing to put in the effort to make Flash work well on multiple platforms.
Goddamnit, why do people keep taking Adobe's statements at face value -- shipping versions of Flash on Windows aren't hardware accelerated either!
The Windows Flash 10.1 plugin has been in public beta for less than 6 months, and only accelerates video decoding on minority hardware. A few percent of their install base has it, tops. Flash on Windows has decoded H.264 video at unaccelerated libavcodec speeds just fine without it going back to Flash 9 in 2007, and H.263 going back to Flash 6 in 2002. Neither of those codecs works nearly as well on OS X or Linux.
They're pushing this angle because it makes them out to be the heroes -- see the passive-aggressive spiel you get when you visit the Flash page on an iPhone -- they'd love to frame everything as "if only Apple would let us". Unfortunately it's not true in the slightest.
Adobe ignored OS X for years and is now finding themselves in a position where they're losing a hold on Flash as the 'standard' for online video. Rather than fixing the technical issues they're focused on marketing. The last 3 years of iPhone sales have proven that people can live without Flash. All Apple has to do now is continue to ignore them and hold their ground while Flash slowly fades away.
Yes, I think this is a little to late for them. It seems to me that they went along with something like "Apple has too little market share so it's not so relevant to us".
In the meanwhile Apple become relevant increasing its computer market share with the Mac, conquering the third place in the smartphone market with the iPhone and creating a device (the iPad) that is targeted to a big new audience and in my opinion will take a big share on of the pie (also considering that this is the "multimedia" pie, one very relevant to Adobe).
But in all these years they pissed of Steve Jobs, and he is the wrong person to have as an enemy when you will depend more and more on Apple platforms.
"Lastly, does anyone really think it would be a good idea for web content plugins to have direct access to graphics card hardware?" As if there's no secure way to allow it access? Of course there is, and it should have that access if it means the difference between being able to stream video from the web well or not.
I'm not clicking links to anymore of this guy's posts. He's the very definition of a mouthpiece. Nearly every post of his are bad rationalizations for Apple's policies.
> Of course there is, and it should have that access if it means the difference between being able to stream video from the web well or not.
Evidence seems to be strongly indicating that it is not necessary, unless you're Adobe and you need someone to blame for years of neglect.
Also, as pointed out all over the place, it hardly amounts to an excuse for everything else that Flash does that isn't related to h.264.
> Nearly every post of his are bad rationalizations for Apple's policies.
Hard to argue that a browser plugin should have direct GPU access when it clearly doesn't need it.
Also note that Gruber is an Apple pundit and obviously a fan of the company, but he has also been very critical of them in areas (eg, App Store policies).
As if there's no secure way to allow it access? Of course there is, and it should have that access if it means the difference between being able to stream video from the web well or not.
A safe, high level API exists: QTKit. Adobe wants direct access, so they've ignored this totally. Whether it makes sense to give hardware control to a piece of software notorious for instability and resource consumption is a judgment call, but it seems a pretty clear one.
This argument is ridiculous. Flash is native code and does not run in a sandbox. It already interacts with graphics hardware through numerous other APIs and has the ability to kill your system in innumerable other ways. An API for hardware acceleration of video decoding should be the least of your worries.
Furthermore, this argument would apply just as well to WebGL, which gives graphics hardware access directly to Javascript on any website you visit. WebGL is awesome and I believe it can be done safely.
I don't know much about QTKit but I think it's entirely plausible that it isn't flexible enough for use in Flash. Flash needs complete control over drawing because videos are integrated with other Flash content (likely rendered at least partially in software), and can be manipulated by ActionScript to produce effects such as 360 degree video: http://www.immersivemedia.com/work/cbc/hockey/index.html
> This argument is ridiculous. Flash is native code and does not run in a sandbox. It already interacts with graphics hardware through numerous other APIs and has the ability to kill your system in innumerable other ways.
Actually, in Safari 4 (Intel, 64bit) each plugin runs in its own process, and it _is_ effectively sandboxed. If Flash crashes, it no longer takes down the browser, or even the tab a la Chrome; you just get a hole in the page.
Adobe's platform evangelist claims( http://theflashblog.com/?p=1641#comment-639881 ) that the reason they can't use h.264 hardware acceleration on OS X is due to restrictions on browser plugins, which implies that it does not have full access to the local system.
I believe it has to do specifically with how drawing to the screen happens; if that has to go through the browser, then it can't utilize hardware acceleration.
One interesting test we did recently was to make a very simple flash app that draws some basic controls on the screen and scales to the window size. It also prints out the amount of memory being used by the AVM. In IE, memory usage was extremely low and was about the same regardless of the screen size. In Firefox, memory usage was higher and also almost entirely dependent on window size. To me this implies that IE is allowing Flash to interface with the video card directly, while in Firefox it's having to maintain its own frame buffer internally.
"I'm not clicking links to anymore of this guy's posts. He's the very definition of a mouthpiece."
In my opinion, you'd be making a mistake. John Gruber offers the highest quality commentary on Apple related topics of anyone (maybe matched by John Siracusa). He doesn't always take a pro-Apple line - he's been a very strong critic of the App Store acceptance process, for example.
Siracusa has a significantly more in-depth understanding of the technology. Gruber's area of expertise is in the user experience side of things. Gruber is at his best when he's critiquing UI design, somewhat less so when analyzing technical issues.
There is no denying that Gruber is a Mac pundit. Just like a political pundit that means rationalizing and cheering whatever decision the mothership makes, with little insider information. The thing is that whether you agree with him or not Gruber firmly has his fingers on the pulse of Apple.
I was really turned by this statement as well. There are plenty of plugins that do ALREADY including Unity 3d, Director (Adobe product that died in the Macromedia-Adobe transition via lack of investment by Adobe (it did lead browser 3d gaming for a while)), Java and more.
There is NO excuse that a plugin shouldn't be able to access the hardware that is pretty standard today. The worst set of cards can even handle better than software many times over. The worst cards are the intel 945s and more but those are also in netbooks. There hasn't been a better time FOR graphics hardware acceleration. This is also the sole reason flash seems slow on OSX and why native apps on the iPhone are the only way for immersive experiences.
There are plenty of ways to make hardware accelerated plugins safe (most run in a sandbox that wraps the OpenGL or DirectX calls). One method is only play them from trusted sites, as you only install apps on your desktop or mobile that you trust. The other is run the process like chrome where it only crashes the plugin, not the browser.
Hardware acceleration is used in many plugins (even Quicktime, Windows Media, etc) and gaming plugins like Unity3D, Director, Java (with processing and GL libraries).
Unless you like hearing your processor spin to death taking days of life out of it, you too should be for hardware accelerated plugins. They are no different than applications that you have to trust.
In fact WebGL is another and O3D is another example of hardware acceleration in a wrapper where what you can use is strictly limited to graphics acceleration.
true.Daring Fireball seems more and more like from Steve Jobs irrational marketing strategy mouth. Does this guy even realize what hardware acceleration is and why its used, and how flash content is more useful with full hardware acceleration. Next time would just ignore this guy
I subscribe that at least part of the 'problem' is Adobe's (previously Macromedia's) attention to the Mac. Flash has always been subpar, and I'm not alone in that the majority of apps that crash Flash is the root problem. If Adobe would step up their game it would probably go a long way, but they may have already blown their chance. Jobs does not like that Safari crashes unexpectedly, especially cause the layman user doesn't realize it was really the Flash plugin.
Adobe's inattention to the Mac extends far beyond flash.
All their applications now basically use a cross-platform UI that mocks both Mac OS and Windows conventions, and defines their own bizarre little world. (Flash is just more of the same.)
Their Mac updater software is a Byzantine nightmare.
I could go on. Just read some of the irate Mac users' commentary on John Nack's blog at http://blogs.adobe.com/jnack/ .
Should Flash Player be a kernel extension, so that it can ensure it gets plenty of CPU cycles and have direct access to whatever hardware it wants?
Yes, that way developers code for the proprietary platform Flash, and Apple joins all the other PC manufacturers in making commodity hardware with little differentiation except styling.
I'd love to see someone come up with actual facts around this Flash on Mac issue. There seems to be somewhat of a shortage of facts. Gruber has mostly hearsay (although he is very convincing with that).
We'd need to do real benchmarking for various sorts of flash content. What about poorly written ActionScript in the SWF? Does it matter when you are running multiple instances of the player, etc.
These ongoing political speculations are entertaining, but they are getting us nowhere.
Yep, that is already quite interesting. He doesn't say how this compares to the situation on windows (and linux). Nevertheless - this is already far more substantial.
Adobe claims there's a mismatch between QTKit and Flash Player's rendering model, so using QTKit would either introduce more overhead or require a re-architecture of Flash Player.
I performed a little experiment on my MacBook (Core 2 Duo, no hardware acceleration). With flash, rendering 720p h264 routinely eats 100% of the cycles on one of my cores. That same video eats 10-20% in QuickTime.
This isn't very scientific - ignoring cache and lots of other considerations - but memcpy()ing 30fps of 720p video from one buffer to another eats 5%. Decoding h264 in QT, and copying the buffer would take 15-25% total. 25% compares favorably to 100%.
I'm aware that the problem is the way Flash writes into Safari's window. But if Adobe thinks that h264 acceleration would dramatically improve its performance, they'd still have to copy frames into Safari somehow.
(Maybe they mean they want to write directly to the GPU's buffer...)
I may be misremembering, but I believe QTKit basically just lets you hand it encoded video data, and then it decodes and renders it to the screen (where you tell it to, of course).
Because of how browser plugins work, Flash needs an API that will let them decode the video, get the decoded YUV data back, and then do something with them. I don't think QTKit provides this.
This is why VDPAU on Linux is also unsuitable for in-browser video acceleration.
Thats what video compositing is for I am not a QTKit expert but just quick glance over the documentation they offer QTMovieLayer which allows you to have multiple layers of media which will be composited later ( i.e. one for video, one for the media controls, etc )
I don't see how the fact that other developers aren't complaining is proof that hardware acceleration is not useful. There is a full spectrum of how much access you allow browser plugins and client-side code to features of the underlying OS and hardware. Apple has chosen a relatively conservative point along that spectrum, Microsoft chose a more aggressive one (ActiveX). There is an obvious tradeoff between capabilities/performance and security. Google, with its Native Client sandbox, static analysis tools, etc. is attempting to get the performance of ActiveX with the security of more stringent sandboxes. This is an extraordinarily difficult problem, and Apple is justified in not wanting to deal with it. However, they are not justified in saying they're not leaving performance on the table.
Adobe should be able to improve H.264 decode performance without HW acceleration, but it is unclear what the upper bound is on performance when running inside the browser sandbox. Certainly it can do no better than a native app.
EDIT: wmf is probably right; though there is no browser-specific sandbox that prevents third-party browsers from allowing plugins access to underlying OS APIs, such an API for HW-accelerated video decoding doesn't exist. It's unclear to me if acceleration is just not supported by the driver at all, or if the capability is only exposed via a private API, reserving it for first-party apps like Quicktime. Certainly many of the GPUs included in Apple products support hardware acceleration, so it seems to be primarily a software issue.
I don't think OS X has any browser plugin sandbox. The issue is not that browser plugins are denied access to the H.264 API for security reasons; there is no public H.264 API.
Edit: There is a private H.264 API that is used by QuickTime.
Apple’s own QuickTime on Snow Leopard only makes use of H.264 hardware acceleration with a single graphics card: the Nvidia 9400M. If you don’t have that graphics card in your Mac, you don’t get H.264 hardware acceleration, period.
Seems very surprising if H264 hardware accel is not also supported by the 9600M GT (which is an upgrade on some models of the MBP).
Right -- but as far as I know, switching between the 9400 and 9600 requires logging out. Seems strange if you'd actually see worse H264 performance using the 9600 than the 9400.
>Lastly, does anyone really think it would be a good idea for web content plugins to have direct access to graphics card hardware?
Well, since moving all applications 'into the cloud' seems to be all the rage these days, it's inevitable that browsers expose deeper functionality of the underlying operating system.
So, no, its not that unreasonable to expect it.
This is off-topic, but, why does Gruber ends his posts with open ended questions when there's no way of leaving comments?
Sites like CopyBlogger always suggest that ending a post with a question or two is a way to make sure that people will feel compelled to comment. What's the reason here?
Is he (ab)using sites like HN as his comment system? Or is this a new form of linkbait?
I don't think so. Aren't rhetorical questions devices intended to reinforce a point whose nobody shoukd answer? Do we even need an answer regarding the access of a plugin to the hardware card?
“I encourage you to send me your comments regarding Daring Fireball. Unfortunately, I am at times a lousy correspondent — where by “at times” I mean “most of the time”. If I don’t respond to your email, or do so only after an inordinate amount of time has passed, please don’t take it personally.
IMHO, Adobe should definitely act more responsible and finetune Flash Player to perform better across all platforms.
But i disagree with John Gruber.
#1) Flash is not "slower" on Mac . It uses up too much resources compared to its Windows edition. I switch between Windows(work) and Mac (personal) all the time and i have never seen anything Flash playing "slower" on mac.Flash makes use of GPU access (if required) not just for video playback. I assume Adobe's excuse for resource hungriness is , 'too much time marketing'?
> Flash is not "slower" on Mac . It uses up too much resources compared to its Windows edition. I switch between Windows(work) and Mac (personal) all the time and i have never seen anything Flash playing "slower" on mac.
I think you'll find that, with regards to computer software "slower" and "uses more resources" are generally interchangable; it's a trade-off. And "slower" can be quite obviously observed when a "uses more resources" app hits a resource limit. For instance, there are flash games (not videos -- _games_) which are so choppy as to be unplayable on my dual core 2.5GHz MBP -- because it uses too much of "more resources," and runs out of cpu cycles.
"slower" means "choppy" and is not interchangeable with "use more resources" as you suggests. I have never seen any flash content that runs choppy on my 2 GHz Macbook. Post an example and back up your claim.