4K, HDMI, and Deep Color

As of this writing (January 2014), there are 2 HDMI specifications that support 4K Video (3840×2160 16:9). HDMI 1.4 and HDMI 2.0. As far as I know, there are currently no HDMI 2.0 capable TVs available in the market (though many were announced at CES this week). A detail that tends to be neglected in all this 4K buzz is the Chroma Subsampling. If you’ve ever compared an HDMI signal against something else (DVI, VGA), and the quality looked worse, one of the reasons is because of Chroma Subsampling (for the other reason, see xvYCC at the bottom of this post)....

Linux Device Input Notes

I can use the following to list all attached USB devices. The output will be something like the following. Take note of Device 009, i.e. “Microsoft Corp.”. Thats an Xbox One controller plugged in to a USB port. (Also FYI, the device known as “Logic3” is a RockCandy brand Xbox 360 controller) I can retrieve some data about the controller as follows: Bus 001, Device 009. It is not controller data though....

Quadruped Animation Test

Yeah, the list of things needed to make that animation better are extensive (it’s so floaty). Still, first time I’ve ever animated a quadruped, and first time I’ve ever seriously animated something in Spine....

Hello 2014. The year of #MRK. Plus a 2013 retrospective

Time to start the year right. After much folley and a good chunk of contract work last year, I started working on a new project. Some of the early-most efforts can be seen in the Quack tech demo video. No gameplay to see there, but you can see one of my prouder achievements in action: Live Coding/Live Content. Change a source file or an asset, and it updates in game immediately....

Linux Complaints

Well, more things I’m expecting to work but don’t. Can’t Full-Screen a Flash Video, and multitask (the video de-full-screens upon click) With multiple monitors, full-screening flash gets confused (doesn’t fill full screen) Clicking an App Icon on Ubuntu doesn’t minimize (by design, but it’s stupid) In some parts of Ubuntu, the Backspace key acts like a back key. In other places, it does not. CTRL+Insert, SHIFT+Delete, SHIFT+Insert are not Copy, Cut, Pastes....

Linux Setup Notes

