Mastodonインスタンスを動かしてみたい(1)


さくらのVPSで自分用Mastodonインスタンスを立てるまでのYak Shavingの記録…になるはずだが、まだ途中。

改めて見たらUbuntuのバージョンが14.04で古すぎたので、まず16.04にアップグレードするところから始める。
ディストリビューションアップグレード中にぶっ壊れるのは怖いので、まずはバックアップを取る。

これを参考にMondo Rescueでバックアップを取ることにする。
ただ、/etc/apt/sources.list.d/mondorescue.sources.listを追加してsudo apt-get updateしたところ、公開鍵が見つからないようで以下の警告が出る:

W: GPG error: ftp://ftp.mondorescue.org 14.04 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6BA8C2D220EBFB0E

検索してみたところ、Mondo Rescueメーリングリストで以下のやりとりを発見。
[Mondo-devel] [OT?] New keys for debian repository…

書かれている通り、以下の鍵を追加して解消。

gpg --recv-keys 8AB63AFD171EFF9E
gpg -a --export 8AB63AFD171EFF9E | sudo apt-key add -
gpg --recv-keys 6BA8C2D220EBFB0E
gpg -a --export 6BA8C2D220EBFB0E | sudo apt-key add -

無事Mondo Rescueがインストールできたので、早速バックアップを試みる。

sudo mkdir /backup
sudo mondoarchive -Oi -L -s 50G -d /backup -E /backup -S /tmp -T /tmp -p backup-20170417

途中で以下のエラーが出てバックアップが失敗する。

Mindi failed to create your boot+data disks.
Fatal error... Failed to generate boot+data disks
---FATALERROR--- Failed to generate boot+data disks
If you require technical support, please contact the mailing list.
See http://www.mondorescue.org for details.
The list's members can help you, if you attach that file to your e-mail.
Log file: /var/log/mondoarchive.log
Mondo has aborted.

ログファイル(/var/log/mondoarchive.log)を見たら、ディスクが足りない…?
HDD容量はまだガラガラのはずだけども。

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
(略)
/dev/vda1        96G  7.3G   84G   9% /
(略)

調べたところ、足りてないのはHDD容量ではなく、MindiのRAMディスクの容量らしい。
[Mondo-devel] no space left on device error – mindi

Mindiの設定ファイル/etc/mindi/mindi.confで大きめのサイズを指定する。何回か失敗したが結局以下のサイズで成功。

EXTRA_SPACE=320152      # increase if you run out of ramdisk space
BOOT_SIZE=80960

先ほどと同じバックアップコマンドでバックアップが始まったが、長時間かかる中でSSH接続がタイムアウトしてしまい、接続切断に巻き込まれてmondoarchiveコマンドが終了させられてしまった。
改めて、途中で切れても大丈夫なようにtmuxでセッションを作り、その中で実行する。Ctrl-B dでセッションからdetach。数時間待って再度tmux attachでセッションに入って結果を確認。今回は成功。
Transmitで手元のMacにダウンロードする。

今日はここまで。

ErgoDox EZ カスタマイズ


ErgoDox EZを買ったので、早速カスタマイズしていきます。

Macには現在 ControllerMate および Karabiner/Seil がインストールされているので、実現したい機能をどれを使って実装するかを選んで考えていく必要があります。また、これまで使っていた DHARMAPOINT DRTCKB91UBK との兼ね合いも考えたいところです。

キートップの違いに注意

ErgoDox EZは購入時にキートップを刻印ありか刻印なしのものから選ぶことが出来ますが、この2つの違いは刻印の有無だけではない点に注意する必要があります。刻印なしのキートップは行ごとに傾斜が異なるスカルプチャーキー(DCS)となっていますが、刻印有りは配列を並べ替えられるよう全キーフラット(DSA)になっています。

