Roving Thoughts archives

2018-03-31

Some notes on watching Crunchyroll shows on Linux (March 2018 edition)

I use Linux and I I subscribe to Crunchyroll, which gives me a set of interesting problems since Crunchyroll's desktop video player is still Flash-based. There probably aren't many other people that this applies to, but I'm still going to write down some notes about whole area. Note that I'm using X, not Wayland; things very likely will be different for Wayland for various reasons.

First off, I use Chrome for this, not any other browser (including Chromium). Google's official binary Chrome packages include a bundled version of Adobe Flash that's more up to date and featureful than the separate 'NPAPI' Linux version that Adobe somewhat reluctantly still makes available as a separate download. This is especially relevant because apparently one of the things not in the NPAPI version is GPU acceleration (per here; Chrome is using the 'PPAPI' version).

(You can apparently download the PPAPI version from Adobe and integrate it into Chromium, but I don't know anything about this. I'm lazy, so I just use Chrome and hold my nose.)

The Linux version of Flash has historically not had the best support for efficient video playback, including hardware acceleration. Based on investigation with radeontop and intel_gpu_top on Fedora 27 on two difference machines, the current version of Chrome's Flash appears to not use hardware video acceleration for Crunchyroll's non-windowed full screen mode. Full screen video seems to be entirely CPU-based, and apparently single core only (so what matters is high single-core performance). However, playback inside a Chrome window is hardware accelerated, including their 'pop out' mode. Thus, if you want to be sure you're getting hardware accelerated video playback (and you probably do) and full screen, you want to use the 'pop out' mode and then maximize the resulting browser window (probably with your window manager's feature for this, not with F11).

(This probably won't be ideal if you have a 16:9 screen, because you'll lose some space to window manager decorations and probably shrink the video slightly. Luckily I have a 16:10 display so I'm not affected by this. Sufficiently clever people using the right window manager might be able to hack their window manager to skip decorations on these windows.)

I've mostly tested with Crunchyroll's 720(p) streams. I'm not entirely convinced that either of my Linux machines can really smoothly play back its 1080 streams even with (some) hardware acceleration at work, although it's hard to know for sure without some way of getting access to stats on frame drops. I'm also not sure how much improvement there really is in Crunchyroll's version of 1080 in general; I've at least heard rumblings about bitrate limits and other things (especially once an episode's been out for a few days), and also that a certain number of shows are not really 1080 to start with and the biggest benefit you might get is a slightly better upscale from 720.

As a disclaimer, your mileage may vary based on the specific GPUs involved. I expect these results to apply to any reasonably modern AMD and integrated Intel graphics, but I don't know about nVidia cards. Hopefully they're at least as accelerated for video playback from Flash in Chrome. Also, I'm not completely sure what's happening with Intel graphics, because I seem to get the same sort of GPU usage reported in straight playback and in fullscreen mode (unlike the AMD GPU, where Crunchyroll's full screen mode shows no GPU activity in radeontop).

I assume that Crunchyroll will someday switch over to HTML5 video playback (hopefully before browsers stop supporting Flash, unless CR intends to entirely abandon desktop users). When that happens, much of this will hopefully stop being an issue, since HTML5 is hopefully much better integrated and much more likely to be hardware accelerated. Certainly on my machine with integrated Intel graphics, full screen HTML5 playback of this pretty dynamic 720p YT video is smooth in both Firefox and Chrome.

(Conveniently, the Youtube HTML5 video player will give you data on frame drops, as part of the 'stats for nerds'. I see no drops in my playback runs.)

If you're playing videos in gmplayer and quite possibly other standalone Linux video players, you likely want to make sure you're using VDPAU on modern hardware (see also the Arch wiki page on hardware video acceleration). As I found out recently, if you ever explicitly told gmplayer to use some video output driver (perhaps to override its defaults to pick a better one on your system at the time), it remembers this and won't automatically switch to the best video acceleration method that it can find. To fix this you can either explicitly give it an appropriate -vo output (eg '-vo vdpau') or manually delete the vo_driver line from ~/.mplayer/gui.conf, which resets gmplayer to using whatever it decides is the best option.

(Using VDPAU may require additional Linux packages that aren't installed by default, but hopefully not.)

PS: radeontop confirms that video playback in gmplayer with VDPAU is hardware accelerated, probably more so than Flash in Chrome based on the amount of GPU usage.

PPS: If you want to know system details for the two machines I'm testing on, they're this machine with a Radeon RX 550 and this machine with current-generation Intel UDH 630 integrated graphics. Both have very good CPUs, so their CPU should not be a limit unless there's no hardware acceleration going on at all.

Sidebar: Why it's hard to tell with integrated Intel graphics (and Wayland)

These days, even basic X uses the GPU with integrated Intel graphics, which complicates trying to tell if Flash is using special hardware acceleration; even perfectly normal X things can light up the GPU. This usually isn't the case on AMD GPUs. Also, for what it's worth, Flash playback on the integrated Intel graphics system seems to use more CPU than on the AMD GPU system.

(It's also possible that intel_gpu_top only captures some information about GPU usage. Strikingly, it reports no GPU usage for HTML5 video playback in Firefox on my test video, although the playback is drop-free and Firefox's CPU usage is not saturating a single core. Playing the same video in Chrome with HTML5 reports some GPU usage.)

Similarly, Wayland intrinsically uses OpenGL and thus the GPU's hardware acceleration for it. This may be at a different and lower level than genuine hardware accelerated video playback, but one would have to pay close attention (including to CPU usage) to be sure.

I guess the ultimate moral here is that Linux users won't know for sure unless video playback problems become clear and obvious, or Crunchyroll someday gives us access to stats on frame drops, bitrate reductions, and so on so we can see if there are quiet problems in our setups. Sane people probably use Windows (or Macs) and likely don't have to care about this.

anime/CrunchyrollLinuxVideo written at 03:17:15; Add Comment


Page tools: See As Normal.
Search:
Login: Password:
Atom Syndication: Recent Pages, Recent Comments.

This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.