Feed on

This weekend, I noticed that the spinning hard drive in my MacBook Pro was dying. I ordered a replacement, installed it, then proceeded to install Yosemite. After counting the numerous Yosemite installer bugs, I noticed an unusual one:

This copy of the Install OS X Yosemite application can’t be verified. It may have been corrupted or tampered with during downloading.

My searches for this didn’t yield a useful solution so I figured out what the problem really was: Since I disconnected the battery as part of my install process, the computer was completely without power for a moment and loss the date/time. So, I set the date in the terminal using the date command, and then the above mentioned error went away.

Note to Apple: If you are trying to verify a signature and it fails, you should check to see if it failed due to a bad date on the cert. If so, then you should prompt the user for the date/time instead of putting a cryptic and incorrect error message on the screen.

The term Net Neutrality covers a lot of hotly debated topics but at its core is whether ISPs should be allowed to treat some traffic differently. In the midst of the discussion, one minor fact seems to have been lost: Not all packets are truly equal.

Around 10 years ago, I had DSL with 768kbps down and 128kbps up. I quickly learned that if I did any upload at all, the download speeds suffered greatly. Upon investigation, I discovered that the outgoing control packets, such as ACK packets, were being stuffed in the same queue as outgoing data packets. One of the solutions was to employ egress traffic shaping. This was simply prioritizing control packets such as ACK, SYN, and RST, followed by small packets all ahead of the large data packets. The result: uploading data no longer slowed downloads. Today, with much higher speeds, this shaping has less benefit, but it is not gone.

If shaping were available on download links, what effect would it have? The control packets are less frequent on downstream links but they are still present. On the other hand there is an advantage to shaping between large data packets. Assume a household has a 15Mbps downstream connection and is watching a movie off Netflix in Super-HD (up to 7Mbps). The teenager in the household starts a torrent that is properly throttling its upload speed as to not saturate the connection. The resulting 20+ connections in the torrent will overwhelm the single connection the Netflix client is using and its quality will drop. If downstream shaping where employed which prioritized Netflix over other connections, the torrent will consume all the remaining bandwidth, but not encroach on the bandwidth used by Netflix. Applying this kind of shaping immediately before the last mile would achieve most of the desired effect since this is where the queues build up awaiting available bandwidth.

In the above, I’ve essentially made an argument for Quality of Service (QoS). This is not new though it is barely used. The question is who marks the priorities on the packets? To affect downstream content, the ISP must mark packets following a set of rules but the best solution is for the consumer to determine the rules. Imagine if an ISP allowed the consumer to prioritize their downstream bandwidth among a few common options. Then the solution to scenario above would be plausible.

Now for the legal aspect. I would argue that ISPs should be allowed to prioritize traffic at the consumer’s behest on an individual basis. Among the available prioritization options, no prioritization must be an allowed option. This yields the best consumer protection whilst allowing for future innovation. It’d be a shame if laws and/or regulations the were intended to protect consumers resulted in a loss of advancements being made available to them.

In my previous post I outlined the issues with using the GoogleTV for playback and I promised to outline my new client.

The Hardware
Since a list makes this easier, I’ll present the hardware that way:

Not mentioned above is the requirement of an HDMI receiver between the TV and NUC. The NUC can be configured to use analog audio output or passing audio directly to a TV over the HDMI, but a receiver provides the best audio experience.

When installing the WiFi+BT card, the antennas are covered with a protective piece of plastic. Do not try to pull these off. Instead, remove the tape on the wires, then these coverings will slide easily down the wire exposing the contacts. I also found it is much easier to connect the antennas before installing the card.

I should initially mention that I had issues getting some of the media to boot off USB ports in the back. I found that it did boot easily from the ports in the front. Also, I had considerable difficulty getting into the BIOS with my USB keyboard. In a cold boot, it would never pick up on F2 being pressed but instead only after rebooting from an OS (which is a pain if you misconfigure the BIOS to no be able to boot into the OS anymore like I did once). I found that placing a powered USB hub between the computer and the keyboard solved this issue.

The BIOS doesn’t need much in terms of settings, but I found that mine was several months out of date. I updated the BIOS to the latest, then configured the minimum fan speed to 20%. Most of the time, the fans will not spin up to audible levels at this setting. This does not affect the fan speed when the device determines it needs a higher speed, just the minimum level.

I started off with a version of OpenELEC (OE) that contained Plex. I liked the novelty of not needing any kind of SATA drive to boot and keep everything in RAM. I eventually decided that while OE has its uses, its limitations became problematic. In particular, the Bluetooth adapter would disappear and never come back without pulling the power from the device. I elected to go with a full Xubuntu install (after ordering the mSATA drive).

I followed an excellent guide for the installation procedure found in the Plex forums. I deviated in the IR installation though. I did not install lirc when I installed ir-keytable. This also means I did not need to do the Configure and Disable LIRC section. I did follow the Optional Permanent VSYNC section.

Configuring IR is slightly different that described in the guide because the remotes are different. Run sudo ir-keytable -t and start pressing buttons on your remote. You will see the scancodes as you do. Use those codes for the buttons you desire in the Configure IR-Keytable section. The keyboard shortcuts page may be of use here.

I would highly recommend searching for Plex Home Theater in the menu in the upper left and right click on it to add it to the desktop. This makes launching from a limited remote much easier.

Lastly, as mentioned in a subsequent post in the above thread, you need to disable xfsettingsd, otherwise when you turn the TV back on after turning it off, the display will never come back. This is simply:

sudo chmod -x /usr/bin/xfsettingsd
killall xfsettingsd