深く考えずに刻印ありキートップを選んでしまいましたが、実際使い始めてみたら傾斜はある方がいい事に気づいたため、ErgoDox EZ販売サイトにメールして刻印なしキートップを新たに入手することに。気をつけましょう…

英数/かなキー

Macの日本語キーボードにはスペースバーの両隣に英数とかなキーがついており、これによりIMEを切り替える形になっています。現在いるモードを意識する必要が無いのでWindowsで標準的な全角/半角トグルキーよりも好きな仕組みですが、これは入れておきたいところ。

結論から言うと KC_LANG2 が英数キー、 KC_LANG1 がかなキーにあたるキー名なので、この2つを両手に割り当て。まだWindowsでは使ってないですが、Win側でもKarabinerみたいなツールでIME ON/OFFに割り当てることできるかな?

親指シフト

このキーボードを期に親指シフトに挑戦してみようかと考えているところですが、色々調べてみると今使われてる親指シフトの実装方法は大抵親指シフト用のキーが足りないのを補うために下の方のキーを潰してて、そのぶん既存のキーが不便になるっぽい様子。割当し放題なErgoDoxではそんな妥協をしなくてもいいはずなので、両方の親指シフトキーを変換に使えるように出来ないか考えてみます。

  • ErgoDox側で親指右キーの位置に普段まず使わないF16を割り当て
  • KarabinerでF16をスペースに割り当て直し
  • 更にKarabinerで親指シフトの右親指キーをF16に割り当てるバージョンをprivate.xmlに記述

private.xml
(Includeが絶対パスになっちゃってるのが気持ち悪い。もっと綺麗な指定の仕方はないものか)

これにより、左右両親指とも日本語入力時は親指シフトキー、英語入力時にはスペースとして振る舞わせることに成功。
まだ親指シフト配列自体の習得は全く出来てないので、これからですが…

キー配列

デフォルトではErgoDox EZはUSキーボードスタイルとなっていますが、色々割り当てなおしてJISキーボードスタイルに変更するかどうかは目下悩み中。DRTCKB91UBKがJIS配列なので揃えておいたほうが混乱は少ない気はするのですが(特に、Macでは配列の異なるキーボードを複数繋いでもそれぞれ異なる配列認識で共存できるのですが、Windowsでは出来ないっぽいので)。やるとしたら先人の知恵を参考にしながらやってみることとします。

しかしErgoDoxについて調べだして初めて知りましたが、簡単にUSBキーボードとして振る舞わせることが出来るうえにファームウェア書き換えも繋いだまま出来る Teensyマイコンボード とか、便利なものが出来てるんですね今時は。
どうりで自作キーボード作り出した人がやたら増えてるわけだ…

Oculus RiftとLiveViewRiftで全方位パノラマを再生する


2016/10追記: LiveViewRiftは現在更新されないまま大分古くなっており、現在のRift製品版やOculus Softwareに追随できていません。現在は全天球動画などを再生する場合、他のソフトの使用をお勧めします。

最近見つけたLiveViewRiftというソフトが非常に強力だったので紹介したいと思います。

LiveViewRiftはMac/Windows用の、Oculus Riftを使って動画や静止画、全方位・全天球映像等の再生ができるソフトです。

こういったソフトは他にも

等いくつかありますが、LiveViewRiftは非常に設定項目が柔軟で、およそどんな形式でデータが作られていても調整次第で表示が可能である点が大きな特徴です。RICOH THETA等で撮影された全天球画像はもちろんの事、例えば立体視でデータが左目と右目のファイルに分かれている場合や、パノラマが床・空・それ以外のファイルに分かれている場合であっても、複数のファイルをレイヤーとして同時に表示再生する事ができるので対応可能です。

なお、このソフトは現在Oculus RuntimeのExtendモードにのみ対応しています。Windowsの場合、Open Broadcaster Software等を併用しないと表示内容のミラーリングが出来ないので、ご注意ください。

Ocufes and the state of the Oculus Rift in Japan