So whoa, I decided to do something outlandish: I switched my primary laptop to Ubuntu Linux. Here are some setup notes (mainly for my own reference). My Laptop is a Lenovo X220. Reminders Things I ocassionally need a refresher on. More Notes: BIOS Tweak Before I was able to get Ubuntu to boot correctly, I had to change my BIOS from “both Legacy and UEFI” mode to just “UEFI Mode”. To bring up the BIOS menu you press the blue ThinkVantage button. This setting can be found on the startup (?) page. Lenovo Thinkpad Utils (Better Power Management) Some notes here. linrunner.de is the home of TLP, a very useful utility for getting laptop Power Management under control. More details here. Key Remapping The Lenovo X220 has Web Forward/Back keys beside the arrow keys. I prefer that they act like alternative PageUp and PageDown keys. Open up /usr/share/X11/symbols/inet (i.e. sudo gedit /usr/share/X11/symbols/inet) Find a key named . Change “XF86Back” to “Prior“. Find a key named . Change “XF86Forward” to “Next“. Browse to /var/lib/xkb/ Delete *.xkm in the /var/lib/xkb folder. You need to do this to force a keyboard code refresh. Logout, then Login to refresh. (Or reboot) Resources: Thinkpad Special Keys, XKB Question * * * Use XEV to check keycode information (if remapping other keys). NOTE: This DOES NOT work anymore. Source Control Mercurial GUI: SVN and GIT (and Mercurial) GUI: NOTE: RabbitVCS has a somewhat ugly icon set (bombs!?). Also at this time, you cannot disable individual modes, thus running both RabbitVCS and TortoiseHG at the same time doubles the icons. Uncool. SDL2 Prerequisites stolen from here. Get the latest code, build, and install. Updating Graphics Drivers (to WIP) Mesa 10.0 was released in December 2013 (now Mesa 10.1), which introduces OpenGL 3.3 support. Ubuntu 13.10 came out back in October (i.e. 2013-10), so it lacks this update. Details can be found here. To install Oibaf’s updated drivers: To revert to your stock drivers (before updating Ubuntu Major versions): NOTE: The current MESA drivers (10.0.2) only support OpenGL 3.0 on the Intel HD 3000 (where as Windows supports OpenGL 3.1, plus many 3.2 and 3.3 extensions). Newer Intel GPUs (the HD 4000 and the HD 2500) should support up to OpenGL 3.3. NOTE 2: The Intel HD 3000 does not support OpenCL. Newer Intel GPUs do. Recovery Mode Especially while playing video drivers, if you screw something up, you can hold SHIFT during boot to bring up the GRUB menu. Start a Recovery Console (which is by default in Read Only mode) and do the following: Now you’ll be free to change files. CPU and Network Usage Mini Graphs Restart X (or reboot). Setting up Windows 7 VM Download the 64bit Linux ‘Bundle’ file. Instructions borrowed from here. Follow instructions. Fairly straightforward. Attach a DVD drive, and insert a Windows 7 CD (NOT a restore CD). Create a VM. Adjust settings accordingly (half your RAM, equal number of CPU cores, ~60 GB of space). To support Intel GPU drivers, open up the “???.vmx” file (where ??? is your VM name). Add the following line. NOTE: VMWare Player 6.0.1 only supports OpenGL 2.1 on Windows 7 (i.e. on par with OpenGL ES 2.0). Disable Touchpad I use a Lenovo laptop for a reason: It has a nub-mouse (joystick). I prefer this to touchpads. However, by default both input methods attempt to work at the same time. This can cause weird glitches, like random copy/pasting or focus loss. An easy fix is to just outright disable the Firefox Backspace Key Due to some sillyness, it was decided that backspace on Linux should do nothing. For the “better” use, as a “Page Back” button, make the following tweak. Custom Right Click Actions Place files in ~/.local/share/nautilus/scripts/ that you want to make available from the right click menu. If a shell script, be sure to set it Executable (chmod +x). Also feel free to ignore adding a “.sh” file extension. Useful Script: Run as Root Execute: Music Player Install Audacious. Current Track can be found under the Speaker Icon in the Panel (I wish there was a track/name up there). A preinstalled plugin AOSD can be enabled for a “Current Track” popup, whenever the song changes. There’s another plugin which enables media keys (FN+Arrows). Image Editing Install GIMP. For reals. Run it. Go to the Windows menu and click Single-Window Mode. Suddenly, it’s 100x more tollerable. PNG files are exported, not saved (unlike Paint Shop Pro and Photoshop). Calculator Install SpeedCrunch. gDEBugger This doesn’t actually work, but… Download it. Unzip it to /opt/gDEBugger/ (or some other nice folder). Create a symlink so gDEBugger can find the 64bit GL libraries. Then run /opt/gDEBugger/gDEBugger to start it. NOTE: gDEBugger-bin wont run directly. More OpenGL debug tools are here (glslDevil?). CodeXL (OpenGL/OpenCL Debugger) Seems easy to install, but REQUIRES an OpenCL capable GPU. Sorry Intel HD 3000. 🙁 APITrace (OpenGL command logger and post-run trace tools) Apparently this is the only Linux GPU debugger worth a damn. Then to run: Restart Audio It happens. Linux seems to sometimes get confused when I plug in a bunch of devices. Source. Silence gedit warnings Install Android SDK Easy. First install Java and Ant. Download the “SDK Tools Only” bundle. Unzip it somewhere (i.e. /opt/android-sdk/) Run the SDK Manager Download the NDK Package. Put it somewhere similar as the sdk (i.e. /opt/android-ndk/) Set path and variables. Done. Install NVidia PerfHud ES IMO this is the best OpenGL debugger available (it shows geometry!), but it only supports NVidia Android devices. Download the Tegra Android Development Pack. It’s an executable that downloads. Deselect everything but PerfHud ES. Install it somewhere common (i.e. /opt/NVPACK/). Setting up the POD Blender Exporter Download PowerVR SDK. Browse to /opt/Imagination/PowerVR/GraphicsSDK/PVRGeoPOD/Plugins/Blender/Linux_x86_64 Copy PVRGeoPODScript.py and libPVRGeoPod.so to your /opt/blender/2.69/scripts/addons folder. Copy libQtCore.so.4 and libQtGui.so.4 to your /opt/blender folder. Start Blender. Go to File->User Preferences->Addons. Search for “pod”, and click the checkbox beside Import-Export: PVRGeoPod. Done. Exporter can now be found under File->Export->PVRGeoPod. Setting up Spine Spine just works, so long as you have Java installed (see Android). Download it, move it to /opt/, paste in your reg code, and go. Lower Compiz CPU usage Compiz has “Sync to VBlank” enabled by default. Causes a wasted 10% extra CPU usage. Open Compiz Config Settings. Click on OpenGL (not the checkbox, the name). Unselect Sync to VBlank. Reboot. Fix Audio Playback in Audacity NOTE 2: Solved. Ignore everything below. To get audio playback working correctly in Audacity (and not silly weird glitch fast), simply select the “Samson GoMic: USB Audio (hw:1,0)” for output, instead of one of the many defaults. Fixed! NOTE: This is incorrect. A good try though. Problem is the Samson Go Mic that I’m using as an audio interface. Audacity works fine with the internal sound card (which has a horrible mic). Oddly though, recording via the Samson appears to work though. Open up “/etc/pulse/default.pa“. Find the following line: https://wiki.archlinux.org/index.php/PulseAudio#Glitches.2C_skips_or_crackling Change it to: Restart audio. Sources: Audacity Forum, Pulse Audio Wiki. Setting up the 3DConnexion Space Navigator 3D Mouse Get the open source driver. Build and install the Daemon. Daemon must be run as root (otherwise it uses 100% CPU usage)! Build and install the config tool. Run Blender. Disabling Bluetooth Simple Sync I assumed this was the problem with my PS4 controller not working wirelessly (disconnecting right away). This is not the case though. Default detection via Bluetooth works fine under Linux. Now I’m just hoping the problem is that the battery is low (have it plugged in charging). Source. Making Backspace work as a back button in Nautilus Open ~/.config/nautilus/accels Add a line (without a “;”) Restart Nautilus. Making Nautilus use “normal” type-to-find-files, instead of type-to-search This is a regression introduced in Nautilus 3.6. The Ubuntu folks appear to have solved it, but only as of the current beta of Ubuntu 14.4. My 13.10 will have to wait to get it. 🙁 Make file sorting *NOT* ignore special characters Set the current locale to the “C” language locale. Add the following to the file. Source. GDB: ptrace operation not permitted Fix is here. Generally speaking, editing /etc/sysctl.d/10-ptrace.conf Adding the following line: Re-enable whitelisting in the SysTray From here. Restart Unity (Logout, then log back in). To whitelist things (Xchat, xchat, Truecrypt, etc): Go to Desktop->Unity->Panel and add your whitelist. Whitelist source, xchat source. SSHFS/Fuse: Mounting remote SSH connections as part of the file system To connect: To disconnect: The Dangers of the OIBAF drivers Don’t get me wrong, the OIBAF MESA drivers are great. Bleeding edge Linux graphics drivers, with the very latest supported OpenGL features (GL 3.0 on my Intel HD 3000 GPU). We’re in a transition period though. Mesa just reached a very important milestone, several months after Ubuntu 13.10’s release: OpenGL 3.x support (i.e. Mesa 10.x). The upcoming Ubuntu 14.4 will ship with these new Mesa drivers, but gosh darnit, I’m doing serious GL shader development, and I need them now! When I first installed them, everything was great. According to /var/log/apt/history.log, my version of OIBAF was from January 10th, 2014. A few days ago I upgraded to the very latest, and that broke both Chrome and more importantly VMware. My game stuff unusually is working fine with the new drivers, but the current drivers from today are busted. So what I need to do: Uninstall OIBAF, then reinstall an older version of OIBAF. Uninstalling a PPA (OIBAF) First install PPA Purge. Then use it to purge the data. Now I’d recommend a reboot, but Logging out and in *may* work (I can’t remember). Checking Installed Mesa/GL version To see your currently installed Mesa version. Ubuntu 13.10 ships with Mesa 9.2 Installing OIBAF Is easy. I’d suggest checking your Mesa version first (see above). You may need to reboot/logout for it to take effect (I forget). Resources: Phoronix, Launchpad (PPA) Upgrading Packages (drivers) With the repository already added (ppa:oibaf/graphics-drivers), it’s just a matter of updating. Notably, the 2nd line is just upgrade, not dist-upgrade. Both functions do the same thing, but if I understand correctly, upgrade doesn’t uninstall obsolete packages, while dist-upgrade does. So dist-upgrade is the smart one. This means that downgrading to Mesa 9.2 (as I had to do) required a full re-download of Mesa 9.2, as it was already removed from my machine. Upgrading Major Ubuntu Versions When April rolls around Mike, do this: Gotta get away from this awful version of Nautilus. Ugh! NOTE: Uninstalling OIBAF before doing a release upgrade is recommended! The Apt Cache /var/cache/apt/archives/ contains cached copies of packages you’ve downloaded. I lucked out, finding my January 10th version of the OIBAF drivers here, so there may still be some hope to downgrade. Reference: Here. To list all installed packages, do: This is an extremely long list that omits version numbers. If you know roughly what the package you want is named, you can include the first part of the name like so: Though, this is really only useful if you know what a package is named. To search the package database for something, use search: This also includes descriptions of packages, which can be extremely helpful for discovering exactly what package you’re looking for. Get information about a package: Another way, with a slightly different output: List just the install options: Yeah, whodathunk. “Madison” ‘eh? OIBAF Adventures Long story short, don’t mess with DPKG! I had to reinstall Linux. ...