Aside from those above, there were a few gotchas I discovered.

  • If you heavily use the WiFi, the Bluetooth range will be dramatically reduced. This appears to be an issue with the hardware since it uses the same antennas for both. I tend to only see this when playing HD content. Using a IR remote does reduce the need for Bluetooth.
  • You should configure Plex to be FullScreen in System -> Advanced if not already. This will enable some other settings, such as framerate switching.
  • If you enable framerate switching (which I would generally encourage) and you desire to play something with HD audio, you may lose all audio as I did. About 80% of the time, if I play something in 24p with TrueHD or DTS-HD (I do passthrough these), the framerate switching occurs and there is no audio. Furthermore, the audio never returns until I reboot or hibernate the device. I am working a bit with one of the devs to track this one down. It seems to be a race condition with the NUC and my receiver. Setting PHT to play a trailer before the movie is a decent workaround. A better workaround is to edit .plexht/userdata/advancedsettings.xml and add

    into the file.

  • VAAPI seems to have an issue with certain MPEG2 video. In particular, when I play an episode of The Simpsons I ripped from DVD, playback is blocking and full of green squares somewhere around 2-15 seconds in. A subsequent Intel driver update seemed to resolve this, but didn’t solve the blocky playback I saw in VC-1 content. Disabling VAAPI resolves seems to be the best solution as I have only one file that gives the CPU decoder any issue.

The one last piece I would like to mention is the PlexAEON skin. I’ve grown to really like this skin and it is pretty easy to install:

cd ~/.plexht/addons
git clone https://github.com/maverick214/skin.PlexAeonPHT.git

After that, restart Plex and then in the settings, simply change the skin. I’ve found that on occasion in either a Movies or TV Shows section, it may not display anything after entering it. Every time I’ve seen this, hitting ESC will then cause it to display. Not sure what the deal is, but I consider it minor.

And that’s it. Hope someone out there finds this useful.

Since my last post on the topic, my client and server software have changed. In the interest of full disclosure, I should mention that I now work part time for Plex, though all of my decisions outlined in this post were made before that time.

Necessity for the change
I started to get frustrated with some of the limitations of the GoogleTV:

  • The platform seemed to become stagnate (and the pending AndroidTV hadn’t been announced yet). It became clear that some of the limitations were never going to be resolved.
  • The device is supposed to passthrough DTS, but it will occasionally fail for a second during playback. It does this both on optical and HDMI. I tended to resolved this by transcoding the DTS to AC3 with the more problematic movies.
  • The device is supposed to play VC-1, but it would stutter during playback if the content was in an MKV file. It did not if the content was in a MPEG-TS. This problem does not exist during disk playback. I resorted to transcoding VC-1 content to AVC.
  • The device is supposed to passthrough HD-audio such as DTS-HD and TrueHD. It does this with playback of a disk, but not from MKV files nor MPEG-TS.

Clearly the best solution is a computer since it has no problem with all of these.

Changing software
I started examining the possibility of porting my client over to a computer. I used this as an opportunity to learn some JavaFX as a possibility for the UI. I also ran across VLCKit as an nice little project for integrating playback in applications. Then I realized that someone had likely solved this problem before.

I ran across XBMC and Plex. It became clear that my best option was one of the two. It seemed the primary difference between the two is that XBMC is primarily designed for local playback while Plex is primarily designed for client-server playback. In addition, Plex supported the GoogleTV and Roku I already owned as clients. Furthermore, if the media file is outside the capabilities of the client, the Plex’s server will transcode and stream the result to the client. So, I elected to try out Plex.

When I made the change, my dad did as well. He noticed that some of his DVDs that went through handbrake had severe artifacts during playback. I discovered it was an issue with transcoder, which uses FFmpeg as its base. I submitted a patch to FFmpeg and asked Plex to merge the change. Afterwards they contacted me about working part time, to which I agreed.

After the data import, I was up and running pretty quickly. Since I have access to the source in most cases, I can fix any minor issues I run across. Overall, it is much more advanced than what I was doing before. I since upgraded my sound system and TV.

All that remained was a better client, which I’ll describe next time.

Using Homebrew

I’ve been using the mac long enough that I’ve gone through several of the package management systems for installing additional open source tools. I started off with Fink which I really liked since it was based on dpkg. Then it became clear that the community had switched to using Mac Ports (formerly Darwin Ports). I was a bit disappointed with this because the package management wasn’t as good as it was with Fink, but it kept pace with the newer OSs better than Fink. Now the community has shifted again, this time to Homebrew. Homebrew seems to have learned a lot of lessons from the previous. The most notable is that most of the Formulas are in binaries and they use git for the formula list rather than rsync for the port list. Also anyone wanting to make a formula would fork the repo on github, commit their formula, and initiate a pull request. Given this adds simplicity on the developers, hopefully homebrew will last longer than the others.

There is one thing that was severely annoying me which prompted me to write this post. I had installed the bash formula, which upgrades bash to 4.3 and also installed bash-completion. When using the newer bash, I discovered the tab completion was not working correctly. For example, if I typed cd Libr<TAB>ap<TAB> it would complete to Library/Application\ S, but would be entirely incapable of completing anything following the space. Even if I finished the directory name manually, it would never complete anything beyond that point. This behavior seemed to be limited mostly to cd, but it was still annoying. Anyway, there is a solution:

brew tap homebrew/versions
brew uninstall bash-completion
brew install bash-completion2

Basically, bash-completion2 is for bash 4, where as 1 is for bash 3. Be sure to follow the instructions at the end of the install otherwise it won’t work at all.

P.S. I had previously run the following to gain case-insensitive tab completion in bash:

echo "set completion-ignore-case on" >> ~/.inputrc

« Newer Posts - Older Posts »