I have been involved in the Japanese Oculus Rift development community for some time now, but only recently realized there is hardly any information available in English about what has been going on in Japan. This is my attempt at summarizing the 9 or so months since the release of the Oculus Rift DK1. Do please cut me some slack for the sweeping generalizations I may make; I do know there are counterexamples to many of them, but referring to them would make the article even longer than it is.

The Kickstarter units


Well, OK, it has absolutely nothing to do with Nintendo, but I had to.

Shipping of the Oculus Rift to Kickstarter backers began in early April 2013 but did not reach Japanese shores until late that month. Once we received our units, much like everyone else in the world, we were blown away by the field of view, stereoscopy and how the visuals fluidly followed your head movement.

Once the initial shock subsided, many of us got down to develop content for the device. The types of content, however, differed greatly from that of the West. Whereas many Western demos created various worlds to transport the player to, many of the demos here reflected the heavily character-driven nature of Japan, focusing on what fictional character to meet ‘in person.’

An aside: Japan loves characters

I must put aside the Rift for a moment and explain Japan’s obsession with characters and anthropomorphizing objects. If you’re familiar with it, skip this section. Nearly everything in Japan has an anthropomorphic representation nowadays: operating systems, WW2 warships, eldritch abominations, you name it.1

img_MIKU_us
One particularly high-profile example is Hatsune Miku, a Vocaloid singing synthesizer program with an accompanying anthropomorphized character. Fans of Miku have gathered to create not just songs but artwork, animation, and even MikuMikuDance, a freeware software suite which enables one to create 3D animated dancing sequences of Miku and gang with ease.

In essence, Miku became a Lenna or Utah Teapot of sorts: the first thing to try by default for hobbyist developers in Japan. Even before the Rift, it was common practice among makers to try to materialize Miku into the real world using various methods, eg. figurines, robotics, 3D printing, projection mapping, augmented reality, etc.

Mikulus

BMf9FbiCUAANiE5GOROman, one of the Kickstarter backers, was an enthusiast from the earliest days of the Rift in Japan. He created Mikulus (Miku + Oculus,) a demo where Miku sits in front of and stares at the user. Whether you find it cute or creepy depends on your tastes, but there is something quite unlike anything else about being able to perceive a life-sized, dare I say it — animated animé-style character within striking distance and looking at it straight in the eyes.

Mikulus was demoed to the public and became a hit with Vocaloid fans during the World Vocaloid Convention 2013. It went on to become one of the most popular demos here. Its popularity spawned a series of other Vocaloid character-themed demos, including Yuujii‘s Lbench, and my own Mikulus Kinect, where I experimented with full-body motion tracking.

Mikulus is currently on display at the Yoshihiro Yonezawa Memorial Library of Manga and Subculture, as part of “The Exhibition of Passion for Hatsune Miku Materialisation: Beyond the wall of dimension”, until June 1st, 2014.

Oculus Festival Japan, a.k.a. “Ocufes”

Once many hobbyist developers had their own demos and games, they ran into a problem: since so few people in Japan own Rifts right now, there was hardly anyone to show their content to! This was even more so if the demo used extra hardware like the Kinect or Razer Hydra, which many did.

Poster advertising the very first Ocufes event, held in August 2013.
Poster advertising the very first Ocufes event, held in August 2013.

Ouka Ichimon (not his real name; pronounced “oh” not “oo”) was one such enthusiast. In cooperation with GOROman, me, and other friends, he launched the Oculus Festival in Japan, or Ocufes for short. Basically, we would rent space, usually in Akihabara but often in other places, to set up PCs with Rifts and let participants freely try games and demos we developed. I exhibited my work several times, including the aforementioned Mikulus Kinect, and a silly VR rendition of Cookie Clicker where piles of cookies would rain down from above.

The venue was packed!
The venue was packed!