Quack/Play-More tech demo v0.01 (Video)

A video demonstration of the tech behind my upcoming game code named #MRK. A look more at the fancy Live Coding features built in to the engine. Everything works so well, it can be used for very rapid iterative development. The program never stops, all asset and code files are automatically reloaded, and if used correctly game state will stay the same across reloads. I’m hoping to do more videos as I introduce more general features, as well as when I have things to show in #MRK....

An Experiment: OpenGL Class Targets

According to the documentation, SDL_GL_CONTEXT_MAJOR_VERSION was primarily used to tell SDL which method to use to construct the Window on desktop Open. OpenGL 3.x introduces a new way of context creation, so this would have been used to suggest which way to create (old way or new way). Of course, Mobile needed a way to handle ES 1.1 vs ES 2.0 (and sort-of ES 3.0 too, but so far the ES 3....

The correct way to SDL_Init

By correct, I mean the way that will work across multiple devices, and give you OpenGL (ES) shaders. If you don’t need shaders (i.e. OpenGL 1.x, OpenGL ES 1.1), a lone SDL_Init will suffice (default behavior). If you are using SDL_GL_LoadLibrary, you *MUST* put the calls in the following order. I had to do it this way (between these 2 calls), otherwise Android devices with PowerVR GPUs would not work (Nexus S, Intel powered devices, Kindle Fire?...

GPU Debugging on Android Devices

Here are some notes on getting the GPU/OpenGL ES debuggers working with devices. NVidia’s Tegra tool seems the best (even has integrated mesh viewer). Qualcomm’s Adreno tool is also quite good. ARM’s MALI tool is difficult to set up (rooting), but covers the essentials. Intel’s GPA tool is a complete suite, but is only a system usage profiler for Android. Imagination’s PowerVR tools appear good, though I haven’t tested them yet (one tool requires rooting)....