Activating HW acceleration for embedded YouTube videos

Ever since Google Chrome became terribly slow in gmail, drive, etc regardless of computer or platform, I’ve picked up Mozilla Firefox again. The switch didn’t go painless but I really was tired of typing a whole sentence before Chrome would display it. This problem produces itself not only on google sites but actually in about any text box I would type, be it intermittently.

The main issue with switching to Firefox was stuttering video playback. As you may know, chrome bundles its own flash plugin which is actually the same plugin but tweaked to work optimally with chrome (pepper api). At the same time google controls distribution/patching.ย  So, if google can tweak the plugin for good performance, why can’t we? ๐Ÿ˜‰

First thing I discovered, is that somehow flash hardware acceleration was disabled. You can enable this by right-clicking on any flash video and click on “settings”. In the “Display” tab, you can check “Enable Hardware Acceleration”.

flash enable HW acceleration settingSmooth youtube vids FTW! Fullscreen video’s also showed up on the correct monitor now (dual head setup). My joy was only for limited time, as I discovered hardware acceleration dit not work for embedded youtube video’s. I was happy nevertheless as the bulk of video’s I watch are on youtube.

However, today, watching the Jolla Tablet intro movie embedded on the site, I could not help feeling the itch again. Why oh why did this play fluently in chrome but did it suck so hard in firefox? Check out this framerate:

yt_embedded_noHWaccel1I started by creating a virgin system account to avoid having my 7 year old home dir, possibly dragging along some evil deprecated setting, be the culprit. This didn’t change anything but at least I had both a blank Firefox and Chrome profile to test with.

First I was under the impression that there would have to be a global flash settings file since when right-clicking on the embedded video, it showed the “Settings” as disabled. There does indeed exist such file: /etc/adobe/mms.cfg in which you can put “EnableLinuxHWVideoDecode=1”. This only crashed my firefox. I did install an additional vdpau package but it didn’t matter. Also, looking at the “Nerd stats” (right-click on video), I learned even youtube vids didn’t have hardware accelerated decoding, only accelerated rendering. So I didn’t proceed on this path.

Now let’s check out how chrome is doing it. Pulling up the “Nerd stats” did surprise me: chrome does not use flash by default for embedded video’s, it uses WebM/VP9!

This begs the question: how is Firefox’s WebM support? Turns out it’s no problem, just change your youtube html5 setting from “default player” (=flash) to “html5”.

youtube html5 settingsSo theย  chrome pepper flash tweak actually came down on not using flash. ๐Ÿ™‚ Youtube does this by default on chrome but not on firefox. Naughty Google!

You may notice that Firefox does not support all youtube hmtl5 features yet. In particular, you will be served VP8 video’s instead of VP9 which may make a difference in the available resolutions. However, Media Source Extensions and WebM VP9 can already be activated by setting:

media.mediasource.enabled = true

in about:config. Experimental h264 support can be activated with:

media.mediasource.ignore_codecs = true

You can track the MSE support in firefox in this bug report.

Itch scratched and fixed. Finally ๐Ÿ™‚

DD-wrt: control radio on a Cisco Linksys E2000

Some people prefer to have their wifi turned off at night. DD-wrt already provides out of the box reprogrammability of the WPS button so you can use that button to turnย the wifi off/on.

If you want to use a cron job to automate this process, you need to know the command line. I tried using the wl command:

wl radio off

Unfortunately this doesn’t do much. We might need to specify the network interface on which to apply the command. List the network interfaces using the ip addr command:

root@DD-WRT:~# ip a
1: lo: <LOOPBACK,MULTICAST,UP,10000> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast
    link/ether c0:c1:c0:ab:6c:70 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast
    link/ether c0:c1:c0:ab:6c:72 brd ff:ff:ff:ff:ff:ff
4: teql0:  mtu 1500 qdisc noop
    link/void
5: tunl0:  mtu 1480 qdisc noop
    link/ipip 0.0.0.0 brd 0.0.0.0
6: gre0:  mtu 1476 qdisc noop
    link/gre 0.0.0.0 brd 0.0.0.0
7: vlan1@eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc noqueue
    link/ether c0:c1:c0:ab:6c:70 brd ff:ff:ff:ff:ff:ff
8: vlan2@eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc noqueue
    link/ether c0:c1:c0:ab:6c:71 brd ff:ff:ff:ff:ff:ff
    inet 178.117.xxx.xxx/20 brd 178.117.xxx.255 scope global vlan2