After holding Ocufes a few times, the event began gaining traction. GOROman drew large amounts of attention both on and off the web when he debuted Miku Miku Akushu, a version of Mikulus connected to a Novint Falcon haptic feedback device. The Falcon was designed for uses like providing gun recoil in first-person shooters, but GOROman replaced the gun handle with a mannequin hand, allowing the user to physically shake hands with Miku.

Eventually, someone at the Digital Content Asociation of Japan caught word and we managed to exhibit Miku Miku Akushu at the Digital Content Expo 2013, held at The National Museum of Emerging Science and Innovation. We did many more of such guest exhibits, often being called upon from events in Akihabara, but also sometimes in places like Tokushima.

The Japanese Rift community does more

Gravure idols (pin-up models) Yuka Kuramochi and Saki Yoshida try on the Rift. This is actually Saki's own Rift!
Gravure idols (pin-up models) Yuka Kuramochi and Saki Yoshida try on the Rift. This is actually Saki’s own Rift!

Demo events weren’t the only stuff the Japanese Rift community did. We also did (in chronological order):

  • Ura-Ocufes (roughly translated to “Ocufes behind-the-scenes”), a mini conference event where developers exchanged their discoveries and shared creations, such as a 3D parking simulator.
  • The Oculus Game Jam in Japan, a two day game jam event in Tokyo by Unity Japan’s Makoto Ito. The jam produced all kinds of wacky demos, including a Wii balance board-controlled hoverboard game, a voice-activated demo where whatever you speak would fly out of your mouth as huge letters, and my multiplayer-enabled Mikulus Kinect Online.


'These 2 guys are hugging each other. In VR.' This went viral.
  • The Oculus Game Jam Kansai, a similar game jam but this time in western Japan.
  • The Oculus Rift Advent Calendar, an online event where developers took turns updating Oculus Rift-related blog entries every day during December.2
  • GOROman, Kouki & Koyama, Negipoyoc, and I each presented projects at the 5th Niconico Gakkai symposium madness talks session. Negipoyoc stunned the audience by his MikuMikuSoine app which enabled one to literally sleep alongside Miku, demoing the app by bringing in a pool chair and a blanket in the middle of his talk. Seriously.
  • Multiple self-hosted development seminars, with the early enthusiasts teaching newly interested folks the basics of developing for the Rift.
  • Ocu-Tabi (“Ocu-travel”), a crowdfunded video event in which GOROman and Kotaro Fujiyama will travel to Miyakojima island wearing an OVRVISION stereo camera on top of the Rift.3 GOROman will attempt to livestream his entire trip to backers. The trip hasn’t happened yet as of this writing, but the crowdfunding has already succeeded. Looking forward to this.

Obviously, this won’t be all. There are plans to hold an Ocufes event during the Niconico Chokaigi 3 festival, and many more exciting/weird stuff are waiting to surface. I must say it is a truly interesting time to be a VR enthusiast in Japan!

Though so far, what I chronicled was mostly of the amateur enthusiast communities. What of big companies then?

Corporate interest?

Gaming in Japan is an overwhelmingly console- and mobile-dominated affair. While PC gaming fans for genres such as FPSs and MMORPGs do exist, their numbers are depressingly small in comparison to the West. Outside those circles, hardly anyone even knows what Steam is! Games by major developers and publishers in Japan are often released to consoles and mobiles first; PC ports is an afterthought at best. About the only domestic games exclusive to the PC are Eroge, games with explicit adult themes which cannot be released to a console.4

Thus, the current PC-centric nature of the Oculus Rift makes it a poor fit for mass adoption in Japan, at least for straightforward gaming purposes. Individual developers such as ICO’s Fumito Ueda have expressed interest, but large commercial Japanese game developers can not seriously consider VR as a business until it works in some form on consoles. Rumors of Sony developing its own VR head-mounted display for the PS4 may shake things up if it happens to be true, but starting to delve into VR only after Sony makes an announcement would place Japanese game developers way behind their Western ilk, who would have already made large strides with the PC and the Rift.

