Tuesday, July 19, 2011

Step-by-step XBMC ZBOX setup

Here are the step-by-step instructions for configuring the ZBOX HD-ID41 as a media PC running XBMC. There’s still a few issues, like outputting encoded audio over HDMI. I’ll have to do some more experimenting when I have the chance, but I do have a full-functional machine after following these steps:
  1. Get Ubuntu 11.04 ‘Natty Narwhal’
  2. Install Ubuntu
    • Insert the USB drive into one of the USB 2.0 ports (drives don’t seem to boot properly from 3.0 ports)
    • Boot the ZBOX, tapping the F11 button until the boot device menu appears
    • Boot from the flash drive and choose Install Ubuntu from the menu
    • Follow the prompts, selecting the ‘Download updates while installing’ and ‘Install this third-party software’ options
    • When asked to Allocate drive space, choose one of the automatic partitioning options (or if you know what you’re doing you can partition manually)
    • Continue through the installer, filling out the requested information
      • For the greatest convenience, set auto-login for your user. However, unless you use a blank password, Ubuntu will ask for the password if access to the keychain is required.
    • Restart
  3. Disable Unity (optional)
    • If Unity, Ubuntu’s new UI bothers you (as it does, me), it can be disabled by going to the Login Screen page in System Settings.
    • Select “Ubuntu Classic” as default session
    • Logout and back in
  4. Install and Configure Video
    • To get proper video playback, you need to install the proprietary NVIDIA display drivers, vdpau, and the configuration tool for compiz
      • In a terminal window, type:
        • sudo apt-get install nvidia-common libvdpau1 vdpau-va-driver compizconfig-settings-manager
          • Ubuntu will ask for your password then ask you to confirm the installation
      • Restart to activate the driver
    • A few tweeks are needed to prevent tearing artifacts in video playback:
      • Open System > Preferences > CompizConfig Settings Manager
      • Click Composite
      • Disable ‘Detect Refresh Rate’
      • Set ‘Refresh Rate’ to the refresh rate of your display. (Probably 60 Hz, but you can check in the NVIDIA X Server Settings
      • Enable ‘Unredirect Fullscreen Windows’
  5. Audio
      • Open System > Preferences > Sound
      • Click the Hardware tab
      • For HDMI sound:
        • Click High Definition Audio Controller
        • Set Profile to ‘Digital Surround 5.1 (HDMI) nr 2 Output
      • For Optical out:
        • Click Internal Audio
        • Set Profile to ‘Digital Stereo (IEC958) Output + Analog Stereo Input
      • Click Test Speakers
        • If no sound is output, type alsamixer in a Terminal window, and unmute either the S/PDIF outputs or IEC958 outputs with the ‘m’ key
      • Set output parameters
        • Type sudo gedit /etc/pulse/daemon.conf in a Terminal
        • To set the output sample rate, add the line:
          • default-sample-rate = x
            • Where x is the sample frequency in Hz (default 44100)
        • To set the output bit depth, add the line:
          • default-sample-format = 2xle
            • Where x is the bit depth in bits (default 16)
        • These changes will not be made until you restart pulseaudio or the computer:
          • pulseaudio -k
          • pulseaudio --start
      • If there is still no sound with HDMI output, you may need to add the following line to your /etc/pulse/default.pa file:
        • load-module module-alsa-sink device=hw:1,7
  6. XBMC
    • As there is not yet a stable repository for Ubuntu Natty, we will use the one for Maverick
    • Type the following into a terminal window:
      • sudo add-apt-repository ppa:team-xbmc
    • Open System > Administration > Synaptic Package Manager
    • Settings > Repositories
    • Click the ‘Other Software’ tab
    • Edit the two lines from team-xbmc, changing the distribution from Natty to Maverick
    • Close Synaptic
    • In a Terminal, type:
      • sudo apt-get update
      • sudo apt-get install xbmc
    • XBMC will then be installed, and can be found in Applications > Sound & Video
    • In XBMC, go to System > System > Audio Output
      • For HDMI out, set Audio Output to analog, Speaker configuration to match your speakers, and set Audio output device to ‘High Definition Audio Controller Digital Surround 5.1 (HDMI) nr 2”
      • For Optical out, set Audio Output to Optical/coax, Audio output device to ‘Internal Audio Digital Stereo (IEC958), and Passthrough output device to ‘HDA Intel iec958’. The other settings should be set depending on your speaker setup.
    • Go to System > Video > Playback
      • Enable VDPAU and ‘Adjust display refresh rate to match video’
If everything is gone right, you should have a fully functioning media centre now.

Sunday, July 17, 2011

Pak Tong Koh

Pak Tong Koh is a leavened, steamed, Chinese cake. It’s very light and features a distinctive porous structure. It’s one of the sweeter Chinese dishes I know of, but is tempered with a noticeable tang from the yeast. I don’t have a proper steamer, but I perched a cake pan on top of a vegetable steamer in a large pot and it seemed to work quite well. My grandmother used to make this all the time, sometimes with brown sugar, sometimes with yellow rock sugar and I’ve been trying to figure it out for years. I’m probably biased, but I think I’ve finally got her’s beat. I’ll have to make it next time I’m home and see. The recipe is a modification/combination of these two recipes: http://chowtimes.com/2007/01/17/steamed-rice-cakes-pak-thong-koh/ and http://wlteef.blogspot.com/2005/06/white-sugar-sponge.html It’s closest to the second recipe, but with the sugar syrup idea from the first. I’ve switched to normal dry yeast and have managed to greatly reduce the preparation time. Apart from the steaming setup, it requires no specialized utensils or tools and is very easy to make. Enjoy!

Serving Size: 12
Yield: 1 cake


190 g rice flour
120 mL water
50 mL warm water
8 g dry yeast
10 g white sugar
250 mL water
150 g golden sugar


1. Mix B and set aside.

2. Mix A together to make a thickened paste.

3. Dissolve sugar in boiling water from C

4. Pour C into A, while still hot, mixing together until smooth. Whisk for 5 min. Put the bowl into the freezer. Wait until cooled to approximately 40 °C. (If it is too hot, the yeast will die)

5. Stir B into the mixture. Cover bowl with a damp towel and set in a warm place for 30 min. The mixture should be actively bubbling.

6. Pour the mixture into a 20 cm round cake pan, lightly oiled, and steam for 25 minutes.

7. Let cool before slicing.

Saturday, July 16, 2011

My HTPC Setup

Well, I’ve been in Toronto a month and a half now and though I’ve outfitted my apartment with a decent TV and sound system, I don’t have cable and my PS3 is still sitting back home in Saskatoon, thanks to the postal strike, so for the past month, I’ve had my huge gaming PC sitting on my coffee table. A few friends are staying over in a couple weeks and I figured I should try something new. I saw a neat mini PC in a flyer and decided to make a home theatre PC. I wanted something relatively cheap, but something that could handle 1080p video and some light server duty.
The heart of my system is the Zotac ZBOX HD-ID41, a diminutive mini-PC powered by an Intel Atom D525 dual-core 1.8 GHz chip and NVIDIA ION graphics. It’s a pretty sleek-looking thing; piano black plastic (that attracts fingerprints like nobody’s business) on top adorned with a glowing blue ring in the centre that can be switched on or off in the BIOS. The bottom panel has slots for air intake and slides off to allow access to the motherboard. The front sports analogue audio jacks, a media card reader, a USB 2.0 port, HDD and wireless activity lights, and the power switch. A single USB 2.0 port sits on the right side, protected by a rubber cap for some reason, and accompanied by the fan exhaust port. Speaking of fans, they’re pretty loud for something of this size; similar to an original PS3. The left side is occupied by a mounting slot that accommodates either a vertical stand, or a very nifty VESA-compatible mount, allowing attachment of the computer to the back of a display. Most connections are done on the back of the box: HDMI and DVI-I ports, optical audio out, 4 USB 2.0 ports, 2 USB 3.0 ports, gigabit ethernet, an eSATA port, and the DC power connector to which the rather diminutive power adaptor is attached. Unfortunately, the back panel ports are where most of my troubles arose. I don’t know if the problem is common to all units or a problem with mine alone but the eSATA port seems to be recessed within the case a bit too much. As 2.5” HDDs are still a bit small, my intention was to use a 3.5” drive in an enclosure connected with eSATA, but the first time I connected it, I thought the port was completely broken. I later found that if you push it right in, it will actually make a connection, but if you jiggle the cable even a bit it will disconnect. The other big issue I had was with connecting the box to my surround sound receiver. The way sound is handled on this thing is that there is an Intel HDA-compatible chip driving the analogue jacks and the optical out, and the ION chip driving digital audio through the HDMI port. Sadly, there doesn’t seem to be any support for sending audio over the DVI port, unlike most standalone NVIDIA cards. I just wish I had figured that out before I wasted two days hacking at ALSA and Pulseaudio.
Which brings me to installation and software. I tossed in a 2 GB DDR3 SODIMM and an old 160 GB 2.5” HDD with no trouble and without needing tools. An external 1 TB drive via eSATA would hold media files and I plugged into my gigabit ethernet network for internet and file serving, though the box supports 802.11n (2.4 GHz only) too. Audio and video to my surround sound and 1080p TV were done with HDMI. As there is no DVD drive, I transferred an Ubuntu 11.04 x86_64 liveCD to a USB drive and did a standard install from there. The OS install was pretty straightforward, but there were some issues turning it into a proper media centre. I ran into problems choosing audio devices, installing XBMC, as well as eliminating tearing issues and getting GPU video acceleration working. For the most part, I’ve solved these and I will detail what I did in another post. [Update: Step-by-step install]
Performance-wise, the Atom chip isn’t all that powerful, but gets most jobs done in good time. Ubuntu’s classic interface is snappy, though there is noticeable lag when trying to do multiple things at once, such as browse the web while installing updates. With only the CPU, only mplayer gives decent playback performance of HD video and at very high CPU usage, however, this is where the ION chip comes in. By enabling vdpau, smooth playback of 1080p video in VLC, mplayer, and XBMC is no problem, at less than10% cpu. Unfortunately, as usual, Flash sucks in Linux. Apparently, with compiz on, there is no GPU acceleration of Flash videos and indeed, I couldn’t watch Zero Punctuation from The Escapist in fullscreen, at acceptable quality. On the other hand, using the box to transcode video on the fly for my iPad with Air Video Server was not an issue. The CPU and GPU power comes at the price of heat. The exhaust air is noticeably hot and I would recommend giving the unit proper clearance on the sides with fan ports.
At this point, I had a great media player setup but for one niggling detail: I had no way of controlling it. I tried a web interface add-on called wTouch Remote that is a neat idea designed to allow one to use an iOS device as a remote control using multitouch gestures. The neat idea, like so many things in life, doesn’t quite live up to expectations. There’s considerable lag before actions register and it stopped responding completely at times. I tried some actual apps for controlling XBMC, but it was clear I needed a real remote. I remembered that some friends back home with a media pc used a wireless keyboard/touchpad combo that was pretty slick. However, a full size keyboard is rather unwieldy for the coffee table so I opted for something a bit smaller. Browsing through Canada Computers’ website, I stumbled upon the VisionTek Candyboard.
The Candyboard is a Bluetooth keyboard/trackpad combo that, as the name implies, is about the size of a candy bar; just the perfect size for a remote control. The keys are reminiscent of a cell phone; short travel, a full qwerty layout with symbols and numbers, and backlighting (very handy during a dark movie session). The battery is a rechargeable lithium cell, charged with a mini-USB connector. It also has some neat extras such as a laser pointer and a tiny USB Bluetooth dongle that fits inside the device. I fell in love with the thing when I saw it, but the infatuation lasted only up until the point at which I tried to use it. I’m not sure if my wifi devices or the apartment itself are interfering with the Bluetooth transmission, but I had some serious problems with range. Using the included USB extension cable, I was able to get decent reception at the couch (about 2 m away) by raising the dongle to the height of the TV, but not far beyond that. When you move out of range of the receiver, button presses are kept and transmitted when back in range. Also, albeit infrequently, the dongle seems to completely stop working in Linux, requiring a reboot. It cost me $69.99 before tax, and I think I have a pretty good setup, but I expected better range for the price. It really annoys me because the thing is otherwise a perfect HTPC remote.
In summary, the ZBOX is a really great machine; relatively cheap, compact, can handle full HD, and looks good under a TV too. It has some small annoyances, but nothing major and it pairs pretty well with Ubuntu 11.04 and XBMC. It cost me $229.99, plus $17.99 for a 2 GB RAM stick at Canada Computers.

Wednesday, July 13, 2011

MIO Japanese and Thai Fusion

440 Spadina Ave.
Toronto ON
Mon–Sat 11:30–23:00
Sun 12:00–20:30

This small restaurant is located on the West side of Spadina Avenue, about a block south of Bloor, at the North end of Chinatown. It’s easily accessible by streetcar or is a short walk from Spadina station. The place was, until recently, known as Sushi Star. It now serves not only standard sushi fare, à la carte and all-you-can-eat, but Thai stuff as well.
A bunch of us walked down from the lab on a Wednesday evening at about 18:00. There were 3 or 4 other diners there, but the place felt pretty empty. Decoration was simple and the atmosphere was casual; the evening news played quietly on a TV mounted in the back. There were about six wooden booths and a number of tables in the restaurant. Unlike busier restaurants, quiet conversation wasn’t a problem.
Though there was only a single waitress, service was excellent; water tumblers were kept full and dishes cleared promptly. We all decided on the all-you-can-eat menu, which is limited to what you’d normally find at a sushi place and ordered a large variety of rolls, tempura, and appetizer-type foods for the six of us. The food arrived quite quickly (though not as rapidly as Aji Sai), staggered into a number of courses. Oddly, the appetizer-like stuff came after all the rolls. The sashimi was properly firm and seemed quite fresh. The crispy spicy salmon and tuna rolls were among the spiciest I’ve had, something many restaurants can’t seem to get right, but they were distinctly lacking in crunchiness. However, they also offered an excellent spicy crab meat roll that was something new to me and very good. We ordered the trio of dragon rolls, and the black and green dragon rolls were spectacular, if not a touch too big to comfortably fit in the mouth. The red dragon roll, on the other hand, was a bit strange; the taste was somewhat bland and the texture unusual. The tempura was average, though it wasn’t really soft or anything, it suffered from the same lack of crunchiness as the crispy rolls. The fried onion and beef, as well as the sweet and sour chicken made delicious side-dishes. Dessert was the traditional green tea and mango ice creams. I swear all of these sushi places buy the same stuff, so nothing special there.
The meal ran me about $21.50 plus tip, without a drink; fairly standard for dinner at an all-you-can-eat place. I would put the food quality perhaps a bit above that of Aji Sai (some of my labmates might disagree) and if I had to choose, MIO would probably win out. The simpler decor notwithstanding, MIO offers similar or better food at about the same price, but at a far quieter location.