9: br0: <BROADCAST,MULTICAST,PROMISC,UP,10000> mtu 1500 qdisc noqueue
    link/ether c0:c1:c0:ab:6c:70 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global br0
    inet 169.254.255.1/16 brd 169.254.255.255 scope global br0:0
10: etherip0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop
    link/ether f6:1f:60:c5:50:bf brd ff:ff:ff:ff:ff:ff

I’m no network expert so I checked the MAC address of the wifi interface in the web admin Status > Wireless page ( http://192.168.1.1/Status_Wireless.asp ) and figured eth1 must be the wifi interface.
And indeed, using the following command it worked!

wl -i eth1 radio off

You can check whether radio state changes in the wireless status page mentioned above. For automation, put these commands in a cron job on the Administration > Management page ( http://192.168.1.1/Management.asp ).

Using your EID on opensuse 12.1

In Belgium you can use your EID to login onto the federal portal for using electronic services, for example, for filing tax return. Installation instructions are provided for Windows, Mac and (Ubuntu) Linux. This is what I had to do to get it working on opensuse 12.1 on a Dell Precision M4600.

Installation

smartcard reader

Since the M4600 is a fairly new model, I had to upgrade my pcsc/ccid package to the latest version. It seems the M4600 comes with a Broadcom Corp 5880 smartcard reader which is connected through USB (internally).

Add the chipcard repo:

sudo zypper ar -r http://download.opensuse.org/repositories/security:/chipcard/openSUSE_12.1/security:chipcard.repo

and “switch system packages” in Yast. You should have installed at least the following packages: pcsc-lite, libpcsclite1 and libpth20.

Depending on your smartcard reader, you need a different pcsc plugin package. The Broadcom 5880 smartcard reader is supported through the ccid driver. This means we have to install the pcsc-ccid package from the chipcard repo.

eid middleware

Add the following repo by Pascal Bleser:

sudo zypper ar -rย http://download.opensuse.org/repositories/home:/pbleser:/belgium-eid/openSUSE_12.1/home:pbleser:belgium-eid.repo

and install the eid-mw package. I also noticed the eid-mw-firefox package in this repo, but it did not seem to work in my case, possibly because I’m using 64-bit firefox.

configuring firefox

  • Install the belgium eid firefox add-on.
  • Trust Belgium Certificate Authority:ย Edit menu -> Preferences -> Advanced -> Encryption -> View Certificates -> Authorities -> Belgium root CA2 -> Edit trust -> check all checkboxes
I’m not sure whether the firefox add-on is really needed. Afterwards I uninstalled it and it kept working.

Troubleshooting

smartcard reader

  • check in /var/log/messages which device you have
  • most devices are connected through usb protocol. Check your usb device list:
    lsusb -v
  • google the device or check the device compatibility lists of the pcsc-<driver> packages. You can find the ccid device list here.
  • if you have a pccard interface for your reader, check whether the device is installed with:
    pccardctl ls
  • install the pcsc-tools and perl-pcsc package to have access to some smartcard reader analysis tools. Running the pcsc_scan tool should yield similar output like this:
  • If you get a segfault when loading the pcsc-ccid driver, for example:
    pcscd[3228]: segfault at 0 ip 00007f98bec38121 sp 00007fff2e806208 error 4 in libc-2.14.1.so[7f98bebb8000+187000]
    check whether you updated your portable thread library with the one in the chipcard repo (package name isย libpth20)
  • be sure to be using all the packages from the chipcard repo by using the “switch system packages”.
  • firmware upgrade as suggested here, was not necessary. Read the whole thread to find out why a ccid upgrade was actually necessary.

eid middleware

The government created an application eid-viewerย which you can use to read some public data from your EID. It’s a java-based app so you need a java JRE to run it:

java -jarย eid-viewer-4.0.4-146_tcm227-178503.jar

You can obtain it from this page under the catory “other”.

firefox

Although I installed this add-on, I don’t believe it is needed. I did have trouble the first time I signed in: it succeeded, but redirected me to a page where I would again need to choose whether I wanted to sign on with EID or password. I closed firefox, and tried again, this time it just worked. You can surf to this test page to test whether everything is configured correctly.

Tip of the day: boot your computer using keyboard

About a year ago, I assembled a new main rig. I put (almost) all hard drives I had into it with the idea to make a “global backup”. This meant I had to leave my super-silencing case open until the backup was done. However, a year later, I’m still “in the process”. ๐Ÿ˜‰

dsc01173.JPG

Since I also removed my front panel for some eSata modding, I have to turn my computer on using a pointy device aka “nail” (on the corner of the white table above). After doing that for a year, every day, knowing that my motherboard supports booting by key stroke, I decided to turn that feature on yesterday. Pressing spacebar boots my computer now. You should try it too, you’ll be surprised how much satisfaction it gives. ๐Ÿ™‚

Freenode raising the bar for routers

This week I noticed a strange problem with my irc client.
First day (Tuesday), it would fail to connect. Since my login to the campus network expired, I had to relogon, so I thought the problem was simply related to that and that the irc client wouldn’t recover until an application restart.
Second day, it still didn’t connect, which I thought was strange, but I didn’t have time to chat anyway, so I neglected.
Today, I frowned and decided to take a look ๐Ÿ™‚

First of all, I noticed it wasn’t really a connect problem, it couldn’t even resolve the hostname. Heh? When I ran “nslookup irc.freenode.org” it spit out:

;; Truncated, retrying in TCP mode.
;; Connection to 192.168.2.1#53(192.168.2.1) for irc.freenode.org failed: connection refused.

mmm..
I went to the freenode site, to see if there were any news items reporting problems or outage. There didn’t seem to be a news section. So I assumed: no news == good news. ๐Ÿ™‚

Then, I noticed the actual hostname for irc is really chat.freenode.net instead of irc.freenode.org. “chat” or “irc” in front works both. Indeed, that did work. So why did irc.freenode.org suddenly stop working? Was it because of a recent patch (although I couldn’t remember applying any in the last week)? Was it because of my firewall? Both answers are negative.

The friendly chaps at #freenode kindly tipped me off that the dns record had probably become too large to be transmitted through UDP and that TCP dns requests seemed blocked. Servers get added to the network on a regular basis, so that would explain why it suddenly stopped working. It became obvious that my dusty old router would be the culprit (quick tip: never blame your linux kernel first ๐Ÿ˜‰ ). After all, according to contemporary standards, one could declare mine “ancient”.

Quite recently I already encountered some problems with it. After an upgrade of the campus network, I kept having strange packet loss when playing multiplayer games for more than 2 minutes. I had never updated my firmware, so I thought I might try that. Although the latest firmware release dated back to 2004, it did help! mattie=1, router=0.

After I pulled the router out of the chain, the dns problem was solved indeed! Unfortunately, updating firmware is no longer an option, so I guess the router and I are even now. ๐Ÿ˜‰

On #freenode, I was told I wasn’t the first one to report this problem, so I guess a lot of people will need to update their firmwares, buy new routers, or simply use a more local dns name. ๐Ÿ˜‰

Boot process explained

It’s always nice to be reminded of the more important things in life, like how computers boot, *ahem* ๐Ÿ™‚
Seriously, as a computer enthousiast, it’s like I _have_ to know about it, yet I don’t seem to be able to remember all the details ๐Ÿ™‚
So guys like duarte chop it into nicely digestable pieces, ideally suited as bed time story material, so it can enter your subconscience when you go to sleep =)

Wiimote fun

Some while ago, I was considering to buy a gyroscopic mouse from Gyration for my future Media Center, but I’m becoming more and more convinced I should simply buy a Wiimote instead ๐Ÿ™‚

There are lots more possibilities while still fulfilling the original needs. The Wiimote IS a gyroscopic mouse but adds the following advantages:

  • IR blaster / receiver (1024×768 resolution!!) 4 point tracking @ 100Hz
  • relatively cheap! (40 EUR)
  • speaker
  • joystick and more buttons than standard mouse
  • on-board storage
  • programmer / hacker friendly
  • go play multiplayer on a friends console ๐Ÿ™‚

After looking at all the neat programs Johnny Lee put together, I guess you understand I can’t wait to try this out myself ๐Ÿ˜‰ Also, be sure to check out his blog and numerous videos floating around the web.

First time I heard of the cool wiimote possibilities was when reading a post of Xfennec, in which he made a simple showcase of the possibilities with libwiimote using his favorite 3D engine Raydium. Be sure to check out the vid. I was really impressed back then, but of course Johnny did a lot more impressive stuff, the guy is a legend by now. Johnny does not use the libwiimote lib, but rather the dotnet WiimoteLib (I mention this ref especially for andrasj ๐Ÿ˜‰ )

I have to admit that at first glance the .net lib seems more attractive due to its event based mechanism (internally, it does an async read on a stream in a loop though). The C lib looks a bit more basic but very easy to get started.