Personally I think MMORPGs may be a good fit for popularizing the Oculus Rift in Japan, as it is one of the few genres in Japan that have stable footing on the PC, not to mention the popularity of VR MMORPG-themed fiction such as Sword Art Online and .hack. Non-games such as virtual travel may also work, as the famous 90-year-old grandma YouTube video have demonstrated.

We should also keep an eye on how VR is going to work with mobile devices, which has a much higher market penetration rate than PCs. If VR were to go mainstream in Japan, my money would be on from this route, not from the PC nor the PS4.

In closing

This blog post has definitely been going way too long, but man I had trouble keeping it trimmed as more and more material kept coming to mind as I was writing them down. I hope this gives you a picture of what has been going on in the Japanese Oculus Rift enthusiast community. If you have any questions, fire away in the comments!


  1. The frequent use of characters is true not just for geeks. Look at a random construction sign or a dentist’s ad in Japan, and chances are, there will be a character drawn on it. 

  2. The term “Advent Calendar” has taken a life of its own in Japan, now often referring to this format of taking turns updating blogs. 

  3. In addition, GOROman will also be wearing binaural microphones, and there will be a spherical GoPro rig for later 360° viewing. 

  4. FWIW, some eroge developers have shown interest in the Rift. 

スマホ差込形HMD Durovis Diveを使う


はじめに

ここのところは相変わらずOculus RiftをはじめとしたVRヘッドマウントディスプレイにご執心な日々ですが、最近はOculusに加えてDurovis Diveにも手を出しました。

Oculus Riftに見た目も構造も似ていますが、開発元が異なる別のHMDです。正確には、この枠の中にスマートフォンを差し込むことでHMDとして機能するようになるマウントパーツということになります。

マウント部を開いたDurovis Dive
マウント部を開いてスマホを外すとこんな感じ。
Oculus RiftとDurovis Dive
左がOculus Rift、右がDurovis Dive

利点と欠点

Oculus Riftを開発したPalmer Luckeyは、かつてFOV2GOというスマートフォンを活用したHMDの研究プロジェクトに関わっていました。その後彼は専用ハードを作る方向に転じ、掲示板などでもスマホの性能の限界を指摘していることからも、体験のクオリティを重視するのであればそれに合わせた専用のハードウェアを作らなければならないという意見のようです。

確かに、Durovis DiveはOculus Riftに比べて

  • 視野が80〜90度程度とやや狭い
  • 次期Oculus Riftの売りであるポジショントラッキングやLow Persistenceモードの搭載は望めない
  • 加速度計やジャイロのトラッキング頻度・精度は低い1
  • 実行環境がモバイルアプリなので、リッチな表現はできない
  • 本体がそのまま頭の前に来るので、首の向き以外での操作ができない

といった欠点があり、基本的にRiftよりも体験の質は劣ります。とはいえ、このアプローチはOculus Riftに勝る点もいくつかあります:

  • PCやケーブルいらずで単体稼働できる
  • スマホ次第で高解像度な画面が使える
  • 実行環境がモバイルアプリなので、Unity3D Free版でも開発できる2
  • なにより既にスマホを持っていればそのまま使えるので安い

特に最後の2点は重要です。実際、Oculus Rift本体やらゲーミングPCやらUnity Proやら3DCGソフトやらで、出費がとんでもない事になってる人を知っています。w
極端な話、Durovisを買わなくとも、FOV2GO方式のレンズとボール紙の即席HMD + Unity Freeで超低コストに最低限の開発スタートが可能です。


  1. iPhone 5Sでも加速度センサの更新頻度は秒間100回程度ですが、頭の動きに低遅延で追随することにこだわったOculus Riftのセンサ更新頻度は秒間1000回と桁違いの高さです。 

  2. Oculus Riftの場合はPCから外部ハードウェアに直接アクセスすることになるため、Unity Pro版ライセンスが必要です。